コード例 #1
0
        public void GenerateRepositorySource(string writeSourceTo, string schemaName = null)
        {
            schemaName = schemaName ?? SchemaName;
            SchemaName = schemaName;
            base.GenerateSource(writeSourceTo);
            SchemaRepositoryModel schemaModel = new SchemaRepositoryModel
            {
                BaseRepositoryType        = BaseRepositoryType,
                BaseNamespace             = SourceNamespace,
                SchemaRepositoryNamespace = SchemaRepositoryNamespace,
                SchemaName = schemaName,
                Types      = Types.Select(t => SchemaTypeModel.FromType(t, DaoNamespace)).ToArray()
            };
            string code = schemaModel.Render();

            code.SafeWriteToFile(Path.Combine(writeSourceTo, $"{schemaName}Repository.cs"));
        }
コード例 #2
0
 public void WriteMethods(SchemaTypeModel type)
 {
     Write(Render <SchemaTypeModel>("SchemaRepositoryMethods.tmpl", new { Model = type }));
 }