Questions tagged [castle-dynamicproxy]

Castle DynamicProxy is a library for generating lightweight .NET proxies on the fly at runtime. Proxy objects allow calls to members of an object to be intercepted without modifying the code of the class.

Castle DynamicProxy is a library for generating lightweight .NET proxies on the fly at runtime. Proxy objects allow calls to members of an object to be intercepted without modifying the code of the class.

Resources

335 questions
0
votes
1 answer

Is it possible to use the Unity Policy Injection within StructureMap to provide AOP functionalities?

I know that we can use Castle Dynamic Proxy within StructureMap to implement the AOP mechanism. A typical example is: HERE But can we use Unity Policy Injection within StructureMap instead of Castle Dyanmic Proxy?
0
votes
1 answer

Proxying meta-interfaces with Castle Dynamic Proxy

I have a question regarding Castle Dynamic Proxy (I've been using Castle Windsor as IoC framework for quite some time, but have never used the dynamic proxy directly). I have a couple of interface describing the abilities of classes. For…
wexman
  • 1,217
  • 10
  • 19
0
votes
1 answer

Castle dynamic proxy not creating an implementation for inherited interface method

I have a base interface that is inherited by several other interfaces. This interface has one method: [ServiceContract] public interface IBase { [OperationContract] List GetShorts(); } I then, of course, have an inheriting…
zimdanen
  • 5,508
  • 7
  • 44
  • 89
0
votes
2 answers

SignalR hub invoke doesn't work when returning a Castle DynamicProxy object without a default constructor

I have some problems invoking a signalr hub when the returned object is a Castle DynamicProxy. Let's say that I have the following server code on the signalr hub (this is not the real code but just to show the problem): public Article Read() { …
Davide Icardi
  • 11,919
  • 8
  • 56
  • 77
0
votes
2 answers

Problems with Castle DynamicProxy2 on .Net 3.5 SP1 on Win2003 Server

I've an mvc + nh asp.net application. On my dev machine (win 7 Ent) all works fine, if deployed on a Win 2k3 (tried 2 different vm and one phisical machine) I got the following error.. anyone can help? Cannot explain this issue (tried the same…
Andrea Balducci
  • 2,834
  • 1
  • 21
  • 18
0
votes
0 answers

What do I need Castle Windsor and PostSharp when i have Entity Framework?

I generated a model (with EF) from my database ,i set Code Generation Strategy to None and then i created my (POCO) classes with the same properties as in model and now my business class are decoupled from EF. (My Model has only two classes:Question…
Blocked
  • 340
  • 2
  • 5
  • 20
0
votes
0 answers

Intercept only service, not implementation in Windsor

I have this code: container.Register( Component.For(typeof(MyServiceInterceptor<>)), Component.For, MyServiceImpl>() .Interceptors(typeof(MyServiceInterceptor<>)) .Anywhere ) Windsor generates…
0
votes
1 answer

NHibernate Proxy Validator changes in 2.1

Can someone please help me understand the following: In the previous version of NHibernate (2.0.1) the following property will validate and is compatible with the Castle Proxies: internal virtual BusinessObject Parent { get { /*code*/…
Brendan Kowitz
  • 1,795
  • 10
  • 14
0
votes
1 answer

How to dynamically decorate a class?

I've got a simple decorator class like the following. Notice how my public methods all create a new instance of the to-be-decorated class, then forward the call to that instance. The problem with this class is that whenever IMyService gets…
Jay Sullivan
  • 17,332
  • 11
  • 62
  • 86
0
votes
1 answer

Retrieve CustomAttribute from property generated method

Inside DynamicProxy Interceptor method I have: public void Intercept(IInvocation invocation) { var _attribute = Attribute.GetCustomAttribute(invocation.Method, typeof(OneToManyAttribute), true); I've decorated my property like…
danyolgiax
  • 12,798
  • 10
  • 65
  • 116
0
votes
3 answers

Castle Dynamic Proxy how to merge data in CreateClassProxyWithTarget

It is possible to add proxy capabilities to an already generated and not empty object using Castle Dynamic Proxy? I've tried this: Dog _myDog=new Dog(); _myDog.Name="Fuffy"; var _proxyDog = generator.CreateClassProxyWithTarget(_myDog,…
danyolgiax
  • 12,798
  • 10
  • 65
  • 116
0
votes
1 answer

Is it possible to configure a Castle Dynamic Proxy with Instance method of the WindsorContainer?

... or does Castle need to have control over the construction process in order to wrap the object with the proxy? I've tried a few different configurations - below is the one that I'm currently using, but the Interceptor is not being applied when I…
carmbrester
  • 910
  • 1
  • 8
  • 21
0
votes
1 answer

How can I get the type name to log along with the method name with a Castle interceptor?

Is there a way I can get the type that method belongs to to log with a Castle interceptor?
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30
0
votes
2 answers

Persisting a Castle DynamicProxy that's not associated with a NH Session

My session uses an NHInterceptor to add INotifyPropertyChanged support to models. // I use the session generated here to fetch Data public class SessionServiceImpl : ISessionService { [Inject] public ISessionFactory SessionFactory { get;…
Sebastian Edelmeier
  • 4,095
  • 3
  • 39
  • 60
0
votes
1 answer

How to suspend dynamic proxy's interceptor?

I have a timing interceptor for the services I use: class TimingInterceptor : IInterceptor { public void Intercept(IInvocation invocation) { var watch = new Stopwatch(); watch.Start(); try { …
Angela_SB
  • 249
  • 4
  • 12
1 2 3
22
23