Missing type map configuration or unsupported mapping.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Core.Seller
public int CustomerId { get; set; }
        public string Name { get; set; }
        public string Username { get; set; }
        public string Email { get; set; }
        public string Gender { get; set; }
        public int CountryId { get; set; }
        public int StateId { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; }

        public virtual Customer customer { get; set; }
        public virtual Country country { get; set; }
        public virtual StateProvince state { get; set; }

Admin.SellerModel

public SellerModel()
        {
            this.customer = new Customer();
            this.AvailableCountries = new List<SelectListItem>();
            this.AvailableStates = new List<SelectListItem>();
        }

        [Required(ErrorMessage = "Required")]
        [NopResourceDisplayName("Admin.Seller.Name")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Required")]
        [NopResourceDisplayName("Admin.Seller.Username")]
        public string Username { get; set; }

        [Required(ErrorMessage = "Required")]
        [EmailAddress(ErrorMessage = "Invalid Email Address")]
        [NopResourceDisplayName("Admin.Seller.Email")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Required")]
        [NopResourceDisplayName("Admin.Seller.Gender")]
        public string Gender { get; set; }

        [NopResourceDisplayName("Admin.Seller.Customer")]
        public int CustomerId { get; set; }
        public virtual Customer customer { get; set; }

        //[Required(ErrorMessage = "Required")]
        [NopResourceDisplayName("Admin.Seller.Country")]
        public int CountryId { get; set; }
        public IList<SelectListItem> AvailableCountries { get; set; }

        //[Required(ErrorMessage="Required")]
        [NopResourceDisplayName("Admin.Seller.State")]
        public int StateId { get; set; }
        public IList<SelectListItem> AvailableStates { get; set; }

        [NopResourceDisplayName("Admin.Seller.CreatedOn")]
        public DateTime CreatedOn { get; set; }

        [NopResourceDisplayName("Admin.Seller.ModifiedOn")]
        public DateTime ModifiedOn { get; set; }


I am trying to add a new Seller in database from admin panel, From user side it is working file but when i try to add seller it shows below error in Mapping.please anyone can tell me what had gone wrong..??


Missing type map configuration or unsupported mapping.

Mapping types:
SellerModel -> Sellers
Nop.Admin.Models.Seller.SellerModel -> Nop.Core.Domain.Seller.Sellers

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

Mapping types:
SellerModel -> Sellers
Nop.Admin.Models.Seller.SellerModel -> Nop.Core.Domain.Seller.Sellers
6 years ago
I believe you need to add a class that maps your entity to the db using EF's EntityTypeConfiguration<T> class.
There's a very good, in-depth series of videos outlining how to develop a nopCommerce plugin with data-access.
On the first video here: https://www.youtube.com/watch?v=vBLDx3uns1k about ~16 minutes in the author shows you how to make such a class. Though in your case, since you are writing this to nop's core solution you should add this Map class to ~\Libraries\Nop.Data\Mapping\(Your table/entity name)\ and call it something like "SellerMap.cs" and you have to make sure you have manually added your new table/entity to the database.

Also, on the official nopCommerce documentation, there's a tutorial for adding a new column to an already existing nopCommerce table here: http://docs.nopcommerce.com/pages/viewpage.action?pageId=1442499 which outlines a lot of similar steps for what you are trying to do.

Hope this helps!
6 years ago
nvasquez6560 thank you for help but the existing models are able to map when i try to display list of all sellers at admin side this error occurs only when i try to add a new record in Seller's table even i am also able to update a particular seller's record in database. By the way i solved this error by calling the Core.Seller class in controller and manually mapping each property with its value. But i want to know what the thing is missing ..?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.