public bool SubscribeToPublisher(int subscriberID, int publisherID) { var newSubscription = new Subscription { WriterId = publisherID, SubscriberId = subscriberID, HasNewContent = true }; _context.Add(newSubscription); _context.SaveChanges(); return(true); }
public bool AddRatingForEpic(Domain.Models.Rating rating) { Rating r = new Rating(); try { r = _context.Ratings.First(r => r.EpicId == rating.RatingEpic.ID && r.RaterId == rating.Rater.ID); } catch { var newModel = Mappers.RatingMapper.MapFull(rating); _context.Add(newModel); _context.SaveChanges(); return(true); } return(false); }