예제 #1
0
        public dynamic EditEndPointCollectionProperty(int endpointcollectionpropertyId, [FromBody] EditEndPointCollectionPropertyInputModel model)
        {
            var orchestrator = new EndPointCollectionPropertyOrchestrator(new ModelStateWrapper(this.ModelState));

            return(orchestrator.EditEndPointCollectionProperty(endpointcollectionpropertyId, model).GetResponse());
        }
        public ResponseWrapper <EditEndPointCollectionPropertyModel> EditEndPointCollectionProperty(int endpointcollectionpropertyId, EditEndPointCollectionPropertyInputModel model)
        {
            var entity = context
                         .EndPointCollectionProperties
                         .Single(x =>
                                 x.EndPointCollectionPropertyId == endpointcollectionpropertyId
                                 );

            entity.PropertiesEndPointPropertyId = model.PropertiesEndPointPropertyId;
            entity.EndPointPropertyId           = model.EndPointPropertyId;
            context.SaveChanges();
            var response = new EditEndPointCollectionPropertyModel
            {
                EndPointCollectionPropertyId = entity.EndPointCollectionPropertyId,
                PropertiesEndPointPropertyId = entity.PropertiesEndPointPropertyId,
                EndPointPropertyId           = entity.EndPointPropertyId,
            };

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