public static async Task <TModel> FindAsync(Expression <Func <TModel, bool> > predicate, bool withTrashed = false, params object[] args) { using (var _helper = new SqlWhereHelper <TModel>().VisitWhereCondition(predicate, args)) { return(await FindAsync(_helper.Sql, withTrashed, _helper.Parameters)); } }
private void RefreshEntity(Expression <Func <TModel, bool> > predicate, params object[] args) { if (predicate != null) { using (var _helper = new SqlWhereHelper <TModel>().VisitWhereCondition(predicate, args)) { RefreshEntity(_helper.Sql, _helper.Parameters); } } else { RefreshEntity("", args); } }
public static IEnumerable <TModel> QueryAll(Expression <Func <TModel, bool> > predicate, bool withTrashed = false, params object[] args) { if (predicate != null) { using (var _helper = new SqlWhereHelper <TModel>().VisitWhereCondition(predicate, args)) { return(QueryAll(_helper.Sql, withTrashed, _helper.Parameters)); } } else { return(QueryAll("", withTrashed, args)); } }