public ResponseWrapper <CreateEndPointModel> CreateEndPoint(CreateEndPointInputModel model) { var newEntity = new EndPoint { Name = model.Name, Route = model.Route, CustomEndPoint = model.CustomEndPoint, EndPointType = model.EndPointType, RootEntityEntityId = model.RootEntityEntityId, ServiceId = model.ServiceId, EndPointModelId = model.EndPointModelId, RootEndPointToRootEntityDataSourceId = model.RootEndPointToRootEntityDataSourceId, }; context .EndPoints .Add(newEntity); context.SaveChanges(); var response = new CreateEndPointModel { EndPointId = newEntity.EndPointId, Name = newEntity.Name, Route = newEntity.Route, CustomEndPoint = newEntity.CustomEndPoint, EndPointType = newEntity.EndPointType, RootEntityEntityId = newEntity.RootEntityEntityId, ServiceId = newEntity.ServiceId, EndPointModelId = newEntity.EndPointModelId, RootEndPointToRootEntityDataSourceId = newEntity.RootEndPointToRootEntityDataSourceId, }; return(new ResponseWrapper <CreateEndPointModel>(_validationDictionary, response)); }
public dynamic CreateEndPoint([FromBody] CreateEndPointInputModel model) { var orchestrator = new EndPointOrchestrator(new ModelStateWrapper(this.ModelState)); return(orchestrator.CreateEndPoint(model).GetResponse()); }