Skip to content

Commit

Permalink
refactor(core): use primary ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
codingawayy committed Jan 6, 2024
1 parent a992e0e commit 491734b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Filer.EntityFrameworkCore/FileStoreContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
using Filer.EntityFrameworkCore.Mappings;
using Microsoft.EntityFrameworkCore;

internal class FileStoreContext : DbContext
internal class FileStoreContext(DbContextOptions options) : DbContext(options)
{
private const string DefaultConnectionString =
"Server=(localdb)\\mssqllocaldb;Database=filer;Trusted_Connection=True;MultipleActiveResultSets=true";

public FileStoreContext()
: base(new DbContextOptionsBuilder().UseSqlServer(DefaultConnectionString).Options)
{
}

public FileStoreContext(DbContextOptions options)
: base(options)
: this(new DbContextOptionsBuilder().UseSqlServer(DefaultConnectionString).Options)
{
}

Expand Down

0 comments on commit 491734b

Please sign in to comment.