LNG LogoLNG Logo
    • Enterprise App Development
    • Product Architecture Design
    • Data Engineering & Analytics
    • Cloud Consulting Services
    • AI-Enabled Applications
    • Remote Engineering Teams
    • UI/UX Design
    • Data Migration
    • Big Data
    • DevOps Solutions
    • Banking
    • Ecommerce
    • Fintech
    • Healthcare
    • Hospitality
    • Manufacturing
    • Telecom
    • Travel
    • Education
    • Cross-Platform & Web Development
    • Digital Experience Platform
    • Enterprise Technologies
    • Modern Frontend Interface
    • About Us
    • Blog
    • Our Team
    • Careers
    • Success Stories
Let's Talk !

Announcing .NET 7 Preview 5: Latest Features and Updates

By: Vikas NischalSeptember 27, 2022

Microsoft is known for constantly upgrading its products to ensure its customers avail the best of the technologies and features.

Today .NET 7 is (almost) a reality and it seems that Microsoft is now confirming many of the rumors that we are in front of the fastest .NET version ever: .NET 7.

.Net has gained the reputation of being the most flexible and efficient software development framework since its inception. Microsoft has been continually innovating and evolving the .Net Framework to make it faster and better.

Microsoft has recently released the third and fourth preview version of .NET 7, along with .NET Core 7 Preview 1 and Entity Framework 7 Preview 1. Microsoft claimed that these fresh versions of .NET bring improved and strong support for cloud-native containers and applications.

Let’s take a look at the latest features and improvements released by Microsoft.

APIs for Tar Archives

The framework gets the new assembly System.Formats.Tar. This cross-platform API allows you to read, write, archive, and extract tar archives.

It contains methods such as TarFile.CreateFromDirectory and Tar-File.ExtractToDirectory, for which there are numerous overloads to address either archives via filenames or via streams.

Here is an example:

TarFile.CreateFromDirectory(
    sourceDirectoryName: "sampleDir/",
    destinationFileName: "example.tar",
    includeBaseDirectory: true
  );

TarFile.ExtractToDirectory( 
    sourceFileName: "sample.tar",
    destinationDirectoryName: "testDir/",
    overwriteFiles: true
  );

The APIs also allow you to open an archive and go through its contents, either to read the entries one by one or to write them.

New LINQ Updates

The new methods Order and OrderDescending sort an IEnumerable based on the type T.  The new feature simplifies your code for sorting:

var unsortedArray = new[] { 77, 13, 19 }; 
var sortedArrayAsc = data.Order(); 
var sortedArrayDesc = data.OrderDescending();

At above interfaces applies for IQueryable also 🙂

Introducing New DataTypes

With .NET 6, some new data types have already been added:

  • DateOnly: “Represents dates with values ranging from January 1, 0001 through December 31, 9999 A.D. (C.E.) in the Gregorian calendar.”
  • TimeOnly: “Represents a time of day, as would be read from a clock, within the range 00:00:00 to 23:59:59.9999999.”
  • Half: “Represents a half-precision floating-point number.”
  • Int128
  • UInt128

System.Text.Json

Polymorphism

System.Text.Json now supports serializing and deserializing polymorphic type hierarchies using attribute annotations:

[JsonDerivedType(typeof(Derived))]
public class Base
{
public int X { get; set; }
}

public class Derived : Base
{
public int Y { get; set; }
}

This configuration enables polymorphic serialization for Base, specifically when the runtime type is Derived:

Base value = new Derived();

JsonSerializer.Serialize<Base>(value); // { "X" : 0, "Y" : 0 }

Note that this does not enable polymorphic deserialization since the payload would be roundtripped as Base:

Base value = JsonSerializer.Deserialize<Base>(@"{ ""X"" : 0, ""Y"" : 0 }"); value is Derived; // false

Using Type Discriminators

To enable polymorphic deserialization, users need to specify a type discriminator for the derived class:

[JsonDerivedType(typeof(Base), typeDiscriminator: "base")]
[JsonDerivedType(typeof(Derived), typeDiscriminator: "derived")]
public class Base
{
public int X { get; set; }
}

public class Derived : Base
{
public int Y { get; set; }
}

Which will now emit JSON along with type discriminator metadata: which can be used to deserialize the value polymorphically:

Base value = new Derived(); JsonSerializer.Serialize<Base>(value); // { "$type" : "derived", "X" : 0, "Y" : 0 }

Type discriminator identifiers can also be integers, so the following form is valid:

[JsonDerivedType(typeof(Derived1), 0)]
[JsonDerivedType(typeof(Derived2), 1)]
[JsonDerivedType(typeof(Derived3), 2)]
public class Base { }

JsonSerializer.Serialize<Base>(new Derived2()); // { "$type" : 1, ... }

Closing

We appreciate you for taking some time and reading this blog. Please give .NET 7 Preview 5 a try and tell us what you think!

Stay tune we will bring more .Net 7 feature in coming blogs.

Check original Source: .NET 7 Preview 5

Two CMSs, One Website: Managing Routing During WordPress to Sitecore MigrationJune 17, 2026Mastering Identity Resolution in Sitecore CDP: Anonymous to Known VisitorsMay 25, 2026

Let's Innovate, Collaborate, Build Your Product Together!

We turn your unique ideas into exceptional results. Contact us to
scale your tech capacity and accelerate business growth.

Let's Talk!
Where We Are

Our Global Presence

Delivering world-class digital solutions from three strategic locations across the globe.

South AfricaSouth Africa
ZACape Town

4th Floor, Mutual Park, Pinelands, Capetown, South Africa - 7405.

UAEUAE
AEDubai

FZCO 421, Dubai Commercity, Dubai, United Arab Emirates.

IndiaIndia
INAmritsar

SCO 6, Floor - 5, Dua Square, Ranjit Avenue, Block - B, Amritsar, Punjab, India - 143002

Logo

AI-Fuelled software agency, helping business professionals to thrive. Trusted by global leaders.

Company

  • About Us
  • Blog
  • Our Term
  • Careers
  • Success Stories

Services

  • AI-Enabled Applications
  • Big Data
  • Cloud Consulting Services
  • Data Engineering & Analytics
  • Data Migration
  • DevOps Solutions
  • Enterprise Application Development
  • Product Architecture Design
  • Remote Engineering Teams
  • UI/UX Design

Industries

  • Banking
  • Ecommerce
  • Fintech
  • Healthcare
  • Hospitality
  • Manufacturing
  • Telecom
  • Travel & Transport
  • Education

Technologies

  • Cross-Platform and Web Development
  • Digital Experience Platform
  • Enterprise Technologies
  • Modern Frontend Interface
Logo

AI-Fuelled software agency, helping business professionals to thrive. Trusted by global leaders.

Company
  • About Us
  • Blog
  • Our Term
  • Careers
  • Success Stories
Services
  • AI-Enabled Applications
  • Big Data
  • Cloud Consulting Services
  • Data Engineering & Analytics
  • Data Migration
  • DevOps Solutions
  • Enterprise Application Development
  • Product Architecture Design
  • Remote Engineering Teams
  • UI/UX Design
Industries
  • Banking
  • Ecommerce
  • Fintech
  • Healthcare
  • Hospitality
  • Manufacturing
  • Telecom
  • Travel & Transport
  • Education
Technologies
  • Cross-Platform and Web Development
  • Digital Experience Platform
  • Enterprise Technologies
  • Modern Frontend Interface

Copyright © 2026 L&G Consultancy. All Rights Reserved.
Privacy PolicyTerms and Conditions
Company Image