Null vigencia notification links before delete
This commit is contained in:
parent
27ebbbab85
commit
c9d8bdfda6
|
|
@ -1177,6 +1177,16 @@ namespace line_gestao_api.Controllers
|
|||
var lastRow = ws.LastRowUsed()?.RowNumber() ?? startRow;
|
||||
|
||||
var tenantId = GetTenantIdFromClaims();
|
||||
var notificationsQuery = _db.Notifications
|
||||
.IgnoreQueryFilters()
|
||||
.Where(n => n.VigenciaLineId != null);
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
notificationsQuery = notificationsQuery.Where(n => n.TenantId == tenantId.Value);
|
||||
}
|
||||
await notificationsQuery.ExecuteUpdateAsync(setters =>
|
||||
setters.SetProperty(n => n.VigenciaLineId, n => null));
|
||||
|
||||
var vigenciaQuery = _db.VigenciaLines.IgnoreQueryFilters();
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue