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

            try
            {
                entity.SampleAttribute.Add(new SampleType(100));
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        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)
            {
            }
        }