docs: #275 a method for retrieving next unmderated GanjoorPoetSuggestedSpecLineViewModel

This commit is contained in:
Hamid Reza Mohammadi 2022-01-30 18:56:06 +03:30
parent cc36097769
commit 02b678bfb4
3 changed files with 60 additions and 2 deletions

View File

@ -10475,6 +10475,13 @@
<param name="id"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.IGanjoorService.GetNextUnmoderatedPoetSuggestedSpecLineAsync(System.Int32)">
<summary>
next unpublished suggested line for poets
</summary>
<param name="skip"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.IGanjoorService.AddPoetSuggestedSpecLinesAsync(RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetSuggestedSpecLineViewModel)">
<summary>
add a suggestion for poets spec lines
@ -11892,11 +11899,18 @@
</member>
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetPoetSuggestedSpecLineAsync(System.Int32)">
<summary>
returns specfic suggested line for poet
returns specific suggested line for poets
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetNextUnmoderatedPoetSuggestedSpecLineAsync(System.Int32)">
<summary>
next unpublished suggested line for poets
</summary>
<param name="skip"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.Implementation.GanjoorService.AddPoetSuggestedSpecLinesAsync(RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetSuggestedSpecLineViewModel)">
<summary>
add a suggestion for poets spec lines

View File

@ -749,6 +749,13 @@ namespace RMuseum.Services
/// <returns></returns>
Task<RServiceResult<GanjoorPoetSuggestedSpecLineViewModel>> GetPoetSuggestedSpecLineAsync(int id);
/// <summary>
/// next unpublished suggested line for poets
/// </summary>
/// <param name="skip"></param>
/// <returns></returns>
Task<RServiceResult<GanjoorPoetSuggestedSpecLineViewModel>> GetNextUnmoderatedPoetSuggestedSpecLineAsync(int skip);
/// <summary>
/// add a suggestion for poets spec lines
/// </summary>

View File

@ -50,7 +50,7 @@ namespace RMuseum.Services.Implementation
}
/// <summary>
/// returns specfic suggested line for poet
/// returns specific suggested line for poets
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
@ -86,6 +86,43 @@ namespace RMuseum.Services.Implementation
}
}
/// <summary>
/// next unpublished suggested line for poets
/// </summary>
/// <param name="skip"></param>
/// <returns></returns>
public async Task<RServiceResult<GanjoorPoetSuggestedSpecLineViewModel>> GetNextUnmoderatedPoetSuggestedSpecLineAsync(int skip)
{
try
{
return new RServiceResult<GanjoorPoetSuggestedSpecLineViewModel>
(
await _context.GanjoorPoetSuggestedSpecLines
.Where
(
r => r.Published == false
)
.Skip(skip)
.Select
(
r => new GanjoorPoetSuggestedSpecLineViewModel()
{
Id = r.Id,
PoetId = r.PoetId,
LineOrder = r.LineOrder,
Contents = r.Contents,
Published = r.Published,
SuggestedById = r.SuggestedById
}
).SingleOrDefaultAsync()
);
}
catch (Exception exp)
{
return new RServiceResult<GanjoorPoetSuggestedSpecLineViewModel>(null, exp.ToString());
}
}
/// <summary>
/// add a suggestion for poets spec lines
/// </summary>