Ejemplo n.º 1
0
        private void CreateDataclassPerEntity(ModelInfo database, TsmDossier dossier, Pallet pallet)
        {
            TsmEntityMold tableMold = new TsmEntityMold();

            foreach (EntityInfo table in database.Entities)
            {
                tableMold.CreateDataclass(database, table, dossier, pallet);
            }
        }
Ejemplo n.º 2
0
        private void CreateModels(ModelInfo database, TsmDossier dossier, Pallet pallet)
        {
            CodeWriter cw = new CodeWriter();

            cw.WriteLine($@"import {{ JsonObject, JsonProperty }} from ""json2typescript"";");
            cw.WriteLine($@"import * as enumerations from  ""./Enumerations"";");

            TsmEntityMold tableMold = new TsmEntityMold();

            foreach (EntityInfo table in database.Entities.OrderByDescending(e => e.Order).ThenBy(e => e.Name))
            {
                tableMold.CreateDataclass(cw, database, table, dossier, pallet);
            }

            pallet.AddProduct("TsmModel", "Models", $@"Models.ts", cw);
        }