Incorporate doc lib v4 ordering
This commit is contained in:
@@ -16,16 +16,18 @@ type SQLiteCategoryData(conn: SqliteConnection, ser: JsonSerializer, log: ILogge
|
||||
let parentIdField = nameof Category.Empty.ParentId
|
||||
|
||||
/// Count all categories for the given web log
|
||||
let countAll webLogId =
|
||||
let countAll webLogId = backgroundTask {
|
||||
log.LogTrace "Category.countAll"
|
||||
Document.countByWebLog Table.Category webLogId conn
|
||||
let! count = conn.countByFields Table.Category Any [ webLogField webLogId ]
|
||||
return int count
|
||||
}
|
||||
|
||||
/// Count all top-level categories for the given web log
|
||||
let countTopLevel webLogId =
|
||||
let countTopLevel webLogId = backgroundTask {
|
||||
log.LogTrace "Category.countTopLevel"
|
||||
let fields = [ webLogField webLogId; Field.NEX parentIdField ]
|
||||
conn.customScalar
|
||||
(Query.byFields (Query.count Table.Category) All fields) (addFieldParams fields []) (toCount >> int)
|
||||
let! count = conn.countByFields Table.Category All [ webLogField webLogId; Field.NEX parentIdField ]
|
||||
return int count
|
||||
}
|
||||
|
||||
/// Find all categories for the given web log
|
||||
let findByWebLog webLogId =
|
||||
|
||||
Reference in New Issue
Block a user