随笔分类 - MiniMalApi
摘要:上一节我们跑通了数据库,并向user表中添加了一条用户记录。这一节我们模拟一样用户登录验证。 一、在UserServer中put接口用于用户名和密码的验证。fluentValidate的基本用法自己找资源看吧。 app.MapPut("/api/Login", (Microsoft.AspNetCo
阅读全文
摘要:一、第二节的时候我们把服务层命名了application。现在改一下,换成Module层会好些。排除application项目,新增Module类库。结构如下。 public class SysUserServer : IServerBase { public ISysUserRepository
阅读全文
摘要:一、创建IRepository相关接口 public interface IRepositoryBase : IDisposable { IRepositoryBase BeginTrans(); int Commit(); int Insert<TEntity>(TEntity entity) w
阅读全文
摘要:minimalapi的 app 实例提供了 Map.Methods、Map.MapXXX 方法实现 HttpMethod 路由的映射。 默认天气接口写在Program 里面,但是把所有的接口代码写到Program.cs会变得很臃肿。 那就想办法把代码剥离开来。 一、利用注入中间件把map.xxx的所
阅读全文
摘要:一、创建简单的minimai api ,命名为AidenAdminCore.Api ,整个项目结构如下: 二、连接数据库 添加引用 EF类库nuget添加: Microsoft.EntityFrameworkCore.SqlServer API解决方案添加: Microsoft.EntityFram
阅读全文

浙公网安备 33010602011771号