Click here to Skip to main content
15,441,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Every one,

I am struggling with an issue in model first approach, their will be main complex type which contains Name,Address,Email,Phoneno which is the parent class. And I should create second complex which will be child class having the first complex type with different name and list of first complex type.


Class Employee
{
public string Name{get;set;}
public string Address {get;set;}
public string Email{get;set;}
public string Phoneno {get;set;}

}

Class Organisation:Employee
{
public Employee Manager{get;set;}
public List<employee> Direct_Roles{get;set;}
}



I want to create a Complex type in the above format in model browser.
Posted
Comments
Christian Graus 11-Nov-13 0:44am    
What is the issue ?

1 solution

You have merged two different concept into one. Inheritance and Complex type.

1. You can do something like this for inheritance.
C#
Class Organisation:Employee
{
   public List<employee> Direct_Roles{get;set;}
}
</employee>


2. Complex type declaration as follows
C#
Class Organisation
{
public Employee Manager{get;set;}
public List<employee> Direct_Roles{get;set;}
}
</employee>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900