Exemplo n.º 1
0
        public void NativeFunq_Perf()
        {
            RegisterServices(serviceController, GetNativeFunqTypeFactory());

            StoreAndGetCustomers(serviceController);

            var request = new GetCustomer { CustomerId = 2 };
            Console.WriteLine("NativeFunq_Perf(): {0}", Measure(() => serviceController.Execute(request), Times));
        }
		public object Any(GetCustomer request)
		{
			if (config.UseCache)
			{
				var inCache = this.CacheClient.Get<GetCustomerResponse>(CacheKey);
				if (inCache != null) return inCache;
			}

			var response = new GetCustomerResponse {
				Customer = db.GetById<Customer>(request.CustomerId)
			};

			if (config.UseCache) 
				this.CacheClient.Set(CacheKey, response);

			return response;
		}