예제 #1
0
        public ChangeTrackingCollection <T> AttachCollection <T>(IEnumerable <T> entities, bool takeSnapshot = true) where T : class
        {
            var chtc = new ChangeTrackingCollection <T>(this);

            if (entities != null)
            {
                foreach (var obj in entities)
                {
                    chtc.Attach(obj, takeSnapshot);
                }
            }
            return(chtc);
        }
예제 #2
0
        public ChangeTrackingCollection <T> AddNewCollection <T>(IEnumerable <T> entities) where T : class
        {
            if (entities == null)
            {
                return(null);
            }
            var chtc = new ChangeTrackingCollection <T>(this);

            if (entities != null)
            {
                foreach (var obj in entities)
                {
                    chtc.Add(obj);
                }
            }
            return(chtc);
        }
예제 #3
0
        public ChangeTrackingCollection <T> CreateTrackingCollection <T>() where T : class
        {
            var chtc = new ChangeTrackingCollection <T>(this);

            return(chtc);
        }