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

            requestFileRepository.Delete(f => f.RequestId == id);
            requestRepository.Delete(id);
            repository.SaveChanges();
        }
        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();
        }