开发者

In C# what does this syntax do and what is it called?

开发者 https://www.devze.com 2023-03-19 20:36 出处:网络
I\'m guessing this is saying the Constructor for Or开发者_运维知识库derRepository passes its parameter to the base constructor?

I'm guessing this is saying the Constructor for Or开发者_运维知识库derRepository passes its parameter to the base constructor?

public OrderRepository(MFEntitiesContainer context) : base(context) { }


This is called constructor chaining - you are chaining the constructor to the base constructor overload.

As you assume, it passes the parameter to the matching base class constructor.


Correct. Its calling the "base constructor".

See this page on constructors.

http://msdn.microsoft.com/en-us/library/ms173115(v=VS.100).aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号