none
EntityFramework 6 Model first RRS feed

  • Question

  • Hey Folks,

    Hope you all are doing well there.

    I have a question about EntityFramework 6 model first! I use the design to make my model. so my question is :

    in my case, can I create a scalar property that is "unique" but i don't want it to be the primary key.

    is that possible?

    Many Thanks 

    Friday, May 9, 2014 10:33 AM

Answers

  • Hello,

    All of types for scalar property can found here with the model first:

    There is not the unique type.

    If you want to define a unique field which is non-key, I would like suggest you using the fluent API, it supports the unique field now:

    http://msdn.microsoft.com/en-us/data/jj591617.aspx#PropertyIndex

    If I misunderstand, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 12, 2014 7:19 AM
    Moderator

All replies

  • Hello,

    All of types for scalar property can found here with the model first:

    There is not the unique type.

    If you want to define a unique field which is non-key, I would like suggest you using the fluent API, it supports the unique field now:

    http://msdn.microsoft.com/en-us/data/jj591617.aspx#PropertyIndex

    If I misunderstand, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 12, 2014 7:19 AM
    Moderator
  • Hello,

    thank you, but i'm working on a model first approach.

    so I think the answer is clearly no..

    Many Thanks

    Friday, May 16, 2014 1:59 PM