C# расширить свойства до класса из другого проектаC#

Место общения программистов C#
Гость
C# расширить свойства до класса из другого проекта

Сообщение Гость »


i have two projects , one of projects is added as a reference to another one to use some functions and classes..

how i can extned the origenal class with some new properties/fields that exists in primary project and use it second project ?

if it's in same project i can extend it like

public class ClassA : ClassB { public string Name{ get; set; } public string Phone{ get; set; } } public class ClassB { public int id{ get; set; } public string someField{ get; set; } } i need to use the fields in ClassB in project 2 only, and add some values to the object

List data = await SomeFunction(); data.ForEach(x => { x.id= 1; x.someField = "some value"; }); i have many classes in the primary project and i want to extend all of them with new class in the second project


Источник: https://stackoverflow.com/questions/781 ... er-project

Вернуться в «C#»