Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database computed column not generating in EF 4.1

I have a database table with a computed column

CREATE TABLE [dbo].[User]
(
    [UserId] [uniqueidentifier] NOT NULL,
    [PersonalityType]  AS ([dbo].[GetPersonalityType]([UserId]))
)

And a scalar function [dbo].[GetPersonalityType] that aggregates and filters data from another table. The computed value is not persisted in the database (because it is non-deterministic, I am told).

When I update the entity framework model from the database the computer column PersonalityType never shows up. What is wrong? Can EF 4.1 model computed columns in this situation?

like image 456
Jeff Avatar asked Jun 12 '26 20:06

Jeff


1 Answers

I'm not sure how you can get this to work, but try playing with a lot of properties and then regenerating it a lot. ;-)

like image 117
Nathan DeWitt Avatar answered Jun 15 '26 12:06

Nathan DeWitt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!