#409 DeleteQueuedPDFBookAsync
This commit is contained in:
parent
1a709e064b
commit
e508c9815d
@ -451,5 +451,12 @@ namespace RMuseum.Services
|
||||
/// <param name="paging"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<(PaginationMetadata PagingMeta, QueuedPDFBook[] Books)>> GetQueuedPDFBooksAsync(PagingParameterModel paging);
|
||||
|
||||
/// <summary>
|
||||
/// delete queued books
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<bool>> DeleteQueuedPDFBookAsync(Guid id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,5 +36,25 @@ namespace RMuseum.Services.Implementation
|
||||
return new RServiceResult<(PaginationMetadata PagingMeta, QueuedPDFBook[] Books)>((null, null), exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// delete queued books
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<RServiceResult<bool>> DeleteQueuedPDFBookAsync(Guid id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var qb = await _context.QueuedPDFBooks.Where(t => t.Id == id).SingleAsync();
|
||||
_context.Remove(qb);
|
||||
await _context.SaveChangesAsync();
|
||||
return new RServiceResult<bool>(true);
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
return new RServiceResult<bool>(false, exp.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user