public ResponseWrapper <EditEndPointModel> EditEndPoint(int endpointId, EditEndPointInputModel model) { var entity = context .EndPoints .Single(x => x.EndPointId == endpointId ); entity.Name = model.Name; entity.Route = model.Route; entity.CustomEndPoint = model.CustomEndPoint; entity.EndPointType = model.EndPointType; entity.RootEntityEntityId = model.RootEntityEntityId; entity.ServiceId = model.ServiceId; entity.EndPointModelId = model.EndPointModelId; entity.RootEndPointToRootEntityDataSourceId = model.RootEndPointToRootEntityDataSourceId; context.SaveChanges(); var response = new EditEndPointModel { EndPointId = entity.EndPointId, Name = entity.Name, Route = entity.Route, CustomEndPoint = entity.CustomEndPoint, EndPointType = entity.EndPointType, RootEntityEntityId = entity.RootEntityEntityId, ServiceId = entity.ServiceId, EndPointModelId = entity.EndPointModelId, RootEndPointToRootEntityDataSourceId = entity.RootEndPointToRootEntityDataSourceId, }; return(new ResponseWrapper <EditEndPointModel>(_validationDictionary, response)); }
public dynamic EditEndPoint(int endpointId, [FromBody] EditEndPointInputModel model) { var orchestrator = new EndPointOrchestrator(new ModelStateWrapper(this.ModelState)); return(orchestrator.EditEndPoint(endpointId, model).GetResponse()); }