Print Page | Close Window

OnPropertyChanged

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3535
Printed Date: 28-Mar-2025 at 12:58pm


Topic: OnPropertyChanged
Posted By: rbautistaole
Subject: OnPropertyChanged
Date Posted: 12-Jul-2012 at 4:19pm
I have a codefirst model. I need to set a property value when another property is changed. Since with codeFirst style the PostSharp decorate my entity, Why is not a OnPropertyChanged created in my entity? Which is the suggested way to business rules on property changes? Using property interceptors?
 
thanks
 



Replies:
Posted By: sbelini
Date Posted: 13-Jul-2012 at 2:53pm
Hi,
 
You should override IPropertyChangedInterceptor as described at http://drc.ideablade.com/xwiki/bin/view/Documentation/code-first-entity-interfaces#HIPropertyChangedInterceptor - http://drc.ideablade.com/xwiki/bin/view/Documentation/code-first-entity-interfaces#HIPropertyChangedInterceptor .
 
Regards,
   Silvio.


Posted By: rbautistaole
Date Posted: 13-Jul-2012 at 6:25pm
ok, but by make this suggestion im replacing the total implementation and i canĀ“t call the injected implementation.
 
Do you see some problem by use an interceptor? i remember tha i read an article from devforce discouraging the use of interceptors in such case.
 
regards.
 
 
 


Posted By: sbelini
Date Posted: 16-Jul-2012 at 2:40pm
I'm not sure what you mean by "can't call the injected implementation".
 
In Code First, this is the only way you can implement your OnPropertyChanged event.
 
Regards,
   Silvio.



Print Page | Close Window