Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

LoadProperty vs SetProperty setters and performance

$
0
0

Hi there,

In my windows project I have more than 50 registered properties per object (more or less) and not every one of them has corresponded field in a Database.

If I use SetProperty as a setter, I run to a severe performance issues, due to PropertyHasChanged event being fired all the time a property changes its value.

Now, when I use LoadProperty as a setter to all properties that I do not want PropertyHasChanges to be fired, and leave SetProperty setter for ones that I do like this event to be fired, the performance is awesome (as it should be), BUT now, all properties that I need to save in the database that used LoadPropery setter are not marked as Dirty, and because of that they cannot be saved (I only save Dirty properties in my database; insert/update).

How can I use LoadProperty, but make the property dirty in the same time (I want the property to be dirty, but I do not want rules to be checked against them automatically or fire OnChildChanged event)? Or would you suggest another approach?

I use CSLA.NET 4, .net 4 framework, and winforms.

 

Thanks in advance,

Tanja.


Viewing all articles
Browse latest Browse all 764

Trending Articles