Exemplo n.º 1
0
        /// <summary>
        /// Удаление заявки
        /// </summary>
        public void Delete(long id)
        {
            requestConstraintsService.CheckExistsRequest(id);

            requestFileRepository.Delete(f => f.RequestId == id);
            requestRepository.Delete(id);
            repository.SaveChanges();
        }
Exemplo n.º 2
0
        public void DeleteFile(long id)
        {
            long?requestId = requestFileRepository.GetList(t => t.Id == id)
                             .Select(t => t.RequestId)
                             .FirstOrDefault();

            if (requestId.HasValue)
            {
                requestConstraintsService.CheckExistsRequest(requestId.Value);
            }

            requestFileRepository.Delete(id);
            repository.SaveChanges();
        }