I'm setting ID of database entry's by creating and using a hash value. The problem is that when I start the application again, the hash value of the same origin values are different and I get a doubling (same values, different ID). Below you find my example code. Start the CLI, remember the given hash value, start again --> different value.
How can I reproduce the same hash value with each instance?
static void Main(string[] args)
{
int drid = 3081;
DateTime dt = DateTime.ParseExact("2019-04-11 00:23:10", "yyyy-MM-dd HH:mm:ss", null);
string idAsString = drid.ToString() + dt.ToString();
Console.WriteLine(idAsString.GetHashCode().ToString());
Console.ReadKey();
}