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:
@@ -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; }
|
||||
}
|
||||
}
|
||||
10
src/Umbraco.Tests/CodeFirst/TestModels/ContentPage.cs
Normal file
10
src/Umbraco.Tests/CodeFirst/TestModels/ContentPage.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
21
src/Umbraco.Tests/CodeFirst/TestModels/DecoratedModelPage.cs
Normal file
21
src/Umbraco.Tests/CodeFirst/TestModels/DecoratedModelPage.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Tests/CodeFirst/TestModels/Home.cs
Normal file
17
src/Umbraco.Tests/CodeFirst/TestModels/Home.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Tests/CodeFirst/TestModels/PlainPocoType.cs
Normal file
17
src/Umbraco.Tests/CodeFirst/TestModels/PlainPocoType.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
14
src/Umbraco.Tests/CodeFirst/TestModels/SimpleContentPage.cs
Normal file
14
src/Umbraco.Tests/CodeFirst/TestModels/SimpleContentPage.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
14
src/Umbraco.Tests/CodeFirst/TestModels/TextPage.cs
Normal file
14
src/Umbraco.Tests/CodeFirst/TestModels/TextPage.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user