Discord.Net/docs/guides/other_libs/samples/DbContextSample.cs

20 lines
400 B
C#
Raw Permalink Normal View History

2024-06-12 22:43:59 -07:00
// 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; }
}