Esempio n. 1
0
        public ResponseWrapper <CreatePostEndPointModel> CreatePostEndPoint(CreatePostEndPointInputModel model)
        {
            var newEntity = new PostEndPoint
            {
                EndPointId = model.EndPointId,
                InputModelEndPointModelId = model.InputModelEndPointModelId,
                EndPoint =
                    new EndPoint
                {
                    Name               = model.EndPoint.Name,
                    Route              = model.EndPoint.Route,
                    CustomEndPoint     = model.EndPoint.CustomEndPoint,
                    EndPointType       = model.EndPoint.EndPointType,
                    RootEntityEntityId = model.EndPoint.RootEntityEntityId,
                    ServiceId          = model.EndPoint.ServiceId,
                    EndPointModelId    = model.EndPoint.EndPointModelId,
                    RootEndPointToRootEntityDataSourceId = model.EndPoint.RootEndPointToRootEntityDataSourceId,
                },
            };

            context
            .PostEndPoints
            .Add(newEntity);

            context.SaveChanges();
            var response = new CreatePostEndPointModel
            {
                PostEndPointId            = newEntity.PostEndPointId,
                EndPointId                = newEntity.EndPointId,
                InputModelEndPointModelId = newEntity.InputModelEndPointModelId,
            };

            return(new ResponseWrapper <CreatePostEndPointModel>(_validationDictionary, response));
        }
Esempio n. 2
0
        public dynamic CreatePostEndPoint([FromBody] CreatePostEndPointInputModel model)
        {
            var orchestrator = new PostEndPointOrchestrator(new ModelStateWrapper(this.ModelState));

            return(orchestrator.CreatePostEndPoint(model).GetResponse());
        }