I have a database which contains a table about some Users.
Schema looks like this :
User : (id, name, username, email, phone, when_deleted)
I use ef core to interact with this table from an asp.net core app. The entity class is as follows.
public class User
{
public int id { get; set; }
public string name { get; set; }
public string username { get; set; }
public string email { get; set; }
public string phone { get; set; }
}
I have ASP.NET core background service that sends a GET request to a vendor REST API endpoint to bring latest info about the users.
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"phone": "1-770-736-8031 x56442"
},
{
"id": 2,
"name": "Jhon Doe",
"username": "JDoe",
"email": "Jdoe@april.biz",
"phone": "1-404-536-8031 x56442"
}
]
Users can be deleted on the API side, but on my side I don't want to delete them, I want just to soft delete or mark them as deleted using a flag, something like when_deleted.
How can I do this the right way?