Enitity Modal Namespace

T

ThatsIT.net.au

I am trying to use entity model in a asp.net site.
I have some classes representing entities in the database, these classes
come under the namespace GGSOBJECTS
while my Entity Namespace is GGSEM
When declaring a ObjectQuery like this

dim x as ObjectQuery(of Category)

I keep getting errors saying that you can not convert GGSOBJECTS.Category to
OBJECTQUERY

I have tried to access the entity classes like
dim x as ObjectQuery(of GGSEM.Category)

but this also errors saying GGSEM.Category is undefined

why can I not declare a ObjectQuery as GGSEM.Category using the name space?

How do I stop the confusion of classes without renaming them all?
 
M

Mr. Arnold

ThatsIT.net.au said:
I am trying to use entity model in a asp.net site.
I have some classes representing entities in the database, these classes
come under the namespace GGSOBJECTS
while my Entity Namespace is GGSEM
When declaring a ObjectQuery like this

dim x as ObjectQuery(of Category)

I keep getting errors saying that you can not convert GGSOBJECTS.Category
to OBJECTQUERY

Those objects you're talking about must inherit from ObjectQuery are they
I have tried to access the entity classes like
dim x as ObjectQuery(of GGSEM.Category)

but this also errors saying GGSEM.Category is undefined

You got an import statement pointing to it?
why can I not declare a ObjectQuery as GGSEM.Category using the name
space?

How do I stop the confusion of classes without renaming them all?

You get them in the right namespace and use an import on the namespace in
the classes that are going to use them.
 
T

ThatsIT.net.au

Mr. Arnold said:
Those objects you're talking about must inherit from ObjectQuery are they


You got an import statement pointing to it?

You get them in the right namespace and use an import on the namespace in
the classes that are going to use them.

if I am working on a page I have no problems but when working in my classes
that have the namespace GGSOBJECTS it gets confused.
For example I have a class classed Course in both my Entity Modal and in
GGSOBJECTS
from a page there is no problem because when I want a GGSOBJECT I use its
namespace, when I use the entity class I use no namespace.
But When I'm working in one of the classes in GGSOBJECTS using no namespace
gives me the GGSOBJECTS class, so I would expect to now be able to address
the entity classes thought the namespace GGSEM but that does not seem to
work.
I really don't want to have to rename them all.

PS I may have mislead you above where I used the syntax "dim x as
ObjectQuery(of GGSEM.Category)"

its the object syntax like this that is the problem
Dim eCourse As Course = em.Course.Where(blah blah
 
T

ThatsIT.net.au

ThatsIT.net.au said:
if I am working on a page I have no problems but when working in my
classes that have the namespace GGSOBJECTS it gets confused.
For example I have a class classed Course in both my Entity Modal and in
GGSOBJECTS
from a page there is no problem because when I want a GGSOBJECT I use its
namespace, when I use the entity class I use no namespace.
But When I'm working in one of the classes in GGSOBJECTS using no
namespace gives me the GGSOBJECTS class, so I would expect to now be able
to address the entity classes thought the namespace GGSEM but that does
not seem to work.
I really don't want to have to rename them all.

PS I may have mislead you above where I used the syntax "dim x as
ObjectQuery(of GGSEM.Category)"

its the object syntax like this that is the problem
Dim eCourse As Course = em.Course.Where(blah blah

sorry I'll correct myself again, it is both syntax has problem
 
M

Mr. Arnold

ThatsIT.net.au said:
if I am working on a page I have no problems but when working in my
classes that have the namespace GGSOBJECTS it gets confused.
For example I have a class classed Course in both my Entity Modal and in
GGSOBJECTS
from a page there is no problem because when I want a GGSOBJECT I use
its namespace, when I use the entity class I use no namespace.
But When I'm working in one of the classes in GGSOBJECTS using no
namespace gives me the GGSOBJECTS class, so I would expect to now be
able to address the entity classes thought the namespace GGSEM but that
does not seem to work.
I really don't want to have to rename them all.

PS I may have mislead you above where I used the syntax "dim x as
ObjectQuery(of GGSEM.Category)"

its the object syntax like this that is the problem
Dim eCourse As Course = em.Course.Where(blah blah

The simplest way to resolve your namespace issues with like name classes
is to create/move the EFM in/to its on Solution folder. You can call
the folder Model.

If want to address a class in the Model, then you prefix it
Model.ClassName.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,825
Members
47,371
Latest member
Brkaa

Latest Threads

Top