Removing dependency on DbProviderFactories in DatabaseFactory.

Refactoring mocked content used by ContentTests.
Refactoring dirty-usage.
This commit is contained in:
sitereactor
2012-11-02 09:11:23 -01:00
parent 49c2be3c4a
commit ccb1734a04
11 changed files with 222 additions and 108 deletions

View File

@@ -115,20 +115,20 @@ namespace Umbraco.Core.Models.EntityBase
private readonly IDictionary<string, bool> _propertyChangedInfo = new Dictionary<string, bool>();
/// <summary>
/// Returns true if the property referenced by the name has been changed on the class
/// Indicates whether a specific property on the current entity is dirty.
/// </summary>
/// <param name="propertyName"></param>
/// <returns></returns>
public bool IsPropertyDirty(string propertyName)
/// <param name="propertyName">Name of the property to check</param>
/// <returns>True if Property is dirty, otherwise False</returns>
public virtual bool IsPropertyDirty(string propertyName)
{
return _propertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
/// Returns true if any properties have been changed on the class
/// Indicates whether the current entity is dirty.
/// </summary>
/// <returns></returns>
public bool IsDirty()
/// <returns>True if entity is dirty, otherwise False</returns>
public virtual bool IsDirty()
{
return _propertyChangedInfo.Any();
}
@@ -136,7 +136,11 @@ namespace Umbraco.Core.Models.EntityBase
/// <summary>
/// Resets dirty properties by clearing the dictionary used to track changes.
/// </summary>
public void ResetDirtyProperties()
/// <remarks>
/// Please note that resetting the dirty properties could potentially
/// obstruct the saving of a new or updated entity.
/// </remarks>
public virtual void ResetDirtyProperties()
{
_propertyChangedInfo.Clear();
}