Exemple #1
0
        public ResponseWrapper <EditSchemaModel> EditSchema(int schemaId, EditSchemaInputModel model)
        {
            var entity = context
                         .Schemas
                         .Single(x =>
                                 x.SchemaId == schemaId
                                 );

            entity.Name          = model.Name;
            entity.ApplicationId = model.ApplicationId;
            context.SaveChanges();
            var response = new EditSchemaModel
            {
                Name          = entity.Name,
                SchemaId      = entity.SchemaId,
                ApplicationId = entity.ApplicationId,
            };

            return(new ResponseWrapper <EditSchemaModel>(_validationDictionary, response));
        }
Exemple #2
0
        public dynamic EditSchema(int schemaId, [FromBody] EditSchemaInputModel model)
        {
            var orchestrator = new SchemaOrchestrator(new ModelStateWrapper(this.ModelState));

            return(orchestrator.EditSchema(schemaId, model).GetResponse());
        }