public static void UpdateAttempt(IEnumerable <Attempt> attempts) { using (var Repository = new AttemptRepository()) { foreach (var attempt in attempts) { Repository.Entry(attempt).State = EntityState.Modified; } Repository.SaveChanges(); } }
public static void InvalidateAttempts(Dictionary <string, List <int> > outliers, DataSource source) { using (var Repo = new AttemptRepository()) { foreach (var entry in outliers) { var attempts = Repo.Attempts.Where(attempt => attempt.ID == entry.Key && attempt.Source == source); foreach (var aNum in entry.Value) { var attempt = attempts.Where(att => att.AttemptNumber == aNum).Single(); attempt.Valid = false; Repo.Entry(attempt).State = EntityState.Modified; } } Repo.SaveChanges(); } }
public static void UpdateAttempt(IEnumerable<Attempt> attempts) { using (var Repository = new AttemptRepository()) { foreach (var attempt in attempts) { Repository.Entry(attempt).State = EntityState.Modified; } Repository.SaveChanges(); } }
public static void InvalidateAttempts(Dictionary<string, List<int>> outliers, DataSource source) { using(var Repo = new AttemptRepository()) { foreach (var entry in outliers) { var attempts = Repo.Attempts.Where(attempt => attempt.ID == entry.Key && attempt.Source == source); foreach(var aNum in entry.Value) { var attempt = attempts.Where(att => att.AttemptNumber == aNum).Single(); attempt.Valid = false; Repo.Entry(attempt).State = EntityState.Modified; } } Repo.SaveChanges(); } }