Exemplo n.º 1
0
 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");
     }
 }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        //[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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        public bool DeleteById(int id)
        {
            var domain = _domainService.GetById(id);

            if (domain == null)
            {
                return(false);
            }

            var deleteAttempt = _domainService.Delete(domain);

            return(deleteAttempt.Success);
        }
Exemplo n.º 6
0
 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));
 }
Exemplo n.º 7
0
        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));
        }
Exemplo n.º 8
0
 protected override void DeleteItem(IDomain item)
 => domainService.Delete(item);
Exemplo n.º 9
0
        public async Task <TDto> Delete(long id)
        {
            var response = await _domainService.Delete(id);

            return(_mapper.Map <TDto>(response));
        }
Exemplo n.º 10
0
 public override void DeleteItem(IDomain item)
 => domainService.Delete(item);