C # basic Knowledge Base keyword

Source: Internet
Author: User
Tags knowledge base

Objective
    • Actually very early wanted to write about the C # Foundation, always self to find excuses, or to search the Internet to look at, now think I feel a little lazy ... As a developer, the basic knowledge is the most serious, only to consolidate, understand, practice to improve their skills. It is also hoped that through this series, we can help those who need to consolidate the foundation.
Base keyword
    • Calling a method that the base class has been overridden by a derived class
 Public classFather { Public Virtual voidSay () {Console.WriteLine ("Father Say"); }    }     Public classSon:father { Public Override voidSay () {Base.            Say (); Console.WriteLine ("Son Say"); }    }
    • Call the constructor of the base class when specifying a derived class instance
 Public classFather { Public stringName {Get;Set; }  PublicFather () {Name="Father"; }        }         Public classSon:father { PublicSon ():Base()            {            }        }
    • The use of base in EntityFramework, such as:

    • Note: The base keyword cannot be used in a static method.

C # basic Knowledge Base keyword

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.