Beispiel #1
0
        public async Task <bool> ProductExistsAsync(int id)
        {
            var productInDb = await _baseDal.GetAsync(x => x.IsDelete == true && x.Id == id);

            return(productInDb == null ? false : true);
        }
Beispiel #2
0
 /// <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));
 }
Beispiel #3
0
 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);
 }
Beispiel #5
0
        public async Task <bool> CategoryExistsAsync(int id)
        {
            var category = await _baseDal.GetAsync(x => x.IsDelete == true && x.Id == id);

            return(category == null ? false : true);
        }
Beispiel #6
0
 public async Task <bool> CommentExistsAsync(int id)
 {
     return(await _baseDal.GetAsync(x => x.Id == id) == null ? false : true);
 }