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
  • 994,864
  • 265
  • 3,241
  • 2,902
Bronzato
  • 9,082
  • 27
  • 113
  • 203

0 Answers0