示例#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);
        }
示例#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));
 }
示例#3
0
 public async Task <Cart> GetCartByProductWithCustomerAsync(int productId, string customer)
 {
     return(await _baseDal.GetAsync(x => x.ProductId == productId && x.Customer == customer));
 }
示例#4
0
 public async Task <bool> OrderDetailExistsAsync(int OrderId, int OrderDetailId)
 {
     return(await _baseDal.GetAsync(x => x.Id == OrderDetailId && x.OrderId == OrderId) != null);
 }
示例#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);
        }
示例#6
0
 public async Task <bool> CommentExistsAsync(int id)
 {
     return(await _baseDal.GetAsync(x => x.Id == id) == null ? false : true);
 }