Created
March 14, 2018 20:30
-
-
Save StefanRiedmann/d17ed07b50f93ffdca33cae22bba4dcf to your computer and use it in GitHub Desktop.
DbContext for EntityFramework Core
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
using Microsoft.EntityFrameworkCore; | |
namespace TestProject | |
{ | |
public class PersonContext : DbContext | |
{ | |
DbSet<Person> Persons { get; set; } | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
optionsBuilder.UseSqlServer("Server=localhost,1401; Database=PersonDb1;User=SA; Password=1StrongPassword!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment