Saturday, July 10, 2021

DotNet Latest Technologies

 I'm not sure exactly what you are looking for or how "recent" the technologies that you might wan to look into are, but I'll provide a list below of some of the different ones that have come about in the last few years:

MVC - ASP.NET MVC, which is simply a different design pattern to build your applications with as opposed to Web Forms. It requires a slight learning curve, especially for those coming from a Web Forms background, but once you get the hang of it, you'll be fine. You can read more about it on the ASP.NETMVC site here.

LINQ - With a simple reference to the System.Linq assembly, you'll find that you can use LINQ to perform complex queries of either your databases or any collections of objects (such as Lists, Arrays, etc) with ease. You can learn more about LINQhere.

SignalR - An incredible real-time framework that leverages Javascript and allows you to create real-time applications that not only allow the client to push events to the server, but the server can actually push out events to the client. You can learn more about SignalRhere.

Entity Framework - You don't see old school ADO.NET connections as much as you used to since the introduction of Entity Framework, which is an ORM (Object Relational Mapper) tool that will allow you to easily access and manipulate your database by creating classes to work with instead of writing SQL code. You can learn more about EntityFramework here.

Web API - Web API is the latest method of writing and handling Web Services within .NET and acts a type of replacement for older WCF services that you may have used within the past. You can learn more about WebAPI here.

SPA - Single Page Applications are another very recent release and a different type of application from those using MVC or Web Forms and leverages much more on using Javascript-based frameworks to handle accessing and presenting data to the client. You can learn more about SPAhere.

vNext - This next generation of ASP.NET brings about a wide array of changes to the ASP.NET ecosystem in general. It takes full advantage of the new Roslyn compiler and focuses on making ASP.NET "leaner" to more easily build both cloud and desktop applications. You can read more about vNexthere.

C# Coding Standards and Naming Conventions

C# Coding Standards and Naming Conventions

DO

  • use PascalCasing for class names and method names.

  • use camelCasing for method arguments and local variables.

  • use PascalCasing for abbreviations 3 characters or more (2 chars are both uppercase).

  • use predefined type names instead of system type names like Int16, Single, UInt64, etc.

  • use implicit type var for local variable declarations. Exception: primitive types (int, string, double, etc) use predefined names.

  • use noun or noun phrases to name a class.

  • prefix interfaces with the letter I.  Interface names are noun (phrases) or adjectives.

  • name source files according to their main classes. Exception: file names with partial classes reflect their source or purpose, e.g. designer, generated, etc.

  • organize namespaces with a clearly defined structure.

  • vertically align curly brackets.

  • declare all member variables at the top of a class, with static variables at the very top.

  • use singular names for enums. Exception: bit field enums.

DO NOT

  • use Hungarian notation or any other type identification in identifiers.

  • use Screaming Caps for constants or readonly variables.

  • use Underscores in identifiers. Exception: you can prefix private static variables with an underscore.

  • explicitly specify a type of an enum or values of enums (except bit fields).

  • suffix enum names with Enum.

AVOID

  • using Abbreviations. Exceptions: abbreviations commonly used as names, such as Id, Xml, Ftp, Uri.

Use appropriate prefix for the UI elements so that you can identify them from the rest of the variables.
There are 2 different approaches recommended here.

a.      Use a common prefix ( ui_ ) for all UI elements. This will help you group all of the UI elements together and easy to access all of them from the intelligence.

b.      Use appropriate prefix for each of the UI element. A brief list is given below. Since .NET has given several controls, you may have to arrive at a complete list of standard prefixes for each of the controls (including third party controls) you are using.



Control

Prefix

Label

lbl

TextBox

txt

DataGrid

dtg

Button

btn

ImageButton

imb

Hyperlink

hlk

DropDownList

ddl

ListBox

lst

DataList

dtl

Repeater

rep

Checkbox

chk

CheckBoxList

cbl

RadioButton

rdo




C# new operator

C# new operator

new operator

The new operator creates a new instance of a type.

You can also use the new keyword as a memberdeclaration modifier or a generictype constraint.

Constructor Invocation

To create a new instance of a type, you typically invoke one of the constructors of that type using the new operator:

var dict = new Dictionary<string, int>(); dict["first"] = 10; dict["second"] = 20; dict["third"] = 30; Console.WriteLine(string.Join("; ", dict.Select(entry => $"{entry.Key}: {entry.Value}"))); // Output: // first: 10; second: 20; third: 30

You can use an objector collection initializer with the new operator to instantiate and initialize an object in one statement, as the following example shows:

var dict = new Dictionary<string, int> { ["first"] = 10, ["second"] = 20, ["third"] = 30 }; Console.WriteLine(string.Join("; ", dict.Select(entry => $"{entry.Key}: {entry.Value}"))); // Output: // first: 10; second: 20; third: 30

