public List <SingleVoteItem> GetSingleVoteItems() { var builder = new SingleVoteTicketBuilder(); var items = Context.SingleVotes .Include("BallotIssue") .Include("Candidate").Include("Candidate.Job") .Select(builder.GetModel).ToList(); return(items); }
public List <SingleVoteItem> GetSingleVoteItemsByIds(List <Guid?> ids) { var builder = new SingleVoteTicketBuilder(); var items = Context.SingleVotes .Include("BallotIssue") .Include("Candidate").Include("Candidate.Job") .Select(builder.GetModel).ToList(); items = items.Where(x => ids.Contains(x.SingleVoteTicketId)).ToList(); return(items); }