Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

.NET Interview Questions: Key Concepts Explained

What's the difference between IQueryable, IEnumerable and List? IQueryable represents a query that is not executed yet. It allows building the query step by step and is typically executed when iterated. IEnumerable represents a…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




What's the difference between IQueryable, IEnumerable and List?





  • IQueryable represents a query that is not executed yet. It allows building the query step by step and is typically executed when iterated.


  • IEnumerable represents a sequence of data that is already in memory (or will be pulled into memory). It supports iteration and can use lazy execution


  • List is a concrete collection in memory that implements IEnumerable. It is fully materialized and allows modification (add, remove, etc).






How does the lifecycle work for services in Dependency Injection (Singleton, Scoped, and Transient)?





  • Singleton creates a single instance for the entire lifetime of the application. The same instance is shared across all requests (e.g., cache service).


  • Scoped creates one instance per request. The same instance is shared across all components within that request (e.g., DbContext).


  • Transient creates a new instance every time it is requested. It is commonly used for lightweight, stateless services (e.g., mappers).






What is the difference between FirstOrDefault() and SingleOrDefault()?





  • FirstOrDefault returns the first element that match the condition, or the default value for that type.

    Every type has a default value. Here are some examples:




    • classes returns null

    • Int returns 0

    • bool returns false






  • SingleOrDefault is very similar to FirstOrDefault, but it throws an exception if the result of the condition returns more than one element.








What is the difference between Value Types and Reference Types?




  • Value Types


    • Store the value directly

    • Typically allocated on the stack (but can be stored on the heap in some cases)


    • struct, int, bool are examples

    • When you copy it, you copy the entire value, like below:









int n1 = 10;
int n2 = a;
n2 = 20; // change does not reflects in "n1"
Console.WriteLine(n1); // 10
Console.WriteLine(n2); // 20







  • Reference Types


    • Store a reference (memory address) to the object

    • Typically allocated on the heap


    • class, string, array, object are examples

    • When you copy it, you copy the reference, not the actual object, like below:









class Person{
public string Name;
}
var p1 = new Person { Name = "Caique" };
var p2 = p1;
p2.Name = "John"; // change reflects in variable "p1"
Console.WriteLine(p1.Name); // "John"









When to use Record, Struct or Class





  • Class: Use it when your object has behavior, meaningful functions, and has identity like an entity.




public class User {
public Guid Id { get; set; }
public string Name { get; set; }
public void ChangeName(string name) {
Name = name;
}
}








  • Struct: Use it when you want immutability or you have few properties, like a coordinate object.




public struct Point {
public int X { get; set; }
public int Y { get; set; }
}








  • Record: Use it when you want to compare values, or when you are modeling just data, not behavior, like a DTO.




public record UserDto{
public required string FirstName { get; init; }
public required string LastName { get; init; }
}; // or
public record UserDto(string FirstName , string LastName );


Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten .NET Interview Questions: Key Concepts Explained

Thematisch verwandte Begriffe: Interview, Questions, Concepts, Explained · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-18163 | IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick