public void DislikeMessage(LikeRequest likeRequest) { var message = messageRepository.GetById(likeRequest.MessageId); message.LikeCounter -= 1; messageRepository.Save(); //var message = _context.Message.Include("UserLikeList").SingleOrDefault(x => x.MessageId == likeRequest.MessageId); //message.LikeCounter -= 1; }
public FileStreamResult DownloadFile(Guid id) { var attachment = attrepository.GetById(id); var upload = _configuration.GetSection("Paths:Archive").Value + "\\Literature\\"; var filePath = Path.Combine(upload, attachment.AttachmentFileReference.ToString()); var memory = new MemoryStream(); using (var stream = new FileStream(filePath, FileMode.Open)) { stream.CopyTo(memory); } memory.Position = 0; var type = GetType(filePath); return(new FileStreamResult(memory, type) { FileDownloadName = attachment.AttachmentFileName }); }
public void DeleteNews(Guid id) { var news = repository.GetById(id); repository.Delete(news); }
public void DeleteLiterature(Guid id) { var literature = repository.GetById(id); repository.Delete(literature); }
public Comment GetComment(Guid id) { var comment = commentrepository.GetById(id); return(comment); }
public Employee GetEmployeeById(Guid id) { return(employeeRepository.GetById(id)); }
public Attachment getFileById(Guid id) { return(attachrepository.GetById(id)); }
public About GetTextByID(Guid id) { return(aboutrepository.GetById(id)); }
public Meetings GetMeeting(Guid id) { return(meetingsrepository.GetById(id)); }
public Documentation getById(Guid id) { return(documentationrepository.GetById(id)); }
public Literature GetById(Guid id) { return(repository.GetById(id)); }