New Posts New Posts RSS Feed: Custom ConnectionOptions?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Custom ConnectionOptions?

 Post Reply Post Reply Page  <12
Author
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Topic: Custom ConnectionOptions?
    Posted: 22-Mar-2012 at 6:39am

Perhaps I'm getting a bit confused; is the name I am specifying the name of the class, or the name contained within the returned ConnectionOptions?

If it's the name of the class, I've tried that and put a breakpoint in GetConnectionOptions, but it never seemed to be hit, at what point would it call 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: 22-Mar-2012 at 6:26am
You use it by specifiying the name of the ConnectionOptions you want your EntityManagerProvider to use through the "With" method. Note that the With method clones the EMP and configures the clone with the new ConnectionOptions. If you use a single shared EntityManagerProvider, I assume you are currently instantiating it in the PrepareCompositionContainer method in your bootstrapper and add it to the CompositionBatch. In that case, you would do the following:
 
        protected override void PrepareCompositionContainer(CompositionBatch batch)
        {
            base.PrepareCompositionContainer(batch);
 
            batch.AddExportedValue<IEntityManagerProvider<yourentitymanagertype>>(
                new EntityManagerProvider<yourentitymanagertype>().With("yourconnectionoptionname"));
        }


Edited by mgood - 22-Mar-2012 at 6:28am
Back to Top
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Posted: 22-Mar-2012 at 6:12am
This may sound silly, but after creating a custom implementation of IConnectionOptionsResolver, how do I actually use it!? In particular, if I am using a single shared EntityManagerProvider throughout the application?
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down