Exemple #1
0
        /// <summary>
        /// 删除默认属性值
        /// </summary>
        /// <param name="id"></param>
        public virtual async Task DeletePredefinedValueAsync(long id)
        {
            var attribute = await PredefinedProductAttributeValueRepository.FirstOrDefaultAsync(id);

            if (attribute != null)
            {
                await PredefinedProductAttributeValueRepository.DeleteAsync(attribute);
            }
        }
Exemple #2
0
        /// <summary>
        /// 根据id获取默认属性值
        /// </summary>
        /// <param name="id"></param>
        /// <param name="includeDeleted"></param>
        /// <returns></returns>
        public virtual async Task <PredefinedProductAttributeValue> GetPredefinedValueByIdAsync(long id, bool includeDeleted = false)
        {
            if (!includeDeleted)
            {
                return(await PredefinedProductAttributeValueRepository.GetAsync(id));
            }

            using (UnitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete))
            {
                return(await PredefinedProductAttributeValueRepository.GetAsync(id));
            }
        }
Exemple #3
0
 /// <summary>
 /// 删除默认属性值
 /// </summary>
 /// <param name="attribute"></param>
 public virtual async Task DeletePredefinedValueAsync(PredefinedProductAttributeValue attribute)
 {
     await PredefinedProductAttributeValueRepository.DeleteAsync(attribute);
 }
Exemple #4
0
 /// <summary>
 /// 添加默认属性值
 /// </summary>
 /// <param name="attribute"></param>
 public virtual async Task CreatePredefinedValueAsync(PredefinedProductAttributeValue attribute)
 {
     await PredefinedProductAttributeValueRepository.InsertAsync(attribute);
 }
Exemple #5
0
 /// <summary>
 /// 根据属性id和名称获取默认属性值
 /// </summary>
 /// <param name="attributeId"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 public virtual async Task <PredefinedProductAttributeValue> FindPredefinedValueByNameAsync(long attributeId, string name)
 {
     return(await PredefinedProductAttributeValueRepository.FirstOrDefaultAsync(a => a.ProductAttributeId == attributeId && a.Name == name));
 }
Exemple #6
0
 /// <summary>
 /// 根据id查找默认属性值
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public virtual async Task <PredefinedProductAttributeValue> FindPredefinedValueByIdAsync(long id)
 {
     return(await PredefinedProductAttributeValueRepository.FirstOrDefaultAsync(id));
 }
Exemple #7
0
 /// <summary>
 /// 根据名称查找默认属性值
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public virtual async Task <PredefinedProductAttributeValue> FindPredefinedValueByNameAsync(string name)
 {
     return(await PredefinedProductAttributeValueRepository.FirstOrDefaultAsync(x => x.Name == name));
 }