#233 adding new fields to poet view model

This commit is contained in:
Hamid Reza Mohammadi 2021-10-29 18:00:52 +03:30
parent 55b5f8d092
commit dce296bba6
4 changed files with 51 additions and 3 deletions

View File

@ -8,8 +8,8 @@
},
"AllowedHosts": "*",
"GoogleAnalyticsCode": "",
"APIRoot": "https://ganjgah.ir",
"GlobalAPIRoot": "https://ganjgah.ir",
"APIRoot": "http://localhost:3439",
"GlobalAPIRoot": "http://localhost:3439",
"SiteUrl": "http://localhost:33081",
"ReadOnlyMode": "False"
}

View File

@ -50,16 +50,36 @@
/// </summary>
public int BirthYearInLHijri { get; set; }
/// <summary>
/// BirthYearInLHijri, for some poets it is only indicator of their century of birth and should not be relied as their valid birth date
/// </summary>
public bool ValidBirthDate { get; set; }
/// <summary>
/// death year in lunar hijri
/// </summary>
public int DeathYearInLHijri { get; set; }
/// <summary>
/// DeathYearInLHijri, for some poets it is only indicator of their century of death and should not be relied as their valid death date
/// </summary>
public bool ValidDeathDate { get; set; }
/// <summary>
/// Home page pin order (zero means not pinned)
/// </summary>
public int PinOrder { get; set; }
/// <summary>
/// birth place
/// </summary>
public string BirthPlace { get; set; }
/// <summary>
/// death place
/// </summary>
public string DeathPlace { get; set; }
public override string ToString()
{
return Nickname;

View File

@ -6950,16 +6950,36 @@
birth year in lunar hijri
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.ValidBirthDate">
<summary>
BirthYearInLHijri, for some poets it is only indicator of their century of birth and should not be relied as their valid birth date
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.DeathYearInLHijri">
<summary>
death year in lunar hijri
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.ValidDeathDate">
<summary>
DeathYearInLHijri, for some poets it is only indicator of their century of death and should not be relied as their valid death date
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.PinOrder">
<summary>
Home page pin order (zero means not pinned)
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.BirthPlace">
<summary>
birth place
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.DeathPlace">
<summary>
death place
</summary>
</member>
<member name="T:RMuseum.Models.Ganjoor.ViewModels.GanjoorPostReportCommentViewModel">
<summary>
report comment view model

View File

@ -43,7 +43,7 @@ namespace RMuseum.Services.Implementation
{
var res =
await
(from poet in _context.GanjoorPoets
(from poet in _context.GanjoorPoets.Include(p => p.BirthLocation).Include(p => p.DeathLocation)
join cat in _context.GanjoorCategories.Where(c => c.ParentId == null)
on poet.Id equals cat.PoetId
where !published || poet.Published
@ -59,6 +59,10 @@ namespace RMuseum.Services.Implementation
ImageUrl = poet.RImageId == null ? "" : $"/api/ganjoor/poet/image{cat.FullUrl}.gif",
BirthYearInLHijri = poet.BirthYearInLHijri,
DeathYearInLHijri = poet.DeathYearInLHijri,
ValidBirthDate = poet.ValidBirthDate,
ValidDeathDate = poet.ValidDeathDate,
BirthPlace = poet.BirthLocation == null ? "" : poet.BirthLocation.Name,
DeathPlace = poet.DeathLocation == null ? "" : poet.DeathLocation.Name,
PinOrder = poet.PinOrder,
}
)
@ -281,6 +285,8 @@ namespace RMuseum.Services.Implementation
ImageUrl = poet.RImageId == null ? "" : $"/api/ganjoor/poet/image{_context.GanjoorCategories.Where(c => c.PoetId == poet.Id && c.ParentId == null).Single().FullUrl}.gif",
BirthYearInLHijri = poet.BirthYearInLHijri,
DeathYearInLHijri = poet.DeathYearInLHijri,
ValidBirthDate = poet.ValidBirthDate,
ValidDeathDate = poet.ValidDeathDate,
PinOrder = poet.PinOrder,
}).AsNoTracking().FirstOrDefaultAsync(),
Cat = catViewModel
@ -392,6 +398,8 @@ namespace RMuseum.Services.Implementation
Published = poet.Published,
ImageUrl = poet.RImageId == null ? "" : $"/api/ganjoor/poet/image{cat.FullUrl}.gif",
BirthYearInLHijri = poet.BirthYearInLHijri,
ValidBirthDate = poet.ValidBirthDate,
ValidDeathDate = poet.ValidDeathDate,
DeathYearInLHijri = poet.DeathYearInLHijri,
PinOrder = poet.PinOrder,
}