Store Generated Pattern not outputing to fluent mapping

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
strandedpirate
Posts: 21
Joined: Tue 07 Jan 2014 12:38

Store Generated Pattern not outputing to fluent mapping

Post by strandedpirate » Wed 29 Jan 2014 00:14

If you set a property's "Store Generated Pattern" to Computed the DbContext template does not write out this specification when fluent mapping is turned on.

I added an OR statement below get this working but this may not take all scenarios into consideration.

Around line ~1392:

Code: Select all

if (prop.PrimaryKey || prop.StoreGeneratedPattern != StoreGeneratedPattern.None) {
#>

			.HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.<#= prop.StoreGeneratedPattern.ToString() #>)<#+
}

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Store Generated Pattern not outputing to fluent mapping

Post by Shalex » Thu 30 Jan 2014 11:33

We could not reproduce the problem in our environment.

Please perform the following steps:
1. Make sure that you are using a predefined template (without changes) shipped with installation of Entity Developer: disable current template (right click on it > Disable), then right click on the Templates node in Model Explorer > New Template > DbContext > OK.
2. Specify all non-default properties of the used DbContext template.
3. Tell us your current version (x.x.xxx) of Entity Developer.
4. Send us a test model to reproduce the issue with incorrect code generation.

Post Reply