I wanted to implement the many-to-many solution described in the Custom Auto Forms section.
However, I’m already stuck in the service section.
The example DeleteAsync method is in OrmLiteWriteExpressionsApiAsync, but I can’t find it.
mythz
October 11, 2024, 1:58am
2
I don’t understand the question, the DeleteAsync APIs exist as extension methods as normal:
{
return dbConn.Exec(dbCmd => dbCmd.InsertOnlyAsync(insertFields, token));
}
/// <summary>
/// Delete the rows that matches the where expression, e.g:
///
/// db.DeleteAsync<Person>(p => p.Age == 27);
/// DELETE FROM "Person" WHERE ("Age" = 27)
/// </summary>
public static Task<int> DeleteAsync<T>(this IDbConnection dbConn, Expression<Func<T, bool>> where,
Action<IDbCommand> commandFilter = null, CancellationToken token = default)
{
return dbConn.Exec(dbCmd => dbCmd.DeleteAsync(where, commandFilter, token));
}
/// <summary>
/// Delete the rows that matches the where expression, e.g:
///
/// var q = db.From>Person<());
/// db.DeleteAsync<Person>(q.Where(p => p.Age == 27));
Please be more specific on what the actual issue is, i.e. what code doesn’t compile?
Got the error, sorry, I was an amateur.