Invoke custom method Update

Hello everyone
So can you help me or show me where to look for information about my problem?
I want to update one record in my database from Invoke Custom method.
And I don't know what to use for it. I can find the record by MachineId and I need to edit it. Should I use an update?
Thank you

My code for search record

var test = DB.CallingSystemMains.Where(o => o.Sate == 1 && o.MachineId == MachineId);
       

return Json(new { value = test }, new JsonSerializerSettings() {
       ContractResolver = new DefaultContractResolver()

Sorry i have it :smiley:

 var record = DB.CallingSystemMains.FirstOrDefault(o => o.Sate == 1 && o.MachineId == MachineId);
       if (record != null)
         {
          record.Sate = 2;
          DB.SaveChanges();
         }