public abstract class BaseEntity<TId>
{
public BaseEntity(TId id)
{
Id = id;
}
public TId Id { get; set; }
}
public abstract class PeopleBaseEntity : BaseEntity<string>
{
public PeopleBaseEntity():base(string.Empty)
{
}
public string? Name { get; set; }
public string? Gender { get; set; }
}
[Table("people_mans")]
public class Man : PeopleBaseEntity
{
public int Age { get; set; }
}
var connection = new MySqlConnection(connectionstring);
var people = connection.Select<Man>(x=> x.Name == "Manohar");
Console.WriteLine(JsonSerializer.Serialize(people));
Genrated SQL : select * from people_mans where (PeopleBaseEntities.Name = @p1)
Genrated SQL : select * from
people_manswhere (PeopleBaseEntities.Name= @p1)