コード例 #1
0
        public override void Scaffold(XmlEntity entityContext, ITobascoContext tobascoContext, string appRoot)
        {
            AddUsingNamespaces(entityContext, tobascoContext);

            Builder.StartNamesspace(tobascoContext.EntityContext.EntityLocation.GetNamespace());

            AddClass(entityContext, tobascoContext);

            Builder.EndNamespace();

            CreateOrOverwriteFile(
                $"{appRoot}//" +
                $"{FileLocationHelper.GetFileLocation(entityContext.EntityLocation, tobascoContext.EntityContext.EntityLocation)}//" +
                $"{entityContext.Name}.cs");
        }
コード例 #2
0
 public override void Scaffold(XmlEntity xmlEntity, ITobascoContext tobascoContext, string appRoot)
 {
     AddInsert(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddUpdate(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddDelete(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddGetById(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddGetByParentId(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     CreateOrOverwriteFile(
         $"{appRoot}//" +
         $"{FileLocationHelper.GetFileLocation(xmlEntity.DatabaseContext.StoredProcedureLocation, tobascoContext.DatabaseContext.StoredProcedureLocation)}//" +
         $"{xmlEntity.Name}.sql");
 }
コード例 #3
0
ファイル: ScaffolderTableBase.cs プロジェクト: bordev/Tobasco
 public override void Scaffold(XmlEntity xmlEntity, ITobascoContext tobascoContext, string appRoot)
 {
     AddTable(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddIndexes(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddConstraints(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddHistoryTable(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddTriggers(xmlEntity, tobascoContext);
     Builder.AppendLine("GO");
     AddDescriptions(xmlEntity, tobascoContext);
     CreateOrOverwriteFile(
         $"{appRoot}//" +
         $"{FileLocationHelper.GetFileLocation(xmlEntity.DatabaseContext.TableLocation, tobascoContext.DatabaseContext.TableLocation)}//" +
         $"{xmlEntity.Name}.sql");
 }