https://github.com/dxtaner/notes-project-.netmvc
Notes Project
https://github.com/dxtaner/notes-project-.netmvc
database dotnet entity-framework-core mvc netapi notes-app
Last synced: about 1 month ago
JSON representation
Notes Project
- Host: GitHub
- URL: https://github.com/dxtaner/notes-project-.netmvc
- Owner: dxtaner
- Created: 2023-03-12T22:07:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-07-17T12:55:09.000Z (11 months ago)
- Last Synced: 2025-12-26T06:49:33.930Z (6 months ago)
- Topics: database, dotnet, entity-framework-core, mvc, netapi, notes-app
- Language: C#
- Homepage:
- Size: 6.56 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Notes Project
## Installation
1. Add the `HomeController` class to your project.
2. Install the necessary NuGet packages to manage dependencies properly.
3. Configure the database connection in the `NoteContext` class.
## Features
- The `Index` method retrieves all notes from the database and passes them to a view for display to the user.
- The `Create` method handles HTTP GET requests to create a new note and displays a creation form to the user. It also passes a `SelectList` object containing all notes to the view.
- The `Create` method handles HTTP POST requests to create a new note. If the submitted data is valid, it adds the note to the database and performs the necessary redirection. If the data is invalid, it redisplays the creation form with errors.
- The `Delete` method handles HTTP POST requests to delete a specified note. It finds the note in the database, deletes it along with its child notes, and performs the necessary redirection.
- The `MoveChildNotes` method moves the child notes of a deleted note under the parent note.
## Usage
1. The `Index` method is used to display all notes on the main page of the application.
2. The `Create` method is used to create a new note. It displays the note creation form when called with an HTTP GET request and saves the new note when called with an HTTP POST request.
3. The `Delete` method is used to delete a specified note. The ID of the note to be deleted is passed as the `id` parameter.