I am trying to create an Account table in my application using SQLite, but the application hangs during the CreateTableAsync
call without throwing an error.
LocalDataContext.Instance.CreateTablesAsync(typeof(Account)).Wait();
var account = LocalDataContext.Instance.GetFirstOrDefaultAsync<Account>().Result;
So, the application goes into the first call and never reaches the second line.
Here is the code for the CreateTablesAsync
method:
/// <summary>
/// Creates the local database tables.
/// </summary>
public async Task CreateTablesAsync(params Type[] tableTypes)
{
await _connection.CreateTablesAsync(tableTypes);
}
The last line in the output when this hangs is Found as 'sqlite3_column_int'.
And here is the Account
model:
public class Account
{
/// <summary>
/// Primary key for record.
/// </summary>
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
/// <summary>
/// Gets or sets the Client ID.
/// </summary>
public string ClientId { get; set; }
/// <summary>
/// Gets or sets the User ID.
/// </summary>
public string UserId { get; set; }
/// <summary>
/// Gets or sets the user password.
/// </summary>
public int Password { get; set; }
}
Anybody know why this may be happening?