Exemplo n.º 1
0
        public static EntityBulkCopySession CreateSession(Object key, params Type[] prepareTypes)
        {
            var bulkCopySession = new EntityBulkCopySession
            {
                Key = key
            };

            foreach (var prepareType in prepareTypes)
            {
                bulkCopySession.Prepare(prepareType);
            }

            sessionsDict.Add(key, bulkCopySession);

            return(bulkCopySession);
        }
Exemplo n.º 2
0
        public static EntityBulkCopySession CreateOrLoadSession(Object key, params Type[] prepareTypes)
        {
            EntityBulkCopySession bulkCopySession;

            if (!sessionsDict.TryGetValue(key, out bulkCopySession))
            {
                bulkCopySession = new EntityBulkCopySession
                {
                    Key = key
                };

                foreach (var prepareType in prepareTypes)
                {
                    bulkCopySession.Prepare(prepareType);
                }

                sessionsDict.Add(key, bulkCopySession);
            }

            return(bulkCopySession);
        }