// Get /// <summary> /// Returns the Rating of a single Store by Id /// </summary> /// <param name="id"></param> /// <returns></returns> public IHttpActionResult Get(int id) { StoreRatingService StoreRatingService = CreateStoreRatingService(); var storeRatings = StoreRatingService.GetRatingsByStore(id); return(Ok(storeRatings)); } // Get by ID
} // Post /// <summary> /// Creates a Store Rating /// </summary> /// <returns></returns> private StoreRatingService CreateStoreRatingService() { var userId = Guid.Parse(User.Identity.GetUserId()); var StoreRatingService = new StoreRatingService(userId); return(StoreRatingService); } // CreateStoreRatingService
// GET: StoreRating /// <summary> /// Returns the Rating of All Stores /// </summary> /// <returns></returns> public IHttpActionResult Get() { StoreRatingService StoreRatingService = CreateStoreRatingService(); var storeRatings = StoreRatingService.GetStoreRatings(); return(Ok(storeRatings)); }