public ResponseWrapper <CreateEndPointPropertyModel> CreateEndPointProperty(CreateEndPointPropertyInputModel model)
        {
            var newEntity = new EndPointProperty
            {
                Name = model.Name,
                EndPointPropertyType = model.EndPointPropertyType,
                EntityId             = model.EntityId,
                DataSourceId         = model.DataSourceId,
            };

            context
            .EndPointProperties
            .Add(newEntity);

            context.SaveChanges();
            var response = new CreateEndPointPropertyModel
            {
                EndPointPropertyId = newEntity.EndPointPropertyId,
                Name = newEntity.Name,
                EndPointPropertyType = newEntity.EndPointPropertyType,
                EntityId             = newEntity.EntityId,
                DataSourceId         = newEntity.DataSourceId,
            };

            return(new ResponseWrapper <CreateEndPointPropertyModel>(_validationDictionary, response));
        }
Esempio n. 2
0
        public dynamic CreateEndPointProperty([FromBody] CreateEndPointPropertyInputModel model)
        {
            var orchestrator = new EndPointPropertyOrchestrator(new ModelStateWrapper(this.ModelState));

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