Serverside template services
This commit is contained in:
34
src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs
Normal file
34
src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
[DataContract(Name = "template", Namespace = "")]
|
||||
public class TemplateDisplay
|
||||
{
|
||||
[DataMember(Name = "id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[DataMember(Name = "name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DataMember(Name = "alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[DataMember(Name = "content")]
|
||||
public string Content { get; set; }
|
||||
|
||||
[DataMember(Name = "path")]
|
||||
public string Path { get; set; }
|
||||
|
||||
[DataMember(Name = "virtualPath")]
|
||||
public string VirtualPath { get; set; }
|
||||
|
||||
[DataMember(Name = "masterTemplateAlias")]
|
||||
public string MasterTemplateAlias { get; set; }
|
||||
}
|
||||
}
|
||||
29
src/Umbraco.Web/Models/Mapping/TemplateModelMapping.cs
Normal file
29
src/Umbraco.Web/Models/Mapping/TemplateModelMapping.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
internal class TemplateModelMapper : MapperConfiguration
|
||||
{
|
||||
public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
|
||||
{
|
||||
config.CreateMap<ITemplate, TemplateDisplay>();
|
||||
|
||||
config.CreateMap<TemplateDisplay, Template>()
|
||||
.ForMember(x => x.Key, exp => exp.Ignore())
|
||||
.ForMember(x => x.Path, exp => exp.Ignore())
|
||||
.ForMember(x => x.CreateDate, exp => exp.Ignore())
|
||||
.ForMember(x => x.UpdateDate, exp => exp.Ignore())
|
||||
.ForMember(x => x.VirtualPath, exp => exp.Ignore())
|
||||
.ForMember(x => x.Path, exp => exp.Ignore());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user