/// <summary> /// Enum types are equal by primary key /// </summary> public bool Equals(MeasurementUnitType other) { if (other == null) { return(false); } return(other.MeasurementUnitTypeID == MeasurementUnitTypeID); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public PerformanceMeasure(string performanceMeasureDisplayName, MeasurementUnitType measurementUnitType, PerformanceMeasureType performanceMeasureType, bool isSummable, PerformanceMeasureDataSourceType performanceMeasureDataSourceType, bool canBeChartedCumulatively) : this() { // Mark this as a new object by setting primary key with special value this.PerformanceMeasureID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.PerformanceMeasureDisplayName = performanceMeasureDisplayName; this.MeasurementUnitTypeID = measurementUnitType.MeasurementUnitTypeID; this.PerformanceMeasureTypeID = performanceMeasureType.PerformanceMeasureTypeID; this.IsSummable = isSummable; this.PerformanceMeasureDataSourceTypeID = performanceMeasureDataSourceType.PerformanceMeasureDataSourceTypeID; this.CanBeChartedCumulatively = canBeChartedCumulatively; }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static PerformanceMeasure CreateNewBlank(MeasurementUnitType measurementUnitType, PerformanceMeasureType performanceMeasureType, PerformanceMeasureDataSourceType performanceMeasureDataSourceType) { return(new PerformanceMeasure(default(string), measurementUnitType, performanceMeasureType, default(bool), performanceMeasureDataSourceType, default(bool))); }