- 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; }
推薦閱讀
- 數(shù)據(jù)庫應(yīng)用實戰(zhàn)
- 信息系統(tǒng)與數(shù)據(jù)科學(xué)
- 輕松學(xué)大數(shù)據(jù)挖掘:算法、場景與數(shù)據(jù)產(chǎn)品
- 分布式數(shù)據(jù)庫系統(tǒng):大數(shù)據(jù)時代新型數(shù)據(jù)庫技術(shù)(第3版)
- 大數(shù)據(jù)導(dǎo)論
- R數(shù)據(jù)科學(xué)實戰(zhàn):工具詳解與案例分析(鮮讀版)
- 算法與數(shù)據(jù)中臺:基于Google、Facebook與微博實踐
- Oracle高性能自動化運(yùn)維
- 深度剖析Hadoop HDFS
- 數(shù)據(jù)庫技術(shù)實用教程
- 大數(shù)據(jù)架構(gòu)商業(yè)之路:從業(yè)務(wù)需求到技術(shù)方案
- INSTANT Android Fragmentation Management How-to
- 編寫有效用例
- 云計算寶典:技術(shù)與實踐
- Mastering ROS for Robotics Programming(Second Edition)