public void SaveSubmissionHistory(SubmissionHistory history) { var context = _serviceProvider.GetService <ApplicationDbContext>(); context.SubmissionHistory.Add(history); context.SaveChanges(); }
public static DocumentStatusListViewModel DocumentStatusListFrom <T>(SubmissionHistory <T> source) where T : SubmissionDocument { return(new DocumentStatusListViewModel { Documents = from s in source.Documents select DocumentStatusFrom(s) }); }
private void EvaluateSave() { foreach (var submission in SubmissionHistory) { SaveSubmission(submission); } Console.WriteLine($"Saved {SubmissionHistory.Count()} submissions"); }
public static PrimaryGeneralStatusListViewModel PrimaryGeneralStatusListFrom <T>(SubmissionHistory <T> primarySource, SubmissionHistory <T> generalSource) where T : SubmissionDocument { return(new PrimaryGeneralStatusListViewModel { PrimaryElection = DocumentStatusListFrom(primarySource).Documents, GeneralElection = DocumentStatusListFrom(generalSource).Documents }); }