TrackableEntities / trackable-entities

N-Tier Support for Entity Framework with WCF or ASP.NET Web API
http://trackableentities.github.io
MIT License
120 stars 36 forks source link

Readonly Properties must not be included in ModifiedProperties Collection #201

Closed noufionline closed 5 years ago

noufionline commented 6 years ago

Hi Tony,

I have an entity base class which implements INotifyDataErrorInfo interface. When I modify an entity and save I noticed HasErrors property name is being added to the modified collection. Can you please help me to figure out how to avoid unwanted properties being added to this collection.

Thanks in advance.

Noufal

tonysneed commented 6 years ago

Yes, there’s an ExcludedProperties member you can set.

weitzhandler commented 6 years ago

Related: #184.

@tonysneed, this harder than what it looks like, since the tracker takes care of an entire graph which can be large and hard to maintain properties. Best thing would be an in-class (attributes?) or per-class ignore configuration, the the CTC picks up automatically.

noufionline commented 6 years ago

But adding readonly properties to modifiedProperties collection really doesn't make sense. I think Readonly properties must be excluded by default.

tonysneed commented 6 years ago

Going to circle back to this as soon as I have a chance.

cbgreely commented 6 years ago

Hi...we hit a similar problem. I have added a word doc outlining our solution. I welcome opinions! DoNotTrack.docx

weitzhandler commented 6 years ago

@cbgreely I couldn't open your document. Would your document fit in your message? Please paste its content here.

cbgreely commented 6 years ago

Hmm…wonder why. Anyway I have attached it.

From: Shimmy [mailto:notifications@github.com] Sent: Wednesday, January 03, 2018 8:41 AM To: TrackableEntities/trackable-entities trackable-entities@noreply.github.com Cc: Chuck Greely chuck.greely@zobrio.com; Mention mention@noreply.github.com Subject: Re: [TrackableEntities/trackable-entities] Readonly Properties must not be included in ModifiedProperties Collection (#201)

@cbgreelyhttps://github.com/cbgreely I couldn't open your document. Would your document fit in your message? Please paste its content here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/TrackableEntities/trackable-entities/issues/201#issuecomment-355014028, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhaYLgxvSRMkQICYF02A0ljxW8XVyfIfks5tG4NlgaJpZM4QSudD.

tonysneed commented 5 years ago

Looks like this was resolved.