瀏覽代碼

修复错误

qinchaoyue 4 月之前
父節點
當前提交
b179f1adc2

+ 2 - 0
src/Hotline.Application.Tests/Application/IndustryApplicationTest.cs

@@ -71,5 +71,7 @@ public class IndustryApplicationTest : TestBase
         var caseId = await _industryApplication.AddIndustryCaseAsync(industryCase);
         var items = await _industryApplication.GetIndustryCaseItems(new IndustryCaseItemInDto(null, null)).ToListAsync();
         items.Count.ShouldNotBe(0);
+        items.Any(m => m.Id.IsNullOrEmpty()).ShouldBeFalse();
+        items.Any(m => m.Name.IsNullOrEmpty()).ShouldBeFalse();
     }
 }

+ 2 - 0
src/Hotline.Application/Snapshot/IndustryApplication.cs

@@ -114,6 +114,8 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
             .WhereIF(dto.CaseName.NotNullOrEmpty(), (c, i) => c.Name.Contains(dto.CaseName))
             .Select<IndustryCaseItemOutDto>((c, i) => 
             new IndustryCaseItemOutDto {
+                Id = c.Id,
+                Name = c.Name,
             IndustryId = i.Id, 
             IndustryName = i.Name});
         return query;