Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code #3574

Merged
merged 2 commits into from
Nov 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samples/core/GetStarted/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ public class BloggingContext : DbContext
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }

public string DbPath { get; private set; }
public string DbPath { get; }

public BloggingContext()
{
var folder = Environment.SpecialFolder.LocalApplicationData;
var path = Environment.GetFolderPath(folder);
DbPath = $"{path}{System.IO.Path.DirectorySeparatorChar}blogging.db";
DbPath = System.IO.Path.Join(path, "blogging.db");
}

// The following configures EF to create a Sqlite database file in the
Expand All @@ -29,7 +29,7 @@ public class Blog
public int BlogId { get; set; }
public string Url { get; set; }

public List<Post> Posts { get; } = new List<Post>();
public List<Post> Posts { get; } = new();
}

public class Post
Expand Down