I've tried this:
x.For<IAlbumRepository>().Use<CachedAlbumRepository>();
x.For<CachedAlbumRepository>().Use<CachedAlbumRepository>().Ctor<IAlbumRepository>().Is
<EfAlbumRepository>();
It fails with a "No default constructore defined" exception.
I started down this path:
x.For<IAlbumRepository>().Add(
c =>
{
if ( %%TheRequestingType%% is
CachedAlbumRepository)
{
return new
CachedAlbumRepository(new EfAlbumRepository());
}
return new EfAlbumRepository();
});
but I can't seem to figure out how to write a conditional that is
based on the type doing the requesting.
Any advice?
Thanks,
Steve
--
Steve Smith
http://SteveSmithBlog.com/
http://twitter.com/ardalis
--
You received this message because you are subscribed to the Google Groups "structuremap-users" group.
To post to this group, send email to structure...@googlegroups.com.
To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/structuremap-users?hl=en.
Steve
Steve
>> For more options, visit this group at
>> http://groups.google.com/group/structuremap-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "structuremap-users" group.
> To post to this group, send email to structure...@googlegroups.com.
> To unsubscribe from this group, send email to