非常优雅的完成了数据模块

This commit is contained in:
橙子
2023-01-20 20:03:25 +08:00
parent 98375f8629
commit fceefac0ee
26 changed files with 185 additions and 32 deletions

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.Entities;
using Yi.Framework.Ddd.Entities;
namespace Yi.Framework.Domain.Student.Entities
@@ -12,7 +13,7 @@ namespace Yi.Framework.Domain.Student.Entities
/// 学生实体
/// </summary>
[SugarTable("Student")]
public class StudentEntity : IEntity<long>
public class StudentEntity : IEntity<long>, ISoftDelete
{
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
@@ -26,5 +27,10 @@ namespace Yi.Framework.Domain.Student.Entities
/// 学号
/// </summary>
public long Number { get;set ; }
/// <summary>
/// 软删除
/// </summary>
public bool IsDeleted { get; set; }
}
}

View File

@@ -6,12 +6,12 @@ using System.Threading.Tasks;
using Yi.Framework.Ddd.Repositories;
using Yi.Framework.Domain.Student.Entities;
namespace Yi.Framework.Domain.Student.IRepository
namespace Yi.Framework.Domain.Student.Repositories
{
/// <summary>
/// 仓储抽象
/// </summary>
public interface IStudentRepository:IRepository<StudentEntity>
public interface IStudentRepository : IRepository<StudentEntity>
{
Task<List<StudentEntity>> GetMyListAsync();
}

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Domain.Student.IRepository;
using Yi.Framework.Domain.Student.Repositories;
namespace Yi.Framework.Domain.Student
{