This question is locked. New answers and comments are not allowed.
I'm confused about how to use a data context from a domain model. I'm following the sofia car rental example to build my own application, which works for the most part, but only the automated pieces. I don't know how to actually interact with the database using an API and I can't find anything like "here's how to select."
How do you select data from a database? I've only been able to use the ToList method with any amount of success, but I don't understand how to do anything else.
I created a domain model and I'm able to populate a grid, but I want to get lists of data to use for other purposes that won't be exposed directly to a UI element. How do I query, say, a distinct list of Cities from a table called CityCountyState with three columns (City, Count, State). I don't think I can make a string with a direct MsSQL query because I've seen a lot of examples suggesting that I have to use notation I don't understand (e.g., g => ...).
How do you select data from a database? I've only been able to use the ToList method with any amount of success, but I don't understand how to do anything else.
I created a domain model and I'm able to populate a grid, but I want to get lists of data to use for other purposes that won't be exposed directly to a UI element. How do I query, say, a distinct list of Cities from a table called CityCountyState with three columns (City, Count, State). I don't think I can make a string with a direct MsSQL query because I've seen a lot of examples suggesting that I have to use notation I don't understand (e.g., g => ...).