Exemplo n.º 1
0
        public virtual DependencyResolverOption DependencyResolverOption()
        {
            var option = new DependencyResolverOption();

            option.AddResolveStrategy <MockAttribute>((type, attr, sp) => sp.GetRequiredService(type));
            option.AddResolveStrategy <TestSubjectAttribute>((type, attr, sp) => sp.GetRequiredService(type));

            if (Partial)
            {
                option.AddResolveStrategy <DependencyAttribute>((type, attr, sp) => sp.GetService(type, attr.Name));
            }

            return(option);
        }
Exemplo n.º 2
0
        public override DependencyResolverOption DependencyResolverOption()
        {
            var option = new DependencyResolverOption();

            option.AddResolveStrategy <CustomAttribute>((type, attr, container) =>
                                                        attr.Descriptor + "TestString");

            return(option);
        }
Exemplo n.º 3
0
        public virtual DependencyResolverOption DependencyResolverOption()
        {
            var option = new DependencyResolverOption();

            option.AddResolveStrategy <HangfireProxyAttribute>((t, n, sp) =>
            {
                return(sp.GetRequiredService(t, t.Name));
            });

            return(option);
        }