This project is read-only.
Microsoft - Utility Rate Service

Category:
TypeProviders.AzureMarketPlace
Description: The Microsoft Utility Rate Service is a database of electric utilities and rates indexed by location within the United States, gathered from Partner Utilities and/or from publically available information. For more information, please goto https://datamarket.azure.com/dataset/b848b1ed-3f61-40a9-8e43-597e0d352394
Code:
type Util = Microsoft.FSharp.Data.TypeProviders.ODataService < ServiceUri = "https://api.datamarket.azure.com/Microsoft/UtilityRateService/" >

let MSU() =
let rate = Util.GetDataContext()
//To sign up for a Windows Azure Marketplace account, please go to https://datamarket.azure.com/account/info
rate.Credentials <- NetworkCredential (Utils.ADM_USER_ID, Utils.ADM_ACCOUNT_ID)

query {
for c in rate.UtilityByPostalCodes do
where (c.PostalCode = "98052")
select c
} |> Seq.iter (fun i -> printfn "%A - %A" i.Name i.RateSource)

// sample output
// "Average Price by State (Residential)" - "AreaAverages"
// "Contoso" - "ThirdParty"



Execution Result:
"Average Price by State (Residential)" - "AreaAverages"
"Contoso" - "ThirdParty"

Last edited Mar 1, 2012 at 8:07 PM by ttliu2000, version 3

Comments

No comments yet.