How I can generete primary key by object's properties? I need something like hash. But stable hash;
public Object1 {
public Object1(string property1, DateTime property2)
{
Property1 = property1;
Property2 = property2;
StableHashID = GetStableHash();
}
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
public int StableHashID { get; private set; }
public string Property1 { get; private set; }
public DateTime Property2 { get; private set; }
public int GetStableHash()
{
return ...; // ???
}
}