Freedom Friday POC of native code first - limited to test project.

Making a few corrections to the serialization attributes after having tested ContentType Serialization.
Enabling bulk saving of new ContentTypes with Parent/Composition dependencies.
This commit is contained in:
Morten Christensen
2012-11-23 19:58:19 -01:00
parent c7693386a2
commit 1053492a29
36 changed files with 1155 additions and 22 deletions

View File

@@ -0,0 +1,14 @@
using System;
using Umbraco.Tests.CodeFirst.Attributes;
using umbraco.editorControls.textfield;
namespace Umbraco.Tests.CodeFirst.TestModels
{
public class AdvancedContentPage : SimpleContentPage
{
[PropertyType(typeof(TextFieldDataType), PropertyGroup = "Content")]
public string Author { get; set; }
public DateTime PublishDate { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
using Umbraco.Tests.CodeFirst.Attributes;
namespace Umbraco.Tests.CodeFirst.TestModels
{
public class ContentPage : ContentTypeBase
{
[Richtext(PropertyGroup = "Content")]
public string BodyContent { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using Umbraco.Tests.CodeFirst.Attributes;
using umbraco.editorControls.textfield;
namespace Umbraco.Tests.CodeFirst.TestModels
{
[ContentType("modelPage", AllowedChildContentTypes = new[] { typeof(ContentPage) }, AllowedTemplates = new[]{"umbMaster"})]
public class DecoratedModelPage
{
[PropertyType(typeof(TextFieldDataType), PropertyGroup = "Content")]
public string Author { get; set; }
[PropertyType(typeof(TextFieldDataType), PropertyGroup = "Content")]
public string Title { get; set; }
[Richtext(PropertyGroup = "Content")]
public string BodyContent { get; set; }
public DateTime PublishDate { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using Umbraco.Tests.CodeFirst.Attributes;
using umbraco.editorControls.textfield;
using umbraco.editorControls.textfieldmultiple;
namespace Umbraco.Tests.CodeFirst.TestModels
{
[ContentType("home", AllowedChildContentTypes = new[] { typeof(ContentPage) })]
public class Home
{
[PropertyType(typeof(TextFieldDataType))]
public string SiteName { get; set; }
[Alias("umbSiteDescription", Name = "Site Description")]
[PropertyType(typeof(textfieldMultipleDataType))]
public string SiteDescription { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using System;
namespace Umbraco.Tests.CodeFirst.TestModels
{
public class PlainPocoType
{
public string Title { get; set; }
public string Author { get; set; }
public bool IsFinished { get; set; }
public int Weight { get; set; }
public DateTime PublishDate { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using Umbraco.Tests.CodeFirst.Attributes;
using umbraco.editorControls.textfield;
namespace Umbraco.Tests.CodeFirst.TestModels
{
public class SimpleContentPage
{
[PropertyType(typeof(TextFieldDataType), PropertyGroup = "Content")]
public string Title { get; set; }
[Richtext(PropertyGroup = "Content")]
public string BodyContent { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using Umbraco.Tests.CodeFirst.Attributes;
using umbraco.editorControls.textfield;
namespace Umbraco.Tests.CodeFirst.TestModels
{
public class TextPage
{
[PropertyType(typeof(TextFieldDataType), PropertyGroup = "Content")]
public string Author { get; set; }
[PropertyType(typeof(TextFieldDataType), PropertyGroup = "Content")]
public string Title { get; set; }
}
}