Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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;
        }