Exemplo n.º 1
0
        private void ExecuteTemplateIEntityRepository(TableInfo tableInfo, Context configContext, IEnumerable <Info> infos)
        {
            if (tableInfo.CodeCustomImplemented)
            {
                return;
            }

            if (!tableInfo.MakeDomain)
            {
                return;
            }

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

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

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

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


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

            using (var stream = new HelperStream(pathOutput).GetInstance())
            {
                stream.Write(classBuilder);
            }
        }