Pessoal,
Desenvolvi as seguintes classes em minha aplicação:
Item.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
namespace api.Models.PackgeProduto
{
public class Item
{
public Int32 Id { get; set; }
public String descricao { get; set; }
}
}
MateriaPrima.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
namespace api.Models.PackgeProduto
{
public class MateriaPrima : Item
{
public Double valorEnergetico { get; set; }
public Double valorDiario { get; set; }
public Boolean causaAlergia { get; set; }
}
}
Produto.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
namespace api.Models.PackgeProduto
{
public class Produto : Item
{
public Double valorVenda { get; set; }
public String preparo { get; set; }
public String conservacao { get; set; }
}
}
ProdutoFormula.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace api.Models.PackgeProduto
{
public class ProdutoFormula
{
public int Id { get; set; }
public Produto produto { get; set; }
public List<MateriaPrima> ingredientes { get; set; }
}
}
Ao tentar usar o add-migration para as classes acima nada é gerado. Alguém saberia me dizer o por que disso?
Todas as outras entidades mapeadas são criadas normalmente, menos essas acima.