Ninject to Unity

Jan 12, 2015 at 1:07 AM
Edited Jan 12, 2015 at 1:09 AM
I am wondering if Unity has the similar methods for WhenTargetHas and When.

For example in ninject we can do:
kernel.Bind<ILogManager>().To<TransactionalLogManager>().WhenTargetHas<TransactionalAttribute>().InRequestScope();

and

kernel.Bind<IElementOfWork>().To<MediaElementOfWork>().When(request =>request.Target != null && request.Target.Member.DeclaringType != null && request.Target.Member.DeclaringType.Assembly == typeof(MvcApplication).Assembly && request.Target.Member.DeclaringType != typeof(MembershipErrorController)).InRequestScope();

How can we translate the ninject codes above to unity?