Print Page | Close Window

Hello, Devforce

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=972
Printed Date: 13-Apr-2025 at 7:21am


Topic: Hello, Devforce
Posted By: Speccomp
Subject: Hello, Devforce
Date 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.



Replies:
Posted By: Speccomp
Date 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....


Posted By: GregD
Date 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

 




Print Page | Close Window