Created
February 28, 2021 08:24
-
-
Save kelumKP/914dc97124999083d1f8c58285dd396f to your computer and use it in GitHub Desktop.
Test DB Context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestDBContext : DbContext, IContext | |
{ | |
public TestDBContext() : base("Name=DB_CONNECTION_STRING"){} | |
public TestDBContext(DbConnection existingConnection, bool contextOwnsConnection) : base(existingConnection, contextOwnsConnection){} | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
{ | |
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); | |
base.OnModelCreating(modelBuilder); | |
} | |
public IDbSet<SampleTable> SampleTables { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment