Пример #1
0
        private void ExecuteTemplateEntityRepository(TableInfo tableInfo, Context configContext, IEnumerable <Info> infos)
        {
            if (tableInfo.CodeCustomImplemented)
            {
                return;
            }

            if (!tableInfo.MakeDomain)
            {
                return;
            }


            var pathOutput = PathOutput.PathOutputInfraEntitysRepository(tableInfo, configContext);

            if (File.Exists(pathOutput))
            {
                return;
            }

            var pathTemplateClass = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this._defineTemplateFolder.Define(tableInfo), DefineTemplateName.EntityRepository(tableInfo));

            if (!File.Exists(pathTemplateClass))
            {
                return;
            }


            var textTemplateClass = Read.AllText(tableInfo, pathTemplateClass, this._defineTemplateFolder);
            var classBuilder      = base.GenericTagsTransformer(tableInfo, configContext, textTemplateClass);

            classBuilder = classBuilder.Replace("<#fieldGetByFilters#>", classBuilder);
            using (var stream = new HelperStream(pathOutput).GetInstance())
            {
                stream.Write(classBuilder);
            }
        }