public CriarLogDto Atualizar(CriarLogDto log) { var logModel = ParaLog(log); _context.Log.Update(logModel); _context.SaveChanges(); return(log); }
public void Criar(CriarLogDto log) { var logModel = ParaLog(log); _context.Log.Add(logModel); _context.SaveChanges(); log.IdLog = logModel.IdLog; }
private Log ParaLog(CriarLogDto log) { return(new Log { IdLog = log.IdLog, Data = log.Data, Descricao = log.Descricao, Eventos = log.Eventos, Host = log.Host, IdAmbiente = log.IdAmbiente, IdStatus = log.IdStatus, IdTipoLog = log.IdTipoLog, TokenUsuario = log.TokenUsuario, Titulo = log.Titulo }); }
public ActionResult Update([FromBody] CriarLogDto log) { _logService.Atualizar(log); return(Ok(log)); }
public ActionResult Post([FromBody] CriarLogDto log) { _logService.Criar(log); return(Ok()); }