1

I'm using ASP.NET Boilerplate (.NET Core v3).

The problem is Create function returns "500 Internal Server Error", though Get and GetAll are working without any problems.

Error on sSwagger

Below id AppService class Code

using System;
using System.Collections.Generic;
using System.Text;
using BoilerplateTemplate.Entities;
using Abp.Domain.Repositories;
using BoilerplateTemplate.Authorization;
using Abp.Authorization;

namespace BoilerplateTemplate.Products
{
    [AbpAuthorize(PermissionNames.Pages_Products)]
    public class ProductsAppService : AsyncCrudAppService<Product, ProductDto, int, PagedAndSortedResultRequestDto, ProductDto>
    {
        public ProductsAppService(IRepository<Product, int> repository) : base(repository)
        {
        }
    }
}

Below is The Dto Code

using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using BoilerplateTemplate.Entities;
using System;
using System.Collections.Generic;
using System.Text;

namespace BoilerplateTemplate.Products.DTOs
{
    [AutoMapFrom(typeof(Product))]
    public class ProductDto:EntityDto<int>
    {
        public string Name { get; set; }
        public int Quantity { get; set; }
    }
}

Below is entity code

using Abp.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Text;

namespace BoilerplateTemplate.Entities
{
    public class Product : Entity<int>
    {
        public string Name { get; set; }
        public int Quantity { get; set; }
    }
}

What I found in Logs.txt file is related to Mapping:

Mapping types: ProductDto -> Product BoilerplateTemplate.Products.DTOs.ProductDto -> BoilerplateTemplate.Entities.Product AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

burg.developer
  • 378
  • 1
  • 12

0 Answers0