public void addSavedStatus(Status s, ApplicationUser a) { UserSavedStatusConnection connection = new UserSavedStatusConnection(); connection.StatusID = s.ID; connection.UserID = a.Id; if (savedConnectionExists(connection)) { return; } db.UserSavedStatusConnections.Add(connection); db.SaveChanges(); }
public bool savedConnectionExists(UserSavedStatusConnection testCase) { var connection = (from c in db.UserSavedStatusConnections where (c.UserID == testCase.UserID && c.StatusID == testCase.StatusID) select c).SingleOrDefault(); if (connection == null) { return false; } return true; }