Hi Team
I want to save local values to my local database, anyone can help. I am struggling to have a logic from the Controller side. Let me share code
C#
// Model side
public class Incident_NameDropDown
{
public string Title { get; set; }
public string Description { get; set; }
}
// View side
// Controller sideI need help here

Sachin SinghRank #66 · 26.2K reputationPosted Nov 12, 2021, 1:52 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 12, 2021, 1:29 AM EST
Guest UserRank #877 · 2.5K reputationPosted Nov 12, 2021, 1:44 AM EST
Vikas PanwarRank #1,447 · 1.1K reputationPosted Nov 12, 2021, 1:47 AM EST
public IActionResult Save(Incident_NameDropDown model) { using (Dbcontext db = new Dbcontext()) { tableName tbObj = new tableName { Title = model.Title, Description = model.Description, }; db.tableName.Add(tbObj); db.SaveChanges(); } }Guest UserRank #877 · 2.5K reputationPosted Nov 12, 2021, 1:56 AM EST
Vikas PanwarRank #1,447 · 1.1K reputationPosted Nov 12, 2021, 3:25 AM EST