Beispiel #1
0
 private static void GetObjectFromRecordSet(IPersistenceObjectCollection persistenceObjectCollection, DataTable dt)
 {
     persistenceObjectCollection.Initialize(dt.Rows.Count);
     for (var rowIndex = 0; rowIndex < dt.Rows.Count; rowIndex++)
     {
         var dr = dt.Rows[rowIndex];
         var persistenceObject = persistenceObjectCollection.CreateObjectForRetrieval();
         RdbRecordMapper.Populate(persistenceObject, dr);
         persistenceObjectCollection.AddRetrievedObject(persistenceObject);
     }
 }
Beispiel #2
0
        private static void Populate(IPersistenceObjectCollection persistenceObjectCollection, object result)
        {
            if (result == null)
            {
                return;
            }
            if (!(result is IList))
            {
                throw new ApplicationException("Unexpected non-collection returns from Web Service");
            }
            var list = ((IList)result);

            persistenceObjectCollection.Initialize(list.Count);
            for (var index = 0; index < list.Count; index++)
            {
                IPersistenceObject persistenceObject = persistenceObjectCollection.CreateObjectForRetrieval();
                //WsRecordMapper.Populate(persistenceObject,  );
                WsRecordMapper.Populate(persistenceObject, list[index]);
                persistenceObjectCollection.AddRetrievedObject(persistenceObject);
            }
        }