Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-327511: Good way to implement read-only property with getter

$
0
0
Reporter Alexey Kuptsov (alexey.kuptsov) Alexey Kuptsov (alexey.kuptsov)
Created Jul 19, 2012 6:24:25 PM
Updated Apr 16, 2018 2:32:13 PM
Resolved Apr 16, 2018 2:32:13 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Feature
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
What we have:
public interface ICanBeValid
{
bool IsValid { get; }
}

public class MyCanBeValid : ICanBeValid{caret}
{}

Default "Alt+Enter, Enter" way makes:
public class MyCanBeValid : ICanBeValid{caret}
{
public bool IsValid { get; private set; }
}

(There is non-noticeable option "Properties as:" if ICanBeValud contains more than one member.)

We need a simple way to implement this property with single getter:
public class MyCanBeValid : ICanBeValid{caret}
{
public bool IsValid { get { throw new NotImplementedException(); } }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>