Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to map column name different from class name in Entity Framework 6.
Scenario:

I have a table named tbl_invoicedetails with column names
->invdetails_id
->item_name
->itemdetails

and so on

Model name InvDetails
->InvDetailsID
->ItemName
->ItemDetails

So I have to map both of them in OnModelCreating event. I've gone through Scott Gu's blog but that's not applicable for EF6. That is for EF4 or 4.1.

I also want to ask if data annotation is better or fluent api. Please provide an example or an ef 6 link...whatever possible.
Posted
Updated 29-Mar-15 7:51am
v2

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