Entity Developer generates code which does not compile

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
migle
Posts: 27
Joined: Tue 19 Jan 2010 13:52

Entity Developer generates code which does not compile

Post by migle » Tue 23 Mar 2010 14:09

Hi,

We have configured a given project to include all model classes in one namespace, and the DataContext class in another namespace.
This is an option in the "Project Properties" dialog box, "Model" tab, the two text boxes labeled "Context Namespace" and "Entity Namespace".

This has suited us better, so far, because we keep these in separate projects, because they have different dependencies (specifically, the model classes do not depend on dotConnect classes and the DataContext does).

However, when we recently added some methods (stored procedures) to the mapping which use model types as arguments or return values, we came across this issue: the methods declarations in the DataContext class use namespace unqualified names for their arguments and return type.

Because the entity types are in a different namespace, this code does not compile.

For instance, if stored procedure "getEntity" on the database receives an int as argument and returns type "Entity", the generated function will be:

Code: Select all

        [Function(Name=@"getEntity", IsComposable=true)]
        public System.Linq.IQueryable GetEntity([Parameter(Name="$1", DbType="int4")] System.Nullable i)
        {
            return this.CreateMethodCallQuery(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), i);
        }
Which won't compile because Entity is not declared within the DataContext namespace.

Right?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 25 Mar 2010 15:04

Thank you for the report, I have reproduced the problem.
I will let you know as soon as it is fixed.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 29 Mar 2010 07:58

We have fixed the error. Look forward to the nearest build.

Post Reply