public bool Authenticate(string email, string password) { var filter = Builders <RegisterViewModel> .Filter.Or( Builders <RegisterViewModel> .Filter.Where(p => p.Email.ToLower().Contains(email.ToLower())), Builders <RegisterViewModel> .Filter.Where(p => p.Password.ToLower().Contains(password))); var document = _database.FindOne(filter); return(document != null); }
public void AddMember(ObjectId id, RegisterViewModel owner) { var filter = Builders <ProjectModel> .Filter.Where(x => x.Id == id); ProjectModel project = _database.FindOne(filter); if (project.Members == null) { project.Members = new List <RegisterViewModel>(); } project.Members.Add(owner); }