querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

TableAttribute introduction

Open fairking opened this issue 3 years ago • 1 comments

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.

fairking avatar May 03 '21 15:05 fairking

I am doing something interesting: https://gitlab.com/fairking/sqlkata.queryman/-/tree/master

fairking avatar Mar 20 '22 22:03 fairking