Files
Discord.Net/docs/guides/other_libs/samples/DbContextSample.cs
Duke 1fc07e742f Guides for Serilog and EFCore (#2134)
* Add serilog guide

* added suggestions from Rozen

* Add efcore guide

* Fix review changes

* Fix grammatical errors & review points
2022-03-02 15:08:51 -04:00

20 lines
400 B
C#

// 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; }
}