我正在尝试从模型上的属性进行迁移,并返回以下消息:
The property 'DadosRequisicao.CnpjFornecedor' could not be mapped because it is of type 'List<string>', which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace PortalDeCotacao.Models
{
public class DadosRequisicao
{
[Key]
[Required]
public int Id { get; set; }
public string DataLimiteCot { get; set; }
public string ObservacoesReq { get; set; }
public List<string> CnpjFornecedor { get; set; } = new List<string>();
public List<int> CodProduto { get; set; } = new List<int>();
}
}
我不明白问题出在哪里。要迁移属性,我应该更改什么?