예제 #1
0
        public async Task <UpdateResult> Update(CommandEntity command)
        {
            var update = new UpdateDefinitionBuilder <CommandEntity>()
                         .Set(x => x.Description, command.Description)
                         .Set(x => x.Name, command.Name)
                         .Set(x => x.UpdatedBy, command.UpdatedBy)
                         .Set(x => x.LastUpdated, DateTime.Now);

            return(await _commandsCollection.UpdateOneAsync(x => x.Id == command.Id, update));
        }
예제 #2
0
 public async Task Create(CommandEntity command)
 {
     command.Created = DateTime.Now;
     command.Deleted = false;
     await _commandsCollection.InsertOneAsync(command);
 }
예제 #3
0
 public async Task Put([FromBody] CommandEntity entity)
 {
     await _commandsRepo.Update(entity);
 }
예제 #4
0
 public async Task Post([FromBody] CommandEntity entity)
 {
     await _commandsRepo.Create(entity);
 }