# CSSelect

    @objc
    public final class CSSelect : NSObject

The `CSSelect` serves as the Objective-C bridging type for `Select`.

See also

`Select`

- `init(numberTerm:)`

  Creates a `CSSelect` clause for querying `NSNumber` values.

      NSNumber *maxAge = [CSCoreStore
         queryValueFrom:CSFromClass([MyPersonEntity class])
         select:CSSelectNumber(CSAggregateMax(@"age"))
         // ...

  #### Declaration

  Swift

      @objc
      public convenience init(numberTerm: CSSelectTerm)

  #### Parameters

  `numberTerm` | the `CSSelectTerm` specifying the attribute/aggregate value to query

- `init(decimalTerm:)`

  Creates a `CSSelect` clause for querying `NSDecimalNumber` values.

      NSDecimalNumber *averagePrice = [CSCoreStore
         queryValueFrom:CSFromClass([MyPersonEntity class])
         select:CSSelectDecimal(CSAggregateAverage(@"price"))
         // ...

  #### Declaration

  Swift

      @objc
      public convenience init(decimalTerm: CSSelectTerm)

  #### Parameters

  `decimalTerm` | the `CSSelectTerm` specifying the attribute/aggregate value to query

- `init(stringTerm:)`

  Creates a `CSSelect` clause for querying `NSString` values.

      NSString *fullname = [CSCoreStore
         queryValueFrom:CSFromClass([MyPersonEntity class])
         select:CSSelectString(CSAttribute(@"fullname"))
         // ...

  #### Declaration

  Swift

      @objc
      public convenience init(stringTerm: CSSelectTerm)

  #### Parameters

  `stringTerm` | the `CSSelectTerm` specifying the attribute/aggregate value to query

- `init(dateTerm:)`

  Creates a `CSSelect` clause for querying `NSDate` values.

      NSDate *lastUpdate = [CSCoreStore
         queryValueFrom:CSFromClass([MyPersonEntity class])
         select:CSSelectDate(CSAggregateMax(@"updatedDate"))
         // ...

  #### Declaration

  Swift

      @objc
      public convenience init(dateTerm: CSSelectTerm)

  #### Parameters

  `dateTerm` | the `CSSelectTerm` specifying the attribute/aggregate value to query

- `init(dataTerm:)`

  Creates a `CSSelect` clause for querying `NSData` values.

      NSData *imageData = [CSCoreStore
         queryValueFrom:CSFromClass([MyPersonEntity class])
         select:CSSelectData(CSAttribute(@"imageData"))
         // ...

  #### Declaration

  Swift

      @objc
      public convenience init(dataTerm: CSSelectTerm)

  #### Parameters

  `dataTerm` | the `CSSelectTerm` specifying the attribute/aggregate value to query

- `init(objectIDTerm:)`

  Creates a `CSSelect` clause for querying `NSManagedObjectID` values.

      NSManagedObjectID *objectID = [CSCoreStore
         queryValueFrom:CSFromClass([MyPersonEntity class])
         select:CSSelectObjectID()
         // ...

  #### Declaration

  Swift

      @objc
      public convenience init(objectIDTerm: ())

- `dictionaryForTerm(_:)`

  Creates a `CSSelect` clause for querying `NSDictionary` of an entity’s attribute keys and values.

      NSDictionary *keyValues = [CSCoreStore
          queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
          select:[CSSelect dictionaryForTerm:[CSSelectTerm maximum:@"age" as:nil]]];

  #### Declaration

  Swift

      @objc
      public static func dictionaryForTerm(_ term: CSSelectTerm) -> CSSelect

  #### Parameters

  `term` | the `CSSelectTerm` specifying the attribute/aggregate value to query

  #### Return Value

  a `CSSelect` clause for querying an entity attribute

- `dictionaryForTerms(_:)`

  Creates a `CSSelect` clause for querying `NSDictionary` of an entity’s attribute keys and values.

      NSDictionary *keyValues = [CSCoreStore
          queryValueFrom:[CSFrom entityClass:[MyPersonEntity class]]
          select:[CSSelect dictionaryForTerms:@[
              [CSSelectTerm attribute:@"name" as:nil],
              [CSSelectTerm attribute:@"age" as:nil]
          ]]];

  #### Declaration

  Swift

      @objc
      public static func dictionaryForTerms(_ terms: [CSSelectTerm]) -> CSSelect

  #### Parameters

  `terms` | the `CSSelectTerm`s specifying the attribute/aggregate values to query

  #### Return Value

  a `CSSelect` clause for querying an entity attribute