renamed IContentStore to IPublishedContentStore. Migrating DynamicNode to Umbraco.Core and cleaning up it's supported codebase.
Starting writing a few unit tests for the new DynamicNode codebase. Will of course leave the original DynamicNode stuff in its current place for backwards compatibility but will deprecate many of the classes which will call the new ones.
This commit is contained in:
24
src/Umbraco.Core/Dynamics/DynamicClass.cs
Normal file
24
src/Umbraco.Core/Dynamics/DynamicClass.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Umbraco.Core.Dynamics
|
||||
{
|
||||
public abstract class DynamicClass
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
PropertyInfo[] props = this.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("{");
|
||||
for (int i = 0; i < props.Length; i++)
|
||||
{
|
||||
if (i > 0) sb.Append(", ");
|
||||
sb.Append(props[i].Name);
|
||||
sb.Append("=");
|
||||
sb.Append(props[i].GetValue(this, null));
|
||||
}
|
||||
sb.Append("}");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user