1

I use Entity Code first in my solution. Lets say I already have a primary key in my table (projectID) but I would like another field to be unique (SlugName). How can I achieve this?

Here is my entity:

[Key]
public int ProjectID   { get; set; }
public string Name     { get; set; }
public string SlugName { get; set; }

Thanks.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
Bronzato
  • 9,438
  • 29
  • 120
  • 212

0 Answers0