I have recently started diving into the new .net core along with asp.net core mvc. There have been several issues that I have come across but have been able to get most of them answered on my own. The one that has really stumped me is the use of NPoco.
How are you supposed to create the database instance?
The documentation reads:
IDatabase db = new Database("connStringName");
List<User> users = db.Fetch<User>("select userId, email from users");
This is not correct for DNXCORE50 as this constructor has been excluded for DNCORE50
I have also attempted this:
IDatabase _db = new Database(new SqlConnection(ConnStr));
_db.Single<string>("SELECT Username FROM dbo.Member");
When this code is ran I get a 'NullReferenceException'
Does anyone know how to get NPoco working properly?