Содержание
- 2. Agenda Roslyn C#
- 3. Roslyn
- 4. Roslyn C# and VB language engine for all the things! All the IDEs and editors All
- 5. C#
- 6. C# new features
- 7. C# techniques OOP
- 8. C# 7 features list Strong interest: Local functions - finished Tuples - in-progress Pattern matching, part
- 9. Allow _ as separator var d = 123_456; var x = 0xAB_CD_EF; Allow 0b as binary
- 10. static void Main(string[] args) { void ForEach (IEnumerable source, Action action) { foreach (var item in
- 11. Demo: local function
- 12. Out var int x; if(int.TryParse(Console.ReadLine(), out x)) { Console.WriteLine($"{nameof(x)} = {x}"); } if(int.TryParse(Console.ReadLine(), out int x))
- 13. Demo: out var
- 14. Pattern matching static void PrintInt(object o) { if (o is int i || (o is string
- 15. Demo pattern matching
- 16. Tuples static void Main(string[] args) { var data = new[] { 1, 2, 3, 4, 5,
- 17. Tuples deconstruction (decomposition) static void Main(string[] args) { var data = new[] { 1, 2, 3,
- 18. Demo tuples
- 19. Ref returns and locals public ref int Find(int number, int[] numbers) { for (int i =
- 20. Demo ref return
- 21. More expression bodies class Person { private static ConcurrentDictionary names = new ConcurrentDictionary (); private int
- 22. async Main static async Task DoWork() { await ... await ... } static void Main() {
- 23. Maybe: Records class Person : IEquatable { public string First { get; } public string Last
- 24. Maybe: Creating immutable objects var p1 = new Point { X = 3, Y = 7
- 25. Resources Roslyn https://github.com/dotnet/roslyn .NET blog https://blogs.msdn.microsoft.com/dotnet VS blog https://blogs.msdn.microsoft.com/visualstudio/ CoreCLR https://github.com/dotnet/coreclr Sergey Teplyakov blog http://sergeyteplyakov.blogspot.com/
- 26. Вопросы?
- 28. Скачать презентацию