Student.IServices/IBaseService.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using yrjw.ORM.Chimp;
using yrjw.ORM.Chimp.Result;
namespace Student.IServices
{
/// <summary>
/// 封装公共方法CURD操作给API直接调用,业务相关操作请在子类中重写基类方法
/// </summary>
/// <typeparam name="TEntity">数据库模型</typeparam>
/// <typeparam name="TEntityDTO">DTO模型</typeparam>
/// <typeparam name="TKey">主键类型</typeparam>
public interface IBaseService<TEntity, TEntityDTO, TKey> where TEntityDTO : class where TEntity : Model.EntityBase<TKey>, new() where TKey : struct
{
/// <summary>
/// 工作单元
/// </summary>
//IUnitOfWork UnitOfWork { get; }
/// <summary>
/// 主键查询
/// </summary>
/// <param name="id">主键</param>
/// <returns></returns>
Task<IResultModel> GetByIdAsync(TKey id);
/// <summary>
/// 所有数据
/// </summary>
/// <param name="isDescending">是否倒序排序</param>
/// <returns></returns>
Task<IResultModel> GetListAllAsync(bool isDescending = false);
/// <summary>
/// 新增数据
/// </summary>
/// <param name="model">DTO视图模型</param>
/// <returns></returns>
Task<IResultModel> InsertAsync(TEntityDTO model);
/// <summary>
/// 修改数据
/// </summary>
/// <param name="model">DTO视图模型</param>
/// <returns></returns>
Task<IResultModel> UpdateAsync(TEntityDTO model);
/// <summary>
/// 修改数据-批量
/// </summary>
/// <param name="entitys">DTO视图模型</param>
/// <returns></returns>
Task<IResultModel> UpdateAsync(IEnumerable<TEntityDTO> models);
/// <summary>
/// 软删除
/// </summary>
后面还有 26 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。