diff --git a/RMuseum/Services/Implementation/GanjoorService.cs b/RMuseum/Services/Implementation/GanjoorService.cs index d23290df..0a3361d9 100644 --- a/RMuseum/Services/Implementation/GanjoorService.cs +++ b/RMuseum/Services/Implementation/GanjoorService.cs @@ -91,6 +91,16 @@ namespace RMuseum.Services.Implementation if (cat == null) return new RServiceResult(null); + if(cat.Parent != null) + { + var parent = cat.Parent; + while(parent.ParentId != null) + { + parent.Parent = await _context.GanjoorCategories.Where(c => c.Id == parent.ParentId).FirstOrDefaultAsync(); + parent = parent.Parent; + } + } + return new RServiceResult ( new GanjoorPoetCompleteViewModel()