开发者

EFCodeFirst ctp 5 composite primary key

开发者 https://www.devze.com 2023-03-02 19:48 出处:网络
Is there a way to create a composite key in efcodefirst with code(model) first. a开发者_如何学Ctm I have this

Is there a way to create a composite key in efcodefirst with code(model) first.

a开发者_如何学Ctm I have this

 [Key]
    public string ResourceType { get; set; }
    public string CultureCode { get; set; }
    public string ResourceKey { get; set; }
    public string ResourceValue { get; set; }

I need resourcetype+resourcekey to be the composite key.


I found the solution. It is the same as presented here Composite Key with EF 4.1 Code First

0

精彩评论

暂无评论...
验证码 换一张
取 消