diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataMoveDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataMoveDto.cs index 45801cf33..86e61aa42 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataMoveDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataMoveDto.cs @@ -1,8 +1,11 @@ using System; +using System.ComponentModel; namespace LINGYUN.Platform.Datas; public class DataMoveDto { + + [DisplayName("DisplayName:ParentData")] public Guid? ParentId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs index 1d6b418f1..dbd934de4 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs @@ -130,6 +130,10 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService if (!string.Equals(data.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) { + if (await DataRepository.FindByNameAsync(input.Name) != null) + { + throw new UserFriendlyException(L["DuplicateData", input.Name]); + } data.Name = input.Name; } if (!string.Equals(data.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs index a2e554aed..3dc5735f1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs @@ -94,6 +94,10 @@ public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppServic if (!string.Equals(layout.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) { + if (await LayoutRepository.FindByNameAsync(input.Name) != null) + { + throw new UserFriendlyException(L["DuplicateLayout", input.Name]); + } layout.Name = input.Name; } if (!string.Equals(layout.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase))