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?