See Also: HKQuantitySample Members
The following examples show how you can create a HKQuantitySample, one using standard C#, and another using named parameters to make their use more obvious:
c# Example
var bodyTemperature = HKQuantityType.Create (HKQuantityTypeIdentifier.BodyTemperature);
var temp = HKQuantity.FromQuantity (HKUnit.DegreeFahrenheit, 99);
var sample = HKQuantitySample.FromType (bodyTemperature, temp, NSDate.Now, NSDate.Now, new HKMetadata () {
BodyTemperatureSensorLocation = HKBodyTemperatureSensorLocation.Mouth
});
var sample2 = HKQuantitySample.FromType (
quantityType: HKQuantityType.Create (HKQuantityTypeIdentifier.BodyTemperature),
quantity: HKQuantity.FromQuantity (HKUnit.DegreeFahrenheit, 99),
startDate: NSDate.Now,
endDate: NSDate.Now,
metadata: new HKMetadata () {
BodyTemperatureSensorLocation = HKBodyTemperatureSensorLocation.Mouth
}
);