This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Maybe<T> where T : class | |
{ | |
private readonly T _value; | |
public T Value | |
{ | |
get | |
{ | |
if (HasNoValue) | |
throw new InvalidOperationException(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<decimal> prices = new List<decimal>() { 2.4m, 5.6m, 6.40m }; | |
decimal total = 0; | |
foreach(var price in prices) | |
{ | |
total += i; | |
} | |
return total; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<decimal> p = new List<decimal>() { 2.4m, 5.6m, 6.40m }; | |
decimal t = 0; | |
foreach(var i in p) | |
{ | |
t += i; | |
} | |
return t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Product { | |
public string Name {get; set;} | |
public string Description {get;set;} | |
} |