/// <summary> /// Gets the near by stores. /// </summary> /// <param name="storefront">The storefront.</param> /// <param name="visitorContext">The visitor context.</param> /// <param name="inputModel">The input model.</param> /// <returns> /// The manager response where the stores are returned in the Result. /// </returns> public ManagerResponse <GetNearbyStoresResult, IReadOnlyCollection <Store> > GetNearbyStores([NotNull] CommerceStorefront storefront, [NotNull] VisitorContext visitorContext, [NotNull] GetNearbyStoresInputModel inputModel) { Assert.ArgumentNotNull(storefront, "storefront"); Assert.ArgumentNotNull(visitorContext, "visitorContext"); Assert.ArgumentNotNull(inputModel, "inputModel"); Assert.ArgumentNotNullOrEmpty(inputModel.Latitude, "inputModel.Latitude"); Assert.ArgumentNotNullOrEmpty(inputModel.Longitude, "inputModel.Longitude"); var request = new GetNearbyStoresRequest(System.Convert.ToDecimal(inputModel.Latitude, CultureInfo.InvariantCulture), System.Convert.ToDecimal(inputModel.Longitude, CultureInfo.InvariantCulture), 10); var result = this.StoreServiceProvider.GetNearbyStores(request); if (!result.Success) { Helpers.LogSystemMessages(result.SystemMessages, result); } return(new ManagerResponse <GetNearbyStoresResult, IReadOnlyCollection <Store> >(result, result.Stores)); }
/// <summary> /// Gets the near by stores. /// </summary> /// <param name="storefront">The storefront.</param> /// <param name="visitorContext">The visitor context.</param> /// <param name="inputModel">The input model.</param> /// <returns> /// The manager response where the stores are returned in the Result. /// </returns> public ManagerResponse<GetNearbyStoresResult, IReadOnlyCollection<Store>> GetNearbyStores([NotNull] CommerceStorefront storefront, [NotNull] VisitorContext visitorContext, [NotNull] GetNearbyStoresInputModel inputModel) { Assert.ArgumentNotNull(storefront, "storefront"); Assert.ArgumentNotNull(visitorContext, "visitorContext"); Assert.ArgumentNotNull(inputModel, "inputModel"); Assert.ArgumentNotNullOrEmpty(inputModel.Latitude, "inputModel.Latitude"); Assert.ArgumentNotNullOrEmpty(inputModel.Longitude, "inputModel.Longitude"); var request = new GetNearbyStoresRequest(System.Convert.ToDecimal(inputModel.Latitude, CultureInfo.InvariantCulture), System.Convert.ToDecimal(inputModel.Longitude, CultureInfo.InvariantCulture), 10); var result = this.StoreServiceProvider.GetNearbyStores(request); if (!result.Success) { Helpers.LogSystemMessages(result.SystemMessages, result); } return new ManagerResponse<GetNearbyStoresResult, IReadOnlyCollection<Store>>(result, result.Stores); }