完善更新功能

This commit is contained in:
橙子
2023-01-31 20:09:54 +08:00
parent 5fb09c1c4a
commit 1c8f20440c
12 changed files with 77 additions and 21 deletions

View File

@@ -3,10 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Services.Abstract;
namespace Yi.Framework.Ddd.Dtos.Abstract
{
public interface IPagedAllResultRequestDto
public interface IPagedAllResultRequestDto: IPageTimeResultRequestDto, IPagedAndSortedResultRequestDto
{
DateTime? StartTime { get; set; }
DateTime? EndTime { get; set; }

View File

@@ -8,7 +8,7 @@ using Yi.Framework.Ddd.Services.Abstract;
namespace Yi.Framework.Ddd.Dtos
{
public class PagedAllResultRequestDto : PagedAndSortedResultRequestDto, IPageTimeResultRequestDto, IPagedAndSortedResultRequestDto
public class PagedAllResultRequestDto : PagedAndSortedResultRequestDto, IPagedAllResultRequestDto, IPagedAndSortedResultRequestDto, IPageTimeResultRequestDto
{
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }

View File

@@ -57,6 +57,11 @@ namespace Yi.Framework.Ddd.Services
where TGetListOutputDto : IEntityDto<TKey>
{
protected virtual Task<TEntity> MapToEntityAsync(TGetListInput getListinput)
{
return Task.FromResult(_mapper.Map<TEntity>(getListinput));
}
protected virtual Task<TEntity> MapToEntityAsync(TCreateInput createInput)
{
@@ -153,7 +158,6 @@ namespace Yi.Framework.Ddd.Services
{
throw new ArgumentNullException(nameof(id));
}
var entity = await MapToEntityAsync(input);
entity.Id = id;
await _repository.UpdateIgnoreNullAsync(entity);