querybuilder
querybuilder copied to clipboard
TableAttribute introduction
Would be nice to introduce TableAttribute
.
Usage:
[Table("core_users")]
public class User
{
[Key]
public int Id { get; set; }
public string UserName { get; set; } // Default column name based on property name converted to snake_case
[Column("email_address")]
public string Email { get; set; }
[Ignore]
public UserRole Role => UserRole.Guest; // Ignored by SQLKata
}
...
_db.Query<User>().Insert(new User() { UserName = "user1", Email = "[email protected]" }); // See Query<User>()
Many thanks.
I am doing something interesting: https://gitlab.com/fairking/sqlkata.queryman/-/tree/master