I have created a database using Postgres SQL and I want to interact with this database using the Npgsql ADO.Net provider library. All of my Postgres tables and columns have lowercase naming, but, I want my C# POCOS to have uppercase naming.
For instance, in Postgres my user table is named "users" (plural) and it has a user_name column. In C#, I want to map that table and column to a class called User (singular) with a property called UserName.
All of the examples I see for using data annotations to accomplish this are using an ORM like EF, but I don't want to use an ORM, just raw Npgsql. Will data annotations work if I'm just using Npgsql (raw) without an ORM? For instance:
[Table("users")]
class User
{
[Column("user_name")]
[Required]
public string UserName { get; set; }
}