Scroll to top

Random


Category

C# Language : Enum

An enum can derive from any of the following types: byte, sbyte, short, ushort, int, uint, long, ulong. The default is int, and can be changed by specifying the…

Curious Bot December 1, 2018

C# Language : LINQ Queries

LINQ is an acronym which stands for Language INtegrated Query. It is a concept which integrates a query language by offering a consistent model for working with…

Curious Bot December 1, 2018

C# Language : IEnumerable

IEnumerable is the base interface for all non-generic collections like ArrayList that can be enumerated. IEnumerator<T> is the base interface for all generic…

Curious Bot December 1, 2018

C# Language : IComparable

Sort versions Class: public class Version : IComparable<Version> { public int[] Parts { get; } public Version(string value) { if (value == null) throw new…

Curious Bot December 1, 2018

C# Language : Regex Parsing

Single match using System.Text.RegularExpressions; string pattern = ":(.*?):"; string lookup = "--:text in here:--"; // Instanciate your regex…

Curious Bot December 1, 2018

C# Language : Dependency Injection

Dependency Injection C# and ASP.NET with Unity First why we should use depedency injection in our code ? We want to decouple other components from other classes…

Curious Bot December 1, 2018

C# Language : Looping

Looping styles While The most trivial loop type. Only drawback is there is no intrinsic clue to know where you are in the loop. /// loop while the condition satisfies…

Curious Bot December 1, 2018

C# Language : Getting started with C# Language

Creating a new console application (Visual Studio) Open Visual Studio In the toolbar, go to File ? New Project Select the Console Application project type Open the…

Curious Bot December 1, 2018

C# Language : CLSCompliantAttribute

Access Modifier to which CLS rules apply using System; [assembly:CLSCompliant(true)] namespace CLSDoc { public class Cat { internal UInt16 _age = 0; private UInt16…

Curious Bot December 1, 2018

C# Language : Using Statement

Provides a convenient syntax that ensures the correct use of IDisposable objects. Using Statement Basics using is syntactic sugar that allows you to guarantee that…

Curious Bot December 1, 2018

C# Language : Linq to Objects

LINQ to Objects refers to the use of LINQ queries with any IEnumerable collection. How LINQ to Object executes queries LINQ queries do not execute immediately. When…

Curious Bot December 1, 2018

C# Language : Code Contracts and Assertions

Assertions to check logic should always be true Assertions are used not to perform testing of input parameters, but to verify that program flow is corect —…

Curious Bot December 1, 2018

C# Language : Tuples

Creating tuples Tuples are created using generic types Tuple<T1>–Tuple<T1,T2,T3,T4,T5,T6,T7,T8>. Each of the types represents a tuple containing…

Curious Bot December 1, 2018

C# Language : Conditional Statements

If-Else Statement Programming in general often requires a decision or a branch within the code to account for how the code operates under different inputs or conditions.…

Curious Bot December 1, 2018

C# Language : XmlDocument and the System.Xml namespace

Basic XML document interaction public static void Main() { var xml = new XmlDocument(); var root = xml.CreateElement("element"); // Creates an attribute,…

Curious Bot December 1, 2018

C# Language : Using json.net

Using JSON.net JsonConverter class. Using JsonConverter on simple values Example using JsonCoverter to deserialize the runtime property from the api response into…

Curious Bot December 1, 2018