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 ...
Voe asked 23/5, 2018 at 4:4
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...
V2 asked 4/9, 2017 at 11:23
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 ...
Reversal asked 28/2, 2013 at 11:40
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...
Sitdown asked 31/5, 2011 at 10:27
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...
Carhop asked 22/4, 2012 at 11:27
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...
Archfiend asked 14/11, 2011 at 16:23
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...
Tupi asked 15/2, 2010 at 23:6
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...
Fash asked 29/6, 2009 at 14:55
1
© 2022 - 2024 — McMap. All rights reserved.