Closed DiegoHSeto closed 4 years ago
I'm moving this issue to Dapper.FluentMap.
Also, do you have a reproducible code sample for this?
Do we have a fix on this? I'm facing the same issue.
My base class
public class EntityBase
{
public int Id { get; set; }
public bool Status { get; set; }
}
My entity
public class Avaliacao : EntityBase
{
public string Designacao { get; set; }
}
Mapping:
public class AvaliacaoMap : DommelEntityMap<Avaliacao>
{
public AvaliacaoMap()
{
ToTable("T_AQV_AVALIACAO");
Map(a => a.Id).ToColumn("PK_AVL").IsKey().IsIdentity();
Map(a => a.Designacao).ToColumn("DESIG_AVL");
Map(a => a.Status).ToColumn("STATUS_AVL");
}
}
FluentMap setup:
FluentMapper.Initialize(config =>
{
config.AddMap(new AvaliacaoMap());
config.AddMap(new CondicaoAcessoMap());
config.AddMap(new CondicaoReproducaoMap());
config.AddMap(new DepositoMap());
config.ForDommel();
});
The query:
var result = await Connection
.SelectAsync<Avaliacao>(a=> a.Designacao.Contains(designacao) && a.Status == status);
The error:
System.Data.SqlClient.SqlException (0x80131904): Nome de coluna 'Status' inválido.
(invalid Status column)
I'm working with inheritance, but, when i map properties of a base class, i'm getting the error: "Invalid column name".
I'm using the forDommel() line code too.