-1

I'm trying to create an OleTableAttribute that I will apply to a class MyTable alongside a System.Data.Linq.Mapping.TableAttribute so that it would look something like this:

[Table(Name="MyTable")]
[OleTable]
public class MyTable
{
    [Column(IsPrimaryKey = true)]
    public int pk_id { get; set; }
    /*...*/
}

What I'd like the OleTableAttribute to do is look for any [Column] attributed properties in the class that it is marked on, and reflectively add some type of listener to the setter method if it has one. The focus of this question is really how to do the reflective monitoring-setup of setter calls; just a simple "hey-its-been-called" signal is all I need. Is this possible?

Ian Ray
  • 378
  • 2
  • 18

1 Answers1

0

PostSharp works. Using the [NotifyPropertyChanged] aspect will decorate all your properties behind the scenes with just the type of signalling I'm looking for here. Then the [OleTable] can treat it's attributed class as INotifyPropertyChanged and add its own PropertyChanged event.

Ian Ray
  • 378
  • 2
  • 18