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); } }
public async Task <Attachments> GetAttachmentsById(int id) { return(await _attachmentRepository.FindAsync(id)); }