Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 304929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:19:33+00:00 2026-05-12T07:19:33+00:00

I am using Castle.DynamicProxy2 and I am instantiating my proxy as such: private static

  • 0

I am using Castle.DynamicProxy2 and I am instantiating my proxy as such:

private static T GenerateProxy()
{   
    ArrayList addtlInterfaces = new ArrayList();

    addtlInterfaces.Add(typeof (INotifyPropertyChanged));
    addtlInterfaces.Add(typeof (EntityStatus));

    object entityProxy = ProxyGenerator.CreateClassProxy(typeof(T), 
                                                          addtlInterfaces.ToArray(typeof(Type)) as Type[],
                                                          ProxyGenerationOptions.Default,
                                                          new IInterceptor[] { new LazyInterceptor() });


    return (T)entityProxy;
}

My interface of IEntityStatus looks like such:

public interface  IEntityStatus
{
    bool IsDirty
    { get; set;}
}

I need to be able to use that property during run time so that when my DTO has a property changed event the event could set the DTO to dirty. However because it is an interface and has no explicit implementation I am at a loss as to how to do this. Creating a delegate for the get and set method is an option I would like to avoid. So is there another way to achieve what I am looking to achieve?

I realize I could set up a collection of all my active DTOs and when the property changed event fires on one of the DTOs I could update that collection to show that this particular DTO is dirty, but I would really like for this information to be a part of the proxied DTO for pure syntactic ease.

Look forward to responses!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:19:34+00:00Added an answer on May 12, 2026 at 7:19 am

    I dont know how you handle the INotifyPropertyChanged but I’d use mixin for both interfaces, having one subscribed to another’s event. Is that a viable solution?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Castle DynamicProxy2 to tack on interfaces to retrieve fields from a dictionary.
Platform: C# 2.0 Using: Castle.DynamicProxy2 I have been struggling for about a week now
I'm currently doing a bit of experimenting using Autofac-1.4.5.676, autofac contrib and castle DynamicProxy2.
I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL
I have been using Castle MonoRail for the last two years, but in a
I'm using castle windsor for a pet-project I'm working on. I'm starting to notice
I'm using Castle Windsor and Binsor to use dependency injection in my application. I'm
I am working on a project using Castle Active Record. I stumbled across the
I decided to make a system for a client using Castle ActiveRecord , everything
I've got a pretty basic question about how to start using Castle Windsor. I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.