This question is locked. New answers and comments are not allowed.
In your DataStorageDemoXaml the database is created in the following way:
This is not realistic, even if it is a demo.
How can I know that the CityFK of New York is '1'?
How can I get the CityId of New York after inserting the dataset?
//table: Cities{CityID, CityName, Population} ; CityID field is autoincremental and auto generatedcontext.Insert(new Cities() { CityName = "New York", State = "New York", Population = 8300000 });context.Insert(new Cities() { CityName = "Los Angeles", State = "California", Population = 3800000 });//table: BikeStores {StoreID, CityFK, StoreName, StoreAddress}; StoreID field is autoincremental and auto generatedcontext.Insert(new BikeStores { CityFK = 1, StoreName = "Bikes for NY", StoreAddress = "8175 Thunder Bear Ramp" });This is not realistic, even if it is a demo.
How can I know that the CityFK of New York is '1'?
How can I get the CityId of New York after inserting the dataset?