public async Task <MethodReturnResult <BaseAttribute> > GetAsync(BaseAttributeKey key) { return(await Task.Run <MethodReturnResult <BaseAttribute> >(() => { return base.Channel.Get(key); })); }
public async Task <MethodReturnResult> DeleteAsync(BaseAttributeKey key) { return(await Task.Run <MethodReturnResult>(() => { return base.Channel.Delete(key); })); }
/// <summary> /// 删除基础属性。 /// </summary> /// <param name="key">基础属性标识符。</param> /// <returns><see cref="MethodReturnResult" />.</returns> public MethodReturnResult Delete(BaseAttributeKey key) { MethodReturnResult result = new MethodReturnResult(); if (!this.BaseAttributeDataEngine.IsExists(key)) { result.Code = 1002; result.Message = String.Format(StringResource.BaseAttributeService_IsNotExists, key); return result; } try { this.BaseAttributeDataEngine.Delete(key); } catch (Exception ex) { result.Code = 1000; result.Message = String.Format(StringResource.BaseAttributeService_OtherError, ex.Message); } return result; }
public async Task <ActionResult> Delete(string categoryName, string attributeName) { MethodReturnResult result = new MethodReturnResult(); using (BaseAttributeServiceClient client = new BaseAttributeServiceClient()) { var key = new BaseAttributeKey() { CategoryName = categoryName, AttributeName = attributeName }; result = await client.DeleteAsync(key); if (result.Code == 0) { result.Message = string.Format(StringResource.BaseAttribute_Delete_Success , key); } return(Json(result)); } }
/// <summary> /// 获取基础数据数据。 /// </summary> /// <param name="key">基础数据标识符。</param> /// <returns><see cref="MethodReturnResult<BaseAttribute>" />,基础数据数据.</returns> public MethodReturnResult <BaseAttribute> Get(BaseAttributeKey key) { return(base.Channel.Get(key)); }
/// <summary> /// 删除基础数据。 /// </summary> /// <param name="key">基础数据标识符。</param> /// <returns><see cref="MethodReturnResult" />.</returns> public MethodReturnResult Delete(BaseAttributeKey key) { return(base.Channel.Delete(key)); }