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);
        }
예제 #2
0
        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);
        }