• Home
  • My Account
  • Docs
  • Catalog Browser
  • API Status
Show / Hide Table of Contents

Class WhenFreshApiClientExtensions

A helper class providing extension methods to simplify interaction with the WhenFresh Api.

Inheritance
object
WhenFreshApiClientExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: WhenFresh.Api.Client
Assembly: WhenFresh.Api.Client.dll
Syntax
public static class WhenFreshApiClientExtensions

Methods

FindAddressesByPostcodeAsync(IWhenFreshApiClient, string)

Finds PostalAddress Resources for a given Postcode.

Declaration
public static Task<IEnumerable<PostalAddress>> FindAddressesByPostcodeAsync(this IWhenFreshApiClient client, string postcode)
Parameters
Type Name Description
IWhenFreshApiClient client
string postcode
Returns
Type Description
Task<IEnumerable<PostalAddress>>

GetAddressAsync(IWhenFreshApiClient, PostalAddressFileKey)

Gets a PostalAddress Resource for a given PostalAddressFileKey.

Declaration
public static Task<PostalAddress> GetAddressAsync(this IWhenFreshApiClient client, PostalAddressFileKey postalAddressFileKey)
Parameters
Type Name Description
IWhenFreshApiClient client
PostalAddressFileKey postalAddressFileKey
Returns
Type Description
Task<PostalAddress>

GetResourceCatalogAsync(IWhenFreshApiClient, ResourceCatalogId)

Gets a ResourceCatalog Resource for a given ResourceCatalogId.

Declaration
public static Task<ResourceCatalog> GetResourceCatalogAsync(this IWhenFreshApiClient client, ResourceCatalogId resourceCatalogId)
Parameters
Type Name Description
IWhenFreshApiClient client
ResourceCatalogId resourceCatalogId
Returns
Type Description
Task<ResourceCatalog>

PurchaseVariablesAsync(IWhenFreshApiClient, PostalAddressFileKey, IEnumerable<VariableId>)

Purchases Variables from the ResourceCatalog Resource belonging to a given PostalAddress Resource.

Declaration
public static Task<IEnumerable<PurchasedDatum>> PurchaseVariablesAsync(this IWhenFreshApiClient client, PostalAddressFileKey pafKey, IEnumerable<VariableId> selection)
Parameters
Type Name Description
IWhenFreshApiClient client
PostalAddressFileKey pafKey
IEnumerable<VariableId> selection
Returns
Type Description
Task<IEnumerable<PurchasedDatum>>

PurchaseVariablesAsync(IWhenFreshApiClient, ResourceCatalogId, IEnumerable<VariableId>)

Purchases Variables from a ResourceCatalog for a given ResourceCatalogId.

Declaration
public static Task<IEnumerable<PurchasedDatum>> PurchaseVariablesAsync(this IWhenFreshApiClient client, ResourceCatalogId resourceCatalogId, IEnumerable<VariableId> selection)
Parameters
Type Name Description
IWhenFreshApiClient client
ResourceCatalogId resourceCatalogId
IEnumerable<VariableId> selection
Returns
Type Description
Task<IEnumerable<PurchasedDatum>>