Inheritance: FrameworkEntityBase
        public void CollectionInterceptor_InlineMethodCall_Test()
        {
            var entity = new SampleType(-1).AsAttributeExtendable<SampleAttributeMetadata>();

            try
            {
                entity.SampleAttribute.Add(new SampleType(100));
            }
            catch (Exception)
            {
            }
        }
示例#2
0
        public void TestMethod1()
        {
            int max = 1000;
            int printOnCount = (max / 100);

            Console.WriteLine("First {0}", GC.GetTotalMemory(false));

            for (int i = 0; i < max; i++)
            {
                var metadata = new SampleType(-1).AsAttributeExtendable<SampleAttributeMetadata>();
                if (i % printOnCount == 0)
                {
                    Console.WriteLine(GC.GetTotalMemory(false));
                }
            }

            Console.WriteLine("Last {0}", GC.GetTotalMemory(true));
        }
        public void CollectionInterceptor_GettSetter_Test()
        {
            var entity = new SampleType(-1).AsAttributeExtendable<SampleAttributeMetadata>();

            try
            {
                // getter
                var collection = entity.SampleAttribute;
                collection.Add(new SampleType(100));
                entity.SampleAttribute = collection;
            }
            catch (Exception)
            {
            }

            try
            {
                // setter
                entity.SampleAttribute = new List<SampleType>();
            }
            catch (Exception)
            {
            }
        }