LINQ and Properties - C# Typing CST Test
Loading…
LINQ and Properties — C# Code
Shows modern C# features including LINQ, auto-properties, and string interpolation.
using System;
using System.Collections.Generic;
using System.Linq;
public class Person {
public string Name { get; set; }
public int Age { get; set; }
public string City { get; set; }
}
class Program {
static void Main() {
var people = new List<Person> {
new Person { Name = "Alice", Age = 25, City = "New York" },
new Person { Name = "Bob", Age = 30, City = "London" },
new Person { Name = "Charlie", Age = 35, City = "New York" }
};
var adults = people
.Where(p => p.Age >= 30)
.OrderBy(p => p.Name)
.Select(p => new { p.Name, p.Age })
.ToList();
foreach (var person in adults) {
Console.WriteLine($"{person.Name} is {person.Age} years old");
}
}
}C# Language Guide
C# (C-Sharp) is a modern, object-oriented, multi-paradigm programming language built by Microsoft for the .NET platform. It is designed for productivity, type safety, performance, and building scalable applications across desktop, web, mobile, gaming, and cloud systems.
Primary Use Cases
- ▸Enterprise backend systems
- ▸Web APIs (ASP.NET Core)
- ▸Unity game development
- ▸Desktop software (WPF/WinUI)
- ▸Cloud-native microservices on Azure
- ▸Cross-platform mobile apps (MAUI/Xamarin)
Notable Features
- ▸Strongly-typed OOP design
- ▸Async/await built-in
- ▸LINQ for querying data
- ▸Cross-platform runtime via .NET Core
- ▸Modern functional programming features
- ▸Powerful tooling with Visual Studio
Origin & Creator
Created by Anders Hejlsberg at Microsoft in 2000 as part of the .NET platform. Evolved significantly with versions introducing LINQ, async/await, records, pattern matching, and high-performance features in modern .NET.
Industrial Note
C# dominates Windows development, enterprise CRM/ERP systems, Unity-powered games, Azure cloud apps, and scalable backend systems. It is widely chosen for large corporate software ecosystems, cloud-native microservices, and cross-platform applications through .NET Core.