Silly question, but why wouldn't we want to generate the specialized
DataContext subclass?
Thanks,
- Jon
On Mon, 2009-10-26 at 15:24 +0100, Emanuele Aina wrote:
> This patch that adds a /noDataContext option to the DbMetal program to
> avoid the generation of the specialized DataContext subclass.
>
> Here is the diff for comments, but I've also attached the gzipped patch:
> hopefully it will apply cleanly on r1244.
>
> ---
> .../CodeTextGenerator/CodeGenerator.cs | 4 +++-
> src/DbMetal/Parameters.cs | 7 +++++++
> 2 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git
> a/src/DbMetal/Generator/Implementation/CodeTextGenerator/CodeGenerator.cs
> b/src/DbMetal/Generator/Implementation/CodeTextGenerator/CodeGenerator.cs
> index 77a6fee..041d238 100644
> --- a/src/DbMetal/Generator/Implementation/CodeTextGenerator/CodeGenerator.cs
> +++ b/src/DbMetal/Generator/Implementation/CodeTextGenerator/CodeGenerator.cs
> @@ -95,7 +95,9 @@ namespace DbMetal.Generator.Implementation.CodeTextGenerator
> {
> using (WriteNamespace(codeWriter, contextNamespace))
> {
> - WriteDataContext(codeWriter, dbSchema, context);
> + if (!context.Parameters.NoDataContext) {
> + WriteDataContext(codeWriter, dbSchema, context);
> + }
> WriteClasses(codeWriter, dbSchema, context);
> }
> }
> diff --git a/src/DbMetal/Parameters.cs b/src/DbMetal/Parameters.cs
> index 0391667..e38badc 100644
> --- a/src/DbMetal/Parameters.cs
> +++ b/src/DbMetal/Parameters.cs
> @@ -215,6 +215,13 @@ namespace DbMetal
> public bool ReadLineAtExit { get; set; }
>
> /// <summary>
> + /// avoid generating the DataContext subclass with specialized table
> accessors
> + /// DbLinq specific
> + /// </summary>
> + [Option("Do not generate the specialized DataContext subclass.",
> Group = 4)]
> + public bool NoDataContext { get; set; }
> +
> + /// <summary>
> /// specifies a provider (which here is a pair or ISchemaLoader and
> IDbConnection implementors)
> /// SQLMetal compatible
> /// </summary>
> --
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---