mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-06 05:59:45 +08:00
!797 fix(#I2AGWM): throw exception when not register DataService and no OnAddAsync callback
* fix: 修复未开启 UseInjectDataService 未设置 OnAddAsync 时报错
This commit is contained in:
parent
42345e6b43
commit
0cf7f294ef
@ -181,12 +181,19 @@ namespace BootstrapBlazor.Components
|
||||
{
|
||||
if (UseInjectDataService || OnSaveAsync != null)
|
||||
{
|
||||
if (OnAddAsync != null) EditModel = await OnAddAsync();
|
||||
else
|
||||
if (OnAddAsync != null)
|
||||
{
|
||||
EditModel = await OnAddAsync();
|
||||
}
|
||||
else if (UseInjectDataService)
|
||||
{
|
||||
EditModel = new TItem();
|
||||
await GetDataService().AddAsync(EditModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditModel = new TItem();
|
||||
}
|
||||
|
||||
SelectedItems.Clear();
|
||||
EditModalTitleString = AddModalTitle;
|
||||
|
Loading…
Reference in New Issue
Block a user