Example #1
0
        public async Task <User> Modify(Guid id, ModifiedUser modifiedUser)
        {
            FilterDefinition <User> filter = Builders <User> .Filter.Eq("_id", id);

            User user = await _collection.Find(filter).FirstAsync();

            user.Description = modifiedUser.Description;
            await _collection.ReplaceOneAsync(filter, user);

            return(user);
        }
 public Task <User> Modify(Guid id, [FromBody] ModifiedUser user, string adminkey)
 {
     if (_processor.CheckIfAdmin(adminkey).Result)
     {
         return(_processor.Modify(id, user));
     }
     else
     {
         throw new NotAdminException("You are not admin!");
     }
 }
Example #3
0
 public Task <User> Modify(Guid id, ModifiedUser user)
 {
     return(_repository.Modify(id, user));
 }