diff --git a/src/Umbraco.Core/BindingRedirects.cs b/src/Umbraco.Core/BindingRedirects.cs index fc50b73a17..e698ffa646 100644 --- a/src/Umbraco.Core/BindingRedirects.cs +++ b/src/Umbraco.Core/BindingRedirects.cs @@ -1,10 +1,10 @@ using System; using System.Reflection; -using System.Text.RegularExpressions; using System.Web; using Umbraco.Core; -[assembly: PreApplicationStartMethod(typeof(BindingRedirects), "Initialize")] +// no binding redirect for now = de-activate +//[assembly: PreApplicationStartMethod(typeof(BindingRedirects), "Initialize")] namespace Umbraco.Core { @@ -18,7 +18,7 @@ namespace Umbraco.Core // this only gets called when an assembly can't be resolved AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; } - + /// /// This is used to do an assembly binding redirect via code - normally required due to signature changes in assemblies /// @@ -27,9 +27,12 @@ namespace Umbraco.Core /// private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { + // When an assembly can't be resolved. In here we can do magic with the assembly name and try loading another. + // keep here for reference - we don't use AutoMapper /* //AutoMapper: + // this is used for loading a signed assembly of AutoMapper (v. 3.1+) without having to recompile old code. // ensure the assembly is indeed AutoMapper and that the PublicKeyToken is null before trying to Load again // do NOT just replace this with 'return Assembly', as it will cause an infinite loop -> stackoverflow if (args.Name.StartsWith("AutoMapper") && args.Name.EndsWith("PublicKeyToken=null")) @@ -37,7 +40,6 @@ namespace Umbraco.Core */ return null; - } } } diff --git a/src/Umbraco.Core/Composing/CompositionExtensions/CoreMappingProfiles.cs b/src/Umbraco.Core/Composing/CompositionExtensions/CoreMappingProfiles.cs index a77c7ad5eb..68a19a013b 100644 --- a/src/Umbraco.Core/Composing/CompositionExtensions/CoreMappingProfiles.cs +++ b/src/Umbraco.Core/Composing/CompositionExtensions/CoreMappingProfiles.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.Composing.CompositionExtensions { composition.RegisterUnique(); composition.WithCollectionBuilder() - .Append(); + .Add(); return composition; } } diff --git a/src/Umbraco.Core/Composing/SetCollectionBuilderBase.cs b/src/Umbraco.Core/Composing/SetCollectionBuilderBase.cs new file mode 100644 index 0000000000..e901655cd8 --- /dev/null +++ b/src/Umbraco.Core/Composing/SetCollectionBuilderBase.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; + +namespace Umbraco.Core.Composing +{ + /// + /// Implements a set collection builder. + /// + /// The type of the builder. + /// The type of the collection. + /// The type of the items. + /// + /// A set collection builder is the most basic collection builder, + /// where items are not ordered. + /// + public abstract class SetCollectionBuilderBase : CollectionBuilderBase + where TBuilder : SetCollectionBuilderBase + where TCollection : class, IBuilderCollection + { + protected abstract TBuilder This { get; } + + /// + /// Clears all types in the collection. + /// + /// The builder. + public TBuilder Clear() + { + Configure(types => types.Clear()); + return This; + } + + /// + /// Adds a type to the collection. + /// + /// The type to add. + /// The builder. + public TBuilder Add() + where T : TItem + { + Configure(types => + { + var type = typeof(T); + if (types.Contains(type)) types.Remove(type); + types.Add(type); + }); + return This; + } + + /// + /// Adds a type to the collection. + /// + /// The type to add. + /// The builder. + public TBuilder Add(Type type) + { + Configure(types => + { + EnsureType(type, "register"); + if (types.Contains(type)) types.Remove(type); + types.Add(type); + }); + return This; + } + + /// + /// Adds types to the collections. + /// + /// The types to add. + /// The builder. + public TBuilder Add(IEnumerable types) + { + Configure(list => + { + foreach (var type in types) + { + // would be detected by CollectionBuilderBase when registering, anyways, but let's fail fast + EnsureType(type, "register"); + if (list.Contains(type)) list.Remove(type); + list.Add(type); + } + }); + return This; + } + + /// + /// Removes a type from the collection. + /// + /// The type to remove. + /// The builder. + public TBuilder Remove() + where T : TItem + { + Configure(types => + { + var type = typeof(T); + if (types.Contains(type)) types.Remove(type); + }); + return This; + } + + /// + /// Removes a type from the collection. + /// + /// The type to remove. + /// The builder. + public TBuilder Remove(Type type) + { + Configure(types => + { + EnsureType(type, "remove"); + if (types.Contains(type)) types.Remove(type); + }); + return This; + } + + /// + /// Replaces a type in the collection. + /// + /// The type to replace. + /// The type to insert. + /// The builder. + /// Throws if the type to replace does not already belong to the collection. + public TBuilder Replace() + where TReplaced : TItem + where T : TItem + { + Configure(types => + { + var typeReplaced = typeof(TReplaced); + var type = typeof(T); + if (typeReplaced == type) return; + + var index = types.IndexOf(typeReplaced); + if (index < 0) throw new InvalidOperationException(); + + if (types.Contains(type)) types.Remove(type); + index = types.IndexOf(typeReplaced); // in case removing type changed index + types.Insert(index, type); + types.Remove(typeReplaced); + }); + return This; + } + + /// + /// Replaces a type in the collection. + /// + /// The type to replace. + /// The type to insert. + /// The builder. + /// Throws if the type to replace does not already belong to the collection. + public TBuilder Replace(Type typeReplaced, Type type) + { + Configure(types => + { + EnsureType(typeReplaced, "find"); + EnsureType(type, "register"); + + if (typeReplaced == type) return; + + var index = types.IndexOf(typeReplaced); + if (index < 0) throw new InvalidOperationException(); + + if (types.Contains(type)) types.Remove(type); + index = types.IndexOf(typeReplaced); // in case removing type changed index + types.Insert(index, type); + types.Remove(typeReplaced); + }); + return This; + } + } +} diff --git a/src/Umbraco.Core/Mapping/IMapperProfile.cs b/src/Umbraco.Core/Mapping/IMapperProfile.cs index 90aedbe9fd..9d0c412c68 100644 --- a/src/Umbraco.Core/Mapping/IMapperProfile.cs +++ b/src/Umbraco.Core/Mapping/IMapperProfile.cs @@ -1,7 +1,13 @@ namespace Umbraco.Core.Mapping { + /// + /// Represents a mapper profile. + /// public interface IMapperProfile { - void SetMaps(Mapper mapper); + /// + /// Defines maps. + /// + void DefineMaps(Mapper mapper); } } diff --git a/src/Umbraco.Core/Mapping/Mapper.cs b/src/Umbraco.Core/Mapping/Mapper.cs index 438b6031f1..8fcfd2ca11 100644 --- a/src/Umbraco.Core/Mapping/Mapper.cs +++ b/src/Umbraco.Core/Mapping/Mapper.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Mapping public Mapper(MapperProfileCollection profiles) { foreach (var profile in profiles) - profile.SetMaps(this); + profile.DefineMaps(this); } #region Define diff --git a/src/Umbraco.Core/Mapping/MapperProfileCollectionBuilder.cs b/src/Umbraco.Core/Mapping/MapperProfileCollectionBuilder.cs index fc4cee8300..2bf7f5a5d8 100644 --- a/src/Umbraco.Core/Mapping/MapperProfileCollectionBuilder.cs +++ b/src/Umbraco.Core/Mapping/MapperProfileCollectionBuilder.cs @@ -2,7 +2,7 @@ namespace Umbraco.Core.Mapping { - public class MapperProfileCollectionBuilder : OrderedCollectionBuilderBase + public class MapperProfileCollectionBuilder : SetCollectionBuilderBase { protected override MapperProfileCollectionBuilder This => this; diff --git a/src/Umbraco.Core/Models/Identity/IdentityMapperProfile.cs b/src/Umbraco.Core/Models/Identity/IdentityMapperProfile.cs index dc4f6f313d..04937bf55a 100644 --- a/src/Umbraco.Core/Models/Identity/IdentityMapperProfile.cs +++ b/src/Umbraco.Core/Models/Identity/IdentityMapperProfile.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core.Models.Identity _globalSettings = globalSettings; } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define( (source, context) => diff --git a/src/Umbraco.Core/Runtime/CoreRuntime.cs b/src/Umbraco.Core/Runtime/CoreRuntime.cs index bc7b8afc3b..6a47d8a735 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntime.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Reflection; -using System.Threading; using System.Web; using Umbraco.Core.Cache; using Umbraco.Core.Composing; @@ -12,10 +9,8 @@ using Umbraco.Core.Exceptions; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Logging.Serilog; -using Umbraco.Core.Migrations.Upgrade; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Mappers; -using Umbraco.Core.Services.Implement; using Umbraco.Core.Sync; namespace Umbraco.Core.Runtime @@ -78,7 +73,6 @@ namespace Umbraco.Core.Runtime // application environment ConfigureUnhandledException(); - ConfigureAssemblyResolve(); ConfigureApplicationRootPath(); Boot(register, timer); @@ -211,23 +205,6 @@ namespace Umbraco.Core.Runtime }; } - protected virtual void ConfigureAssemblyResolve() - { - // When an assembly can't be resolved. In here we can do magic with the assembly name and try loading another. - // This is used for loading a signed assembly of AutoMapper (v. 3.1+) without having to recompile old code. - AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => - { - // here for reference - we don't use automapper anymore + see BindingRedirects ?? - /* - // ensure the assembly is indeed AutoMapper and that the PublicKeyToken is null before trying to Load again - // do NOT just replace this with 'return Assembly', as it will cause an infinite loop -> stack overflow - if (args.Name.StartsWith("AutoMapper") && args.Name.EndsWith("PublicKeyToken=null")) - return Assembly.Load(args.Name.Replace(", PublicKeyToken=null", ", PublicKeyToken=be96cd2c38ef1005")); - */ - return null; - }; - } - protected virtual void ConfigureApplicationRootPath() { var path = GetApplicationRootPath(); diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index c2839792bd..8f8e67a796 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -165,6 +165,7 @@ + diff --git a/src/Umbraco.Tests/Mapping/MappingTests.cs b/src/Umbraco.Tests/Mapping/MappingTests.cs index a3ee676316..ef19411537 100644 --- a/src/Umbraco.Tests/Mapping/MappingTests.cs +++ b/src/Umbraco.Tests/Mapping/MappingTests.cs @@ -105,7 +105,7 @@ namespace Umbraco.Tests.Mapping private class Profile1 : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new Thing2(), Map); } diff --git a/src/Umbraco.Web/Composing/CompositionExtensions/WebMappingProfiles.cs b/src/Umbraco.Web/Composing/CompositionExtensions/WebMappingProfiles.cs index d0c404a679..b90b7b4f6a 100644 --- a/src/Umbraco.Web/Composing/CompositionExtensions/WebMappingProfiles.cs +++ b/src/Umbraco.Web/Composing/CompositionExtensions/WebMappingProfiles.cs @@ -10,24 +10,24 @@ namespace Umbraco.Web.Composing.CompositionExtensions public static Composition ComposeWebMappingProfiles(this Composition composition) { composition.WithCollectionBuilder() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append(); + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add(); composition.Register(); diff --git a/src/Umbraco.Web/Models/Mapping/AuditMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/AuditMapperProfile.cs index e7756b4538..ac540b1bce 100644 --- a/src/Umbraco.Web/Models/Mapping/AuditMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/AuditMapperProfile.cs @@ -6,7 +6,7 @@ namespace Umbraco.Web.Models.Mapping { internal class AuditMapperProfile : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new AuditLog(), Map); } diff --git a/src/Umbraco.Web/Models/Mapping/CodeFileMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/CodeFileMapperProfile.cs index 735125d4b1..d26422fc90 100644 --- a/src/Umbraco.Web/Models/Mapping/CodeFileMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/CodeFileMapperProfile.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.Models.Mapping { public class CodeFileMapperProfile : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new EntityBasic(), Map); mapper.Define((source, context) => new CodeFileDisplay(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs index faa601cd41..8ee8bc9f4b 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentMapperProfile.cs @@ -53,7 +53,7 @@ namespace Umbraco.Web.Models.Mapping _contentVariantMapper = new ContentVariantMapper(_localizationService); } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new ContentPropertyCollectionDto(), Map); mapper.Define((source, context) => new ContentItemDisplay(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/ContentPropertyMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/ContentPropertyMapperProfile.cs index 9b4afada34..2a032fb47a 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentPropertyMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentPropertyMapperProfile.cs @@ -24,7 +24,7 @@ namespace Umbraco.Web.Models.Mapping _contentPropertyDisplayMapper = new ContentPropertyDisplayMapper(dataTypeService, textService, logger, propertyEditors); } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define>((source, context) => new Tab(), Map); mapper.Define((source, context) => new ContentPropertyBasic(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeMapperProfile.cs index 74bdd542a0..e0ca7aeaee 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeMapperProfile.cs @@ -37,7 +37,7 @@ namespace Umbraco.Web.Models.Mapping _logger = logger; } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new ContentType(source.ParentId), Map); mapper.Define((source, context) => new MediaType(source.ParentId), Map); diff --git a/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs index eebadf2830..6bf48f520e 100644 --- a/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs @@ -29,7 +29,7 @@ namespace Umbraco.Web.Models.Mapping Constants.DataTypes.DefaultMembersListView }; - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new PropertyEditorBasic(), Map); mapper.Define((source, context) => new DataTypeConfigurationFieldDisplay(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/DictionaryMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/DictionaryMapperProfile.cs index 39c302ba0d..ed520da513 100644 --- a/src/Umbraco.Web/Models/Mapping/DictionaryMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/DictionaryMapperProfile.cs @@ -22,7 +22,7 @@ namespace Umbraco.Web.Models.Mapping _localizationService = localizationService; } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new EntityBasic(), Map); mapper.Define((source, context) => new DictionaryDisplay(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs index 7ff923c427..0d75f76a9d 100644 --- a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs @@ -15,7 +15,7 @@ namespace Umbraco.Web.Models.Mapping { internal class EntityMapperProfile : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new EntityBasic(), Map); mapper.Define((source, context) => new EntityBasic(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/LanguageMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/LanguageMapperProfile.cs index 648fe000e3..f9de5ab0f9 100644 --- a/src/Umbraco.Web/Models/Mapping/LanguageMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/LanguageMapperProfile.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.Models.Mapping { internal class LanguageMapperProfile : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new EntityBasic(), Map); mapper.Define((source, context) => new Language(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs index 8100b2fc95..9d2b59b2f1 100644 --- a/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/MacroMapperProfile.cs @@ -20,7 +20,7 @@ namespace Umbraco.Web.Models.Mapping _logger = logger; } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new EntityBasic(), Map); mapper.Define>((source, context) => source.Properties.Values.Select(context.Mapper.Map).ToList()); diff --git a/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs index aa2405779d..80f8a3b61e 100644 --- a/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs @@ -32,7 +32,7 @@ namespace Umbraco.Web.Models.Mapping _tabsAndPropertiesMapper = new TabsAndPropertiesMapper(localizedTextService); } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new ContentPropertyCollectionDto(), Map); mapper.Define((source, context) => new MediaItemDisplay(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs index 08c7a53bd0..4414480b37 100644 --- a/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs @@ -30,7 +30,7 @@ namespace Umbraco.Web.Models.Mapping _tabsAndPropertiesMapper = new TabsAndPropertiesMapper(localizedTextService); } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new MemberDisplay(), Map); mapper.Define((source, context) => MemberService.CreateGenericMembershipProviderMember(source.UserName, source.Email, source.UserName, ""), Map); diff --git a/src/Umbraco.Web/Models/Mapping/RedirectUrlMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/RedirectUrlMapperProfile.cs index f9b971785b..d4ff6b04d6 100644 --- a/src/Umbraco.Web/Models/Mapping/RedirectUrlMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/RedirectUrlMapperProfile.cs @@ -15,7 +15,7 @@ namespace Umbraco.Web.Models.Mapping private UmbracoContext UmbracoContext => _umbracoContextAccessor.UmbracoContext; - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new ContentRedirectUrl(), Map); } diff --git a/src/Umbraco.Web/Models/Mapping/RelationMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/RelationMapperProfile.cs index 56e41e5a07..a56a3ca0a9 100644 --- a/src/Umbraco.Web/Models/Mapping/RelationMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/RelationMapperProfile.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.Models.Mapping { internal class RelationMapperProfile : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new RelationTypeDisplay(), Map); mapper.Define((source, context) => new RelationDisplay(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/SectionMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/SectionMapperProfile.cs index 2dc61fabe5..e24c0133a8 100644 --- a/src/Umbraco.Web/Models/Mapping/SectionMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/SectionMapperProfile.cs @@ -15,7 +15,7 @@ namespace Umbraco.Web.Models.Mapping _textService = textService; } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new Section(), Map); diff --git a/src/Umbraco.Web/Models/Mapping/TagMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/TagMapperProfile.cs index 4424113698..e10d7733b9 100644 --- a/src/Umbraco.Web/Models/Mapping/TagMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/TagMapperProfile.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.Models.Mapping { internal class TagMapperProfile : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new TagModel(), Map); } diff --git a/src/Umbraco.Web/Models/Mapping/TemplateMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/TemplateMapperProfile.cs index 246660b46b..a95a979187 100644 --- a/src/Umbraco.Web/Models/Mapping/TemplateMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/TemplateMapperProfile.cs @@ -6,7 +6,7 @@ namespace Umbraco.Web.Models.Mapping { internal class TemplateMapperProfile : IMapperProfile { - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new TemplateDisplay(), Map); mapper.Define((source, context) => new Template(source.Name, source.Alias), Map); diff --git a/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs index 83b186fac9..8771b57de7 100644 --- a/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs @@ -38,7 +38,7 @@ namespace Umbraco.Web.Models.Mapping _globalSettings = globalSettings; } - public void SetMaps(Mapper mapper) + public void DefineMaps(Mapper mapper) { mapper.Define((source, context) => new UserGroup { CreateDate = DateTime.UtcNow }, Map); mapper.Define(Map);