Is there any way to make autogenerated primary keys for string type, not int or guid?
public class User
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] //???
public string Id { get; set; } // string type
public string Name { get; set; }
public string Login { get; set; }
}
In case of following questions "why?": the thing is that in my current model PK is login, and I want to imperceptibly separate login and primary key, saving PKs that's already in use.