Exemple #1
0
        public async Task <UpdateResult> Update(EndpointEntity endpointsService)
        {
            var update = new UpdateDefinitionBuilder <EndpointEntity>()
                         .Set(x => x.Description, endpointsService.Description)
                         .Set(x => x.Name, endpointsService.Name)
                         .Set(x => x.UpdatedBy, endpointsService.UpdatedBy)
                         .Set(x => x.LastUpdated, DateTime.Now)
                         .Set(x => x.EndpointMethods, endpointsService.EndpointMethods);

            return(await _endpointsServicesCollection.UpdateOneAsync(x => x.Id == endpointsService.Id, update));
        }
Exemple #2
0
 public async Task Put([FromBody] EndpointEntity entity)
 {
     await _endpointsRepo.Update(entity);
 }
Exemple #3
0
 public async Task Post([FromBody] EndpointEntity entity)
 {
     await _endpointsRepo.Create(entity);
 }
Exemple #4
0
 public async Task Create(EndpointEntity endpointsService)
 {
     endpointsService.Created = DateTime.Now;
     endpointsService.Deleted = false;
     await _endpointsServicesCollection.InsertOneAsync(endpointsService);
 }