我在 Entity Framework 6通用存储库上有以下方法:
public void Add<T>(T entity) where T : class {
_context.Set<T>().Add(entity);
} // Add
public void Add<T>(Expression<Func<T, Boolean>> criteria) where T : class {
_context.Set<T>().AddRange(_context.Set<T>().Where(criteria));
} // Add
public IQueryable<T> Find<T>(Expression<Func<T, Boolean>> criteria) where T : class {
return _context.Set<T>().Where(criteria);
} // Find
如何使这些方法异步?
谢谢你,米格尔