I am doing a proof of concept in a line of a business application where I want to change the current implementation of the C # Code-First Entity Framework using F # one. I am following this article, which seems to work very well, but I was hoping to use FSharp record types instead of the classes that the article uses. When I try to add data annotation to a record type, for example:
type Family = {[<Key>]Id:int; LastName:string; IsRegistered:bool}
I get the following error:
Error 1 The type 'Key' is not defined
Is there a way to use data annotations with record types? EF Code-First seems to require annotation ...
Record types support attributes just fine (and with your syntax).
, System.ComponentModel.DataAnnotations, KeyAttribute.
System.ComponentModel.DataAnnotations
KeyAttribute
: EF , EF. F # 3.0+, CLIMutable ( , # - ).
CLIMutable
, , F # 2.0 - CLIMutable , .
Source: https://habr.com/ru/post/1569127/More articles:ΠΠ΅Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ ΠΊΠΎΠΌΠΏΠΎΠ·ΠΈΡΠΎΡ Π½Π° OS X - phpΠΏΠΎΠΈΡΠΊ ip-Π°Π΄ΡΠ΅ΡΠΎΠ², ΠΊΡΠΎΠΌΠ΅ 127.0.0.1, Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ ΡΠ΅Π³ΡΠ»ΡΡΠ½ΡΡ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠΉ - linuxWhite list of templates in a template set with a controlled multi-page window in regular expression - stringDjango - Saving method offset on model - pythonΠ‘ΠΎΠΎΡΠ²Π΅ΡΡΡΠ²ΠΈΠ΅ Π³ΡΠ°Π½ΠΈΡΡ ΡΠ΅Π³ΡΠ»ΡΡΠ½ΠΎΠ³ΠΎ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΡ Java? - javaAn effective way to check if the IPv6 bitwise netmask is adjacent - cΠΠ°ΠΊ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ Ρ ΠΊΠΎΠΌΠΏΠΎΠ·ΠΈΡΠΎΡΠΎΠΌ, Π΅ΡΠ»ΠΈ Ρ ΠΌΠ΅Π½Ρ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΠΊΠΎΠΌΠΏΠΎΠ·ΠΈΡΠΎΡΠΎΠ² .json Π² Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΈΡ ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°Ρ ? - phpAttempting to work with the Polymer Paper button - javascriptAlarmManager does not work on time in Android Lollipop - androidLibGdx Bow and physics of shooting games - 2dAll Articles