Меня интересуют сущности BOOKS только из среды edm.
Однако я получаю некоторые другие сущности вместе с сущностью BOOKS.
Вот мой контроллер веб-API
public class BooksController : ApiController
{
private MyECommerceDBEntities db = new MyECommerceDBEntities();
// GET: api/Books
[ResponseType(typeof(BOOKS))]
public IQueryable<BOOKS> GetBOOKS()
{
return db.BOOKS.OrderByDescending(x => x.BOOKID).Skip(977).Take(5).AsQueryable<BOOKS>();
}
}
Вот моя возвращенная строка JSON
[{"$id":"1","PRODUCTS":{"$id":"2","MOVIES":[],"ORDERITEMS":[],"PRODUCTDETAILS":[],"SUBCATEGORIES":{"$id":"3","CATEGORIES":{"$id":"4","SUBCATEGORIES":[{"$ref":"3"},{"$id":"5","CATEGORIES":{"$ref":"4"},"PRODUCTS":[],"SUBCATEGORYID":2,"CATEGORYID":1,"SUBCATEGORY":"Kindle Edition","DESCRIPTION":"Kindle EBook"}],"CATEGORYID":1,"CATEGORY":"Books","DESCRIPTION":"Books"},"PRODUCTS":[{"$ref":"2"},{"$id":"6","MOVIES":[],"ORDERITEMS":[],"PRODUCTDETAILS":[],"SUBCATEGORIES":{"$ref":"3"},"REVIEWS":[],"SELLERS_PRODUCTS":[],"CART":[],"BOOKS":[{"$id":"7","PRODUCTS":{"$ref":"6"},"BOOKID":1,"PRODUCTID":1964,"ISBN10":"ISBN-10: 1-934356-43","ISBN13":"ISBN-13: 978-1-93435","BOOKNAME":"Agile Coaching","DESCRIPTION":"","AUTHOR":null,"PUBLISHER":null,"PAGES":"236","BOOKIMAGE":"Agile `Coaching.jpeg","PUBLISHEDDATE":null}],"PRODUCTID":1964,"SUBCATEGORYID":1,"NAME":"Agile Coaching","DESCRIPTION":"","PRICE":0.0},{"$id":"8","MOVIES":[],"ORDERITEMS":[],"PRODUCTDETAILS":[],"SUBCATEGORIES":{"$ref":"3"},"REVIEWS":[],"SELLERS_PRODUCTS":[],"CART":[],"BOOKS":`