Questions tagged [property-injection]

61 questions
0
votes
1 answer

How can StructureMap be used to create setter dependencies of objects that have primitive constructor argumeents?

I have an object "TestProperty" which implements "ITestProperty". "TestProperty" takes a string constructor argument. This is configured in StructureMap using something along the lines CtorDependency or WithCtorArg. I want to inject the an instance…
Zac Seth
  • 2,742
  • 5
  • 37
  • 56
0
votes
1 answer

use Mono.Cecil inject the property's auto-implemented backing field

To be more lazy, I just want to write less code but do the same thing, so I did a test. Just want to use some Attribute and use mono.cecil to inject the .dll file with some il code. And the following is the detail: When coding…
0
votes
0 answers

Conceptual: Setter Dependency Injection for Angular 1.*

preface - this is more a conceptual discussion rather than a "how-to". If there is a simple way to implement, then I would certainly be thankful for tips on how but I really want to gain insight on why/why not this isn't possible or a good idea. …
0
votes
1 answer

Windsor Castle : Property Inject

I implemented a CustomMembershipProvider which is deriving from ExtendedMembershipProvider. IUserService is a dependency of CustomMembershipProvider which will be used to validate the given credentials. This will be configured in Web.Config; …
RSF
  • 510
  • 6
  • 18
0
votes
1 answer

Autofac injecting context into controller and entities

I've got an MVC app built on EF4.3 and am trying to do some refactoring/cleanup by injecting the DbContext into entities instead of passing it around. I already am using Autofac to pass the context to my controllers and that works great. But using…
0
votes
0 answers

Property injection leads to StackOverflowException

I'm new to AutoFac and i am trying to auto inject my property with the instance that i registered with AutoFac. public class PersonalDataProvider { public ISocialAppUnitOfWork SocialAppUnitOfWork { get …
Jamie
  • 3,031
  • 5
  • 36
  • 59
0
votes
0 answers

structure-map property injection for Attribute class with external dependency doesnt work for me

I am new to structure map. When I use property Injection for a Custom validation class the property is always null. I think i am missing some thing. Any help in this regards will be highly appreciated. I don't want to use…
0
votes
1 answer

How to auto load Objects into Page properties

To start, I know this can be done but as i was not involved in setting it up or implementing it i did not see how it was done. At a former job, when i was helping support a web-application (MVC or Web-App), we had your usual EF design pattern. But…
0
votes
1 answer

How to inject a property into a class that I don't control the creation of

How do I inject the IServiceManager property into this class using autofac? This is a custom resource provider factory class that gets called when you make a call to HttpContext.GetGlobalResourceObject("", "MyResource") to get a resource…
TugboatCaptain
  • 4,150
  • 3
  • 47
  • 79
0
votes
2 answers

How can I handle exception raised during Castle Windsor optional property injection?

Castle Windsor 3.2 provides a cool addition that is Diagnostic logging in the container. This helped me redirect the container logs to a log4net log file that's being used to store the application logs. What I'd like to do now is to be able to…
0
votes
1 answer

Castle Windsor IoC property injection. Using property from BaseClass inside ChildClass constructor

I have a base class as following public class BaseClass { public ISomeObject Property { get; set; } } and ChildClass inherited from BaseClass.I need to use Property from BaseClass inside ChildClass constructor, but it's not initialized by IoC…
0
votes
0 answers

jsf 2.0 viewscope in two windows need to refresh each other

I have a problem: I have a View-Scoped bean/view with an overview of some data (list). when someone clicks on an item, it opens another view-scoped window/browser tab which loads and shows some detailed information about the item clicked. All I…
Niko
  • 1,054
  • 5
  • 25
  • 52
0
votes
2 answers

How to pass data from one component to another component in flex

I have one class named as EmployeeResult where I am getting the response from the service. Inside the resulthandler I am getting an array of employees like name, id, age etc. I have one dataGrid inside the employeeView.mxml file. Inside the…
nitin
  • 75
  • 1
  • 12
0
votes
1 answer

Property Injection using Autofac

So I have a simple question (I think). How do you do Property Injection on a FilterAttribute with Autofac? Public Class TestFilterAttribute Inherits ActionFilterAttribute Public Property Service As IMyService Public Overrides…
Sam
  • 15,336
  • 25
  • 85
  • 148
0
votes
1 answer

Are there any advantages of Property Injection over Constructor Injection?

Possible Duplicate: Dependency injection through constructors or property setters? I'm curios if Property Injection has any advantages over Constructor Injection: public class LoginController : Controller { [Inject] public…
Ruslan
  • 2,678
  • 3
  • 22
  • 25