New Posts New Posts RSS Feed: Code Second
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Code Second

 Post Reply Post Reply
Author
Vonzkie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01-Aug-2011
Location: PH
Posts: 133
Post Options Post Options   Quote Vonzkie Quote  Post ReplyReply Direct Link To This Post Topic: Code Second
    Posted: 16-Aug-2012 at 5:34pm
Hi,

I'm playing around with the Code Second approach w/c is basically a Code First. :)
Now, I want to ask some questions:

1. How can I create a concrete base class that implements IEntity because we need to occasionally check EntityAspect class.
I checked the tutorial here http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-code-first-walk but the base class here throws a not implemented exception on the getter of the EntityAspect. Can I have real world example here? We need a base class that behaves like the Devforce Entity base class.

2. Is IDataSourceKeyResolver still applicable in Code First to dynamically compose connections string?
3. It seems that we have lots of breaking changes in our codes cause we're using the Devforce Entity class as the generic parameter for few repository classes. Do you have some advise on how we can easily migrate from Database First to Code First without having to completely rewrite our codes? 
4. What are the other things that we might encounter in migrating or upgrading to Code First from Database First as far as coding is concern?

Thanks,
Von
Back to Top
Vonzkie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01-Aug-2011
Location: PH
Posts: 133
Post Options Post Options   Quote Vonzkie Quote  Post ReplyReply Direct Link To This Post Posted: 17-Aug-2012 at 12:33am
For #2, I checked this article  http://drc.ideablade.com/xwiki/bin/view/Documentation/advanced-database-connections and I didn't find a way to dynamically compose connection string like IDataSourceKeyResolver does.

Btw, I choose to use EntityManager over DBContext.

Can you help me on this cause IDatasourceKeyResolver is not firing anymore when I convert my model to Code First.

Thanks,
Von
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 20-Aug-2012 at 1:22pm
Hi Von,
 
1. The tempHire Cocktail sample will give you an example of a base class. Have you taken a look at it?
 
2. You should be able to use IDataSourceKeyResolver without problems. Please provide a small solution reproducing your issue, so we can check what's wrong.
 
Silvio.
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down