private Func <object[], object> BuildWithAspects(Type type)
        {
            var services = new[] { type }.Union(type.GetInterfaces()).ToArray();

            return(args =>
            {
                try
                {
                    return Aspects.Create(type, args, services);
                }
                catch (MissingMethodException mme)
                {
                    throw new MissingMethodException(@"Can't create instance of an type {0}. 
Check if type should be registered in the container or if correct arguments are passed.".With(type.FullName), mme);
                }
            });
        }
Exemple #2
0
 public static TIf Create <TImp, TIf>(this IAspectComposer composer)
     where TImp : class, TIf
 {
     return((TIf)composer.Create(typeof(TImp), null, new[] { typeof(TImp), typeof(TIf) }));
 }