public virtual bool HasVoted(int pollId, int hungryProfessionalId, out Vote vote) { vote = (from v in LPContext.Vote.Include("SelectedRestaurant") where v.PollId == pollId && v.HungryProfessionalId == hungryProfessionalId select v).FirstOrDefault(); return (vote != null); }
public virtual void RegisterVote(int pollId, int professionalId, int selectedRestaurantId) { var vote = new Vote { PollId = pollId, HungryProfessionalId = professionalId, SelectedRestaurantId = selectedRestaurantId }; DAL.SaveVote(vote); }
public virtual bool HasVoted(int pollId, int hungryProfessionalId, out Vote vote) { return DAL.HasVoted(pollId, hungryProfessionalId, out vote); }
public virtual void SaveVote(Vote vote) { LPContext.Vote.Add(vote); LPContext.SaveChanges(); }