コード例 #1
0
        public dynamic EditEndPointModelProperty(int endpointmodelpropertyId, [FromBody] EditEndPointModelPropertyInputModel model)
        {
            var orchestrator = new EndPointModelPropertyOrchestrator(new ModelStateWrapper(this.ModelState));

            return(orchestrator.EditEndPointModelProperty(endpointmodelpropertyId, model).GetResponse());
        }
コード例 #2
0
        public ResponseWrapper <EditEndPointModelPropertyModel> EditEndPointModelProperty(int endpointmodelpropertyId, EditEndPointModelPropertyInputModel model)
        {
            var entity = context
                         .EndPointModelProperties
                         .Single(x =>
                                 x.EndPointModelPropertyId == endpointmodelpropertyId
                                 );

            entity.EndPointModelId    = model.EndPointModelId;
            entity.EndPointPropertyId = model.EndPointPropertyId;
            context.SaveChanges();
            var response = new EditEndPointModelPropertyModel
            {
                EndPointModelPropertyId = entity.EndPointModelPropertyId,
                EndPointModelId         = entity.EndPointModelId,
                EndPointPropertyId      = entity.EndPointPropertyId,
            };

            return(new ResponseWrapper <EditEndPointModelPropertyModel>(_validationDictionary, response));
        }