From 9f869343cd4af1371c0e5d7d43505e6eb5cfdda8 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 29 Sep 2010 17:21:30 +0000 Subject: [PATCH] Faster method of moving objects from a temporary cache list to indexed cache lists --- PROMS/MyGeneration/csla_21/CSLA_Objects.csgen | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/Annotation.cs | 15 +++++++-------- .../Generated/AnnotationInfo.cs | 15 +++++++-------- .../Generated/AnnotationType.cs | 15 +++++++-------- .../Generated/AnnotationTypeInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/Assignment.cs | 15 +++++++-------- .../Generated/AssignmentInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/Association.cs | 15 +++++++-------- .../Generated/AssociationInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/Connection.cs | 15 +++++++-------- .../Generated/ConnectionInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Content.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/ContentInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/DetailInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/DocVersion.cs | 15 +++++++-------- .../Generated/DocVersionInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Document.cs | 15 +++++++-------- .../Generated/DocumentInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/EntryInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/FigureInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/FolderInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Format.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/FormatInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Group.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/GroupInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Item.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/Membership.cs | 15 +++++++-------- .../Generated/MembershipInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Part.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/PartInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/Permission.cs | 15 +++++++-------- .../Generated/PermissionInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/RODbInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/ROFstInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/ROImageInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/RoUsageInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/Role.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/RoleInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/Transition.cs | 15 +++++++-------- .../Generated/TransitionInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/User.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/UserInfo.cs | 15 +++++++-------- PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs | 15 +++++++-------- .../Generated/ZContentInfo.cs | 15 +++++++-------- .../VEPROMS.CSLA.Library/Generated/ZTransition.cs | 15 +++++++-------- .../Generated/ZTransitionInfo.cs | 15 +++++++-------- 55 files changed, 385 insertions(+), 440 deletions(-) diff --git a/PROMS/MyGeneration/csla_21/CSLA_Objects.csgen b/PROMS/MyGeneration/csla_21/CSLA_Objects.csgen index e546926d..bbb07dbd 100644 --- a/PROMS/MyGeneration/csla_21/CSLA_Objects.csgen +++ b/PROMS/MyGeneration/csla_21/CSLA_Objects.csgen @@ -714,12 +714,13 @@ namespace <%=_nameSpace%> %> private static void ConvertListToDictionary() { - List<<%=_className%>> remove = new List<<%=_className%>>(); - foreach (<%=_className%> tmp in _CacheList) + while (_CacheList.Count > 0) // Move <%=_className%>(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(<%=pKey%>)) + <%=_className%> tmp = _CacheList[0]; // Get the first <%=_className%> + string pKey = <%=pKey%>; + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[<%=pKey%>] = new List<<%=_className%>>(); // Add new list for PrimaryKey<% + _CacheByPrimaryKey[pKey] = new List<<%=_className%>>(); // Add new list for PrimaryKey<% foreach(IIndex ind in uniqueIndexes) { string sBy = FormatColumns("{name}",ind.Columns,"_",""); @@ -729,7 +730,7 @@ namespace <%=_nameSpace%> } %> } - _CacheByPrimaryKey[<%=pKey%>].Add(tmp); // Add to Primary Key list<% + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list<% foreach(IIndex ind in uniqueIndexes) { string sBy = FormatColumns("{name}",ind.Columns,"_",""); @@ -738,10 +739,8 @@ namespace <%=_nameSpace%> _CacheBy<%=sBy%>[<%=sKey%>].Add(tmp); // Unique Index<% } %> - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first <%=_className%> } - foreach (<%=_className%> tmp in remove) - RemoveFromCache(tmp); }<% if (bInfo && AnyNotOneToOne(_workingTable)) // AddList function for infolist - Any non 1 to 1 relationships { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs index 899f750b..98b6a721 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Annotation.cs @@ -65,18 +65,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Annotation tmp in _CacheList) + while (_CacheList.Count > 0) // Move Annotation(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AnnotationID.ToString())) + Annotation tmp = _CacheList[0]; // Get the first Annotation + string pKey = tmp.AnnotationID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.AnnotationID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.AnnotationID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Annotation } - foreach (Annotation tmp in remove) - RemoveFromCache(tmp); } protected static Annotation GetCachedByPrimaryKey(int annotationID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationInfo.cs index c3da222c..97f44af2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (AnnotationInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move AnnotationInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AnnotationID.ToString())) + AnnotationInfo tmp = _CacheList[0]; // Get the first AnnotationInfo + string pKey = tmp.AnnotationID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.AnnotationID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.AnnotationID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first AnnotationInfo } - foreach (AnnotationInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(AnnotationInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs index b39d3b4a..c5e6692d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationType.cs @@ -77,20 +77,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByName = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (AnnotationType tmp in _CacheList) + while (_CacheList.Count > 0) // Move AnnotationType(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TypeID.ToString())) + AnnotationType tmp = _CacheList[0]; // Get the first AnnotationType + string pKey = tmp.TypeID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.TypeID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByName[tmp.Name.ToString()] = new List(); // Add new list for Name } - _CacheByPrimaryKey[tmp.TypeID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByName[tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first AnnotationType } - foreach (AnnotationType tmp in remove) - RemoveFromCache(tmp); } protected static AnnotationType GetCachedByPrimaryKey(int typeID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeInfo.cs index 306a11c2..9b56a09a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AnnotationTypeInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (AnnotationTypeInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move AnnotationTypeInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TypeID.ToString())) + AnnotationTypeInfo tmp = _CacheList[0]; // Get the first AnnotationTypeInfo + string pKey = tmp.TypeID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.TypeID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.TypeID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first AnnotationTypeInfo } - foreach (AnnotationTypeInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(AnnotationTypeInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs index 6604fee9..7f1bc75b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Assignment.cs @@ -66,18 +66,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Assignment tmp in _CacheList) + while (_CacheList.Count > 0) // Move Assignment(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AID.ToString())) + Assignment tmp = _CacheList[0]; // Get the first Assignment + string pKey = tmp.AID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.AID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.AID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Assignment } - foreach (Assignment tmp in remove) - RemoveFromCache(tmp); } protected static Assignment GetCachedByPrimaryKey(int aid) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AssignmentInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AssignmentInfo.cs index e2fa1a17..d356030f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AssignmentInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AssignmentInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (AssignmentInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move AssignmentInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AID.ToString())) + AssignmentInfo tmp = _CacheList[0]; // Get the first AssignmentInfo + string pKey = tmp.AID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.AID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.AID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first AssignmentInfo } - foreach (AssignmentInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(AssignmentInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs index d4b19eb4..85ee508b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Association.cs @@ -66,20 +66,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByVersionID_ROFstID = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Association tmp in _CacheList) + while (_CacheList.Count > 0) // Move Association(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AssociationID.ToString())) + Association tmp = _CacheList[0]; // Get the first Association + string pKey = tmp.AssociationID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.AssociationID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByVersionID_ROFstID[tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString()] = new List(); // Add new list for VersionID_ROFstID } - _CacheByPrimaryKey[tmp.AssociationID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByVersionID_ROFstID[tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first Association } - foreach (Association tmp in remove) - RemoveFromCache(tmp); } protected static Association GetCachedByPrimaryKey(int associationID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/AssociationInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/AssociationInfo.cs index 0fb771e0..87f50454 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/AssociationInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/AssociationInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (AssociationInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move AssociationInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AssociationID.ToString())) + AssociationInfo tmp = _CacheList[0]; // Get the first AssociationInfo + string pKey = tmp.AssociationID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.AssociationID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.AssociationID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first AssociationInfo } - foreach (AssociationInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(AssociationInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs index 8cb46298..646015c4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Connection.cs @@ -77,20 +77,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByName = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Connection tmp in _CacheList) + while (_CacheList.Count > 0) // Move Connection(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DBID.ToString())) + Connection tmp = _CacheList[0]; // Get the first Connection + string pKey = tmp.DBID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.DBID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByName[tmp.Name.ToString()] = new List(); // Add new list for Name } - _CacheByPrimaryKey[tmp.DBID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByName[tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first Connection } - foreach (Connection tmp in remove) - RemoveFromCache(tmp); } protected static Connection GetCachedByPrimaryKey(int dbid) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionInfo.cs index f7cb2b89..348a7709 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ConnectionInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ConnectionInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move ConnectionInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DBID.ToString())) + ConnectionInfo tmp = _CacheList[0]; // Get the first ConnectionInfo + string pKey = tmp.DBID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.DBID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.DBID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ConnectionInfo } - foreach (ConnectionInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(ConnectionInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs index 8fdb68ff..6a40365d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Content.cs @@ -129,18 +129,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Content tmp in _CacheList) + while (_CacheList.Count > 0) // Move Content(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) + Content tmp = _CacheList[0]; // Get the first Content + string pKey = tmp.ContentID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Content } - foreach (Content tmp in remove) - RemoveFromCache(tmp); } protected static Content GetCachedByPrimaryKey(int contentID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ContentInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ContentInfo.cs index e4d8f266..3f8b983a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ContentInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ContentInfo.cs @@ -67,18 +67,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ContentInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move ContentInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) + ContentInfo tmp = _CacheList[0]; // Get the first ContentInfo + string pKey = tmp.ContentID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ContentInfo } - foreach (ContentInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(ContentInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs index 0c39b91e..4540cb94 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Detail.cs @@ -64,18 +64,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Detail tmp in _CacheList) + while (_CacheList.Count > 0) // Move Detail(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DetailID.ToString())) + Detail tmp = _CacheList[0]; // Get the first Detail + string pKey = tmp.DetailID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.DetailID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.DetailID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Detail } - foreach (Detail tmp in remove) - RemoveFromCache(tmp); } protected static Detail GetCachedByPrimaryKey(int detailID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DetailInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DetailInfo.cs index 921568c5..0fd05fc3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DetailInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DetailInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (DetailInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move DetailInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DetailID.ToString())) + DetailInfo tmp = _CacheList[0]; // Get the first DetailInfo + string pKey = tmp.DetailID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.DetailID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.DetailID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first DetailInfo } - foreach (DetailInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(DetailInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs index df9d8659..735f7f43 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersion.cs @@ -79,18 +79,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (DocVersion tmp in _CacheList) + while (_CacheList.Count > 0) // Move DocVersion(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.VersionID.ToString())) + DocVersion tmp = _CacheList[0]; // Get the first DocVersion + string pKey = tmp.VersionID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.VersionID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.VersionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first DocVersion } - foreach (DocVersion tmp in remove) - RemoveFromCache(tmp); } protected static DocVersion GetCachedByPrimaryKey(int versionID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionInfo.cs index 09f4b726..27860e9b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocVersionInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (DocVersionInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move DocVersionInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.VersionID.ToString())) + DocVersionInfo tmp = _CacheList[0]; // Get the first DocVersionInfo + string pKey = tmp.VersionID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.VersionID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.VersionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first DocVersionInfo } - foreach (DocVersionInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(DocVersionInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs index 2c9f88bd..ec8662fc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Document.cs @@ -76,18 +76,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Document tmp in _CacheList) + while (_CacheList.Count > 0) // Move Document(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DocID.ToString())) + Document tmp = _CacheList[0]; // Get the first Document + string pKey = tmp.DocID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.DocID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.DocID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Document } - foreach (Document tmp in remove) - RemoveFromCache(tmp); } protected static Document GetCachedByPrimaryKey(int docID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentInfo.cs index 8dfcc8f0..ddf1022f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/DocumentInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/DocumentInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (DocumentInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move DocumentInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DocID.ToString())) + DocumentInfo tmp = _CacheList[0]; // Get the first DocumentInfo + string pKey = tmp.DocID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.DocID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.DocID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first DocumentInfo } - foreach (DocumentInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(DocumentInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs index c0b3314c..2f95aa9f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Entry.cs @@ -64,18 +64,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Entry tmp in _CacheList) + while (_CacheList.Count > 0) // Move Entry(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) + Entry tmp = _CacheList[0]; // Get the first Entry + string pKey = tmp.ContentID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Entry } - foreach (Entry tmp in remove) - RemoveFromCache(tmp); } protected static Entry GetCachedByPrimaryKey(int contentID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/EntryInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/EntryInfo.cs index 458d4c9f..da0206a4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/EntryInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/EntryInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (EntryInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move EntryInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) + EntryInfo tmp = _CacheList[0]; // Get the first EntryInfo + string pKey = tmp.ContentID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first EntryInfo } - foreach (EntryInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(EntryInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs index c2702969..1b851841 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Figure.cs @@ -66,20 +66,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByROFstID_ImageID = new Dictionary>(); private static void ConvertListToDictionary() { - List
remove = new List
(); - foreach (Figure tmp in _CacheList) + while (_CacheList.Count > 0) // Move Figure(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FigureID.ToString())) + Figure tmp = _CacheList[0]; // Get the first Figure + string pKey = tmp.FigureID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.FigureID.ToString()] = new List
(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List
(); // Add new list for PrimaryKey _CacheByROFstID_ImageID[tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString()] = new List
(); // Add new list for ROFstID_ImageID } - _CacheByPrimaryKey[tmp.FigureID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByROFstID_ImageID[tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first Figure } - foreach (Figure tmp in remove) - RemoveFromCache(tmp); } protected static Figure GetCachedByPrimaryKey(int figureID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FigureInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FigureInfo.cs index 5464009e..da1f601d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FigureInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FigureInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (FigureInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move FigureInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FigureID.ToString())) + FigureInfo tmp = _CacheList[0]; // Get the first FigureInfo + string pKey = tmp.FigureID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.FigureID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.FigureID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first FigureInfo } - foreach (FigureInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(FigureInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs index 16143603..f55b5f0f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs @@ -99,20 +99,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByParentID_Name = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Folder tmp in _CacheList) + while (_CacheList.Count > 0) // Move Folder(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FolderID.ToString())) + Folder tmp = _CacheList[0]; // Get the first Folder + string pKey = tmp.FolderID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.FolderID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()] = new List(); // Add new list for ParentID_Name } - _CacheByPrimaryKey[tmp.FolderID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first Folder } - foreach (Folder tmp in remove) - RemoveFromCache(tmp); } protected static Folder GetCachedByPrimaryKey(int folderID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FolderInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FolderInfo.cs index e75e5586..8eaddc47 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FolderInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FolderInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (FolderInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move FolderInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FolderID.ToString())) + FolderInfo tmp = _CacheList[0]; // Get the first FolderInfo + string pKey = tmp.FolderID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.FolderID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.FolderID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first FolderInfo } - foreach (FolderInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(FolderInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs index c4ebe3ad..14abc535 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Format.cs @@ -110,20 +110,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByParentID_Name = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Format tmp in _CacheList) + while (_CacheList.Count > 0) // Move Format(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FormatID.ToString())) + Format tmp = _CacheList[0]; // Get the first Format + string pKey = tmp.FormatID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.FormatID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()] = new List(); // Add new list for ParentID_Name } - _CacheByPrimaryKey[tmp.FormatID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first Format } - foreach (Format tmp in remove) - RemoveFromCache(tmp); } protected static Format GetCachedByPrimaryKey(int formatID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfo.cs index dae022b1..9b50b7bd 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (FormatInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move FormatInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FormatID.ToString())) + FormatInfo tmp = _CacheList[0]; // Get the first FormatInfo + string pKey = tmp.FormatID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.FormatID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.FormatID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first FormatInfo } - foreach (FormatInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(FormatInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs index e91604bd..2ce28344 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Group.cs @@ -90,20 +90,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByGroupName = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Group tmp in _CacheList) + while (_CacheList.Count > 0) // Move Group(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.GID.ToString())) + Group tmp = _CacheList[0]; // Get the first Group + string pKey = tmp.GID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.GID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByGroupName[tmp.GroupName.ToString()] = new List(); // Add new list for GroupName } - _CacheByPrimaryKey[tmp.GID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByGroupName[tmp.GroupName.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first Group } - foreach (Group tmp in remove) - RemoveFromCache(tmp); } protected static Group GetCachedByPrimaryKey(int gid) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/GroupInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/GroupInfo.cs index 79481c57..702fd22a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/GroupInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/GroupInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (GroupInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move GroupInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.GID.ToString())) + GroupInfo tmp = _CacheList[0]; // Get the first GroupInfo + string pKey = tmp.GID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.GID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.GID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first GroupInfo } - foreach (GroupInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(GroupInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs index 3af0b23a..d4e180e4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Item.cs @@ -136,18 +136,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Item tmp in _CacheList) + while (_CacheList.Count > 0) // Move Item(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ItemID.ToString())) + Item tmp = _CacheList[0]; // Get the first Item + string pKey = tmp.ItemID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ItemID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ItemID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Item } - foreach (Item tmp in remove) - RemoveFromCache(tmp); } protected static Item GetCachedByPrimaryKey(int itemID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs index f2c4fbd3..0bc00190 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ItemInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move ItemInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ItemID.ToString())) + ItemInfo tmp = _CacheList[0]; // Get the first ItemInfo + string pKey = tmp.ItemID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ItemID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ItemID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ItemInfo } - foreach (ItemInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(ItemInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs index 2e554832..0d7630b0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Membership.cs @@ -65,18 +65,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Membership tmp in _CacheList) + while (_CacheList.Count > 0) // Move Membership(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UGID.ToString())) + Membership tmp = _CacheList[0]; // Get the first Membership + string pKey = tmp.UGID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.UGID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.UGID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Membership } - foreach (Membership tmp in remove) - RemoveFromCache(tmp); } protected static Membership GetCachedByPrimaryKey(int ugid) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/MembershipInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/MembershipInfo.cs index 2cd4944a..166fee99 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/MembershipInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/MembershipInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (MembershipInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move MembershipInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UGID.ToString())) + MembershipInfo tmp = _CacheList[0]; // Get the first MembershipInfo + string pKey = tmp.UGID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.UGID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.UGID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first MembershipInfo } - foreach (MembershipInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(MembershipInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs index 33c85ebd..d0c4d3b3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Part.cs @@ -65,18 +65,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Part tmp in _CacheList) + while (_CacheList.Count > 0) // Move Part(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString() + "_" + tmp.FromType.ToString())) + Part tmp = _CacheList[0]; // Get the first Part + string pKey = tmp.ContentID.ToString() + "_" + tmp.FromType.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Part } - foreach (Part tmp in remove) - RemoveFromCache(tmp); } protected static Part GetCachedByPrimaryKey(int contentID, int fromType) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/PartInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/PartInfo.cs index 78a69cee..92a16a81 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/PartInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/PartInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (PartInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move PartInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString() + "_" + tmp.FromType.ToString())) + PartInfo tmp = _CacheList[0]; // Get the first PartInfo + string pKey = tmp.ContentID.ToString() + "_" + tmp.FromType.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first PartInfo } - foreach (PartInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(PartInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs index d28ae14e..eaf074e8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Permission.cs @@ -64,18 +64,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Permission tmp in _CacheList) + while (_CacheList.Count > 0) // Move Permission(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.PID.ToString())) + Permission tmp = _CacheList[0]; // Get the first Permission + string pKey = tmp.PID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.PID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.PID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Permission } - foreach (Permission tmp in remove) - RemoveFromCache(tmp); } protected static Permission GetCachedByPrimaryKey(int pid) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/PermissionInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/PermissionInfo.cs index dd2f0141..4d23ceba 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/PermissionInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/PermissionInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (PermissionInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move PermissionInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.PID.ToString())) + PermissionInfo tmp = _CacheList[0]; // Get the first PermissionInfo + string pKey = tmp.PID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.PID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.PID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first PermissionInfo } - foreach (PermissionInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(PermissionInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs index 3763043f..a5ab2455 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODb.cs @@ -103,20 +103,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByFolderPath = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (RODb tmp in _CacheList) + while (_CacheList.Count > 0) // Move RODb(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RODbID.ToString())) + RODb tmp = _CacheList[0]; // Get the first RODb + string pKey = tmp.RODbID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.RODbID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByFolderPath[tmp.FolderPath.ToString()] = new List(); // Add new list for FolderPath } - _CacheByPrimaryKey[tmp.RODbID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByFolderPath[tmp.FolderPath.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first RODb } - foreach (RODb tmp in remove) - RemoveFromCache(tmp); } protected static RODb GetCachedByPrimaryKey(int rODbID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RODbInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RODbInfo.cs index 85c125f6..32d2476a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RODbInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RODbInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (RODbInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move RODbInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RODbID.ToString())) + RODbInfo tmp = _CacheList[0]; // Get the first RODbInfo + string pKey = tmp.RODbID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.RODbID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.RODbID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first RODbInfo } - foreach (RODbInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(RODbInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs index 0a59d0f8..a89d6b9e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFst.cs @@ -91,20 +91,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByRODbID_DTS = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ROFst tmp in _CacheList) + while (_CacheList.Count > 0) // Move ROFst(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROFstID.ToString())) + ROFst tmp = _CacheList[0]; // Get the first ROFst + string pKey = tmp.ROFstID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ROFstID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByRODbID_DTS[tmp.RODbID.ToString() + "_" + tmp.DTS.ToString()] = new List(); // Add new list for RODbID_DTS } - _CacheByPrimaryKey[tmp.ROFstID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByRODbID_DTS[tmp.RODbID.ToString() + "_" + tmp.DTS.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first ROFst } - foreach (ROFst tmp in remove) - RemoveFromCache(tmp); } protected static ROFst GetCachedByPrimaryKey(int rOFstID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstInfo.cs index d10bfecf..a5906c43 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROFstInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROFstInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ROFstInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move ROFstInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROFstID.ToString())) + ROFstInfo tmp = _CacheList[0]; // Get the first ROFstInfo + string pKey = tmp.ROFstID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ROFstID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ROFstID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ROFstInfo } - foreach (ROFstInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(ROFstInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs index 693466f2..1a007710 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROImage.cs @@ -78,20 +78,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByRODbID_FileName_DTS = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ROImage tmp in _CacheList) + while (_CacheList.Count > 0) // Move ROImage(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ImageID.ToString())) + ROImage tmp = _CacheList[0]; // Get the first ROImage + string pKey = tmp.ImageID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ImageID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByRODbID_FileName_DTS[tmp.RODbID.ToString() + "_" + tmp.FileName.ToString() + "_" + tmp.DTS.ToString()] = new List(); // Add new list for RODbID_FileName_DTS } - _CacheByPrimaryKey[tmp.ImageID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByRODbID_FileName_DTS[tmp.RODbID.ToString() + "_" + tmp.FileName.ToString() + "_" + tmp.DTS.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first ROImage } - foreach (ROImage tmp in remove) - RemoveFromCache(tmp); } protected static ROImage GetCachedByPrimaryKey(int imageID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageInfo.cs index 9817546a..c5845d65 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ROImageInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ROImageInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ROImageInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move ROImageInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ImageID.ToString())) + ROImageInfo tmp = _CacheList[0]; // Get the first ROImageInfo + string pKey = tmp.ImageID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ImageID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ImageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ROImageInfo } - foreach (ROImageInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(ROImageInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs index 5a320472..b22aef3b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsage.cs @@ -65,18 +65,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (RoUsage tmp in _CacheList) + while (_CacheList.Count > 0) // Move RoUsage(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROUsageID.ToString())) + RoUsage tmp = _CacheList[0]; // Get the first RoUsage + string pKey = tmp.ROUsageID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ROUsageID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ROUsageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first RoUsage } - foreach (RoUsage tmp in remove) - RemoveFromCache(tmp); } protected static RoUsage GetCachedByPrimaryKey(int rOUsageID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsageInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsageInfo.cs index f8a83030..a3a5c450 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoUsageInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoUsageInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (RoUsageInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move RoUsageInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROUsageID.ToString())) + RoUsageInfo tmp = _CacheList[0]; // Get the first RoUsageInfo + string pKey = tmp.ROUsageID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ROUsageID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ROUsageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first RoUsageInfo } - foreach (RoUsageInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(RoUsageInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs index 370c22f0..dc3e1a46 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Role.cs @@ -90,20 +90,19 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByName = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Role tmp in _CacheList) + while (_CacheList.Count > 0) // Move Role(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RID.ToString())) + Role tmp = _CacheList[0]; // Get the first Role + string pKey = tmp.RID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.RID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey _CacheByName[tmp.Name.ToString()] = new List(); // Add new list for Name } - _CacheByPrimaryKey[tmp.RID.ToString()].Add(tmp); // Add to Primary Key list + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list _CacheByName[tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); + _CacheList.RemoveAt(0); // Remove the first Role } - foreach (Role tmp in remove) - RemoveFromCache(tmp); } protected static Role GetCachedByPrimaryKey(int rid) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RoleInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/RoleInfo.cs index 4350d409..9486a552 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RoleInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/RoleInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (RoleInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move RoleInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RID.ToString())) + RoleInfo tmp = _CacheList[0]; // Get the first RoleInfo + string pKey = tmp.RID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.RID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.RID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first RoleInfo } - foreach (RoleInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(RoleInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs index 847c35c0..9ef650ea 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Transition.cs @@ -66,18 +66,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (Transition tmp in _CacheList) + while (_CacheList.Count > 0) // Move Transition(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) + Transition tmp = _CacheList[0]; // Get the first Transition + string pKey = tmp.TransitionID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first Transition } - foreach (Transition tmp in remove) - RemoveFromCache(tmp); } protected static Transition GetCachedByPrimaryKey(int transitionID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/TransitionInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/TransitionInfo.cs index d000b346..f67802f3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/TransitionInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/TransitionInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (TransitionInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move TransitionInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) + TransitionInfo tmp = _CacheList[0]; // Get the first TransitionInfo + string pKey = tmp.TransitionID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first TransitionInfo } - foreach (TransitionInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(TransitionInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/User.cs b/PROMS/VEPROMS.CSLA.Library/Generated/User.cs index e089ed2b..7a2fd0ab 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/User.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/User.cs @@ -76,18 +76,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (User tmp in _CacheList) + while (_CacheList.Count > 0) // Move User(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UID.ToString())) + User tmp = _CacheList[0]; // Get the first User + string pKey = tmp.UID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.UID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.UID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first User } - foreach (User tmp in remove) - RemoveFromCache(tmp); } protected static User GetCachedByPrimaryKey(int uid) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/UserInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/UserInfo.cs index 6fde4012..c90deb13 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/UserInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/UserInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (UserInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move UserInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UID.ToString())) + UserInfo tmp = _CacheList[0]; // Get the first UserInfo + string pKey = tmp.UID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.UID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.UID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first UserInfo } - foreach (UserInfo tmp in remove) - RemoveFromCache(tmp); } internal static void AddList(UserInfoList lst) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs index 3d6cf843..16b7c509 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZContent.cs @@ -63,18 +63,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ZContent tmp in _CacheList) + while (_CacheList.Count > 0) // Move ZContent(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) + ZContent tmp = _CacheList[0]; // Get the first ZContent + string pKey = tmp.ContentID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ZContent } - foreach (ZContent tmp in remove) - RemoveFromCache(tmp); } protected static ZContent GetCachedByPrimaryKey(int contentID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZContentInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZContentInfo.cs index 4c813dec..f3339d08 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZContentInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZContentInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ZContentInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move ZContentInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) + ZContentInfo tmp = _CacheList[0]; // Get the first ZContentInfo + string pKey = tmp.ContentID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ZContentInfo } - foreach (ZContentInfo tmp in remove) - RemoveFromCache(tmp); } protected static ZContentInfo GetCachedByPrimaryKey(int contentID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs index 6f7dfc5c..733a23f6 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransition.cs @@ -63,18 +63,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ZTransition tmp in _CacheList) + while (_CacheList.Count > 0) // Move ZTransition(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) + ZTransition tmp = _CacheList[0]; // Get the first ZTransition + string pKey = tmp.TransitionID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ZTransition } - foreach (ZTransition tmp in remove) - RemoveFromCache(tmp); } protected static ZTransition GetCachedByPrimaryKey(int transitionID) { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransitionInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransitionInfo.cs index 7b84665d..893e4435 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ZTransitionInfo.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/ZTransitionInfo.cs @@ -48,18 +48,17 @@ namespace VEPROMS.CSLA.Library private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); private static void ConvertListToDictionary() { - List remove = new List(); - foreach (ZTransitionInfo tmp in _CacheList) + while (_CacheList.Count > 0) // Move ZTransitionInfo(s) from temporary _CacheList to _CacheByPrimaryKey { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) + ZTransitionInfo tmp = _CacheList[0]; // Get the first ZTransitionInfo + string pKey = tmp.TransitionID.ToString(); + if (!_CacheByPrimaryKey.ContainsKey(pKey)) { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey + _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); + _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list + _CacheList.RemoveAt(0); // Remove the first ZTransitionInfo } - foreach (ZTransitionInfo tmp in remove) - RemoveFromCache(tmp); } protected static ZTransitionInfo GetCachedByPrimaryKey(int transitionID) {