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