BUG: Computed columns in MySQL are not mapping properly to model data types.

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
LiamNeville
Posts: 1
Joined: Fri 20 Dec 2019 00:06

BUG: Computed columns in MySQL are not mapping properly to model data types.

Post by LiamNeville » Fri 20 Dec 2019 00:13

I have a column on a MySQL table that is an Int computed at the database as the sum of three other required fields. When generating the model from database that property is not placed on the autogenerated tag in the edml file. This causes an error when creating new entities and breaks on saveChanges(). I have to manually change the edml file by hand by adding this tag and then it works as expected. It seems that it is a bug that this tag is not staying. Also, upon bringing in other changes to the model this property is wiped and has to be added in manually every time.

This is the tag before (from devart autogeneration)
<Property Name="NumCycles" Type="int" />

This is the tag after I manually edit it:
<Property Name="NumCycles" Type="int" StoreGeneratedPattern="Computed" />

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

Re: BUG: Computed columns in MySQL are not mapping properly to model data types.

Post by Shalex » Thu 26 Dec 2019 18:29

In Solution Explorer, right-click *.edml > Open With > Entity Developer. Navigate to Tools > Entity Developer > Model Explorer > expand the *.Store node, select your calculated property and set Store Generated Pattern=Computed. After this, Entity Developer will add StoreGeneratedPattern="Computed" for this property in the SSDL part of your model.

We will improve Entity Developer to set StoreGeneratedPattern="Computed" for the generated columns automatically and notify you.

Post Reply