Question

Is it possible have custom properties in POCO or STE. as a rule, STE or POCO property names should match table column names. so is it achievable in STE?

ie. Table has 3 columns (Id, Name, DateOfBirth). Whether entity can have Age (custom property without db mapping)?

regards, Anand

Was it helpful?

Solution

You can have custom non mapped properties in both POCO and STEs (created by T4 generator). You can simply add them to your partial part of entity class. The limitation of custom properties is that they cannot be used in linq-to-entities queries or filled from linq queries.

Btw. properties of POCO and STEs can have different names from columns in database - that is one of EDMX's functionality to specify custom names for mapped properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top