erotik film
bodyheat full moves www xxx kajal video la figa che sborra ver video de sexo porno
Luxury replica watches
sex
asyabahis
escort antalya

** THIS SITE IS AN ARCHIVE ** - New Content is at:
BlazorHelpWebsite.com

Jul 13

Written by: kchristo
Friday, July 13, 2012  RssIcon

One very common task when one is implementing the business logic in Common project is writing custom PropertyName_Changed partial methods.
This “approach” has an undesired “side-effect” when the property is an entity property (as compared to screen properties). The property changes many times during the lifetime of the object. While loading, while deleting etc., whereas what we want to implement is handle the “actual” property changes caused either by the user or by some other piece of business logic.
I found myself debugging code that shouldn’t be executing (according to my logic, obviously LS had another opinion) before ending up writing a small extension method to use in all PropertyName_Changed partial methods. I don’t claim this method will help you avoid ALL unwanted business logic code execution, but covers most of the cases. I would be glad to read any comments improving it in a generic way.
Here is the code of the extension method:
public static bool IgnorePropertyChange(this IEntityObject entity) {
return entity.Details.EntityState == EntityState.Unchanged ||
entity.Details.EntityState == EntityState.Discarded ||
entity.Details.EntityState == EntityState.Deleted;
}




And here how all my property changed partial implementations for entity properties look like
partial void ScheduledEndDate_Changed() {
if (this.IgnorePropertyChange())
return;
.
.
.
}



This looks (and is) simple but the concept, alone, of “unwanted” code execution is important and should be taken good care of. If not using this extension method any other way one may like Winking smile.

Tags:
Categories:

1 comment(s) so far...


Wholesale NFL Jerseys
NBA Jersey
NFL Jerseys
Custom NBA Jerseys
MLB Jerseys
Custom NFL Jersey
Cheap NFL Jerseys
Football Jerseys
NBA Jerseys Wholesale
Cheap NBA Jerseys
NFL Shop Official Online Store
NFL Jerseys China
NFL Jerseys
NFL Shop
Cheap NFL Jerseys From China
Cheap NHL Jerseys Reddit
Cheap Jerseys
Cheap MLB Jerseys
Wholesale Jerseys
Cheap Jerseys Wholesale
Custom Football Jerseys
NHL Jerseys Wholesale
Wholesale Jerseys China
MLB Jerseys
NFL Fan Shop
NFL Jerseys Cheap
Wholesale Jerseys China
NFL Store Online Shopping
Cheap Jerseys Sale
NFL Jerseys
Cheap NBA Jerseys
NBA Shop
NFL Gear
Custom NHL Jerseys
MLB Shops
NFL Gear
MLB Fan Shop
NFL Store
NHL Apparel
MLB Store Official Site
Cheap NBA Jerseys
Cheap Jerseys
MLB Store
Cheap NHL Jerseys
NFL Jersey

By Holder on   Thursday, February 24, 2022

Your name:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation