更新过滤器更改
parent
099d76a53c
commit
7664a92e7e
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
//public string ModuleType { get; set; } = String.Empty;
|
||||
|
||||
|
||||
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
private readonly IRepository<TrialSite> _trialSiteRepository;
|
||||
private readonly IRepository<TrialSiteUser> _trialSiteUserRepository;
|
||||
|
||||
public TrialMaintenanceService(IRepository<TrialSite> trialSiteRepository,IRepository<TrialSiteUser> trialSiteUserRepository)
|
||||
public TrialMaintenanceService(IRepository<TrialSite> trialSiteRepository, IRepository<TrialSiteUser> trialSiteUserRepository)
|
||||
{
|
||||
_trialSiteRepository = trialSiteRepository;
|
||||
_trialSiteUserRepository = trialSiteUserRepository;
|
||||
|
@ -28,7 +28,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
{
|
||||
|
||||
var siteStatQuery = _trialSiteRepository.Where(t => t.TrialId == param.TrialId, ignoreQueryFilters: true)
|
||||
.WhereIf(param.IsDeleted!=null, t => t.IsDeleted==param.IsDeleted)
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode), t => t.TrialSiteAliasName.Contains(param.TrialSiteCode))
|
||||
|
@ -191,6 +191,8 @@ namespace IRaCIS.Core.Application.Services
|
|||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput> DeleteSiteCRC(Guid id, bool isDelete)
|
||||
{
|
||||
|
||||
|
||||
var isSuccess = await _trialSiteUserRepository.UpdateFromQueryAsync(u => u.Id == id, u => new TrialSiteUser()
|
||||
{ IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null });
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
///CommonDocument
|
||||
///</summary>
|
||||
[Table("CommonDocument")]
|
||||
public class CommonDocument : Entity, IAuditUpdate, IAuditAdd
|
||||
public class CommonDocument : Entity, IAuditUpdate, IAuditAdd,ISoftDelete
|
||||
{
|
||||
|
||||
|
||||
|
@ -65,10 +65,12 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
[Required]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Code
|
||||
/// </summary>
|
||||
/// Code
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string Code { get; set; }
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue