I’m new to MVC and am building a project in ASP.NET MVC.
In my project I don’t want to delete any saved data from my database, but hide them from the user. I look some giving status to data, but I don’t understand. What is the explanation?
I can explain a common way to do it. This is a quick answer using SQL Server.
Please study SQL first before starting your project. Here is a good place to learn SQL.
I assume the table name is "MyItems":
Add another column to your table
Name it as IsActive (or whatever you want)
Set the data type as bit
You can set either true or false for this column
Write your SQL select query as:
Select * from MyItems where IsActive=1
This will give you all IsActive=true records.
If you want to get hidden records:
Select * from MyItems where IsActive=0