support transformable values

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

View File

@@ -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))
}
}