/// <summary> /// Deletes the reaction. /// </summary> /// <param name="allergyReaction">The allergy reaction.</param> public virtual void DeleteReaction( AllergyReaction allergyReaction ) { Check.IsNotNull(allergyReaction, "allergyReaction is required."); _allergyReactions.Delete ( allergyReaction); NotifyItemRemoved ( () => AllergyReactions, allergyReaction ); }
/// <summary> /// Determines if the values are equal. /// </summary> /// <param name="allergyReaction"> /// The other object. /// </param> /// <returns> /// A boolean denoting equality of the values. /// </returns> public virtual bool ValuesEqual( AllergyReaction allergyReaction ) { if (allergyReaction == null) { return false; } var valuesEqual = Equals ( Allergy.Key, allergyReaction.Key ) && Equals ( Reaction.Key, allergyReaction.Key ); return valuesEqual; }
/// <summary> /// Adds the reaction. /// </summary> /// <param name="reaction">The reaction.</param> /// <returns>An AllergyReaction. /// </returns> public virtual AllergyReaction AddReaction( Reaction reaction ) { Check.IsNotNull ( reaction, "reaction is required." ); var allergyReaction = new AllergyReaction ( reaction ) { Allergy = this }; _allergyReactions.Add ( allergyReaction ); NotifyItemAdded ( () => AllergyReactions, allergyReaction ); return allergyReaction; }