Beispiel #1
0
 public async Task <Attachment> GetById(Guid id)
 {
     using (var dbContextReadOnlyScope = _dbContextScopeFactory.CreateReadOnly())
     {
         return(await _attachmentRepository.FindAsync(x => x.Id == id));
     }
 }
        public async Task <ResponseLogic> DeleteAsync(int attachmentId)
        {
            var attachment = await _repository.FindAsync(attachmentId);

            if (attachment is null)
            {
                return(ResponseLogic.NOT_FOUND);
            }

            var success = await _repository.DeleteAsync(attachmentId);

            if (success)
            {
                return(ResponseLogic.SUCCESS);
            }
            else
            {
                return(ResponseLogic.ERROR_DELETING);
            }
        }
Beispiel #3
0
 public async Task <Attachments> GetAttachmentsById(int id)
 {
     return(await _attachmentRepository.FindAsync(id));
 }