Exemple #1
0
 public async Task Create(MicroServiceEntity microService)
 {
     microService.Id      = ObjectId.GenerateNewId();
     microService.Created = DateTime.Now;
     microService.Deleted = false;
     await _microServicesCollection.InsertOneAsync(microService);
 }
Exemple #2
0
        public async Task <UpdateResult> Update(MicroServiceEntity microService)
        {
            var update = new UpdateDefinitionBuilder <MicroServiceEntity>()
                         .Set(x => x.Description, microService.Description)
                         .Set(x => x.Name, microService.Name)
                         .Set(x => x.UpdatedBy, microService.UpdatedBy)
                         .Set(x => x.LastUpdated, DateTime.Now);

            return(await _microServicesCollection.UpdateOneAsync(x => x.Id == microService.Id, update));
        }
Exemple #3
0
 public async Task Put([FromBody] MicroServiceEntity entity)
 {
     await _microServicesRepo.Update(entity);
 }