Ejemplo n.º 1
0
        public ResponseWrapper <CreateGetDetailsEndPointModel> CreateGetDetailsEndPoint(CreateGetDetailsEndPointInputModel model)
        {
            var newEntity = new GetDetailsEndPoint
            {
                EndPointId = model.EndPointId,
                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
            .GetDetailsEndPoints
            .Add(newEntity);

            context.SaveChanges();
            var response = new CreateGetDetailsEndPointModel
            {
                GetDetailsEndPointId = newEntity.GetDetailsEndPointId,
                EndPointId           = newEntity.EndPointId,
            };

            return(new ResponseWrapper <CreateGetDetailsEndPointModel>(_validationDictionary, response));
        }
        public dynamic CreateGetDetailsEndPoint([FromBody] CreateGetDetailsEndPointInputModel model)
        {
            var orchestrator = new GetDetailsEndPointOrchestrator(new ModelStateWrapper(this.ModelState));

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