private void SaveLog(string texto) { var log = new Domain.Log { Texto = texto }; _logRepository.Add(log); }
public async Task <LogDTO> GetLogInfoAsync(int id) { Domain.Log logFromDB = await _logRepository.FirstOrDefaultAsync(id); if (logFromDB == null) { throw new InvalidOperationException("未找到该日志"); } return(_mapper.Map <LogDTO>(logFromDB)); }
public void Add(Domain.Log log) { Log.Add(log); SaveChanges(); }