Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Jul 09, 2019 @ 12:08
    Ismail Mayat
    0

    automapper configs in v8

    So in v7 you could do:

    using AutoMapper;
    
    using global::Umbraco.Core;
    using global::Umbraco.Core.Models.Mapping;
    using global::Umbraco.Core.Models.Membership;
    
    using Our.Umbraco.RedirectsViewer.Models;
    
    /// <summary>
    /// The usergroup mapping.
    /// </summary>
    internal class UsergroupMapping : MapperConfiguration
    {
        /// <summary>
        /// Configures the user group mappings
        /// </summary>
        /// <param name="config">
        /// The config.
        /// </param>
        /// <param name="applicationContext">
        /// The application context.
        /// </param>
        public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
        {
    

    what do u have todo in v8 to add mappings?Current i get error on :

    MapperConfiguration

    It cannot inherit from it because it cannot find it. Has it moved? Do you namespaces need updating?

    Regards

    Ismail

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Jul 09, 2019 @ 12:12
  • Warren Buckley 2089 posts 4578 karma points MVP ∞ admin hq c-trib
    Jul 09, 2019 @ 12:12
    Warren Buckley
    0

    Hi Ismail,
    Umbraco V8 no longer ships with AutoMapper out of the box, if you want to add that you still can but you need to add it yourself

    Alternatively you can use our mapper instead if you prefer

    https://our.umbraco.com/documentation/Reference/Mapping/?_ga=2.98174495.1403028710.1562569887-381923933.1557318288/

    https://umbraco.com/blog/umbraco-81-release/#changes

    Warren

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies