landmarkhw / Dapper.GraphQL

A .NET Core library designed to integrate the Dapper and graphql-dotnet projects with ease-of-use in mind and performance as the primary concern.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for pluralized table names

benmccallum opened this issue · comments

Could we support pluralized table names for all the generic methods like Insert<T>? I see it just defaults to a table with a name the same as type T. I prefer using Users as my table names instead of User.

We could use an attribute on the T classes, like TableName("Users") that is checked before the default is used. What do you think? Or go down a fluent-style declaration in Startup.cs with some extension methods. Or support both even.

I prefer fluent style, because it doesn't require you to have control over the source. In some projects, models are out of your control.

ALmost finished a PR for this. Will submit it when I'm back again haha.