예제 #1
0
        public static void InsertSTUDENTS()
        {
            ISqlMapper mapper = EntityMapper;
            MyClass3   testVo = new MyClass3()
            {
                C_KOR_NAME = "윤호", C_ENG_NAME = "YUNHO", C_AGE = 30
            };

            mapper.Insert("InsertSTUDENTS", testVo);
        }
예제 #2
0
        public static void SelectSTUDENTS()
        {
            ISqlMapper       mapper     = EntityMapper;
            MyClass3         testVo     = new MyClass3();
            IList <MyClass3> resultList = mapper.QueryForList <MyClass3>("SelectSTUDENTS", testVo);

            for (int x = 0; x < resultList.Count; x++)
            {
                Console.WriteLine(resultList[x].C_KOR_NAME + resultList[x].C_ENG_NAME + resultList[x].C_AGE);
            }
        }
예제 #3
0
파일: Program.cs 프로젝트: pJqEM5Kj/stuff
        static void Main(string[] args)
        {
            MyClass m1 = new MyClass();
            MyClass2 m2 = new MyClass2();
            MyClass3 m3 = new MyClass3();

            Console.WriteLine(m1.GetHashCode() + "    " + m1.id);
            Console.WriteLine(m2.GetHashCode() + "    " + m2.id);
            Console.WriteLine(m3.GetHashCode() + "    " + m3.id);

            Console.WriteLine("-----------------------");
            m1 = (MyClass)m1.clone();
            m2 = (MyClass2)m2.clone();
            m3 = (MyClass3)m3.Clone();
            Console.WriteLine("-----------------------");

            Console.WriteLine(m1.GetHashCode() + "    " + m1.id);
            Console.WriteLine(m2.GetHashCode() + "    " + m2.id);
            Console.WriteLine(m3.GetHashCode() + "    " + m3.id);
        }
예제 #4
0
파일: Program.cs 프로젝트: pJqEM5Kj/stuff
        public object Clone()
        {
            MyClass3 clon = new MyClass3();
            clon.i = this.i;
            clon.str = this.str;

            //clon.id = this.id;          // passive clonning
            clon.id = clon.GetHashCode(); // smart clonning

            return clon;

            #region another way
            MyClass3 clon2 = (MyClass3)this.MemberwiseClone();
            clon2.id = clon2.GetHashCode();
            return clon2;

            //or
            //return this.MemberwiseClone();
            #endregion
        }