Hi Denis,
I did it and it's not working either
Here is the class where I defined the Default CompositionContext. The main application has a reference on the silverlight Domain hosting this Resolver.
Note that I have others Resolver, located in others Domain assembly (they might or might not be downloaded by request). Each of them declare their own CompositionContext, only here the Default is overriden.
public class MyCompositionContextResolver : ICompositionContextResolver
{
public static CompositionContext MyDefault = CompositionContext.Default
#if !SILVERLIGHT
.WithGenerator(typeof(CommonEntityServerSaveInterceptor))
#endif
.WithName(CompositionContext.Default.Name);
public CompositionContext GetCompositionContext(string compositionContextName)
{
return null;
}
}
Here is the definition of my Interceptor
public class CommonEntityServerSaveInterceptor: EntityServerSaveInterceptor
{
protected override bool ExecuteSave()
{
throw new Exception("CommonEntityServerSaveInterceptor");
}
}
Still, I can save entities to my database, no exception as I would have expected.
Below the log showing devforce doesn't care about the override.
2012-04-04 10:49:57 IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport CompositionContext: '-IbDefault-' - Probed for any 'IIdGenerator' and found 'IdeaBlade.EntityModel.StoreGeneratedIdGenerator'.
2012-04-04 10:49:57 IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport CompositionContext: '-IbDefault-' - Probed for non-default 'IConcurrencyStrategy' and found no matching exports.
2012-04-04 10:49:57 IdeaBlade.Core.Composition.CompositionHost:CheckSingleExport CompositionContext: '-IbDefault-' - Probed for default 'IConcurrencyStrategy' and found 'IdeaBlade.EntityModel.DefaultConcurrencyValueSetter'.
2012-04-04 10:49:57 IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport CompositionContext: '-IbDefault-' - Probed for non-default 'IVerifierProvider' and found no matching exports.
2012-04-04 10:49:57 IdeaBlade.Core.Composition.CompositionHost:CheckSingleExport CompositionContext: '-IbDefault-' - Probed for any 'EntityServerSaveInterceptor' and found 'IdeaBlade.EntityModel.Server.EntityServerSaveInterceptor'.
Could the ConnectionOption defined in Cocktail (which seems to gice the compositioncontext to the manager) be the cause of this behavior ?