Reference problem in LinqMetaData.cs

Posts   
 
    
FatAlbert
User
Posts: 11
Joined: 10-Aug-2006
# Posted on: 22-Nov-2010 10:21:43   

When I generate the data access code I get the following class in LinqMetaData.cs:

public IDataSource GetQueryableForEntity(int typeOfEntity)
        {
            IDataSource toReturn = null;
            switch((Timeline.DataAccess.EntityType)typeOfEntity)
            {
                case Timeline.DataAccess.EntityType.AreaEntity:
                    toReturn = this.Area;
                    break;
                case Timeline.DataAccess.EntityType.ArtefactEntity:
                    toReturn = this.Artefact;
                    break;
                case Timeline.DataAccess.EntityType.EventEntity:
                    toReturn = this.Event;
                    break;
                case Timeline.DataAccess.EntityType.EventTypeEntity:
                    toReturn = this.EventType;
                    break;
                case Timeline.DataAccess.EntityType.RangeEntity:
                    toReturn = this.Range;
                    break;
                case Timeline.DataAccess.EntityType.RoleEntity:
                    toReturn = this.Role;
                    break;
                case Timeline.DataAccess.EntityType.TimelineEntity:
                    toReturn = this.Timeline;
                    break;
                default:
                    toReturn = null;
                    break;
            }
            return toReturn;
        }

In the switch statement the compiler doesn't have any problem with the reference Timeline.DataAccess.EntityType, but inside the switch (in every case statement) the compiler doesn't like Timeline.DataAccess.EntityType. I have to remove Timeline.DataAccess. on each line to be able to compile.

Why is this and what can I do about it?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Nov-2010 16:11:02   

Please provide more info:

Which version of LLBLGen Pro are you using? Which .NET Framework version do you target? Which template set are you using?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 22-Nov-2010 17:04:26   

Is there a type in your project called EntityType? It should be the enum generated in the ConstantsEnums file

Frans Bouma | Lead developer LLBLGen Pro
FatAlbert
User
Posts: 11
Joined: 10-Aug-2006
# Posted on: 22-Nov-2010 17:27:44   

Walaa wrote:

Which version of LLBLGen Pro are you using?

2.6 Final

Walaa wrote:

Which .NET Framework version do you target?

3.5

Walaa wrote:

Which template set are you using?

SelfServicing

FatAlbert
User
Posts: 11
Joined: 10-Aug-2006
# Posted on: 22-Nov-2010 17:32:50   

Otis wrote:

Is there a type in your project called EntityType? It should be the enum generated in the ConstantsEnums file

Thanks for your reply.

From your answer I understood what is wrong. I've got an entity called Timeline and the root of the namespace is Timeline, so the compiler gets confused I guess.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 23-Nov-2010 09:17:17   

Glad you have found it.