Update improvements.md

This commit is contained in:
Mark J Price 2023-03-02 11:53:51 +00:00
parent 85fd10e541
commit ac31cc7878

View file

@ -202,6 +202,12 @@ public static IServiceCollection AddNorthwindContext(
path = Path.GetFullPath(path);
WriteLine($"Database path: {path}");
if (!File.Exists(path))
{
throw new FileNotFoundException(
message: $"{path} not found.", fileName: path);
}
services.AddDbContext<NorthwindContext>(options =>
{
// Data Source is the modern equivalent of Filename.