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; | |
| public class Math | |
| { | |
| public virtual int Sum(int a , int b) | |
| { | |
| return a+b; | |
| } | |
| } |
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 Newtonsoft.Json; | |
| string json = "{\"Code\":\"AA10\",\"day\":\"monday\",\"errors\":[]}"; | |
| var newyvar = JsonConvert.DeserializeObject<Dictionary<string, object>>(json); | |
| string new_row = Convert.ToString(newyvar["Code"]) + ";" + "New"; | |
| Console.WriteLine(new_row); |
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 Newtonsoft.Json; | |
| string json = "{\"id\":\"5005t000004RMNTAA4\",\"success\":true,\"errors\":[]}"; | |
| var dict = JsonConvert.DeserializeObject<Dictionary<string, object>>(json); | |
| Console.WriteLine(string.Join(", ", dict.Keys)); |
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 void SetInfo(string code) | |
| { | |
| eventCode = code switch | |
| { | |
| "K" => eventCodes[0], | |
| "L" => eventCodes[1], | |
| "R" => eventCodes[2], | |
| "Q" => eventCodes[3], | |
| "N" => eventCodes[4], | |
| _ => "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
| using System; | |
| using System.Globalization; | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| var zone = TimeZoneInfo.FindSystemTimeZoneById("Altai Standard Time"); | |
| DateTime start = new DateTime(2013, 12, 31, 16, 0, 0, DateTimeKind.Utc); | |
| DateTime end = start.AddHours(4); |
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
| Imports System | |
| Module Program | |
| Sub Main(args As String()) | |
| Dim upload As Dictionary(Of (Long, Long, Long), Long) = New Dictionary(Of (Long, Long, Long), Long) | |
| upload.Add((1, 2, 3), 5) | |
| End Sub | |
| End Module |
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.Globalization; | |
| string text = "2020-10-14T13:11:51Z"; | |
| var dt = DateTime.ParseExact(text, "yyyy'-'MM'-'dd'T'hh':'mm':'ss'Z'", CultureInfo.InvariantCulture); | |
| Console.WriteLine(dt); |
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.Reflection; | |
| [System.AttributeUsage(System.AttributeTargets.All, Inherited = false, AllowMultiple = true)] | |
| sealed class CustomDateTimeAttribute : System.Attribute | |
| { | |
| // See the attribute guidelines at | |
| // http://go.microsoft.com/fwlink/?LinkId=85236 | |
| readonly string positionalString; |
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
| String res = | |
| stuff.equals("TV") ? "Walter" | |
| : stuff.equals("Movie") ? "White" | |
| : "No result"; |
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.Collections; | |
| using System.Collections.Generic; | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| MySetting setting = new MySetting() | |
| { |