#418 model + ClaimedByBothPoets

This commit is contained in:
Hamid Reza Mohammadi 2023-12-15 16:15:57 +03:30
parent 947cc97463
commit 749f1dfdf1
3 changed files with 12 additions and 0 deletions

View File

@ -132,5 +132,10 @@ namespace RMuseum.Models.Ganjoor
/// when a poem contains more than one quoted couplet from another one this should be more than 1
/// </summary>
public int SamePoemsQuotedCount { get; set; }
/// <summary>
/// poems (same poem) are claimed by both poets
/// </summary>
public bool ClaimedByBothPoets { get; set; }
}
}

View File

@ -8914,6 +8914,11 @@
when a poem contains more than one quoted couplet from another one this should be more than 1
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorQuotedPoem.ClaimedByBothPoets">
<summary>
poems (same poem) are claimed by both poets
</summary>
</member>
<member name="T:RMuseum.Models.Ganjoor.GanjoorRelatedPerson">
<summary>
a person refered by a poem

View File

@ -172,6 +172,7 @@ namespace RMuseum.Services.Implementation
SortOrder = 1000,
Note = "",
Published = true,
ClaimedByBothPoets = false,
SamePoemsQuotedCount = await context.GanjoorQuotedPoems.AsNoTracking().Where(p => p.PoemId == poem1.Id && p.RelatedPoemId == poem2.Id).AnyAsync() ?
1 + await context.GanjoorQuotedPoems.AsNoTracking().Where(p => p.PoemId == poem1.Id && p.RelatedPoemId == poem2.Id).CountAsync() : 1
};
@ -360,6 +361,7 @@ namespace RMuseum.Services.Implementation
CoupletVerse2 = relatedPoem.RelatedCoupletVerse2,
CoupletVerse2ShouldBeEmphasized = relatedPoem.RelatedCoupletVerse2ShouldBeEmphasized,
CoupletIndex = relatedPoem.RelatedCoupletIndex,
ClaimedByBothPoets = false,
SamePoemsQuotedCount = await context.GanjoorQuotedPoems.AsNoTracking().Where(p => p.PoemId == poem2.Id && p.RelatedPoemId == poem1.Id).AnyAsync() ?
1 + await context.GanjoorQuotedPoems.AsNoTracking().Where(p => p.PoemId == poem2.Id && p.RelatedPoemId == poem1.Id).CountAsync() : 1