support transformable values

This commit is contained in:
John Estropia committed 2017-04-21 19:35:29 +09:00
1 parent 274a54451a
commit e6aa72fb5f
13 files changed
+495 -117

No files matched your search

@@ -45,6 +45,16 @@ public extension DynamicObject where Self: CoreStoreObject {
return condition(self.meta)
}
public static func ascending<O: CoreStoreObject, V: ImportableAttributeType>(_ attribute: (Self) -> ValueContainer<O>.Optional<V>) -> OrderBy {
return OrderBy(.ascending(attribute(self.meta).keyPath))
}
public static func descending<O: CoreStoreObject, V: ImportableAttributeType>(_ attribute: (Self) -> ValueContainer<O>.Optional<V>) -> OrderBy {
return OrderBy(.descending(attribute(self.meta).keyPath))
}
}