Hi
I have bought and read the "Expert C# 2008 Business Objects" book and changed my Business Layer code accordingly. My properties Now look like this for example:
"public static PropertyInfo<string> MineNameProperty = RegisterProperty<string>(c => c.MineName);
public string MineName
{
get { return GetProperty(MineNameProperty); }
set { LoadProperty(MineNameProperty, value); }
}"
My problem is that my object's IsDirty property doesn't change to true if I edit the object like this:
MineName = "MyName";
It always stay false. Can anybody point me to what I am missing?
As I post the question I read through my writing and saw that I use LoadProperty instead of SetProperty. I have changed this and now it is working.
I assume LoadProperty is for a ReadOnly object and SetProperty is for an Editable object.
LoadProperty is useful when fetching data as well, therefore not marking your object as dirty or running validation rules.
Copyright (c) Marimer LLC