New Posts New Posts RSS Feed: Validate in EntitymanagerDelegate
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Validate in EntitymanagerDelegate

 Post Reply Post Reply
Author
jkattestaart View Drop Down
Newbie
Newbie


Joined: 30-Jul-2010
Location: Netherlands
Posts: 37
Post Options Post Options   Quote jkattestaart Quote  Post ReplyReply Direct Link To This Post Topic: Validate in EntitymanagerDelegate
    Posted: 25-Jan-2013 at 7:35am
Hello,
 
I started a new cocktail development on an existing SQL Server database.
Everything looks ok, but i wondered what to do with the Validate in EntityManagerDelegate.
In the Code First this calls the Virtual Validate in the EntityBase, but for my solutions my entities are generated from the EntityModel. What is the best way to do this. Add an interface in my partial class for the entities: IEntityBase?
I suppose you do want to add some extra validation there.
 
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 25-Jan-2013 at 9:28am
You can still add a base class as documented here and do it similar to how it's done with code first.

http://drc.ideablade.com/devforce-2012/bin/view/Documentation/model-custom-base-class
Back to Top
jkattestaart View Drop Down
Newbie
Newbie


Joined: 30-Jul-2010
Location: Netherlands
Posts: 37
Post Options Post Options   Quote jkattestaart Quote  Post ReplyReply Direct Link To This Post Posted: 25-Jan-2013 at 12:08pm
Thanks Marcel for your quick reply.
Back to Top
jkattestaart View Drop Down
Newbie
Newbie


Joined: 30-Jul-2010
Location: Netherlands
Posts: 37
Post Options Post Options   Quote jkattestaart Quote  Post ReplyReply Direct Link To This Post Posted: 25-Jan-2013 at 1:03pm
When i introduce the Entitybase injection it generates OK, but when i build the following errors is reported.
 
Error 27 An error occurred during metadata generation and a metadata file could not be created.  Error: Unable to find the requested .Net Framework Data Provider.  It may not be installed. C:\Users\JKT\Documents\Visual Studio 2010\Projects\AccoBooking\packages\IdeaBlade.DevForce-2010.Aop.6.1.9
\tools\IdeaBlade.DevForce.Common.targets 110 5 DomainModel
When I remove the injected EntityBase the error disappears. I don't understand this.
 
 
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jan-2013 at 2:41am
You appear to have the DevForce 2010 Code-First NuGet package installed to your project. Since your model is not code-first you should uninstall the Code-First package.
Back to Top
jkattestaart View Drop Down
Newbie
Newbie


Joined: 30-Jul-2010
Location: Netherlands
Posts: 37
Post Options Post Options   Quote jkattestaart Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jan-2013 at 2:48am
Yes forgot about that DevForce CF link. Thanks Marcel!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down