Skip to content

Instantly share code, notes, and snippets.

@MichalGrzegorzak
Forked from sclarson/gist:3106850
Created February 12, 2013 08:44
Show Gist options
  • Save MichalGrzegorzak/4761015 to your computer and use it in GitHub Desktop.
Save MichalGrzegorzak/4761015 to your computer and use it in GitHub Desktop.
private static bool PageDataHasChanged(PageData pageOne, PageData pageTwo)
{
PageType type = PageType.Load(pageOne.PageTypeName);
foreach (var property in type.Definitions.Where(p=> GetPropertynames<CoursePage>().Contains(p.Name)))
{
if (pageOne[property.Name] == pageTwo[property.Name])
{
continue;
}
if ((pageOne[property.Name] == null && pageTwo[property.Name] != null) || (pageOne[property.Name] != null && pageTwo[property.Name] == null))
{
return true;
}
if (pageOne[property.Name].Equals(pageTwo[property.Name]))
{
continue;
}
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment