locked
How to select max column value from dataBase in c# .net core? RRS feed

  • Question

  • User-790790109 posted

    if (ModelState.IsValid)
    {

    //the select query here 

    }

    Wednesday, August 14, 2019 10:04 AM

Answers

  • User-790790109 posted

    fixed so simple:

    if (ModelState.IsValid)
    {
    Pacientes paciente = _context.Pacientes.Where(
    p => p.Processo == _context.Pacientes.Max(r => r.Processo)
    ).First();
    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 14, 2019 10:41 AM