예제 #1
0
 public async Task <Attachment> GetById(Guid id)
 {
     using (var dbContextReadOnlyScope = _dbContextScopeFactory.CreateReadOnly())
     {
         return(await _attachmentRepository.FindAsync(x => x.Id == id));
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public async Task <Attachments> GetAttachmentsById(int id)
 {
     return(await _attachmentRepository.FindAsync(id));
 }