Turned getDownloads into a proper query.

This commit is contained in:
Achim D. Brucker 2018-07-24 07:43:42 +01:00
parent f0b2b92c43
commit d1b0a7d402
1 changed files with 4 additions and 6 deletions

View File

@ -25,12 +25,10 @@ module ExtensionQueries =
let getDownloads (ctx:ExtensionDbType) extid =
query {
for order in ctx.Extensions.Extension do
where (order.Extid = extid)
select (order.Date, order.Downloads)
} |> Seq.filter (fun (_, download) -> download.IsSome)
|> Seq.map (fun (date, download) -> (date,
download.Value))
where (order.Extid = extid && order.Downloads.IsSome)
select (order.Date, order.Downloads.Value)
}
let getAllExtIds (ctx:ExtensionDbType) =
query {
for ext in ctx.Extensions.Extension do