Пример #1
0
        public string RelationalJsonSelectQuery(string fk, string pk, string conditionConstValue)
        {
            var readSelectTemplate = System.IO.File.ReadAllText("sqlTemplates\\relationJsonTemplate.txt");
            var result             =
                readSelectTemplate.
                Replace("#RELATIONCONST#", (conditionConstValue + "_" + SqlConstString)).
                Replace("#TABLE#", TABLE_NAME).
                Replace("#RELATIONCONSTANDKEY#", conditionConstValue).
                Replace("#SCHEMA#", TABLE_SCHEMA).
                Replace("#FK#", fk).
                Replace("#PK#", pk).
                Replace("#SELECTNAMES#", TableSqlCodeInfoes.SelectNameSingleInfo(Properties, (conditionConstValue + "_" + SqlConstString)));

            return(result);
        }
Пример #2
0
        public string ManyRelationalCountSelectQuery(string conditionConstValue, string fkCol, string pkCol, IEnumerable <EntityCode> EntityCodeList, IEnumerable <SqlRelationNames> AllKeys)
        {
            var readSelectTemplate = System.IO.File.ReadAllText("sqlTemplates\\selectCountManyRelation.txt");
            var result             =
                readSelectTemplate.
                Replace("#RELATIONCONST#", (conditionConstValue + "_" + SqlConstString)).
                Replace("#MANYCONST#", (conditionConstValue + "_" + SqlConstString)).
                Replace("#RELATIONSJSON#", "").
                Replace("#TABLE#", TABLE_NAME).
                Replace("#NAME#", TABLE_NAME).
                Replace("#RELATIONCONSTANDKEY#", conditionConstValue).
                Replace("#SCHEMA#", TABLE_SCHEMA).
                Replace("#SELECTNAMES#", TableSqlCodeInfoes.SelectNameSingleInfo(Properties, (conditionConstValue + "_" + SqlConstString))).
                Replace("#PKEYCOLUMN#", pkCol).
                Replace("#FKEYCOLUMN#", fkCol).
                Replace("#SELECTCONST#", conditionConstValue);

            return(result);
        }