New Posts New Posts RSS Feed: Hello, Devforce
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Hello, Devforce

 Post Reply Post Reply
Author
Speccomp View Drop Down
Newbie
Newbie


Joined: 21-Oct-2008
Posts: 2
Post Options Post Options   Quote Speccomp Quote  Post ReplyReply Direct Link To This Post Topic: Hello, Devforce
    Posted: 21-Oct-2008 at 9:41am
I'm trying to walk through the sample solution and running in to a problem with the console01 project.
 
When I try and build the project I get an error on this line.
 

var query = _manager.Employees ;
"Then name _manager does not exist in the current context."
 
I'm new to Visual Studio and just not sure where this is trying to pull from.  Everything looks OK up to this point.  I've only attached the NorthwindsIB data model.  I did see in the documentation about renaming one of the Adventureworks relationships to "Manager" but I didn't think that had anything to do with this error.
 
I'm eager to keep working through the samples to try to understand the framework's capabilities.
 
Thanks,
-Sid M.
Back to Top
Speccomp View Drop Down
Newbie
Newbie


Joined: 21-Oct-2008
Posts: 2
Post Options Post Options   Quote Speccomp Quote  Post ReplyReply Direct Link To This Post Posted: 21-Oct-2008 at 1:05pm
OK, I found the issue.
 
Don't know if this is an error in the documentation or something that has changed with the new VS2008 SP1.
 

#region Private Fields

static DomainModelEntityManager _manager = new DomainModelEntityManager();

#endregion

 
The default from page 52
 

3. Select the Untitled.ibedmx node in the tree control. Observe the "Domain Model Settings".

When the Object Mapper saves the domain model and generates code, it will use the Namespace ("DomainModel") shown for the generated code, and will also name the EntityManager container ("DomainModelManager") as shown. You‟ll use the EntityManager for retrieving data into your local cache, for saving changes, and for many other data persistence operations.

-It was in fact "DomainModelEntityManager" for the EntityManager container.
 
...Onwards....
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 21-Oct-2008 at 3:32pm

Thanks for the heads up, Sid.

The name mismatch resulted from a change in the default name we give to the specialized EntityManager generated by the Object Mapper. We used to call it "DomainModelManager" and now, as you see, we call it "DomainModelEntityManager".

I've updated the "Hello, DevForce" section of the Developers Guide, although, alas, too late for today's release.

FYI, I also changed the declarations like

     DomainModelEntityManager _manager = new DomainModelEntityManager();

to

     DomainModelEntityManager = DomainModelEntityManager.DefaultManager;

Both work, but the latter always gives you the same instance of the DomainModelEntityManager, whereas the former always gives you a brand new instance. Most of the time you'll want to use the same instance in your different forms, etc., so that all will share the same cache.

Best regards,

Greg Dunn

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down