Azure Mobile Apps 프로젝트에서 작업 중입니다. 어디에서 두 개의 매개 변수를 받아들이고 값 목록을 제공 할 수있는 표 컨트롤러를 정의해야합니다. 나는 그것의 가격 및 상인에 의해 특정 제품 항목, 필터를 얻을 필요가Azure 테이블 컨트롤러 - 매개 변수별로 레코드 가져 오기
public class ProductItem : EntityData
{
public string Name { get; set; }
public string Details { get; set; }
public double Price { get; set; }
public string Image { get; set; }
public Merchant Merchant { get; set; }
}
입니다 ProductItem
에 대한 데이터 객체를 가지고있다. ProductItemContoller
에는 이미 기존 예제를 살펴보면 비계가
// GET tables/ProductItem
public IQueryable<ProductItem> GetAllProductItems()
{
return Query();
}
// GET tables/ProductItem/48D68C86-6EA6-4C25-AA33-223FC9A27959
public SingleResult<ProductItem> GetProductItem(string id)
{
return Lookup(id);
}
개 있습니다. 그러나 예제에서 우리는 클라이언트로부터 주어진 메소드를 호출하지 않았다. 오히려 IEnumerable<ProductItem> items = await productTable.ToEnumerableAsync();
이 호출되었습니다.
제 질문은 왜 컨트롤러에 이미 클라이언트에 정의되어있는 GetAllProductItems()
을 호출 할 수 없는지입니다. 우리가 전화 할 수 있다면, 어떻게해야하는지.
또한 컨트롤러 메서드가 있어야하는데, GetAllProductByMerchat(string merchantId)
이 있어야합니다. 어떻게하면 가능합니까?
난 계산할 논리에 상주하는 서버가 있습니다. 두꺼운 서버 - 씬 클라이언트 개념을 따라야합니다. TableController를 사용하여 가능한가요? –
자세한 내용은 http://aka.ms/zumobook - 3 장을 참조하십시오. –