Implements CodeFileController
This commit is contained in:
20
src/Umbraco.Web/Models/ContentEditing/CodeFileDisplay.cs
Normal file
20
src/Umbraco.Web/Models/ContentEditing/CodeFileDisplay.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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 = "scriptFile", Namespace = "")]
|
||||
public class CodeFileDisplay
|
||||
{
|
||||
[DataMember(Name = "virtualPath")]
|
||||
public string VirtualPath { get; set; }
|
||||
[DataMember(Name = "content")]
|
||||
public string Content { get; set; }
|
||||
[DataMember(Name = "snippet")]
|
||||
public string Snippet { get; set; }
|
||||
}
|
||||
}
|
||||
47
src/Umbraco.Web/Models/Mapping/CodeFileDisplayMapper.cs
Normal file
47
src/Umbraco.Web/Models/Mapping/CodeFileDisplayMapper.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
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.Mapping;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
public class CodeFileDisplayMapper : MapperConfiguration
|
||||
{
|
||||
public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
|
||||
{
|
||||
config.CreateMap<IPartialView, CodeFileDisplay>()
|
||||
.ForMember(x => x.Snippet, exp => exp.Ignore());
|
||||
|
||||
config.CreateMap<Script, CodeFileDisplay>()
|
||||
.ForMember(x => x.Snippet, exp => exp.Ignore());
|
||||
|
||||
config.CreateMap<CodeFileDisplay, IPartialView>()
|
||||
.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.Path, exp => exp.Ignore())
|
||||
.ForMember(x => x.Alias, exp => exp.Ignore())
|
||||
.ForMember(x => x.Name, exp => exp.Ignore())
|
||||
.ForMember(x => x.OriginalPath, exp => exp.Ignore())
|
||||
.ForMember(x => x.HasIdentity, exp => exp.Ignore());
|
||||
|
||||
config.CreateMap<CodeFileDisplay, Script>()
|
||||
.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.Path, exp => exp.Ignore())
|
||||
.ForMember(x => x.Alias, exp => exp.Ignore())
|
||||
.ForMember(x => x.Name, exp => exp.Ignore())
|
||||
.ForMember(x => x.OriginalPath, exp => exp.Ignore())
|
||||
.ForMember(x => x.HasIdentity, exp => exp.Ignore());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user