mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-04 22:07:39 +00:00
Update improvements.md
This commit is contained in:
parent
85fd10e541
commit
ac31cc7878
1 changed files with 6 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue