public static async Task <TEntity> FirstOrDefaultAsync <TEntity>(this IBucket bucket, Expression <Func <TEntity, bool> > expression, bool throwIfFailed = true) where TEntity : class, IBaseEntity { var result = await bucket.QuerySlimAsync(expression, throwIfFailed); return(result.FirstOrDefault()); }