Skip to content

Code Generation and T4 Text Templates #58

@kccarter76

Description

@kccarter76

Is your feature request related to a problem? Please describe.
As a developer, I want the ability to add SubSonicContext to my project via the add wizard and use a T4 template to generate classes and the database context for me.

Describe the solution you'd like

  1. On the solution explorer right click a folder location and go to the Add -> New Item
  2. Under Visual C# Items -> SubSonic
  3. Data Context, should appear as an option.
  4. when selected, wizard is started that allow the user to configure the following:
    • database connection, db name and the default schema.
    • schema name that contains user defined table types
    • default schema is "dbo"
  5. once confirmed, a T4 template is added to the project and using the connection:
    • Generates the table, procedure and view partial classes, if possible by convention mark a table with a corresponding defined table type.
    • If the generated class can not be marked with a defined table type, a non generated partial class can be used instead.
    • Generate SubSonic Data Context partial class
      • Context will contain ISubSonicSetCollections{TEntity} for each table and view.
      • At this time do not override OnDbConfiguring and OnDbModeling, will be implemented in a non generated partial class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions