google-code-export / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
Other
0 stars 0 forks source link

Using sqlmetal on Mono generate invalid Using #202

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Sqlite database.
2. Execute the following sqlmetal 

sqlmetal /provider:Sqlite /conn:Uri=file:/home/luciano/Test.sqlite / 
code:Output.cs /case:NET / 
language:C#2 /namespace:TestLinq.DbLinq /culture:en 

What is the expected output? What do you see instead?
The result Output.cs file have 2 Using statement with DbLinq.. which 
should be System.Data.Linq.

What version of the product are you using? On what operating system?
Mono 2.6.1

if i erase */namespace:TestLinq.DbLinq* the output file is correct without 
the invalid using.

Original issue reported on code.google.com by lucia...@gmail.com on 16 Feb 2010 at 2:40

GoogleCodeExporter commented 9 years ago
When I try it with trunk, I'm always getting the DbLinq namespaces. :-/

Original comment by jonmpr...@gmail.com on 10 Mar 2010 at 9:20

GoogleCodeExporter commented 9 years ago
The problem is the /language:C#2, not /namespace:TestLinq.DbLinq.

Remove /language, and no DbLinq namespaces are generated.

Original comment by jonmpr...@gmail.com on 23 Mar 2010 at 9:19

GoogleCodeExporter commented 9 years ago
And the problem is...

We have *two* different C# generators:

    DbMetal.Generator.Implementation.CodeTextGenerator.CSCodeGenerator
    DbMetal.Generator.Implementation.CodeDomGenerator.CSharpCodeDomGenerator

The first one is used when you use a .cs extension, while the second one is 
used when 
we use /language:C#2.

Original comment by jonmpr...@gmail.com on 24 Mar 2010 at 9:11

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1348.

Original comment by jonmpr...@gmail.com on 25 Mar 2010 at 5:26

GoogleCodeExporter commented 9 years ago
Note that wrt the original bug, if you use DbMetal instead of sqlmetal the code 
will 
not compile due to /namespace:TestLinq.DbLinq option; it results in the error:

error CS0234: The type or namespace name `Data' does not exist in the namespace 
`TestLinq.DbLinq'. Are you missing an assembly reference?

This is because we generate a `using DbLinq.Data.Linq;` from within a `DbLinq` 
sub-
namespace; consequently, the compiler will be looking for a 
TestLinq.DbLinq.Data.Linq 
namespace, which doesn't exist (hence the error).  In this case, the only 
solution is 
to change your namespace name.

Original comment by jonmpr...@gmail.com on 25 Mar 2010 at 5:30

GoogleCodeExporter commented 9 years ago
Closing.

Original comment by jonmpr...@gmail.com on 9 Apr 2010 at 7:55