예제 #1
0
        public async Task <string> GetCurrentLabel(OptionSetValueItem item)
        {
            //通过使用StringLanguageTranslate来获取基于当前上下文语言的标签
            //多语言键为选项集名称+"."+选项集项的值
            var result = StringLanguageTranslate.Translate($"{ item.OptionSetValue.Name}.{item.Value.ToString()}", item.DefaultLabel);

            return(await Task.FromResult(result));
        }
예제 #2
0
 /// <summary>
 /// 为选项集修改项
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public async Task UpdateItem(OptionSetValueItem item)
 {
     await _imp.UpdateItem(this, item);
 }
예제 #3
0
 public async Task UpdateItem(OptionSetValueMetadata metadata, OptionSetValueItem item)
 {
     item.OptionSetValue = metadata;
     await _optionSetValueItemStore.Update(item);
 }
예제 #4
0
 /// <summary>
 /// 为选项集增加项
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public async Task AddItem(OptionSetValueItem item)
 {
     await _imp.AddItem(this, item);
 }