Guides for Serilog and EFCore (#2134)
* Add serilog guide * added suggestions from Rozen * Add efcore guide * Fix review changes * Fix grammatical errors & review points
This commit is contained in:
19
docs/guides/other_libs/samples/DbContextSample.cs
Normal file
19
docs/guides/other_libs/samples/DbContextSample.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
// ApplicationDbContext.cs
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
public class ApplicationDbContext : DbContext
|
||||
{
|
||||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DbSet<UserEntity> Users { get; set; } = null!;
|
||||
}
|
||||
|
||||
// UserEntity.cs
|
||||
public class UserEntity
|
||||
{
|
||||
public ulong Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user