- C# 7 and .NET Core 2.0 High Performance
- Ovais Mehboob Ahmed Khan
- 95字
- 2021-08-27 18:47:10
Reference returns
Reference returns allows a method to return an object as a reference instead of its value. We can define the reference return value by adding a ref keyword before the type in the method signature and when returning the object from the method itself.
Here is the signature of the method that allows reference returns:
public ref Person GetPersonInformation(int ID); Following is the implementation of the GetPersonInformation method that uses the ref keyword while returning the person's object. Person _person; public ref Person GetPersonInformation(int ID) { _person = CallPersonHttpService(); return ref _person; }
推薦閱讀
- Hands-On Machine Learning with Microsoft Excel 2019
- 云計(jì)算環(huán)境下的信息資源集成與服務(wù)
- Python廣告數(shù)據(jù)挖掘與分析實(shí)戰(zhàn)
- 數(shù)據(jù)庫開發(fā)實(shí)踐案例
- 數(shù)據(jù)結(jié)構(gòu)與算法(C語言版)
- Neural Network Programming with TensorFlow
- 大數(shù)據(jù):從概念到運(yùn)營
- Python醫(yī)學(xué)數(shù)據(jù)分析入門
- Remote Usability Testing
- 智能數(shù)據(jù)時(shí)代:企業(yè)大數(shù)據(jù)戰(zhàn)略與實(shí)戰(zhàn)
- SQL應(yīng)用及誤區(qū)分析
- SAS金融數(shù)據(jù)挖掘與建模:系統(tǒng)方法與案例解析
- Expert Python Programming(Third Edition)
- 數(shù)據(jù)指標(biāo)體系:構(gòu)建方法與應(yīng)用實(shí)踐
- Swift Functional Programming(Second Edition)