Open rosdi opened 7 years ago
I would need to add a callback to allow extra config options to be set. I'll get back to this once data annotations are completed.
Ok thanks.
Duh!... I am an idiot... I could just use annotation to achieve the same purpose!
Func<Column, string> WritePocoColumn = c =>
{
if (c.NameHumanCase == "CreatedDate")
return "System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedAttribute(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Computed)] " + c.Entity;
return c.Entity;
};
Hi, I'd like to output properties (Columns) with back-end fields instead of auto-properties, I'd like to add some logic in the setter.
For that I'd like to know how to get the column Type.
Is WritePocoColumn, the right place to output properties? Thanks.
I am trying to customize the output of the
*Configuration
classes..., basically I want all columns that are namedCreatedDate
to haveDatabaseGeneratedOption.Computed
annotation.Right now I butchered the
EF.Reverse.POCO.Core.ttinclude
to have that effect, and it works, here is how I did it.--
EF.Reverse.POCO.Core.ttinclude around line 806
--And i get a nice output like this...
But I have the feeling this is not the proper place to do this, if I upgrade Reverse POCO Generator, my changes will be overwritten.
I have browsed through the
Database.tt
script but could not figure out a way to achieve this in that file.