public CategoryInformationResponse GetCategoryInformation(CategoryInformationRequest request) { var categoryDto = _inMemory().SingleOrDefault(c => c.CategoryId == request.CategoryId); var response = new CategoryInformationResponse { Categories = new List <CategoryDto>() }; response.Categories.Add(categoryDto); return(response); }
private static void PrintResponse(CategoryInformationResponse responce) { Console.WriteLine("Received responce"); foreach (var category in responce.Categories) { Console.WriteLine($"Id: {category.CategoryId}"); Console.WriteLine($"Name: {category.Name}"); Console.WriteLine($"Description: {category.Description}"); Console.WriteLine($"Photo: {category.Photo}"); Console.WriteLine(); } }
private CategoryInformationResponse ProcessRequesFor15Seconds(CategoryInformationRequest request) { var categoryDto = _inMemory().SingleOrDefault(c => c.CategoryId == request.CategoryId); var responce = new CategoryInformationResponse { Categories = new List <CategoryDto> { categoryDto } }; System.Threading.Thread.Sleep(System.TimeSpan.FromSeconds(15)); return(responce); }