trunk/src/LythumOSL.Core/Data/Database.cs
/// <summary>
/// Cleans up fields from array which is not required for specific query.
/// Cleanup will remove fields:
/// NowOnUpdate - while will be done insert
/// NowOnInsert - while will be done update
/// </summary>
/// <param name="infos"></param>
/// <param name="forWhat"></param>
/// <returns></returns>
Cleans up fields from array which is not required for specific query.
Cleanup will remove fields:
NowOnUpdate - while will be done insert
NowOnInsert - while will be done update
Cleans up fields from array which is not required for specific query . Cleanup will remove fields : NowOnUpdate - while will be done insert NowOnInsert - while will be done update
static DbFieldInfo[] Cleanup (DbFieldInfo[] infos, ForWhat forWhat)
		{
			List<DbFieldInfo> retVal = new List<DbFieldInfo> ();
			foreach (DbFieldInfo i in infos)
			{
				switch (i.UpdateMode)
				{
					case DbFieldUpdateMode.NowOnUpdate:
						if (forWhat == ForWhat.ForUpdate)
						{
							retVal.Add (i);
						}
						break;
					case DbFieldUpdateMode.NowOnInsert:
						if (forWhat == ForWhat.ForInsert)
						{
							retVal.Add (i);
						}
						break;
					default:
						retVal.Add (i);
						break;
				}
			}
			return retVal.ToArray();
		}
static DbFieldInfo [ ] Cleanup ( DbFieldInfo [ ] infos , ForWhat forWhat ) { List < DbFieldInfo > retVal = new List < DbFieldInfo > ( ) ; foreach ( DbFieldInfo i in infos ) { switch ( i . UpdateMode ) { case DbFieldUpdateMode . NowOnUpdate : if ( forWhat == ForWhat . ForUpdate ) { retVal . Add ( i ) ; } break ; case DbFieldUpdateMode . NowOnInsert : if ( forWhat == ForWhat . ForInsert ) { retVal . Add ( i ) ; } break ; default : retVal . Add ( i ) ; break ; } } return retVal . ToArray ( ) ; }
Cleans up fields from array which is not required for specific query.
Cleans up fields from array which is not required for specific query .
None
infos
DbFieldInfo[]
None
forWhat
ForWhat
None