private static void CreateCode() { Def.CodeDefinitionCollection.Where(o => o.Source == "Def").ForEach(codeDefinition => { var code = Creators.Create(codeDefinition, new DataContainer("DefinitionFile")); if (code != string.Empty) { Merger.Merge(codeDefinition.OutputPath, code, codeDefinition.MergeToExisting); } }); }
private static void CreateNotRepeat(string target) { Def.CodeDefinitionCollection .Where(o => target.IsNullOrEmpty() || o.Id == target) .Where(o => o.Source == "Mvc") .Where(o => o.RepeatType.IsNullOrEmpty()) .ForEach(codeDefinition => Merger.Merge( Directories.Outputs(codeDefinition.OutputPath), Creators.Create(codeDefinition, new DataContainer("Table")), codeDefinition.MergeToExisting)); }
private static void CreateEachTable(string target) { Def.TableNameCollection().ForEach(tableName => Def.CodeDefinitionCollection .Where(o => target.IsNullOrEmpty() || o.Id == target) .Where(o => o.Source == "Mvc") .Where(o => o.RepeatType == "Table") .Where(o => !Table.CheckExclude(o, tableName)) .ForEach(codeDefinition => { var dataContainer = new DataContainer("Table"); var modelName = Def.ModelNameByTableName(tableName); dataContainer.TableName = tableName; dataContainer.ModelName = modelName; var code = ReplacePlaceholder( Creators.Create(codeDefinition, dataContainer), tableName, modelName); var fileName = ReplacePlaceholder( Directories.Outputs(codeDefinition.OutputPath), tableName, modelName); Merger.Merge(fileName, code, codeDefinition.MergeToExisting); })); }