完成工作单元
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
服务实现
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.Application.Student.StudentService.PostShijie">
|
||||
<member name="M:Yi.Framework.Application.Student.StudentService.PostUow">
|
||||
<summary>
|
||||
你好世界
|
||||
Uow
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
|
||||
@@ -28,13 +28,15 @@ namespace Yi.Framework.Application.Student
|
||||
{
|
||||
private readonly IStudentRepository _studentRepository;
|
||||
private readonly StudentManager _studentManager;
|
||||
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
||||
//private readonly IUnitOfWorkManager _unitOfWorkManager;
|
||||
public StudentService(IStudentRepository studentRepository, StudentManager studentManager, IUnitOfWorkManager unitOfWorkManager)
|
||||
{
|
||||
_studentRepository = studentRepository;
|
||||
_studentManager = studentManager;
|
||||
_unitOfWorkManager = unitOfWorkManager;
|
||||
}
|
||||
|
||||
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
||||
/// <summary>
|
||||
/// Uow
|
||||
/// </summary>
|
||||
@@ -44,6 +46,7 @@ namespace Yi.Framework.Application.Student
|
||||
StudentGetOutputDto res = new();
|
||||
using (var uow = _unitOfWorkManager.CreateContext())
|
||||
{
|
||||
var studentRepository = uow.GetRepository<StudentEntity>();
|
||||
res = await base.CreateAsync(new StudentCreateInputVo { Name = $"老杰哥{DateTime.Now.ToString("ffff")}", Number = 2023 });
|
||||
if (new Random().Next(0, 2) == 0) throw new NotImplementedException();
|
||||
uow.Commit();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\framework\Yi.Framework.Uow\Yi.Framework.Uow.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Application.Contracts\Yi.Framework.Application.Contracts.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Domain\Yi.Framework.Domain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -32,3 +32,4 @@
|
||||
2023:01:17-22:45:52本次运行启动时间为:1877毫秒
|
||||
2023:01:17-23:24:07本次运行启动时间为:1836毫秒
|
||||
2023:01:17-23:29:20本次运行启动时间为:1958毫秒
|
||||
2023:01:17-23:45:25本次运行启动时间为:2016毫秒
|
||||
|
||||
Reference in New Issue
Block a user