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)); }
public async Task Put([FromBody] EndpointEntity entity) { await _endpointsRepo.Update(entity); }
public async Task Post([FromBody] EndpointEntity entity) { await _endpointsRepo.Create(entity); }
public async Task Create(EndpointEntity endpointsService) { endpointsService.Created = DateTime.Now; endpointsService.Deleted = false; await _endpointsServicesCollection.InsertOneAsync(endpointsService); }