#241 fixing bugs and improvements
This commit is contained in:
parent
781aec0666
commit
7bfc50e1e9
@ -58,6 +58,11 @@ namespace RMuseum.Services.Implementation
|
||||
context.GanjoorPoems.Update(poem);
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
if(poem.GanjoorMetreId != null && !string.IsNullOrEmpty(poem.RhymeLetters))
|
||||
{
|
||||
await _UpdateRelatedPoems(context, (int)poem.GanjoorMetreId, poem.RhymeLetters);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ namespace RMuseum.Services.Implementation
|
||||
int metreId = (int)poem.GanjoorMetreId;
|
||||
string rhyme = poem.RhymeLetters;
|
||||
|
||||
var relatedPoems = context.GanjoorPoems.AsNoTracking().Include(p => p.Cat).ThenInclude(c => c.Poet)
|
||||
var relatedPoems = await context.GanjoorPoems.AsNoTracking().Include(p => p.Cat).ThenInclude(c => c.Poet)
|
||||
.Where(p =>
|
||||
p.GanjoorMetreId == metreId
|
||||
&&
|
||||
@ -62,7 +62,7 @@ namespace RMuseum.Services.Implementation
|
||||
&&
|
||||
p.Id != poemId
|
||||
)
|
||||
.OrderBy(p => p.Cat.Poet.BirthYearInLHijri).ThenBy(p => p.Cat.PoetId);
|
||||
.OrderBy(p => p.Cat.Poet.BirthYearInLHijri).ThenBy(p => p.Cat.PoetId).ToListAsync();
|
||||
|
||||
List<GanjoorCachedRelatedPoem> ganjoorCachedRelatedPoems = new List<GanjoorCachedRelatedPoem>();
|
||||
int r = 0;
|
||||
|
||||
@ -3004,6 +3004,8 @@ namespace RMuseum.Services.Implementation
|
||||
|
||||
if(oldMetreId != dbPoem.GanjoorMetreId || oldRhymeLetters != dbPoem.RhymeLetters)
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
if (oldMetreId != null && !string.IsNullOrEmpty(oldRhymeLetters))
|
||||
await _UpdateRelatedPoems(_context, (int)oldMetreId, oldRhymeLetters);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user