I hope you can help me.
I have 2 tables in the db: Bill and BillItem. These tables are configured with one to one relation in the db where bill is the principle table while BillItem is the dependent one
The structure of table Bill :
Int BillId (PK)
Int BillTypeId Not Null
Varchar(5) Usr Not Null
DateTime Tm Not Null
The structure of table BillItem:
Int BillItemId (PK)
Int ItemId Not Null
Varchar(5) Usr Not Null
DateTime Tm Not Null
I would like to map these 2 table into a single POCO class using Fluent API and Entity Framework 4.1 Code First approach
I also want to configure the tables columns names to use different properties names in the POCO Class (i.e. Id instead of BillId, User instead of Usr)
This is a legacy database, I cannot modify any of its objects.
How can achieve that?
Thank you all.
The resulting class should be (if can be):
public int Id {get;set;}
public int BillTypeId {get;set;}
public int ItemId {get;set;}
public string User {get;set;}
public string User1 {get;set;}
public DateTime Tm {get;set;}
public DateTime Tm1 {get;set;}