{"id":3462,"date":"2023-05-30T01:05:07","date_gmt":"2023-05-29T17:05:07","guid":{"rendered":"https:\/\/lonelinerd.com\/?p=3462"},"modified":"2023-06-16T01:21:19","modified_gmt":"2023-06-15T17:21:19","slug":"anonymous-members","status":"publish","type":"post","link":"https:\/\/lonelinerd.com\/index.php\/2023\/05\/30\/anonymous-members\/","title":{"rendered":"C#\u7b46\u8a18 \u2013 \u533f\u540d\u985e\u578b\u8207\u533f\u540d\u65b9\u6cd5"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3462\" class=\"elementor elementor-3462\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-42231ad elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"42231ad\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-55ec069\" data-id=\"55ec069\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-913fcdc elementor-widget elementor-widget-text-editor\" data-id=\"913fcdc\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<h5 class=\"md-end-block md-heading\"><strong><span class=\"md-plain\">\u533f\u540d\u985e\u578b<\/span><\/strong><\/h5>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u4e00\u7a2e\u81ea\u52d5\u8072\u660e\u4e0d\u53ef\u8b8a\u7684\u5143\u7d44\u985e\u578b\u7684\u8a9e\u6cd5<\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5143\u7d44\u985e\u578b\uff1a\u542b\u6709\u4e00\u7d44\u5c6c\u6027\u7684\u985e\u578b<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li class=\"md-list-item\">\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"C#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">o1<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Kelvin\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">24<\/span> };<\/span><\/pre>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u7de8\u8b6f\u5668\u81ea\u52d5\u5275\u5efa\u985e\u578b\u540d\u7a31\uff0c\u800c\u958b\u767c\u8005\u7121\u6cd5\u5f97\u77e5\uff0c\u53ea\u80fd\u4f7f\u7528var\u63a5\u6536<\/span><\/span><\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">var\uff1a<\/span><\/span><\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-comment\">\/\/\u7de8\u8b6f\u5668\u7372\u53d6\u521d\u59cb\u5316\u8868\u9054\u5f0f\u5728\u7de8\u8b6f\u6642\u7684\u985e\u578b\uff0c\u4f7f\u8b8a\u91cf\u4e5f\u5177\u6709\u90a3\u7a2e\u985e\u578b<\/span><\/span><br><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">varName<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span> <span class=\"cm-variable\">MyType<\/span>();<\/span><\/pre>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u9650\u5236<\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u53ea\u6709<\/span><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5c40\u90e8\u8b8a\u91cf\u53ef\u7528var\uff0c\u975c\u614b\u5b57\u6bb5\u548c\u5be6\u4f8b\u5b57\u6bb5\u90fd\u4e0d\u53ef\u4ee5\u4f7f\u7528<\/span><\/span><\/span><\/p>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u8b8a\u91cf\u5728\u8072\u660e\u7684\u540c\u6642\u88ab\u521d\u59cb\u5316<\/span><\/span><\/span><\/p>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u521d\u59cb\u5316\u8868\u9054\u5f0f\u4e0d\u662f\u65b9\u6cd5\u7d44\uff0c\u4e5f\u4e0d\u662f\u533f\u540d\u65b9\u6cd5\/Lambda\u8868\u9054\u5f0f\uff08\u5982\u679c\u4e0d\u9032\u884c\u5f37\u5236\u8f49\u63db\uff09<\/span><\/span><\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-comment\">\/\/Invalid<\/span><\/span><br><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">starter<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span>() { <span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(); };<\/span><br><span role=\"presentation\"><span class=\"cm-comment\">\/\/Valid<\/span><\/span><br><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">starter<\/span> <span class=\"cm-operator\">=<\/span> (<span class=\"cm-variable\">SomeDelegate<\/span>)<span class=\"cm-keyword\">delegate<\/span>() { <span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(); }<\/span><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u521d\u59cb\u5316\u8868\u9054\u5f0f\u4e0d\u662fnull<\/span><\/span><\/span><\/p>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u8a9e\u53e5\u4e2d\u53ea\u8072\u660e\u4e86\u4e00\u500b\u8b8a\u91cf<\/span><\/span><\/span><\/p>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u4e0d\u5305\u542b\u6b63\u5728\u8072\u660e\u7684\u8b8a\u91cf<\/span><\/span><\/span><\/p>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u8b8a\u91cf\u985e\u578b\u662f\u521d\u59cb\u5316\u8868\u9054\u5f0f\u7684\u7de8\u8b6f\u6642\u985e\u578b<\/span><\/span><\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">args<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable\">Environment<\/span>.<span class=\"cm-variable\">GetArgs<\/span>();<\/span><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728using, for, foreach\u8a9e\u53e5\u7684\u958b\u982d\u90e8\u5206\u4e2d\u8072\u660e\u7684\u5c40\u90e8\u8b8a\u91cf\u4f7f\u7528var\u4e5f\u662f\u5408\u6cd5\u7684<\/span><\/span><\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u512a\u7f3a\u9ede<\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u53ef\u8b80\u6027<\/span><\/p>\n<ul class=\"ul-list\" data-mark=\"-\">\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u512a\u9ede\uff1a\u6e1b\u5c11\u4ee3\u78bc\u91cf<\/span><\/p>\n<\/li>\n<li class=\"md-list-item\">\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u7f3a\u9ede\uff1a\u7121\u6cd5\u76f4\u89c0\u5224\u65b7\u985e\u578b<\/span><span style=\"font-style: inherit; font-weight: inherit;\">&nbsp;<\/span><\/p><\/li><\/ul><\/li><\/ul><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-797500c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"797500c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8637e6d\" data-id=\"8637e6d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8bfe48b elementor-widget elementor-widget-image\" data-id=\"8bfe48b\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"257\" src=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2022\/03\/CLR_10_4.png\" class=\"attachment-large size-large wp-image-2193\" alt=\"\" srcset=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2022\/03\/CLR_10_4.png 596w, https:\/\/lonelinerd.com\/wp-content\/uploads\/2022\/03\/CLR_10_4-300x129.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7806f1c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7806f1c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-da9a365\" data-id=\"da9a365\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2b706c7 elementor-widget elementor-widget-text-editor\" data-id=\"2b706c7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<ul class=\"ul-list\" data-mark=\"-\"><li style=\"list-style-type: none;\"><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item md-focus-container\"><p class=\"md-end-block md-p md-focus\"><span class=\"md-plain md-expand\">\u7de8\u8b6f\u5668\u9996\u5148<\/span><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u63a8\u65b7\u6bcf\u500b\u8868\u9054\u5f0f\u7684\u985e\u578b\uff0c\u5275\u5efa\u63a8\u65b7\u985e\u578b\u7684\u79c1\u6709\u5b57\u6bb5<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"IL\" spellcheck=\"false\"><span role=\"presentation\">\/\/Name<\/span><br \/><span role=\"presentation\">.field private initonly !'&lt;Name&gt;j__TPar' '&lt;Name&gt;i__Field'<\/span><br \/><span role=\"presentation\">.custom instance void [System.Diagnostics.Debug]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Diagnostics.Debug]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) <\/span><br \/><br \/><span role=\"presentation\">\/\/Age<\/span><br \/><span role=\"presentation\">.field private initonly !'&lt;Age&gt;j__TPar' '&lt;Age&gt;i__Field'<\/span><br \/><span role=\"presentation\">.custom instance void [System.Diagnostics.Debug]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Diagnostics.Debug]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) <\/span><\/pre><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u7136\u5f8c\u70ba\u6bcf\u500b\u5b57\u6bb5\u5275\u5efa\u5c0d\u61c9\u7684\u552f\u8b80\u5c6c\u6027<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u518d\u5275\u5efa\u69cb\u9020\u5668\u4f86\u63a5\u53d7\u6240\u6709\u8868\u9054\u5f0f<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u6700\u5f8c\u91cd\u5bebEquals\u3001GetHashCode\u548cToString\u65b9\u6cd5<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5982\u679c\u5b9a\u7fa9\u4e86\u591a\u500b\u76f8\u540c\u7d50\u69cb\u7684\u533f\u540d\u985e\u578b\uff0c\u7de8\u8b6f\u5668\u4e5f\u53ea\u6703\u5275\u5efa\u4e00\u500b\u533f\u540d\u985e\u578b\u5b9a\u7fa9\uff0c\u7136\u5f8c\u5275\u5efa\u8a72\u985e\u578b\u7684\u591a\u500b\u5be6\u4f8b<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u9019\u4f7f\u5f97\u4ee5\u4e0b\u64cd\u4f5c\u6210\u70ba\u4e86\u53ef\u80fd<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"C#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">o1<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Kelvin\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">24<\/span> };<\/span><br \/><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">o2<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Catherine\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">24<\/span> };<\/span><br \/><br \/><span role=\"presentation\"><span class=\"cm-variable\">o1<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable\">o2<\/span>;<\/span><br \/><br \/><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">people<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span>[]<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">o1<\/span>,<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Virgil\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">18<\/span> },<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Nero\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">18<\/span> },<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Dante\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">18<\/span> },<\/span><br \/><span role=\"presentation\">};<\/span><\/pre><\/li><\/ul><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u533f\u540d\u985e\u578b\u7d93\u5e38\u8207LINQ\u914d\u5408\u4f7f\u7528\uff0c\u4e5f\u662fvar\u7684\u4e3b\u8981\u4f7f\u7528\u5834\u666f<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u9650\u5236\uff1a<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u533f\u540d\u985e\u578b\u7684\u5be6\u4f8b\u4e0d\u80fd\u6cc4\u9732\u5230\u65b9\u6cd5\u5916\u90e8<\/span><\/p><\/li><\/ul><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u65b9\u6cd5\u4e0d\u80fd\u63a5\u53d7\u533f\u540d\u985e\u578b\u7684\u53c3\u6578\uff1b\u4e5f\u4e0d\u53ef\u4ee5\u8fd4\u56de\u533f\u540d\u985e\u578b\u7684\u8fd4\u56de\u503c<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u96d6\u7136\u53ef\u4ee5\u628a\u533f\u540d\u985e\u578b\u8996\u70baObject\uff1b\u4f46\u662f<\/span><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">Object\u4e0d\u80fd\u8f49\u70ba\u533f\u540d\u985e\u578b<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item md-focus-container\"><p class=\"md-end-block md-p md-focus\"><span class=\"md-plain md-expand\">\u533f\u540d\u985e\u578b\u5728\u7de8\u8b6f\u6642\u7684\u540d\u7a31\u662f\u672a\u77e5\u7684<\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u533f\u540d\u985e\u578b\u7684\u5c6c\u6027\u90fd\u662f\u53ef\u8b80\u4e0d\u53ef\u5beb\u7684\uff0c\u5176\u503c\u548c\u985e\u578b\u5df2\u5728\u7528\u65bc\u5275\u5efa\u5be6\u4f8b\u7684\u533f\u540d\u5c0d\u8c61\u521d\u59cb\u5316\u7a0b\u5e8f\u4e2d\u6307\u5b9a\uff08\u78ba\u5b9a\uff09<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-comment\">\/\/\u96b1\u5f0f\u985e\u578b\u6578\u7d44<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-keyword\">var<\/span> <span class=\"cm-def\">family<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span>[]<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-comment\">\/\/\u533f\u540d\u985e\u578b<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Holly\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">36<\/span> },<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Jon\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">36<\/span> },<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Tom\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">9<\/span> },<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"Robin\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">6<\/span> },<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">new<\/span> { <span class=\"cm-variable\">Name<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"William\"<\/span>, <span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">6<\/span> }<\/span><br \/><span role=\"presentation\">};<\/span><\/pre><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">family\u4e2d\u6240\u6709\u4eba\u90fd\u5fc5\u9808\u6709\u76f8\u540c\u7684\u985e\u578b\uff0c\u5426\u5247\u7de8\u8b6f\u5668\u7121\u6cd5\u63a8\u65b7\u6578\u7d44\u7684\u985e\u578b<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728\u4efb\u4f55\u4e00\u500b\u7d66\u5b9a\u7684\u7a0b\u5e8f\u96c6\u4e2d\uff0c\u5982\u679c\u5169\u500b\u533f\u540d\u5c0d\u8c61\u521d\u59cb\u5316\u7a0b\u5e8f\u5305\u542b\u76f8\u540c\u6578\u91cf\u7684\u5c6c\u6027\uff0c\u4e14\u5177\u6709\u76f8\u540c\u7684\u540d\u7a31\u548c\u985e\u578b\uff0c\u4ee5\u76f8\u540c\u7684\u9806\u5e8f\u51fa\u73fe\uff0c\u5c31\u88ab\u8a8d\u70ba\u662f\u540c\u4e00\u500b\u985e\u578b\u3002<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item md-focus-container\"><p class=\"md-end-block md-p md-focus\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u533f\u540d\u985e\u578b\u88ab\u8072\u660e\u6642\uff0cIL\u6703\u81ea\u52d5\u5275\u5efa\u4e00\u500b\u985e\u4e26\u5305\u542b\u5230\u6700\u7d42\u7684\u7a0b\u5e8f\u96c6\u4e2d\uff0cCLR\u628a\u5b83\u5011\u770b\u505a\u666e\u901a\u7684\u985e\u578b<\/span><\/span><\/span><\/p><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-68a0041 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"68a0041\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1fb0667\" data-id=\"1fb0667\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d8af5c0 elementor-widget elementor-widget-image\" data-id=\"d8af5c0\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"600\" src=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/AnnoymousType.png\" class=\"attachment-large size-large wp-image-1641\" alt=\"\" srcset=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/AnnoymousType.png 556w, https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/AnnoymousType-278x300.png 278w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0abd812 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0abd812\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-45f0452\" data-id=\"45f0452\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0c5acea elementor-widget elementor-widget-text-editor\" data-id=\"0c5acea\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<ul class=\"ul-list\" data-mark=\"-\"><li style=\"list-style-type: none;\"><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\">\/\/\u533f\u540d\u985e\u5be6\u4f8b\u5316IL<br \/>IL_0009: ldstr \"Holly\"<br \/>IL_000e: ldc.i4.s 36<br \/>IL_0010: newobj instance void class '&lt;&gt;f__AnonymousType0`2'&lt;string,int32&gt;::.ctor(!0,<br \/>!1)<br \/>IL_0015: stelem.ref<br \/>IL_0016: dup<br \/>IL_0017: ldc.i4.1<br \/>IL_0018: ldstr \"Jon\"<br \/>IL_001d: ldc.i4.s 36<br \/>IL_001f: newobj instance void class '&lt;&gt;f__AnonymousType0`2'&lt;string,int32&gt;::.ctor(!0,<br \/>!1)<br \/>IL_0024: stelem.ref<br \/>IL_0025: dup<br \/>IL_0026: ldc.i4.2<br \/>IL_0027: ldstr \"Tom\"<br \/>IL_002c: ldc.i4.s 9<br \/>IL_002e: newobj instance void class '&lt;&gt;f__AnonymousType0`2'&lt;string,int32&gt;::.ctor(!0,<br \/>!1)<br \/>IL_0033: stelem.ref<br \/>IL_0034: dup<br \/>IL_0035: ldc.i4.3<br \/>IL_0036: ldstr \"Robin\"<br \/>IL_003b: ldc.i4.6<br \/>IL_003c: newobj instance void class '&lt;&gt;f__AnonymousType0`2'&lt;string,int32&gt;::.ctor(!0,<br \/>!1)<br \/>IL_0041: stelem.ref<br \/>IL_0042: dup<br \/>IL_0043: ldc.i4.4<br \/>IL_0044: ldstr \"William\"<br \/>IL_0049: ldc.i4.6<br \/>IL_004a: newobj instance void class '&lt;&gt;f__AnonymousType0`2'&lt;string,int32&gt;::.ctor(!0,<br \/>!1)<\/pre><\/li><\/ul><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5b9fb54 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5b9fb54\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2ff4e8f\" data-id=\"2ff4e8f\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ae661b9 elementor-widget elementor-widget-text-editor\" data-id=\"ae661b9\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\" style=\"list-style-type: none;\"><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\">\/\/\u533f\u540d\u985e\u5167\u90e8IL<br \/>.method public hidebysig specialname rtspecialname <br \/>instance void .ctor(!'j__TPar' Name,<br \/>!'j__TPar' Age) cil managed<br \/>{<br \/>.custom instance void [System.Diagnostics.Debug]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) <br \/>\/\/ \u7a0b\u5f0f\u78bc\u5927\u5c0f 21 (0x15)<br \/>.maxstack 8<br \/>IL_0000: ldarg.0<br \/>IL_0001: call instance void [System.Runtime]System.Object::.ctor()<br \/>IL_0006: ldarg.0<br \/>IL_0007: ldarg.1<br \/>IL_0008: stfld !0 class '&lt;&gt;f__AnonymousType0`2'&lt;!'j__TPar',!'j__TPar'&gt;::'i__Field'<br \/>IL_000d: ldarg.0<br \/>IL_000e: ldarg.2<br \/>IL_000f: stfld !1 class '&lt;&gt;f__AnonymousType0`2'&lt;!'j__TPar',!'j__TPar'&gt;::'i__Field'<br \/>IL_0014: ret<br \/>} \/\/ end of method '&lt;&gt;f__AnonymousType0`2'::.ctor<\/pre><\/li><\/ul><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3df2b0e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3df2b0e\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-088ae33\" data-id=\"088ae33\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ba819f7 elementor-widget elementor-widget-text-editor\" data-id=\"ba819f7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<ul><li style=\"list-style-type: none;\"><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\">\u533f\u540d\u985e\u5305\u542b\u4e86<\/li><\/ul><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-fddd995 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"fddd995\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8bab419\" data-id=\"8bab419\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-675b196 elementor-widget elementor-widget-image\" data-id=\"675b196\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"385\" height=\"589\" src=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/AnnoymousType_2.png\" class=\"attachment-large size-large wp-image-1643\" alt=\"\" srcset=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/AnnoymousType_2.png 385w, https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/AnnoymousType_2-196x300.png 196w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b23941c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b23941c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-44ab452\" data-id=\"44ab452\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-77e5a24 elementor-widget elementor-widget-text-editor\" data-id=\"77e5a24\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<ul><li style=\"list-style-type: none;\"><ul><li style=\"list-style-type: none;\"><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u4e00\u500b\u7372\u53d6\u6240\u6709\u521d\u59cb\u503c\u7684\u69cb\u9020\u51fd\u6578\u3002\u53c3\u6578\u9806\u5e8f\u548c\u5b83\u5011\u5728\u533f\u540d\u5c0d\u8c61\u521d\u59cb\u5316\u7a0b\u5e8f\u4e2d\u7684\u9806\u5e8f\u4e00\u6a23\uff0c\u540d\u7a31\u985e\u578b\u4e5f\u4e00\u6a23<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u516c\u6709\u7684\u53ea\u8b80\u5c6c\u6027<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u533f\u540d\u985e\u578b\u662f<\/span><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u300c\u4e0d\u6613\u8b8a\u300d\u7684<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5c6c\u6027\u7684\u79c1\u6709\u53ea\u8b80\u5b57\u6bb5<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u91cd\u5beb\u7684Equals\u3001GetHashCode\u3001ToString<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u7576\u540c\u4e00\u500b\u533f\u540d\u985e\u578b\u7684\u5169\u500b\u5be6\u4f8b\u5224\u65b7\u76f8\u7b49\u6027\u6642\uff0c\u7528\u5c6c\u6027\u985e\u578b\u7684Equals\u65b9\u6cd5\u4f9d\u6b21\u6bd4\u8f03\u6bcf\u500b\u5c6c\u6027\u503c\u3002<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u751f\u6210HashCode\u4e5f\u662f\u4f9d\u6b21\u70ba\u6bcf\u500b\u5c6c\u6027\u503c\u8abf\u7528GetHashCode\uff0c\u5e76\u7d44\u5408\u7d50\u679c\uff0c\u8fd4\u56de\u4e00\u500b\u8907\u5408\u7684\u6563\u5217<\/span><\/p><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3024461 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3024461\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-aec244c\" data-id=\"aec244c\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-364a6b1 elementor-widget elementor-widget-text-editor\" data-id=\"364a6b1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<h5 class=\"md-end-block md-heading\"><strong><span class=\"md-plain\">\u533f\u540d\u65b9\u6cd5<\/span><\/strong><\/h5><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u533f\u540d\u65b9\u6cd5\u5141\u8a31\u4f60\u6307\u5b9a\u4e00\u500b\u5167\u806f\u59d4\u6258\u5be6\u4f8b\u7684\u64cd\u4f5c\uff0c\u4f5c\u70ba\u5275\u5efa\u59d4\u6258\u5be6\u4f8b\u8868\u9054\u5f0f\u7684\u4e00\u90e8\u5206\u3002<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u8a9e\u6cd5\uff1a<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u4f7f\u7528delegate\u95dc\u9375\u5b57<\/span><\/p><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-keyword\">delegate<\/span>(<span class=\"cm-variable\">\u53c3\u6578<\/span>)<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">\u4ee3\u78bc\u584a<\/span><\/span><br \/><span role=\"presentation\">};<\/span><\/pre><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u533f\u540d\u65b9\u6cd5\u7684\u7d50\u679c\u662f\u4e00\u500b\u59d4\u6258\u5be6\u4f8b<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u4e0d\u540c\u65bc\u4e00\u822c\u59d4\u6258\u5be6\u4f8b\uff0c\u9006\u8b8a\u6027\u4e0d\u9069\u7528\u65bc\u533f\u540d\u65b9\u6cd5\uff0c\u5fc5\u9808\u6307\u5b9a\u548c\u59d4\u6258\u985e\u578b\u5b8c\u5168\u5339\u914d\u7684\u53c3\u6578\u985e\u578b<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728IL\u4e2d\uff0c\u7de8\u8b6f\u5668\u6703\u5728\u5df2\u77e5\u985e\uff08\u533f\u540d\u65b9\u6cd5\u6240\u5728\u7684\u985e\uff09\u7684\u5167\u90e8\u751f\u6210\u4e00\u500b\u65b9\u6cd5\uff0c\u4e26\u4f7f\u7528\u5275\u5efa\u59d4\u6258\u5be6\u4f8b\u6642\u7684\u64cd\u4f5c\uff0c\u5c31\u50cf\u4e00\u500b\u666e\u901a\u65b9\u6cd5\u4e00\u6a23\u3002<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u4f46\u9019\u4e9b\u65b9\u6cd5\u7684\u540d\u7a31\u662f\u4e0d\u53cb\u597d\uff08unspeakable\uff09\u7684\uff0c\u56e0\u6b64\uff0c\u5b83\u5011\u53ea\u5728IL\u4e2d\u6709\u6548\uff0c\u5728C#\u4e2d\u5247\u7121\u6548\uff0c\u56e0\u6b64\u7121\u6cd5\u5728C#\u4ee3\u78bc\u4e2d\u76f4\u63a5\u5f15\u7528\u5b83\u5011\u3002<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-comment\">\/\/C# \u5c64<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-keyword\">static<\/span> <span class=\"cm-keyword\">void<\/span> <span class=\"cm-variable\">Main<\/span>(<span class=\"cm-variable-3\">string<\/span>[] <span class=\"cm-variable\">args<\/span>)<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable-3\">Action<\/span><span class=\"cm-operator\">&lt;<\/span><span class=\"cm-variable-3\">string<\/span><span class=\"cm-operator\">&gt;<\/span> <span class=\"cm-variable\">printReverse<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span> (<span class=\"cm-variable-3\">string<\/span> <span class=\"cm-variable\">text<\/span>)<\/span><br \/><span role=\"presentation\"> \u00a0  {<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable-3\">char<\/span>[] <span class=\"cm-variable\">chars<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable\">text<\/span>.<span class=\"cm-variable\">ToCharArray<\/span>();<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">Array<\/span>.<span class=\"cm-variable\">Reverse<\/span>(<span class=\"cm-variable\">chars<\/span>);<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-keyword\">new<\/span> <span class=\"cm-variable-3\">string<\/span>(<span class=\"cm-variable\">chars<\/span>));<\/span><br \/><span role=\"presentation\"> \u00a0  }<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">printReverse<\/span>(<span class=\"cm-string\">\"Let It Out\"<\/span>);<\/span><br \/><span role=\"presentation\">}<\/span><\/pre><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\">\/\/IL\u5c64<br \/>\/\/\u5165\u53e3<br \/>\/\/Main : void(string[])<br \/>\/\/\u81e8\u6642\u5275\u5efa\u4e00\u500b\u985e<br \/>IL_000a: ldsfld class CSharpInDepth.Program\/'&lt;&gt;c' CSharpInDepth.Program\/'&lt;&gt;c'::'&lt;&gt;9'<br \/>\/\/\u5728\u81e8\u6642\u985e\u88e1\u751f\u6210\u4e00\u500b\u65b9\u6cd5<br \/>IL_000f: ldftn instance void CSharpInDepth.Program\/'&lt;&gt;c'::'&lt;Main&gt;b__6_0'(string)<br \/>IL_0015: newobj instance void class [System.Runtime]System.Action`1&lt;string&gt;::.ctor(object,<br \/>native int)<br \/>IL_001a: dup<br \/>IL_001b: stsfld class [System.Runtime]System.Action`1&lt;string&gt; CSharpInDepth.Program\/'&lt;&gt;c'::'&lt;&gt;9__6_0'<\/pre><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\">\/\/IL\u5c64<br \/>\/\/\u88ab\u69cb\u9020\u7684\u65b9\u6cd5<br \/>\/\/&lt;&gt;c<br \/>\/\/&lt;Main&gt;b__6_0 : void(string)<br \/>.method assembly hidebysig instance void <br \/>'&lt;Main&gt;b__6_0'(string text) cil managed<br \/>{<br \/>\/\/ \u7a0b\u5f0f\u78bc\u5927\u5c0f 28 (0x1c)<br \/>.maxstack 1<br \/>.locals init (char[] V_0)<br \/>IL_0000: nop<br \/>IL_0001: ldarg.1<br \/>IL_0002: callvirt instance char[] [System.Runtime]System.String::ToCharArray()<br \/>IL_0007: stloc.0<br \/>IL_0008: ldloc.0<br \/>IL_0009: call void [System.Runtime]System.Array::Reverse&lt;char&gt;(!!0[])<br \/>IL_000e: nop<br \/>IL_000f: ldloc.0<br \/>IL_0010: newobj instance void [System.Runtime]System.String::.ctor(char[])<br \/>IL_0015: call void [System.Console]System.Console::WriteLine(string)<br \/>IL_001a: nop<br \/>IL_001b: ret<br \/>} \/\/ end of method '&lt;&gt;c'::'&lt;Main&gt;b__6_0'<\/pre><\/li><\/ul><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u8fd4\u56de\u503c<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u6709\u7684\u59d4\u6258\u662f\u53ef\u4ee5\u6709\u8fd4\u56de\u503c\u7684\uff0c\u6bd4\u5982Predicate<\/span><span class=\"md-plain\">\u548cFunc<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u7576\u9700\u8981\u533f\u540d\u51fd\u6578\u9032\u884c\u503c\u7684\u8fd4\u56de\u6642\uff0c\u4e0d\u9700\u8981\u8072\u660e\u8fd4\u56de\u503c\u985e\u578b\uff0c\u7de8\u8b6f\u5668\u81ea\u5df1\u6703\u6aa2\u67e5\u662f\u5426\u6240\u6709\u53ef\u80fd\u7684\u8fd4\u56de\u503c\u90fd\u517c\u5bb9\u65bc\u59d4\u6258\u985e\u578b\uff08\u7de8\u8b6f\u5668\u6703\u5617\u8a66\u5c07\u533f\u540d\u65b9\u6cd5\u8f49\u63db\u6210\u8a72\u59d4\u6258\u985e\u578b\uff09<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u7576\u533f\u540d\u65b9\u6cd5\u8fd4\u56de\u4e00\u500b\u503c\u6642\uff0c\u771f\u7684\u662f\u5f9e\u533f\u540d\u65b9\u6cd5\u8fd4\u56de\uff0c\u4e0d\u662f\u5f9e\u5275\u5efa\u7684\u59d4\u6258\u5be6\u4f8b\u7684\u65b9\u6cd5\u8fd4\u56de<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-variable\">Predicate<\/span><span class=\"cm-operator\">&lt;<\/span><span class=\"cm-variable-3\">int<\/span><span class=\"cm-operator\">&gt;<\/span> <span class=\"cm-variable\">isEven<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span> (<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">x<\/span>) { <span class=\"cm-keyword\">return<\/span> <span class=\"cm-variable\">x<\/span> <span class=\"cm-operator\">%<\/span> <span class=\"cm-number\">2<\/span> <span class=\"cm-operator\">==<\/span> <span class=\"cm-number\">0<\/span>; }; <span class=\"cm-comment\">\/\/\u517c\u5bb9\u7684\u8fd4\u56de\u503c\u985e\u578b\uff1abool<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-variable-3\">Func<\/span><span class=\"cm-operator\">&lt;<\/span><span class=\"cm-variable-3\">int<\/span>, <span class=\"cm-variable-3\">string<\/span><span class=\"cm-operator\">&gt;<\/span> <span class=\"cm-variable\">test<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span> (<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">y<\/span>) { <span class=\"cm-keyword\">return<\/span> <span class=\"cm-variable\">$<\/span><span class=\"cm-string\">\"Answer:{y}\"<\/span>; }; <span class=\"cm-comment\">\/\/\u517c\u5bb9\u7684\u8fd4\u56de\u503c\u985e\u578b\uff1a\u6700\u5f8c\u4e00\u500b\u53c3\u6578<\/span><\/span><\/pre><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5ffd\u7565\u59d4\u6258\u53c3\u6578<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5982\u679c\u4e0d\u95dc\u5fc3\u59d4\u6258\u7684\u53c3\u6578\uff0c\u53ef\u4ee5\u4e0d\u7528\u8072\u660e\u5b83\u5011<\/span><\/p><\/li><\/ul><\/li><\/ul><h5 class=\"md-end-block md-heading\"><strong><span class=\"md-plain\">\u6355\u7372\u8b8a\u91cf<\/span><\/strong><\/h5><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u9589\u5305<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u4e00\u500b\u51fd\u6578\u9664\u4e86\u80fd\u901a\u904e\u63d0\u4f9b\u7d66\u5b83\u7684\u53c3\u6578\u4ea4\u4e92\u4e4b\u5916\uff0c\u9084\u80fd\u540c\u74b0\u5883\u9032\u884c\u66f4\u5927\u7a0b\u5ea6\u7684\u4e92\u52d5<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5916\u90e8\u8b8a\u91cf\uff08outer variable\uff09<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728\u5305\u62ec\u533f\u540d\u65b9\u6cd5\u7684\u4f5c\u7528\u57df\uff08scope\uff09\u4e2d\u7684\u5c40\u90e8\u8b8a\u91cf\u6216\u53c3\u6578\uff08\u4e0d\u5305\u62ecref\u548cout\u53c3\u6578\uff09\u3002\u5728\u985e\u7684\u5be6\u4f8b\u6210\u54e1\u5167\u90e8\u7684\u533f\u540d\u65b9\u6cd5\u4e2d\uff0cthis\u5f15\u7528\u4e5f\u88ab\u8a8d\u70ba\u662f\u4e00\u500b\u5916\u90e8\u8b8a\u91cf<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u6355\u7372\uff08\u7684\u5916\u90e8\uff09\u8b8a\u91cf\uff08captured (outer) variable\uff09<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728\u533f\u540d\u65b9\u6cd5\u5167\u90e8\u4f7f\u7528\u7684\u5916\u90e8\u8b8a\u91cf<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728\u9589\u5305\u5b9a\u7fa9\u4e2d\uff0c\u300c\u51fd\u6578\u300d\u6307\u7684\u662f\u533f\u540d\u65b9\u6cd5\uff0c\u300c\u8207\u4e4b\u4ea4\u4e92\u7684\u74b0\u5883\u300d\u6307\u7684\u662f\u533f\u540d\u65b9\u6cd5\u6355\u7372\u5230\u7684\u8b8a\u91cf\u96c6<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u7c21\u8a00\u4e4b\uff0c\u533f\u540d\u65b9\u6cd5\u80fd\u4f7f\u7528\u5728\u8072\u660e\u8a72\u533f\u540d\u65b9\u6cd5\u7684\u65b9\u6cd5\u5167\u90e8\u5b9a\u7fa9\u7684\u5c40\u90e8\u8b8a\u91cf<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-keyword\">void<\/span> <span class=\"cm-variable\">EnclosingMethod<\/span>()<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">outerVar<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">5<\/span>; <span class=\"cm-comment\">\/\/\u5916\u90e8\u8b8a\u91cf<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable-3\">string<\/span> <span class=\"cm-variable\">capturedVar<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"captured\"<\/span>; <span class=\"cm-comment\">\/\/\u6355\u7372\u8b8a\u91cf<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">if<\/span>(<span class=\"cm-variable-3\">DateTime<\/span>.<span class=\"cm-variable\">Now<\/span>.<span class=\"cm-variable\">Hour<\/span> <span class=\"cm-operator\">==<\/span> <span class=\"cm-number\">23<\/span>)<\/span><br \/><span role=\"presentation\"> \u00a0  {<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">normalLocalVar<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable-3\">DateTime<\/span>.<span class=\"cm-variable\">Now<\/span>.<span class=\"cm-variable\">Minute<\/span>; <span class=\"cm-comment\">\/\/\u666e\u901a\u65b9\u6cd5\u7684\u5c40\u90e8\u8b8a\u91cf<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-variable\">normalLocalVar<\/span>);<\/span><br \/><span role=\"presentation\"> \u00a0  }<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">MethodInvoker<\/span> <span class=\"cm-variable\">x<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span>()<\/span><br \/><span role=\"presentation\"> \u00a0  {<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable-3\">string<\/span> <span class=\"cm-variable\">anonLocal<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"local to anonymous method\"<\/span>; <span class=\"cm-comment\">\/\/\u533f\u540d\u65b9\u6cd5\u7684\u5c40\u90e8\u8b8a\u91cf<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-variable\">capturedVar<\/span> <span class=\"cm-operator\">+<\/span> <span class=\"cm-variable\">anonLocal<\/span>); <span class=\"cm-comment\">\/\/\u6355\u7372\u8b8a\u91cf\u7684\u4f7f\u7528<\/span><\/span><br \/><span role=\"presentation\"> \u00a0  };<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">x<\/span>();<\/span><br \/><span role=\"presentation\">}<\/span><\/pre><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u884c\u70ba<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u88ab\u533f\u540d\u65b9\u6cd5\u6355\u7372\u7684\u662f\u300c\u8b8a\u91cf\u300d\uff0c\u800c\u4e0d\u662f\u5275\u5efa\u59d4\u6258\u5be6\u4f8b\u6642\u300c\u8a72\u8b8a\u91cf\u7684\u503c\u300d<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-variable-3\">string<\/span> <span class=\"cm-variable\">captured<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"before x is created\"<\/span>;<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">TEST<\/span> <span class=\"cm-variable\">t<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span><\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-variable\">captured<\/span>);<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">captured<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"changed by t\"<\/span>;<\/span><br \/><span role=\"presentation\">};<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">captured<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"directly before x is invoked\"<\/span>;<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">t<\/span>(); <span class=\"cm-comment\">\/\/Expected: directly before x is invoked<\/span><\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-variable\">captured<\/span>); <span class=\"cm-comment\">\/\/Expected: changed by t<\/span><\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">captured<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-string\">\"before second invocation\"<\/span>;<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">t<\/span>(); <span class=\"cm-comment\">\/\/Expected before second invocation<\/span><\/span><\/pre><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5275\u5efa\u59d4\u6258\u5be6\u4f8b\u6642\uff0c\u4e0d\u6703\u57f7\u884c\u533f\u540d\u51fd\u6578\u5167\u7684\u4ee3\u78bc<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728\u6574\u500b\u65b9\u6cd5\u4e2d\uff0c\u4f7f\u7528\u7684\u59cb\u7d42\u662f\u300c\u540c\u4e00\u500b\u8b8a\u91cf\u300d<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u7528\u9014<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u6355\u7372\u8b8a\u91cf\u80fd\u7c21\u5316\u907f\u514d\u5c08\u9580\u5275\u5efa\u4e00\u4e9b\u985e\u4f86\u5b58\u5132\u4e00\u500b\u59d4\u6258\u9700\u8981\u8655\u7406\u7684\u4fe1\u606f<\/span><\/p><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-variable\">List<\/span><span class=\"cm-operator\">&lt;<\/span><span class=\"cm-variable\">Person<\/span><span class=\"cm-operator\">&gt;<\/span> <span class=\"cm-def\">FindAllYoungerThan<\/span>(<span class=\"cm-variable\">List<\/span><span class=\"cm-operator\">&lt;<\/span><span class=\"cm-variable\">Person<\/span><span class=\"cm-operator\">&gt;<\/span> <span class=\"cm-variable\">people<\/span>, <span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">limit<\/span>)<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">return<\/span> <span class=\"cm-variable\">people<\/span>.<span class=\"cm-variable\">FindAll<\/span>(<span class=\"cm-keyword\">delegate<\/span>(<span class=\"cm-variable\">Person<\/span> <span class=\"cm-variable\">person<\/span>)<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  {<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-keyword\">return<\/span> <span class=\"cm-variable\">person<\/span>.<span class=\"cm-variable\">Age<\/span> <span class=\"cm-operator\">&lt;<\/span> <span class=\"cm-variable\">limit<\/span>;<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  });<\/span><br \/><span role=\"presentation\">}<\/span><\/pre><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u4ee5\u4e0a\u9762\u7684\u4ee3\u78bc\u70ba\u4f8b\uff0c\u5982\u679c\u53ea\u6709\u533f\u540d\u65b9\u6cd5\u800c\u6c92\u6709\u6355\u7372\u8b8a\u91cf\uff0c\u5c31\u53ea\u80fd\u5728\u533f\u540d\u65b9\u6cd5\u4e2d\u4f7f\u7528\u4e00\u500b\u300c\u786c\u7de8\u78bc\u300d\u7684\u9650\u5236\u5e74\u9f61\uff0c\u800c\u4e0d\u80fd\u4f7f\u7528\u4f5c\u70ba\u53c3\u6578\u50b3\u905e\u7684limit<\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u6355\u7372\u8b8a\u91cf\u7684\u751f\u5b58\u671f<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5c0d\u65bc\u4e00\u500b\u6355\u7372\u8b8a\u91cf\uff0c\u53ea\u8981\u9084\u6709\u4efb\u4f55\u59d4\u6258\u5be6\u4f8b\u5728\u5f15\u7528\u5b83\uff0c\u5b83\u5c31\u6703\u4e00\u76f4\u5b58\u5728<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-keyword\">void<\/span> <span class=\"cm-variable\">Main<\/span>()<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">TEST<\/span> <span class=\"cm-variable\">t<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable\">CreateDelegateInstance<\/span>(); <span class=\"cm-comment\">\/\/5<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-comment\">\/\/counter\u53ea\u5b58\u6d3b\u5728CreateDelegateInstance\u4e2d<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-comment\">\/\/\u800cCreateDelegateInstance\u5728\u4e0a\u9762\u5df2\u7d93\u5b8c\u6210\u4e86\u8abf\u7528\uff0c\u751f\u547d\u5468\u671f\u5b8c\u7d50<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-comment\">\/\/\u4f46\u7531\u65bct\u88e1\u9762\u9084\u6355\u6349\u8457counter\uff0c\u56e0\u6b64counter\u751f\u5b58\u671f\u88ab\u5ef6\u9577<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">t<\/span>(); <span class=\"cm-comment\">\/\/6<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">t<\/span>(); <span class=\"cm-comment\">\/\/7<\/span><\/span><br \/><span role=\"presentation\">}<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-keyword\">static<\/span> <span class=\"cm-variable\">TEST<\/span> <span class=\"cm-def\">CreateDelegateInstance<\/span>()<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">counter<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">5<\/span>;<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">TEST<\/span> <span class=\"cm-variable\">t<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span><\/span><br \/><span role=\"presentation\"> \u00a0  {<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-variable\">counter<\/span>);<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">counter<\/span><span class=\"cm-operator\">++<\/span>;<\/span><br \/><span role=\"presentation\"> \u00a0  };<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">t<\/span>();<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-keyword\">return<\/span> <span class=\"cm-variable\">t<\/span>;<\/span><br \/><span role=\"presentation\">}<\/span><\/pre><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5728\u8abf\u7528CreateDelegateInstance\u6642\uff0ccounter\u7684\u503c\u7406\u6240\u7576\u61c9\u662f\u53ef\u7528\u7684<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5728\u65b9\u6cd5\u8fd4\u56de\u5f8c\uff0c\u96d6\u7136counter\u5df2\u96a8\u8457CreateDelegateInstance\u7684\u68e7\u5e40\u88ab\u92b7\u6bc0\u6642\u800c\u6d88\u5931<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5118\u7ba1\u5982\u6b64\uff0c\u7de8\u8b6f\u5668\u5275\u5efa\u4e86\u4e00\u500b\u984d\u5916\u7684\u985e\u4f86\u5bb9\u7d0d\u8b8a\u91cf\u3002CreateDelegateInstance\u65b9\u6cd5\u64c1\u6709\u5c0d\u8a72\u985e\u7684\u4e00\u500b\u5be6\u4f8b\u7684\u5f15\u7528\uff0c\u6240\u4ee5\u5b83\u80fd\u4f7f\u7528counter<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u53e6\u5916\uff0c\u59d4\u6258\u4e5f\u6709\u5c0d\u8a72\u5be6\u4f8b\u7684\u4e00\u500b\u5f15\u7528\uff0c\u9019\u500b\u5be6\u4f8b\u548c\u5176\u4ed6\u5be6\u4f8b\u4e00\u6a23\u90fd\u5728\u5806\u4e0a\u3002\u9664\u975e\u59d4\u6258\u6e96\u5099\u597d\u88ab\u5783\u573e\u56de\u6536\uff0c\u5426\u5247\u90a3\u500b\u5be6\u4f8b\u662f\u4e0d\u6703\u88ab\u56de\u6536\u7684\u3002<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5c40\u90e8\u8b8a\u91cf\u5be6\u4f8b\u5316<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5c40\u90e8\u8b8a\u91cf\u6bcf\u88ab\u8072\u660e\u4e00\u6b21\uff0c\u5b83\u5c31\u6703\u88ab\u5be6\u4f8b\u5316\u4e00\u6b21\u3002<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5047\u5982\u4e0d\u6d89\u53ca\u4efb\u4f55\u533f\u540d\u65b9\u6cd5\uff0c\u5c40\u90e8\u8b8a\u91cf\u6240\u9700\u7684\u7a7a\u9593\u90fd\u5728\u65b9\u6cd5\u958b\u59cb\u6642\u5728\u68e7\u4e0a\u5206\u914d\uff0c\u6240\u4ee5\u4e0d\u6703\u7522\u751f\u6bcf\u6b21\u5faa\u74b0\u8fed\u4ee3\u90fd\u300c\u91cd\u65b0\u8072\u660e\u300d\u8b8a\u91cf\u7684\u958b\u92b7<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u4f46\u662f\u4ee5\u4e0b\u9762\u4ee3\u78bc\u70ba\u4f8b\uff1a<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5982\u679c\u628a\u8b8a\u91cf\u6355\u7372\uff0c\u90a3\u5728\u6bcf\u4e00\u6b21\u5faa\u74b0\u88e1\u8072\u660e\u7684\u5c40\u90e8\u8b8a\u91cf\uff0c\u90fd\u6703\u518d\u5be6\u4f8b\u5316\u4e00\u500b\u65b0\u7684\u540c\u540d\u5be6\u4f8b<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5982\u679c\u8072\u660e\u5728\u5faa\u74b0\u5916\u9762\uff0c\u90a3\u6355\u7372\u7684\u53ea\u6709\u90a3\u300c\u4e00\u500b\u300d\u8b8a\u91cf\u5be6\u4f8b\uff0c\u4e5f\u4e0d\u6703\u91cd\u65b0\u5be6\u4f8b\u5316<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-variable\">List<\/span><span class=\"cm-operator\">&lt;<\/span><span class=\"cm-variable\">TEST<\/span><span class=\"cm-operator\">&gt;<\/span> <span class=\"cm-variable\">list<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span> <span class=\"cm-variable\">List<\/span><span class=\"cm-operator\">&lt;<\/span><span class=\"cm-variable\">TEST<\/span><span class=\"cm-operator\">&gt;<\/span>();<\/span><br \/><span role=\"presentation\"><span class=\"cm-comment\">\/\/int counter = 10;<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-keyword\">for<\/span> (<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">i<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">0<\/span>; <span class=\"cm-variable\">i<\/span> <span class=\"cm-operator\">&lt;<\/span> <span class=\"cm-number\">5<\/span>; <span class=\"cm-variable\">i<\/span><span class=\"cm-operator\">++<\/span>)<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">counter<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable\">i<\/span> <span class=\"cm-operator\">*<\/span> <span class=\"cm-number\">10<\/span>;<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">list<\/span>.<span class=\"cm-variable\">Add<\/span>(<span class=\"cm-keyword\">delegate<\/span><\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-variable\">counter<\/span>);<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"cm-variable\">counter<\/span><span class=\"cm-operator\">++<\/span>;<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 });<\/span><br \/><span role=\"presentation\">}<\/span><\/pre><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u7576\u4e00\u500b\u8b8a\u91cf\u88ab\u6355\u7372\u6642\uff0c\u6355\u6349\u7684\u662f\u8b8a\u91cf\u7684\u5be6\u4f8b\u3002\u5982\u679c\u5728\u5faa\u74b0\u88e1\u6355\u7372counter\uff0c<\/span><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u7b2c\u4e00\u6b21\u5faa\u74b0\u6642\u6355\u7372\u7684\u8b8a\u91cf\u8207\u7b2c\u4e8c\u6b21\u5faa\u74b0\u6642\u6355\u7372\u7684\u8b8a\u91cf\u662f\u4e0d\u540c\u7684<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u800c<\/span><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5faa\u74b0\u7684\u521d\u59cb\u90e8\u5206\u8072\u660e\u7684\u8b8a\u91cf\u4e5f\u662f\u53ea\u8981\u88ab\u5be6\u4f8b\u5316\u4e00\u6b21\uff08int i\uff09<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u56e0\u6b64\uff0c\u5982\u679c\u60f3\u6355\u7372\u5faa\u74b0\u8b8a\u91cf\u5728\u4e00\u6b21\u7279\u5b9a\u5faa\u74b0\u8fed\u4ee3\u4e2d\u7684\u503c\uff0c\u5fc5\u9808\u5728\u5faa\u74b0\u5167\u90e8\u5f15\u5165\u53e6\u4e00\u500b\u8b8a\u91cf\uff0c\u5e76\u5c07\u5faa\u74b0\u8b8a\u91cf\u7684\u503c\u8ce6\u7d66\u5b83\uff0c\u518d\u6355\u6349\u9019\u500b\u65b0\u7684\u8b8a\u91cf<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u540c\u6642\u4f7f\u7528\u5171\u4eab\u8207\u975e\u5171\u4eab\u8b8a\u91cf<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"c#\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-variable\">TEST<\/span>[] <span class=\"cm-variable\">delegates<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">new<\/span> <span class=\"cm-variable\">TEST<\/span>[<span class=\"cm-number\">2<\/span>];<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">outside<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">0<\/span>;<\/span><br \/><span role=\"presentation\"><span class=\"cm-keyword\">for<\/span> (<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">i<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">0<\/span>; <span class=\"cm-variable\">i<\/span> <span class=\"cm-operator\">&lt;<\/span> <span class=\"cm-number\">2<\/span>; <span class=\"cm-variable\">i<\/span><span class=\"cm-operator\">++<\/span>)<\/span><br \/><span role=\"presentation\">{<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable-3\">int<\/span> <span class=\"cm-variable\">inside<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-number\">0<\/span>;<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0<span class=\"cm-variable\">delegates<\/span>[<span class=\"cm-variable\">i<\/span>] <span class=\"cm-operator\">=<\/span> <span class=\"cm-keyword\">delegate<\/span><\/span><br \/><span role=\"presentation\"> \u00a0  {<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">Console<\/span>.<span class=\"cm-variable\">WriteLine<\/span>(<span class=\"cm-variable\">$<\/span><span class=\"cm-string\">\"{outside}, {inside}\"<\/span>);<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">outside<\/span><span class=\"cm-operator\">++<\/span>;<\/span><br \/><span role=\"presentation\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"cm-variable\">inside<\/span><span class=\"cm-operator\">++<\/span>;<\/span><br \/><span role=\"presentation\"> \u00a0  };<\/span><br \/><span role=\"presentation\">}<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">TEST<\/span> <span class=\"cm-variable\">first<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable\">delegates<\/span>[<span class=\"cm-number\">0<\/span>];<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">TEST<\/span> <span class=\"cm-variable\">second<\/span> <span class=\"cm-operator\">=<\/span> <span class=\"cm-variable\">delegates<\/span>[<span class=\"cm-number\">1<\/span>];<\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-comment\">\/\/Outside, Inside<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">first<\/span>(); <span class=\"cm-comment\">\/\/0, 0<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">first<\/span>(); <span class=\"cm-comment\">\/\/1, 1<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">first<\/span>(); <span class=\"cm-comment\">\/\/2, 2<\/span><\/span><br \/><span role=\"presentation\">\u200b<\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">second<\/span>(); <span class=\"cm-comment\">\/\/3, 0<\/span><\/span><br \/><span role=\"presentation\"><span class=\"cm-variable\">second<\/span>(); <span class=\"cm-comment\">\/\/4, 1<\/span><\/span><\/pre><\/li><\/ul><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c0d7b5c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c0d7b5c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d4ba5e4\" data-id=\"d4ba5e4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a631fbf elementor-widget elementor-widget-image\" data-id=\"a631fbf\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"802\" src=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/capturedVars-1024x802.jpg\" class=\"attachment-large size-large wp-image-1612\" alt=\"\" srcset=\"https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/capturedVars-1024x802.jpg 1024w, https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/capturedVars-300x235.jpg 300w, https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/capturedVars-768x602.jpg 768w, https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/capturedVars-1536x1204.jpg 1536w, https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/05\/capturedVars.jpg 1590w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c4ce8e8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c4ce8e8\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c49ebf4\" data-id=\"c49ebf4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-93593d3 elementor-widget elementor-widget-text-editor\" data-id=\"93593d3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<ul><li class=\"md-end-block md-p md-focus\"><span class=\"md-plain md-expand\">\u7576\u540c\u6642\u6355\u7372\u5faa\u74b0\u5916\u548c\u5faa\u74b0\u5167\u7684\u8b8a\u91cf\u6642\uff0c\u5206\u5225\u6703\u751f\u6210\u5169\u500b\u985e\u53bb\u5b58\u5132\u6355\u7372\u8b8a\u91cf<\/span><br \/><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u4e00\u500b\u5305\u542b\u4e86outside\u7684\u8b8a\u91cf\u7684\u985e<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u4e00\u500b\u5305\u542binside\u8b8a\u91cf\u4ee5\u53ca\u5c0doutside\u8b8a\u91cf\u985e\u7684\u5f15\u7528\u7684\u985e<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5f9e\u6839\u672c\u4e0a\u4f86\u8aaa\uff0c\u5305\u542b\u4e86\u4e00\u500b\u6355\u7372\u8b8a\u91cf\u7684\u6bcf\u500b\u4f5c\u7528\u57df\u90fd\u6709\u5b83\u81ea\u5df1\u7684\u985e\u578b<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u6355\u7372\u8b8a\u91cf\u7684\u4f7f\u7528\u898f\u5247<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5982\u679c\u7528\u6216\u4e0d\u7528\u6642\u7684\u4ee3\u78bc\u540c\u6a23\u7c21\u55ae\uff0c\u90a3\u5c31\u4e0d\u7528<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u6355\u7372\u7531for\/foreach\u8a9e\u53e5\u8072\u660e\u7684\u8b8a\u91cf\u524d\uff0c\u601d\u8003\u59d4\u6258\u662f\u5426\u9700\u8981\u5728\u5faa\u74b0\u7d50\u675f\u5f8c\u5ef6\u7e8c\uff0c\u662f\u5426\u60f3\u8b93\u5b83\u770b\u5230\u90a3\u500b\u8b8a\u91cf\u7684\u5f8c\u7e8c\u503c\u3002\u5982\u679c\u4e0d\u662f\uff0c\u5c31\u5728\u5faa\u74b0\u5167\u53e6\u5efa\u4e00\u500b\u8b8a\u91cf\uff0c\u7528\u4f86\u8907\u88fd\u4f60\u60f3\u8981\u7684\u503c\u3002<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5982\u679c\u5275\u5efa\u591a\u500b\u59d4\u6258\u5be6\u4f8b\uff0c\u800c\u4e14\u6355\u7372\u4e86\u8b8a\u91cf\uff0c\u601d\u8003\u6e05\u695a\u6355\u7372\u7684\u5c0d\u8c61\u662f\u5426\u540c\u4e00\u500b<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5982\u679c\u6355\u7372\u7684\u8b8a\u91cf\u4e0d\u8b8a\uff0c\u5c31\u6c92\u90a3\u9ebc\u591a\u4e8b<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5982\u679c\u59d4\u6258\u5be6\u4f8b\u6c38\u9060\u4e0d\u6703\u5b58\u5132\u5230\u5225\u7684\u5730\u65b9\uff0c\u4e8b\u60c5\u6703\u7c21\u55ae<\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u6355\u7372\u5c0d\u8c61\u904e\u591a\/\u5167\u5b58\u958b\u92b7\u904e\u9ad8\uff0c\u57fa\u65bc\u88ab\u6355\u7372\u5c0d\u8c61\u7684\u751f\u5b58\u671f\u5ef6\u9577\uff0c\u5f9e\u5783\u573e\u56de\u6536\u7684\u89d2\u5ea6\u4f86\u770b\uff0c\u554f\u984c\u5c31\u6703\u6d6e\u73fe\u51fa\u4f86<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-plain\">\u6355\u7372\u8b8a\u91cf\u7684\u5c0f\u7d50<\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u6355\u7372\u7684\u662f\u8b8a\u91cf\uff0c\u800c\u4e0d\u662f\u5275\u5efa\u59d4\u6258\u5be6\u4f8b\u6642\u5b83\u7684\u503c<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u6355\u7372\u7684\u8b8a\u91cf\u751f\u5b58\u671f\u88ab\u5ef6\u9577\u4e86\uff0c\u81f3\u5c11\u548c\u6355\u6349\u5b83\u7684\u59d4\u6258\u4e00\u6a23\u9577<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u591a\u500b\u59d4\u6258\u53ef\u6355\u7372\u540c\u4e00\u8b8a\u91cf<\/span><\/span><\/span><\/p><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u4f46\u5728\u5faa\u74b0\u5167\u90e8\uff0c\u540c\u4e00\u500b\u8b8a\u91cf\u7684\u8072\u660e\u5be6\u969b\u4e0a\u6703\u5f15\u7528\u4e0d\u540c\u7684\u8b8a\u91cf\u300c\u5be6\u4f8b\u300d<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><li class=\"md-list-item\"><p class=\"md-end-block md-p\"><span class=\"md-html-inline\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5728for\u5faa\u74b0\u7684\u8072\u660e\u4e2d\u5275\u5efa\u7684\u8b8a\u91cf\uff08int i\uff09\u50c5\u5728\u5faa\u74b0\u6301\u7e8c\u671f\u9593\u6709\u6548\uff0c\u4e0d\u6703\u5728\u6bcf\u6b21\u5faa\u74b0\u8fed\u4ee3\u6642\u90fd\u5be6\u4f8b\u5316<\/span><\/span><\/span><\/p><\/li><li class=\"md-list-item md-focus-container\"><p class=\"md-end-block md-p md-focus\"><span class=\"md-html-inline md-expand\" spellcheck=\"false\"><span style=\"color: red;\"><span class=\"md-plain\">\u5fc5\u8981\u6642\u5275\u5efa\u984d\u5916\u7684\u985e\u578b\u4f86\u4fdd\u5b58\u6355\u7372\u8b8a\u91cf<\/span><\/span><\/span><\/p><\/li><\/ul><\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2d8b5cf elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2d8b5cf\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ee92a5d\" data-id=\"ee92a5d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2f27cb7 elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"2f27cb7\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-717d1c2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"717d1c2\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-18d3568\" data-id=\"18d3568\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-870d576 elementor-widget elementor-widget-text-editor\" data-id=\"870d576\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<h4 class=\"md-end-block md-heading\"><span style=\"text-decoration: underline;\"><strong><span class=\"md-plain md-expand\">\u53c3\u8003\u66f8\u76ee<\/span><\/strong><\/span><\/h4><ul class=\"ul-list\" data-mark=\"-\"><li class=\"md-list-item md-focus-container\">\u300aCLR via C#\u300b\uff08\u7b2c4\u7248\uff09 Jeffrey Richter<\/li><li>\u300a\u6df1\u5165\u7406\u89e3C#\u300b\uff08\u7b2c3\u7248\uff09 Jon Skeet<\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u533f\u540d\u985e\u578b\u662f\u4e00\u7a2e\u81ea\u52d5\u8072\u660e\u3001\u4e0d\u53ef\u8b8a\u7684\u5143\u7d44\u985e\u578b\u7684\u8a9e\u6cd5\uff1b\u800c\u533f\u540d\u65b9\u6cd5\u5247\u662f\u5141\u8a31\u6307\u5b9a\u4e00\u500b\u5167\u806f\u59d4\u6258\u5be6\u4f8b\u7684\u64cd\u4f5c\uff0c\u4f5c\u70ba\u5275\u5efa\u59d4\u6258\u5be6\u4f8b\u8868\u9054\u5f0f\u7684\u4e00\u90e8\u5206\u3002<\/p>\n","protected":false},"author":1,"featured_media":947,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,27,18],"tags":[],"class_list":["post-3462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-reading-notes","category-c-sharp","category-developing"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/lonelinerd.com\/wp-content\/uploads\/2021\/03\/FeatureCover_ReadingNotes.png","_links":{"self":[{"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/posts\/3462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/comments?post=3462"}],"version-history":[{"count":36,"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/posts\/3462\/revisions"}],"predecessor-version":[{"id":3973,"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/posts\/3462\/revisions\/3973"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/media\/947"}],"wp:attachment":[{"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/media?parent=3462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/categories?post=3462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lonelinerd.com\/index.php\/wp-json\/wp\/v2\/tags?post=3462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}