/// <summary> /// Get specified species observation field. /// </summary> /// <param name="speciesObservationFields">Species observation fields.</param> /// <param name="speciesObservationClass">Web service request context.</param> /// <param name="speciesObservationProperty">Species observation search criteria.</param> /// <returns>Specified species observation field.</returns> public static WebSpeciesObservationField GetField(this List <WebSpeciesObservationField> speciesObservationFields, SpeciesObservationClassId speciesObservationClass, SpeciesObservationPropertyId speciesObservationProperty) { return(speciesObservationFields.GetField(speciesObservationClass.ToString(), speciesObservationProperty.ToString())); }
/// <summary> /// Add a field to the species observation. /// </summary> /// <param name="speciesObservation">The species observation.</param> /// <param name="speciesObservationClassId">Species observation class id.</param> /// <param name="speciesObservationPropertyId">Species observation property id.</param> /// <param name="value">A Double value.</param> public static void AddField(this WebSpeciesObservation speciesObservation, SpeciesObservationClassId speciesObservationClassId, SpeciesObservationPropertyId speciesObservationPropertyId, Double value) { WebSpeciesObservationField field; if (speciesObservation.Fields.IsNull()) { speciesObservation.Fields = new List <WebSpeciesObservationField>(); } field = new WebSpeciesObservationField(); field.ClassIdentifier = speciesObservationClassId.ToString(); field.PropertyIdentifier = speciesObservationPropertyId.ToString(); field.Type = WebDataType.Float64; field.Value = value.WebToString(); speciesObservation.Fields.Add(field); }