Difference in C# between different getter styles

I do sometimes see abbreviations in properties for the getter. E.g. those two types: public int Number { get; } = 0 public int Number => 0; Can someone please tell me if there are any differences between those two. How do they behave? Are both...
more »

2017-09-05 07:09 (3) Answers

Declaring variables in a getter

I have a complex getter as follows public bool IsOk { get { return (IsFirstCondition && (IsSecondCondition.Items.First.Item == MyItems.PublicItems.BestItem || IsThirdCondition.Collection.EditedItem.IsTheMostUsedItem);...
more »

2016-07-29 11:07 (4) Answers