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

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

@@ -19,7 +19,12 @@
学号
</summary>
</member>
<member name="T:Yi.Framework.Domain.Student.IRepository.IStudentRepository">
<member name="P:Yi.Framework.Domain.Student.Entities.StudentEntity.IsDeleted">
<summary>
软删除
</summary>
</member>
<member name="T:Yi.Framework.Domain.Student.Repositories.IStudentRepository">
<summary>
仓储抽象
</summary>

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
{

View File

@@ -11,6 +11,7 @@
<Compile Include="..\..\GlobalUsings.cs" Link="Properties\GlobalUsings.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\framework\Yi.Framework.Data\Yi.Framework.Data.csproj" />
<ProjectReference Include="..\Yi.Framework.Domain.Shared\Yi.Framework.Domain.Shared.csproj" />
</ItemGroup>

View File

@@ -7,13 +7,15 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core.Attributes;
using Yi.Framework.Data;
using Yi.Framework.Domain.Shared;
using Yi.Framework.Domain.Student;
namespace Yi.Framework.Domain
{
[DependsOn(
typeof(YiFrameworkDomainSharedModule)
typeof(YiFrameworkDomainSharedModule),
typeof(YiFrameworkDataModule)
)]
public class YiFrameworkDomainModule : IStartupModule
{