public static void Remove(User user) { using ContraWebDBContext contraDB = new ContraWebDBContext(); user match = contraDB.user.Single(v => v.username == user.Username); contraDB.user.Remove(match); contraDB.SaveChanges(); }
public static void Submit(User user) { using ContraWebDBContext contraDB = new ContraWebDBContext(); contraDB.user.Add(new user { username = user.Username, salt = user.Salt, password = user.Password, role = UserRole.RoleToDatabaseName(user.Role), macs = user.MACs.ToArray() }); contraDB.SaveChanges(); }