/// <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 IActiveTradeCashTable source, DbParameterValues paramValues) { for (var i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "cash": paramValues[i] = source.Cash; break; case "character_id": paramValues[i] = (Int32)source.CharacterID; break; } } }
/// <summary> /// Initializes a new instance of the <see cref="ActiveTradeCashTable"/> class. /// </summary> /// <param name="source">IActiveTradeCashTable to copy the initial values from.</param> public ActiveTradeCashTable(IActiveTradeCashTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ActiveTradeCashTable. /// </summary> /// <param name="source">The IActiveTradeCashTable to copy the values from.</param> public void CopyValuesFrom(IActiveTradeCashTable source) { Cash = source.Cash; CharacterID = source.CharacterID; }
/// <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(IActiveTradeCashTable source, IDictionary <String, Object> dic) { dic["cash"] = source.Cash; dic["character_id"] = source.CharacterID; }
/// <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(IActiveTradeCashTable source, IDictionary<String, Object> dic) { dic["cash"] = source.Cash; dic["character_id"] = source.CharacterID; }
/// <summary> /// Checks if this <see cref="IActiveTradeCashTable"/> contains the same values as another <see cref="IActiveTradeCashTable"/>. /// </summary> /// <param name="source">The source <see cref="IActiveTradeCashTable"/>.</param> /// <param name="otherItem">The <see cref="IActiveTradeCashTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IActiveTradeCashTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IActiveTradeCashTable source, IActiveTradeCashTable otherItem) { return Equals(source.Cash, otherItem.Cash) && Equals(source.CharacterID, otherItem.CharacterID); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ActiveTradeCashTable. /// </summary> /// <param name="source">The IActiveTradeCashTable to copy the values from.</param> public void CopyValuesFrom(IActiveTradeCashTable source) { this.Cash = (System.Int32)source.Cash; this.CharacterID = (DemoGame.CharacterID)source.CharacterID; }
/// <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(IActiveTradeCashTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["cash"] = (System.Int32)source.Cash; dic["character_id"] = (DemoGame.CharacterID)source.CharacterID; }
/// <summary> /// Checks if this <see cref="IActiveTradeCashTable"/> contains the same values as another <see cref="IActiveTradeCashTable"/>. /// </summary> /// <param name="source">The source <see cref="IActiveTradeCashTable"/>.</param> /// <param name="otherItem">The <see cref="IActiveTradeCashTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IActiveTradeCashTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static Boolean HasSameValues(this IActiveTradeCashTable source, IActiveTradeCashTable otherItem) { return(Equals(source.Cash, otherItem.Cash) && Equals(source.CharacterID, otherItem.CharacterID)); }
/// <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 IActiveTradeCashTable source, DbParameterValues paramValues) { paramValues["cash"] = source.Cash; paramValues["character_id"] = (Int32)source.CharacterID; }
/// <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(IActiveTradeCashTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["cash"] = (System.Int32)source.Cash; dic["character_id"] = (DemoGame.CharacterID)source.CharacterID; }