示例#1
0
        public ResponseWrapper <CreateSchemaModel> CreateSchema(CreateSchemaInputModel model)
        {
            var newEntity = new Schema
            {
                Name          = model.Name,
                ApplicationId = model.ApplicationId,
            };

            context
            .Schemas
            .Add(newEntity);

            context.SaveChanges();
            var response = new CreateSchemaModel
            {
                Name          = newEntity.Name,
                SchemaId      = newEntity.SchemaId,
                ApplicationId = newEntity.ApplicationId,
            };

            return(new ResponseWrapper <CreateSchemaModel>(_validationDictionary, response));
        }
示例#2
0
        public dynamic CreateSchema([FromBody] CreateSchemaInputModel model)
        {
            var orchestrator = new SchemaOrchestrator(new ModelStateWrapper(this.ModelState));

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