-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a4f66c
commit cf73e0b
Showing
21 changed files
with
337 additions
and
138 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using AspNetCore5._0.Data.Models; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace AspNetCore5._0.Data | ||
{ | ||
public class Demo2DbContext : DbContext | ||
{ | ||
public Demo2DbContext(DbContextOptions<Demo2DbContext> options) : base(options) | ||
{ | ||
|
||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
if (modelBuilder == null) | ||
{ | ||
throw new ArgumentNullException(nameof(modelBuilder)); | ||
} | ||
|
||
base.OnModelCreating(modelBuilder); | ||
modelBuilder.Entity<Employee>().HasKey(e => e.EmployeeId); | ||
} | ||
|
||
public DbSet<Employee> Employee { get; set; } | ||
public DbSet<EmployeeHistory> EmployeeHistories { get; set; } | ||
} | ||
} |
23 changes: 14 additions & 9 deletions
23
...8150617_EmployeeHTableRenamed.Designer.cs → .../20220609053019_InitialCreate.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
25 changes: 15 additions & 10 deletions
25
...128145908_EmployeeHTableAdded.Designer.cs → .../20220609053238_InitialCreate.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.