속성의 경우 함수 호출이 추가로 있기 때문에 가능하면 필드 사용

 

- il code

 

- test code

    class TestClass
    {
        public int field;
        public int Property { get; set; }
    }


    class Program
    {
        static void Main(string[] args)
        {
            var c = new TestClass();

            c.field = 1;
            c.Property = 2;

            Console.WriteLine(c.field);
            Console.WriteLine(c.Property);
        }
    }

'Dev' 카테고리의 다른 글

visual studio 2019 python package 설치  (1) 2022.07.10
.net il 코드 확인  (0) 2021.02.02
네이버 메일 서버를 이용한 메일 발송  (0) 2020.11.19
aws ubuntu 인스턴스 파일 복사  (0) 2018.01.07
ubuntu timezone 설정  (0) 2018.01.07
Posted by geniusds
,