Exemple #1
0
 public bool DeleteEnterprise(int id)
 {
     repository.GetEnterprise(id).Toys.ForEach(toy =>
     {
         toyRepository.DeleteToy(toy.Id);
     });
     repository.DeleteEnterprise(id);
     return(true);
 }
Exemple #2
0
        public EnterpriseUpdateDto GetEnterpriseToUpdate(Guid id)
        {
            EnterpriseUpdateDto e = _enterpriseRepo.GetEnterprise(id)?.ToUpdateDto();

            if (e == null)
            {
                throw new Exception();
            }

            return(e);
        }