property-injection Questions

7

Solved

When Instantiating a class, Windsor by default treats all public properties of the class as optional dependencies and tries to satisfy them. In my case, this creates a rather complicated circular d...
Maturate asked 7/10, 2008 at 14:6

2

I can use Constructor Parameter Injection easily In MVC Core. But Property Injection is not supported.I try use AutoFac but fail too. So how to use Property Injection in MVC Core. Here is the code ...

3

Solved

I would like to use @Value on a property but I always get 0(on int). But on a constructor parameter it works. Example: @Component public class FtpServer { @Value("${ftp.port}") private int por...

2

Solved

I have two classes, one which sets up the container by registering types and one which contains a static property which I want to inject into. My issue is the property is never set by injection so ...

2

Solved

The autofac wiki page about Circular References says to use: cb.Register<DependsByProp>().OnActivated(ActivatedHandler.InjectUnsetProperties); But it looks like ActivatedHandler does not e...

2

Solved

Using Autofac, I can register a class to resolve against an interface using property injection, using the following code: builder.RegisterType<Log4NetAdapter>() .As<ILogger>() .Prope...
Statolatry asked 23/1, 2013 at 16:17

2

Solved

Example: public abstract class BaseControler : Controller { public IUnitOfWork UnitOfWork { get; set; } } public class HomeController : BaseControler { readonly IUserRepository _userRepository;...
Siphonostele asked 4/5, 2012 at 13:26

1

Solved

I have the following classes: public interface IServiceA { string MethodA1(); } public interface IServiceB { string MethodB1(); } public class ServiceA : IServiceA { public IServiceB serviceB...

5

Solved

I am looking for suggestions as to the best way to design objects for IoC Suppose I have an object (Service) that has a dependency to a DataContext which is registered with Ioc. But it also requi...

1

Solved

I have a method attribute which expects several properties to be injected by Ninject 2, but userSession and jobRepository are coming up as null: [AttributeUsage(AttributeTargets.Method, AllowMulti...

1

Solved

I have a property on my classes for logging service. private ILogger logger = NullLogger.Instance; public ILogger Logger { get { return logger; } set { logger = value; } } And I have this in m...
1

© 2022 - 2024 — McMap. All rights reserved.