Editing: prjOne


prjOne https://www.youtube.com/watch?v=6r9OSQdaAb4

Instance = (localdb)\MSSQLLocalDB

1. Asp.net core web app (razor pages ) using .net9.0

2. Add Model Folder

3. Sql query UserManagementCrudApp

CREATE TABLE Users (
    Id INT IDENTITY(1,1) PRIMARY KEY,
    FullName NVARCHAR(100) NOT NULL,
    Email NVARCHAR(100) NOT NULL UNIQUE,
    Role NVARCHAR(50) NOT NULL,
    PhoneNumber NVARCHAR(20) NULL
);

Sql Query

List tables in db

SELECT name 
FROM sys.tables;

Drop Table

DROP TABLE Users;

Model class

using System.ComponentModel.DataAnnotations;

public class User
{
}
public int Id { get; set; }

4. Mvc razor pages crud

5. Tools>nu-getManger>terminal

#

6. Modify Index.cshtml insie User route folder to have boostarp layout such that rather than Index

X. Todo: since now all crating user , reading and updating and deleting can be don by anyone i want to add auth mening fist on index page of Users route user is crated modify MOdle class to have colum password then i will agian migrate and update after that so that after craeting user one can login on index page then