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