体验一下aspweb的功能和用法!!!

This commit is contained in:
heiye111
2025-09-22 22:28:13 +08:00
commit 8ab52738c0
145 changed files with 4569 additions and 0 deletions

15
Data/AppDbContext.cs Normal file
View File

@@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using SimpleTodoApiWithPg.Models; // 引入 Todo 模型
namespace SimpleTodoApiWithPg.Data
{
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
{
}
// 定义一个 DbSet 属性,对应数据库中的 Todos 表
public DbSet<Todo> Todos { get; set; } = default!;
}
}