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
| using System; | |
| //using System.Linq; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Reflection; | |
| using System.Threading; | |
| using System.IO; | |
| using System.Linq; |
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
| using System; | |
| using System.Linq; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Reflection; | |
| using System.Threading; | |
| using System.IO; | |
| [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Workshop.CSharp.Advanced.Tests")] |
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
| class Program | |
| { | |
| static void ExecuteAcionNTimes(int n, Action<int> cosDoZrobienia) | |
| { | |
| for (int i = 0; i < n; i++) | |
| { | |
| cosDoZrobienia.Invoke(i); | |
| } | |
| } |
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
| async Optional<string> ProcessText(string text1, string text2) | |
| { | |
| int number1 = await TryParseInt(text1); | |
| int number2 = await TryParseInt(text2); | |
| return (number1 + number2).ToString(); | |
| } | |
| Optional<int> TryParseInt(string text) => | |
| int.TryParse(text, out var result) ? new Optional<int>(result) : Optional<int>.None; |
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
| async Optional<string> ProcessText(string text1, string text2) | |
| { | |
| int number1 = await TryParseInt(text1); | |
| int number2 = await TryParseInt(text2); | |
| return (number1 + number2).ToString(); | |
| } | |
| Optional<int> TryParseInt(string text) => | |
| int.TryParse(text, out var result) ? new Optional<int>(result) : Optional<int>.None; |