Esempio n. 1
0
        /// <summary>
        /// Update User
        /// </summary>
        /// <param name="users"></param>
        /// <returns></returns>
        public async Task <bool> UpdateUser(Users users)
        {
            var filter = Builders <Users> .Filter.Where(x => x.Id == users.Id);

            var update = Builders <Users> .Update.Set(x => x.UserNo, users.UserNo)
                         .Set(x => x.Mobile, users.Mobile)
                         .Set(x => x.Name, users.Name)
                         .Set(x => x.IsActive, users.IsActive)
                         .Set(x => x.Language, users.Language)
                         .Set(x => x.UpdatedDate, DateTime.UtcNow)
                         .Set(x => x.BlobUrl, users.BlobUrl)
                         .Set(x => x.AttachmentName, users.AttachmentName);

            await _userRepository.FindOneAndUpdateAsync(filter, update);

            return(true);
        }
Esempio n. 2
0
        public async Task <Todos> UpdateTodo(Todos todo)
        {
            var filter = Builders <Todos> .Filter.Where(x => x.Id == todo.Id);

            var update = Builders <Todos> .Update.Set(x => x.Name, todo.Name)
                         .Set(x => x.Description, todo.Description)
                         .Set(x => x.UpdatedDate, DateTime.UtcNow);

            return(await _todoRepository.FindOneAndUpdateAsync(filter, update));
        }