Beginning with C# 9.0, constructor invocation expressions are target-typed. That is, if a target type of an expression is known, you can omit a type name, as the following example shows:

List<int> xs = new(); List<int> ys = new(capacity: 10_000); List<int> zs = new() { Capacity = 20_000 }; Dictionary<int, List<int>> lookup = new() { [1] = new() { 1, 2, 3 }, [2] = new() { 5, 8, 3 }, [5] = new() { 1, 0, 4 } };

As the preceding example shows, you always use parentheses in a target-typed new expression.

If a target type of a new expression is unknown (for example, when you use the var keyword), you must specify a type name.

Array creation

You also use the new operator to create an array instance, as the following example shows:

var numbers = new int[3]; numbers[0] = 10; numbers[1] = 20; numbers[2] = 30; Console.WriteLine(string.Join(", ", numbers)); // Output: // 10, 20, 30

For more information about arrays, see Arrays.

Instantiation of anonymous types

To create an instance of an anonymous type, use the new operator and object initializer syntax:

var example = new { Greeting = "Hello", Name = "World" }; Console.WriteLine($"{example.Greeting}, {example.Name}!"); // Output: // Hello, World!

Destruction of type instances

You don't have to destroy earlier created type instances. Instances of both reference and value types are destroyed automatically. Instances of value types are destroyed as soon as the context that contains them is destroyed. Instances of reference types are destroyed by the garbage collector at some unspecified time after the last reference to them is removed.

For type instances that contain unmanaged resources, for example, a file handle, it's recommended to employ deterministic clean-up to ensure that the resources they contain are released as soon as possible. For more information, see the System.IDisposable API reference and the using statement article.

Operator overloadability

A user-defined type cannot overload the new operator.

C# language specification

For more information, see The new operator section of the C# language specification.

For more information about a target-typed new expression, see the feature proposal note.

C# Versions

C# Versions

The history of C# from MS


C# version 1.0

When you go back and look, C# version 1.0, released with Visual Studio .NET 2002. The major features of C# 1.0 included: 

C# version 1.2

C# version 1.2 shipped with Visual Studio .NET 2003. It contained a few small enhancements to the language. Most notable is that starting with this version, the code generated in a foreach loop called Dispose on an IEnumerator when that IEnumerator implemented IDisposable.

C# version 2.0

Now things start to get interesting. Let's take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005:

Other C# 2.0 features added capabilities to existing features:

  • Getter/setter separate accessibility

  • Method group conversions (delegates)

  • Static classes

  • Delegate inference

C# version 3.0

C# version 3.0 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with .NET Framework version 3.5. This version marked a major change in the growth of C#. It established C# as a truly formidable programming language. Let's take a look at some major features in this version:

C# version 4.0

C# version 4.0, released with Visual Studio 2010. The next version did introduce some interesting new features:

C# version 5.0

C# version 5.0, released with Visual Studio 2012, was a focused version of the language: the async and await model for asynchronous programming. Here is the major features list: 

See Also,

C# version 6.0

With versions 3.0 and 5.0, C# had added major new features in an object-oriented language. With version 6.0, released with Visual Studio 2015. Here are some of them:

Other new features include,

  • Index initializers
  • Await in catch/finally blocks
  • Default values for getter-only properties

C# version 7.0

C# version 7.0 was released with Visual Studio 2017. Here are some of the new features:

Other features included:

C# version 7.1

C# started releasing point releases with C# 7.1. This version added the languageversion selection configuration element, three new language features, and new compiler behavior.

The new language features in this release are:

Finally, the compiler has two options -refout and -refonly that control reference assembly generation.

C# version 7.2 

C# 7.2 added several small language features,

C# version 7.3

There are two main themes to the C# 7.3 release. The following new features support the theme of better performance for safe code:

The following enhancements were made to existing features,

  • You can test == and != with tuple types.

  • You can use expression variables in more locations.

  • You may attach attributes to the backing field of auto-implemented properties.

  • Method resolution when arguments differ by in has been improved.

  • Overload resolution now has fewer ambiguous cases.

The new compiler options are,

  • -publicsign to enable Open Source Software (OSS) signing of assemblies.

  • -pathmap to provide a mapping for source directories.

What's new in C# 8.0

  • 04/07/2020

C# 8.0 adds the following features and enhancements to the C# language,

C# 8.0 is supported on .NET Core 3.x and .NET Standard 2.1. For more information, see C#language versioning.

What's new in C# 9.0

  • 04/07/2021

C# 9.0 adds the following features and enhancements to the C# language:

C# 9.0 is supported on .NET 5. For more information, see C#language versioning.

DotNet Latest Technologies

  I'm not sure exactly what you are looking for or how "recent" the technologies that you might wan to look into are, but I...