From 97b713c2de63d3958f2927aa63c64611bd756d5d Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Wed, 26 Jan 2022 20:45:26 +0330 Subject: [PATCH] docs: #275 adding GanjoorPoetSuggestedSpecLine to db context and adding the get method to the service --- RMuseum/DbContext/RMuseumDbContext.cs | 5 ++ RMuseum/RMuseum.xml | 34 ++++++++------ .../GanjoorService-PhotosProject.cs | 46 +++++++++++++++++++ 3 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs diff --git a/RMuseum/DbContext/RMuseumDbContext.cs b/RMuseum/DbContext/RMuseumDbContext.cs index 7910e50a..f76105e0 100644 --- a/RMuseum/DbContext/RMuseumDbContext.cs +++ b/RMuseum/DbContext/RMuseumDbContext.cs @@ -430,5 +430,10 @@ namespace RMuseum.DbContext /// public DbSet GanjoorUserPoemVisits { get; set; } + /// + /// suggested spec line for poets + /// + public DbSet GanjoorPoetSuggestedSpecLines { get; set; } + } } diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index 33d32e48..ce8741c3 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -2493,6 +2493,11 @@ ganjoor user history track items (stored by his or her choice) + + + suggested spec line for poets + + donation expenditures @@ -6368,19 +6373,14 @@ Poet - + - Description + order - + - suggested by id - - - - - suggested by + Contents @@ -6388,11 +6388,6 @@ published - - - order - - ganjoor.net site banner @@ -11630,6 +11625,9 @@ IGanjoorService implementation + + IGanjoorService implementation + @@ -11781,6 +11779,14 @@ + + + return list of suggested spec lines + + + + + Start finding missing rhthms diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs new file mode 100644 index 00000000..1a0b2cdf --- /dev/null +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs @@ -0,0 +1,46 @@ +using DNTPersianUtils.Core; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Newtonsoft.Json; +using RMuseum.DbContext; +using RMuseum.Models.Ganjoor; +using RMuseum.Models.MusicCatalogue; +using RSecurityBackend.Models.Generic; +using RSecurityBackend.Models.Generic.Db; +using RSecurityBackend.Models.Image; +using RSecurityBackend.Services.Implementation; +using System; +using System.Data; +using System.Linq; +using System.Threading.Tasks; + +namespace RMuseum.Services.Implementation +{ + /// + /// IGanjoorService implementation + /// + public partial class GanjoorService : IGanjoorService + { + /// + /// return list of suggested spec lines + /// + /// + /// + /// + public async Task> GetPoetSuggestedSpecLines(int poetId, bool includeUnpublished) + { + return new RServiceResult + ( + await _context.GanjoorPoetSuggestedSpecLines + .Where + ( + r => r.PoetId == poetId + && + (includeUnpublished || r.Published == true) + ) + .OrderBy(r => r.LineOrder) + .ToArrayAsync() + ); + } + } +} \ No newline at end of file