GetAllTasks() => _tasks.Values;
+
+ ///
+ /// Retrieves a task by its unique identifier.
+ ///
+ /// The unique identifier of the task.
+ /// The task item if found; otherwise, null.
+ public TaskItem? GetTaskById(int id) => _tasks.TryGetValue(id, out var task) ? task : null;
+
+ ///
+ /// Creates a new task and stores it in memory.
+ ///
+ /// The task item to create.
+ public void CreateTask(TaskItem task)
+ {
+ var id = System.Threading.Interlocked.Increment(ref _nextId);
+ task.Id = id;
+ _tasks[id] = task;
+ }
+
+ ///
+ /// Updates an existing task in memory.
+ ///
+ /// The unique identifier of the task to update.
+ /// The updated task item.
+ /// True if the update was successful; otherwise, false.
+ public bool UpdateTask(int id, TaskItem updatedTask)
+ {
+ if (!_tasks.ContainsKey(id)) return false;
+ updatedTask.Id = id;
+ _tasks[id] = updatedTask;
+ return true;
+ }
+
+ ///
+ /// Deletes a task from memory by its unique identifier.
+ ///
+ /// The unique identifier of the task to delete.
+ /// True if the deletion was successful; otherwise, false.
+ public bool DeleteTask(int id) => _tasks.TryRemove(id, out _);
+ }
+}
diff --git a/DotnetApp/wwwroot/index.html b/DotnetApp/wwwroot/index.html
new file mode 100644
index 0000000..b60a42a
--- /dev/null
+++ b/DotnetApp/wwwroot/index.html
@@ -0,0 +1,272 @@
+
+
+
+
+
+ Task Manager
+
+
+
+ Task Manager
+
+
+
+
+
+
+
+
+
+
+
+ Tasks
+
+
+
+
+
\ No newline at end of file