mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Refactors the get book slice
This commit is contained in:
1 parent
1d35cd01db
commit
8aaf9fe64e
17 files changed
+395
-347
No files matched your search
-25
@@ -1,25 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Queries.GetBook;
|
||||
using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="GetBookRequest"/>.
|
||||
/// </summary>
|
||||
public static class GetBookRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="GetBookQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted query.</returns>
|
||||
public static GetBookQuery ToQuery(this GetBookRequest request)
|
||||
{
|
||||
return new GetBookQuery(
|
||||
Guid.TryParse(request.Id, out Guid bookId) ? bookId : Guid.Empty
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user