更新过滤器更改

Uat_Study
hang 2022-04-01 10:53:08 +08:00
parent 099d76a53c
commit 7664a92e7e
4 changed files with 12 additions and 8 deletions

View File

@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.ViewModel
//public string ModuleType { get; set; } = String.Empty; //public string ModuleType { get; set; } = String.Empty;
public DateTime? DeletedTime { get; set; }
public DateTime CreateTime { get; set; } public DateTime CreateTime { get; set; }
public DateTime UpdateTime { get; set; } public DateTime UpdateTime { get; set; }

View File

@ -191,6 +191,8 @@ namespace IRaCIS.Core.Application.Services
[TypeFilter(typeof(TrialResourceFilter))] [TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> DeleteSiteCRC(Guid id, bool isDelete) public async Task<IResponseOutput> DeleteSiteCRC(Guid id, bool isDelete)
{ {
var isSuccess = await _trialSiteUserRepository.UpdateFromQueryAsync(u => u.Id == id, u => new TrialSiteUser() var isSuccess = await _trialSiteUserRepository.UpdateFromQueryAsync(u => u.Id == id, u => new TrialSiteUser()
{ IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null }); { IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null });

View File

@ -13,7 +13,7 @@ namespace IRaCIS.Core.Domain.Models
///CommonDocument ///CommonDocument
///</summary> ///</summary>
[Table("CommonDocument")] [Table("CommonDocument")]
public class CommonDocument : Entity, IAuditUpdate, IAuditAdd public class CommonDocument : Entity, IAuditUpdate, IAuditAdd,ISoftDelete
{ {
@ -66,6 +66,8 @@ namespace IRaCIS.Core.Domain.Models
[Required] [Required]
public bool IsDeleted { get; set; } public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
/// <summary> /// <summary>
/// Code /// Code
/// </summary> /// </summary>

View File

@ -250,7 +250,7 @@ namespace IRaCIS.Core.Infra.EFCore
public async Task<bool> UpdateFromQueryAsync(Expression<Func<TEntity, bool>> where, Expression<Func<TEntity, TEntity>> updateFactory) public async Task<bool> UpdateFromQueryAsync(Expression<Func<TEntity, bool>> where, Expression<Func<TEntity, TEntity>> updateFactory)
{ {
return await _dbSet.Where(where).UpdateFromQueryAsync(updateFactory) > 0; return await _dbSet.IgnoreQueryFilters().Where(where).UpdateFromQueryAsync(updateFactory) > 0;
} }
#endregion #endregion