dev-resources.site
for different kinds of informations.
CRUD operations on Arrays
Published at
1/7/2025
Categories
webdev
api
dotnetcore
csharp
Author
letsupdateskills
Author
16 person written this
letsupdateskills
open
Arrays in C# are fixed in size and do not have built-in methods for dynamic operations (like Add or Remove). However, you can perform CRUD operations by working with array elements.
1. Create Operation
You can initialize arrays with specific values or create an empty array and populate it later.
Example
// Creating an array with predefined values
int[] numbers = { 10, 20, 30 };
// Creating an empty array and assigning values later
int[] grades = new int[3];
grades[0] = 85;
grades[1] = 90;
grades[2] = 78;
2. Read Operation
Access specific elements or iterate through the array.
Example
int[] numbers = { 10, 20, 30 };
// Accessing elements by index
Console.WriteLine(numbers[0]); // Output: 10
// Iterating through the array
foreach (var num in numbers)
{
Console.WriteLine(num);
}
3. Update Operation
Modify existing elements by accessing them via their index.
int[] numbers = { 10, 20, 30 };
// Updating the value at index 1
numbers[1] = 25;
foreach (var num in numbers)
{
Console.WriteLine(num);
}
// Output: 10, 25, 30
dotnetcore Article's
30 articles in total
.Net tarixi
read article
Oh bless me, Father, I have done something unholy: Installing .NET Core on Apple Silicon
read article
How to use Scoped service from Singleton Service in .Net Core
read article
How to add a Custom fields to Header in .NET Core Web API ?
read article
c#(.Net) - Basic Authentication WEB API
read article
CRUD operations on Arrays
currently reading
Working with interfaces
read article
Iterations
read article
Protfolio Website
read article
Dependency injection validation error in ASP.NET Core projects
read article
.Net Core and Kafka
read article
C# Null-Conditional (?.) & Null-Coalescing (??) Operators Explained
read article
Change a .Net Console application into an web application
read article
Efficient Bulk Operations with UkrGuru.Sql
read article
Improve Application Performance using βFire and Forgetβ in .NET Core
read article
API Versioning in .Net Core.
read article
Move objects from one folder to other in the same S3 Bucket using C# in AWS
read article
π We Made It: Trending in .NET on Dev.to! π
read article
.NET 9 Improvements for ASP.NET Core: Open API, Performance, and Tooling
read article
.Net Core Microservice Communication Using Kafka.
read article
Getting Started with .NET and Docker Tutorial
read article
Experimental attribute in C# is a powerful tool : Let's explore
read article
Implementing Chain of Responsibility Pattern in C# : Middleware's Design Pattern
read article
How to create a background email sender with outbox pattern integration
read article
The End of Microsoft's Monopoly on ASP.NET
read article
.NET Core MVC Project Structure : Implementing a Generic Service and Repository Pattern
read article
Did you know? How .NET Achieving Language Interoperability (C# + VB.NET = Same Application)
read article
These 10+ comparisons cover entire SQL concepts, Is it?
read article
NET 9 BinaryFormatter migration paths
read article
How to create a background email sender
read article
Featured ones: