public void ClearCulturesAndHostnames(ExtendedTenant tenant) { foreach (var domain in domainService.GetAssignedDomains(tenant.StartContentId, true)) { domainService.Delete(domain); ConnectorContext.AuditService.Add(AuditType.Save, -1, domain.Id, "Domain", $"Cultures and Hostinames for {tenant.Tenant.TenantUId} have been cleared"); } }
public virtual IList <TUiDto> Delete(IList <TBareDto> dtos) { try { // Adapt dtos to domain entities IList <TDomainEntity> domainEntities = _bareDtoToDomainAdapter.Adapt(dtos).ToList(); // delete the entity matching from id in the database IList <Tuple <bool, TDomainEntity> > results = _domainService.Delete(domainEntities); return(results.Select(r => _domainToUiDtoAdapter.Adapt(r.Item2)).ToList()); } catch (Exception ex) { _logger.LogError(ex, Literals.p_ErrorDeletingDtoOfTypeX.ParseParameter(typeof(TBareDto).Name)); throw; } }
//[HttpDelete] public override HttpResponseMessage Delete(string Id) { if (_userDomainService.Get(Id) == null) { Error(HttpStatusCode.NotFound, "No Lead found for the given Id: {0}", new object[] { Id }); } _userDomainService.Delete(Id); return(Request.CreateResponse(HttpStatusCode.OK)); }
public virtual HttpResponseMessage Delete(string id) { if (_domainService.Get(id) == null) { Error(HttpStatusCode.NotFound, "No {1} found for the given id: {0}", new object[] { id }); } _domainService.Delete(id); return(Request.CreateResponse(HttpStatusCode.OK)); }
public bool DeleteById(int id) { var domain = _domainService.GetById(id); if (domain == null) { return(false); } var deleteAttempt = _domainService.Delete(domain); return(deleteAttempt.Success); }
public IActionResult Delete(long domainId, FormCollection formCollection) { if (ModelState.IsValid) { try { _domainService.Delete(_authenticationService.TenantId, domainId); return(RedirectToAction("search")); } catch (ValidationErrorException ex) { _validationService.RegisterValidationErrors(ModelState, ex.Errors, "Domain"); } } return(Delete(domainId)); }
public ActionResult DeleteConfirmed(Guid id) { try { _Service.Delete(id); return(RedirectToAction("Index")); } catch (Exception e) { ModelState.AddModelError(string.Empty, e.GetOriginalException().Message); } var model = _Service.FindView(id); if (model == null) { return(HttpNotFound()); } return(View(model)); }
protected override void DeleteItem(IDomain item) => domainService.Delete(item);
public async Task <TDto> Delete(long id) { var response = await _domainService.Delete(id); return(_mapper.Map <TDto>(response)); }
public override void DeleteItem(IDomain item) => domainService.Delete(item);