add column type DateTime


What I want to do is add the column with the same IdExamen that throws the result and subtract me with another of the same type.

this is what I tried without success, someone who has gone through I am, thanks

public JsonResult ContarTiempo(int idExamen)
    var SumTiempo = (from p in db.Pregunta
                        where p.IdExamen == idExamen
                        select p.Tiempo).Sum();

    var TotalExamen = (from e in db.Examen
                        where e.IdExamen == idExamen
                        select e.Duracion).FirstOrDefault();

    var TotalPregunta = (dynamic)null;

        TotalPregunta = TotalExamen - SumTiempo;
    catch (Exception)
        TotalPregunta = TotalExamen;
    return new JsonResult { Data = TotalPregunta, JsonRequestBehavior = JsonRequestBehavior.AllowGet };

asked by Rodrigo Rodriguez 16.12.2018 в 16:12

0 answers