diff --git a/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeDataProvider.cs b/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeDataProvider.cs
index 99404638b7..3f1e7b645f 100644
--- a/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeDataProvider.cs
+++ b/LinqToUmbraco/src/umbraco.Linq/Core/Node/NodeDataProvider.cs
@@ -100,28 +100,18 @@ namespace umbraco.Linq.Core.Node
#region IDisposable Members
- private bool _disposed;
-
///
/// Releases unmanaged and - optionally - managed resources
///
/// true to release both managed and unmanaged resources; false to release only unmanaged resources.
protected internal override void Dispose(bool disposing)
{
- if (!this._disposed && disposing)
+ if (disposing)
{
this._xmlPath = null;
-
- this._disposed = true;
}
- }
- internal void CheckDisposed()
- {
- if (this._disposed)
- {
- throw new ObjectDisposedException(null);
- }
+ base.Dispose(disposing);
}
#endregion
@@ -344,7 +334,7 @@ namespace umbraco.Linq.Core.Node
if (propertyXml != null)
data = propertyXml.Value;
- if (p.PropertyType.IsValueType && typeof(Nullable<>).IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition()))
+ if (p.PropertyType.IsValueType && p.PropertyType.GetGenericArguments().Length > 0 && typeof(Nullable<>).IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition()))
{
if (string.IsNullOrEmpty(data))
{
diff --git a/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataProvider.cs b/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataProvider.cs
index 037250a25e..ed99fcc5f0 100644
--- a/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataProvider.cs
+++ b/LinqToUmbraco/src/umbraco.Linq/Core/UmbracoDataProvider.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Linq.Expressions;
namespace umbraco.Linq.Core
{
///
- /// Provides the methods required for a data access model within the LINQ to umbraco project
+ /// Provides the methods required for a data access model within the LINQ to Umbraco project
///
///
/// This base class is used when defining how a DataProvider operates against a data source (such as the umbraco.config).
@@ -16,6 +13,11 @@ namespace umbraco.Linq.Core
///
public abstract class UmbracoDataProvider : IDisposable
{
+ ///
+ /// Indicates the disposal status of the current provider
+ ///
+ protected bool _disposed;
+
///
/// Gets the name of the provider
///
@@ -23,21 +25,21 @@ namespace umbraco.Linq.Core
public abstract string Name { get; }
///
- /// Loads the tree with the relivent DocTypes
+ /// Loads the tree with the relevant DocTypes
///
/// The type of the DocType to load.
///
public abstract Tree LoadTree() where TDocType : DocTypeBase, new();
///
- /// Loads the associated nodes with the relivent DocTypes
+ /// Loads the associated nodes with the relevant DocTypes
///
/// The parent node id.
///
public abstract AssociationTree LoadAssociation(int parentNodeId);
///
- /// Loads the associated nodes with the relivent DocTypes
+ /// Loads the associated nodes with the relevant DocTypes
///
/// The type of the DocType to load.
/// The nodes.
@@ -61,6 +63,15 @@ namespace umbraco.Linq.Core
#region IDisposable Members
+ ///
+ /// Checks if the provider has been disposed
+ ///
+ protected internal void CheckDisposed()
+ {
+ if (this._disposed)
+ throw new ObjectDisposedException(null);
+ }
+
///
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
///
@@ -77,10 +88,16 @@ namespace umbraco.Linq.Core
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
protected internal virtual void Dispose(bool disposing)
{
+ this._disposed = true;
}
#endregion
+ ///
+ /// Submits the changes tracked by the UmbracoDataProvider
+ ///
+ /// It is up to the implementor of the UmbracoDataProvider to decide whether or not they are supporting change submission in their provider. This will thrown an exception unless it is explicitly implemented.
+ /// Thrown unless the method is implemented in a custom UmbracoDataProvider.
protected internal virtual void SubmitChanges()
{
throw new NotImplementedException("Provider \"" + this.Name + "\" does not implement a submittable pattern");
diff --git a/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs b/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs
index a9ba1465c9..41d65a3a0d 100644
--- a/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs
+++ b/umbraco/presentation/umbraco/dialogs/ExportCode.aspx.cs
@@ -151,6 +151,7 @@ namespace {0} {{
{{
this.RaisePropertyChanging();
this._{1} = value;
+ this.IsDirty = true;
this.RaisePropertyChanged(""{1}"");
}}
}}