using Model; namespace Stub { public class LibraryStub : ILibraryManager { private StubbedDTO.Stub StubDTO { get; set; } = new StubbedDTO.Stub(); public async Task GetAuthorById(string id) { return (await StubDTO.GetAuthorById(id)).ToPoco(); } public async Task>> GetAuthorsByName(string substring, int index, int count, string sort = "") { var result = await StubDTO.GetAuthorsByName(substring, index, count, sort); return Tuple.Create(result.Item1, result.Item2.ToPocos()); } public async Task GetBookById(string id) { return (await StubDTO.GetBookById(id)).ToPoco(); } public async Task GetBookByISBN(string isbn) { return (await StubDTO.GetBookByISBN(isbn)).ToPoco(); } public async Task>> GetBooksByAuthor(string author, int index, int count, string sort = "") { var result = await StubDTO.GetBooksByAuthor(author, index, count, sort); return Tuple.Create(result.Item1, result.Item2.ToPocos()); } public async Task>> GetBooksByAuthorId(string authorId, int index, int count, string sort = "") { var result = await StubDTO.GetBooksByAuthor(authorId, index, count, sort); return Tuple.Create(result.Item1, result.Item2.ToPocos()); } public async Task>> GetBooksByTitle(string title, int index, int count, string sort = "") { var result = await StubDTO.GetBooksByTitle(title, index, count, sort); return Tuple.Create(result.Item1, result.Item2.ToPocos()); } } }