WEB API v.1.06
THIS API return an ERROR message ...
GET
https://....../api-backend/SpecificationAttributeOption/GetSpecificationAttributeOptionsBySpecificationAttribute/1
{
"message": "Missing type map configuration or unsupported mapping.\r\n\r\nMapping types:\r\nObject -> CategoryDto\r\nSystem.Object -> Nop.Plugin.Misc.WebApi.Backend.Dto.Catalog.CategoryDto",
"inner_exception_message": null,
"stack_trace": "AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.\r\n\r\nMapping types:\r\nObject -> CategoryDto\r\nSystem.Object -> Nop.Plugin.Misc.WebApi.Backend.Dto.Catalog.CategoryDto\r\n at lambda_method151467(Closure , Object , CategoryDto , ResolutionContext )\r\n at Nop.Plugin.Misc.WebApi.Framework.Infrastructure.Mapper.Extensions.MappingExtensions.Map[TDestination](Object source)\r\n at Nop.Plugin.Misc.WebApi.Framework.Infrastructure.Mapper.Extensions.MappingExtensions.ToDto[TBaseJsonDto](Object entity)\r\n at Nop.Plugin.Misc.WebApi.Backend.Controllers.Catalog.SpecificationAttributeOptionController.<>c.<GetSpecificationAttributeOptionsBySpecificationAttribute>b__4_0(SpecificationAttributeOption c)\r\n at System.Linq.Enumerable.SelectListIterator`2.MoveNext()\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)\r\n at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)\r\n at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\r\n at Nop.Plugin.Misc.WebApi.Framework.Middleware.JwtMiddleware.InvokeAsync(HttpContext context, IWorkContext workContext, ICustomerService customerService)\r\n at Nop.Plugin.Misc.WebApi.Framework.Middleware.ErrorHandlerMiddleware.InvokeAsync(HttpContext context)"
}
API of SpecificationAttribute return this:
https://...../api-backend/SpecificationAttribute/GetAll?pageIndex=0&pageSize=2147483647
{
"total_count": 6,
"total_pages": 1,
"has_previous_page": false,
"has_next_page": false,
"items": [
{
"name": "MOD-SCALA-MG",
"display_order": 1,
"specification_attribute_group_id": 1,
"id": 6
},
{
"name": "MOD-CATEGORIA-MG",
"display_order": 2,
"specification_attribute_group_id": 1,
"id": 7
},
{
"name": "MOD-PRODUTTORE-MG",
"display_order": 3,
"specification_attribute_group_id": 1,
"id": 1
},
{
"name": "GIO-SOTTOFAMIGLIA - MG",
"display_order": 4,
"specification_attribute_group_id": 1,
"id": 10
},
{
"name": "GIO-GRUPPO - MG",
"display_order": 5,
"specification_attribute_group_id": 1,
"id": 11
},
{
"name": "GIO-FAMIGLIA-MG",
"display_order": 6,
"specification_attribute_group_id": 1,
"id": 12
}
],
"page_index": 0,
"page_size": 2147483647
}
All 6 specification attributes have specattributeoption values.
Example for specificationattributeid = 1
SELECT [Id]
, [Name]
, [ColorSquaresRgb]
, [SpecificationAttributeId]
, [DisplayOrder]
FROM [SpecificationAttributeOption]
WHERE SpecificationAttributeId = 1
155 rows ...
Id Name ColorSquaresRgb SpecificationAttributeId DisplayOrder
1623 Abrex NULL 1 225
1624 Academy NULL 1 191
1625 Aedes Ars NULL 1 217
1626 Airfix NULL 1 30
1627 Amalgam NULL 1 16
1628 Anson NULL 1 27
1629 Apex Replicas NULL 1 185
1630 Art Model NULL 1 11
......
What could be the problem ? Thanks