public IActionResult GetNearbyStores([FromBody] LocationRequest LocRequest, NestedTagsPolicy NestedTags = NestedTagsPolicy.None) { if (IsUnauthorized()) { return(Unauthorized()); } var Stores = (IEnumerable <StoreUser>)Database.GetNearbyStores(LocRequest); SwitchNestedIncludeType(Stores, NestedTags); return(new JsonResult(Stores)); }
void SwitchNestedIncludeType(IEnumerable <StoreUser> Stores, NestedTagsPolicy NestedPolicy) { switch (NestedPolicy) { case NestedTagsPolicy.All: LoadAllTagsInStores(Stores); break; case NestedTagsPolicy.Foods: Stores.LoadFoods(Database); break; case NestedTagsPolicy.Tags: Stores.LoadTags(Database); break; case NestedTagsPolicy.None: default: break; } }