public static void UpdateScore(Score score) { ARCCproposalsDbContext db = new ARCCproposalsDbContext(); db.Entry(score).State = EntityState.Modified; db.SaveChanges(); }
// update if scoring is complete public static void UpdateProposal(Proposal proposal) { ARCCproposalsDbContext db = new ARCCproposalsDbContext(); db.Entry(proposal).State = EntityState.Modified; db.SaveChanges(); }
public static bool CreateUser(User user) { ARCCproposalsDbContext db = new ARCCproposalsDbContext(); List <User> users = new List <User>(); users = db.Users.ToList(); bool userExists = false; foreach (User u in users) { if (user.email == u.email) { userExists = true; } } if (!userExists) { db.Users.Add(user); db.SaveChanges(); return(true); } return(false); }