/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The key must already exist in the DbParameterValues /// for the value to be copied over. If any of the keys in the DbParameterValues do not /// match one of the column names, or if there is no field for a key, then it will be /// ignored. Because of this, it is important to be careful when using this method /// since columns or keys can be skipped without any indication. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void TryCopyValues(this IAppliedPatchesTable source, NetGore.Db.DbParameterValues paramValues) { for (int i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "date_applied": paramValues[i] = (System.DateTime)source.DateApplied; break; case "file_name": paramValues[i] = (System.String)source.FileName; break; } } }
/// <summary> /// Checks if this <see cref="IAppliedPatchesTable"/> contains the same values as another <see cref="IAppliedPatchesTable"/>. /// </summary> /// <param name="source">The source <see cref="IAppliedPatchesTable"/>.</param> /// <param name="otherItem">The <see cref="IAppliedPatchesTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IAppliedPatchesTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IAppliedPatchesTable source, IAppliedPatchesTable otherItem) { return Equals(source.DateApplied, otherItem.DateApplied) && Equals(source.FileName, otherItem.FileName); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this AppliedPatchesTable. /// </summary> /// <param name="source">The IAppliedPatchesTable to copy the values from.</param> public void CopyValuesFrom(IAppliedPatchesTable source) { this.DateApplied = (System.DateTime)source.DateApplied; this.FileName = (System.String)source.FileName; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IAppliedPatchesTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["date_applied"] = (System.DateTime)source.DateApplied; dic["file_name"] = (System.String)source.FileName; }
/// <summary> /// Initializes a new instance of the <see cref="AppliedPatchesTable"/> class. /// </summary> /// <param name="source">IAppliedPatchesTable to copy the initial values from.</param> public AppliedPatchesTable(IAppliedPatchesTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this AppliedPatchesTable. /// </summary> /// <param name="source">The IAppliedPatchesTable to copy the values from.</param> public void CopyValuesFrom(IAppliedPatchesTable source) { this.DateApplied = (System.DateTime)source.DateApplied; this.FileName = (System.String)source.FileName; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IAppliedPatchesTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["date_applied"] = (System.DateTime)source.DateApplied; dic["file_name"] = (System.String)source.FileName; }
/// <summary> /// Initializes a new instance of the <see cref="AppliedPatchesTable"/> class. /// </summary> /// <param name="source">IAppliedPatchesTable to copy the initial values from.</param> public AppliedPatchesTable(IAppliedPatchesTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void CopyValues(this IAppliedPatchesTable source, NetGore.Db.DbParameterValues paramValues) { paramValues["date_applied"] = (System.DateTime)source.DateApplied; paramValues["file_name"] = (System.String)source.FileName; }
/// <summary> /// Checks if this <see cref="IAppliedPatchesTable"/> contains the same values as another <see cref="IAppliedPatchesTable"/>. /// </summary> /// <param name="source">The source <see cref="IAppliedPatchesTable"/>.</param> /// <param name="otherItem">The <see cref="IAppliedPatchesTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IAppliedPatchesTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IAppliedPatchesTable source, IAppliedPatchesTable otherItem) { return(Equals(source.DateApplied, otherItem.DateApplied) && Equals(source.FileName, otherItem.FileName)); }