public virtual async Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input) { var data = await DataRepository.GetAsync(id); var dataItem = data.FindItem(name); if (dataItem == null) { throw new UserFriendlyException(L["DataItemNotFound", name]); } if (!string.Equals(dataItem.DefaultValue, input.DefaultValue, StringComparison.InvariantCultureIgnoreCase)) { dataItem.DefaultValue = input.DefaultValue; } if (!string.Equals(dataItem.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) { dataItem.DisplayName = input.DisplayName; } if (!string.Equals(dataItem.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) { dataItem.Description = input.Description; } dataItem.AllowBeNull = input.AllowBeNull; await DataRepository.UpdateAsync(data); await CurrentUnitOfWork.SaveChangesAsync(); }
public virtual async Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input) { await DataAppService.UpdateItemAsync(id, name, input); }