-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/nuget/dotnet-reportgenerator-gl…
…obaltool-5.1.21
- Loading branch information
Showing
27 changed files
with
1,157 additions
and
2,190 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,18 @@ module private EntityConfig = | |
user.Property(fun u -> u.Id).HasConversion((fun (UserId id) -> id), UserId) | ||
|> ignore | ||
|
||
user | ||
.Property(fun u -> u.Email) | ||
.HasConversion((fun (Email email) -> email), Email) | ||
|> ignore | ||
|
||
user.HasData( | ||
{ Id = Guid.NewGuid() |> UserId | ||
Name = "Ryu" | ||
Email = "[email protected]" } | ||
Email = Email "[email protected]" } | ||
) | ||
|> ignore | ||
|
||
|
||
let blog (builder: ModelBuilder) = | ||
let blog = builder.Entity<Blog>() | ||
blog.HasKey(fun u -> u.Id :> obj) |> ignore | ||
|
@@ -41,7 +45,7 @@ module private EntityConfig = | |
post.HasOne<Blog>().WithMany().HasForeignKey(fun u -> u.BlogId :> obj) |> ignore | ||
post.HasKey(fun u -> u.Id :> obj) |> ignore | ||
|
||
type AppDbContext(options) = | ||
type MyDbContext(options) = | ||
inherit DbContext(options) | ||
member this.Users = this.Set<User>() | ||
member this.Posts = this.Set<BlogPost>() | ||
|
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
Oops, something went wrong.