I'm using Dapper and Dapper.Contrib to map objects from database.
I have a class name where I define table name for this class because it is different from the actual class name.
Class:
[Table("tblUser")]
public class User
{
public int Id { get; set; }
public string Title { get; set; }
}
How can I get the table name which is set Table data annotation attribute?
EDIT:
I've used following to get it working
var tAttribute =
(TableAttribute)typeof(T).GetCustomAttributes(typeof(TableAttribute), true)[0];
tableName = tAttribute.Name;