Search code examples
xamarin.formssqlite-net-pcl

SQLiteAsyncConnection -> CreateTablesAsync<T>() requires two type arguments


OS/X Mac Xamarin Forms Visual Studio Pro 2017

I'm trying to follow the wonderful course by Mosh Hamedani on Xamarin forms. I try to write the same code from lecture 89:

var connection = DependencyService.Get<ISQLiteDb>().GetConnection();
connection.CreateTablesAsync<Recipe>();

But... I get the error:

Using the generic method ... CreateTablesAsync < t1 , t2 > () requires 2 type arguments

But even the Xamarin documentation doesn't say that! It only shows one type argument of the table class type that you want the table to be created as.

How do I solve this?


Solution

  • CreateTablesAsync<T1,T2> requires 2 type arguments.

    CreateTableAsync<T1> only requires 1 type argument.

    You likely have a typo - remove the "s"