public class TableAttribute : Attribute
public TableAttribute(string mytablename)
MyTableName = mytablename;
public string MyTableName { get; set; }
[Table("CADASTRO_CLIENTE")]
public static string GetTableName()
TableAttribute myAttribute = (TableAttribute)Attribute.GetCustomAttribute(typeof(Cliente), typeof(TableAttribute));
return myAttribute == null ? string.Empty: myAttribute.MyTableName;
public static void Main()
Console.WriteLine(Cliente.GetTableName());