public async Task <bool> ProductExistsAsync(int id) { var productInDb = await _baseDal.GetAsync(x => x.IsDelete == true && x.Id == id); return(productInDb == null ? false : true); }
/// <summary> /// 获取Model-Key为int类型 /// </summary> /// <param name="id"></param> /// <param name="transaction"></param> /// <param name="commandTimeout"></param> /// <returns></returns> public async Task <T> GetAsync(int id, IDbTransaction transaction = null, int?commandTimeout = null) { return(await modelDal.GetAsync(id, transaction, commandTimeout)); }
public async Task <Cart> GetCartByProductWithCustomerAsync(int productId, string customer) { return(await _baseDal.GetAsync(x => x.ProductId == productId && x.Customer == customer)); }
public async Task <bool> OrderDetailExistsAsync(int OrderId, int OrderDetailId) { return(await _baseDal.GetAsync(x => x.Id == OrderDetailId && x.OrderId == OrderId) != null); }
public async Task <bool> CategoryExistsAsync(int id) { var category = await _baseDal.GetAsync(x => x.IsDelete == true && x.Id == id); return(category == null ? false : true); }
public async Task <bool> CommentExistsAsync(int id) { return(await _baseDal.GetAsync(x => x.Id == id) == null ? false : true); }