Ejemplo n.º 1
0
        public async Task <Log> SaveLogAsync(Log log, CancellationToken cancellationToken = default(CancellationToken))
        {
            log.LoggedOn = DateTime.UtcNow;

            var savedLog = await _logsRepository.SaveOrUpdateAsync(log, cancellationToken, true);

            foreach (var unit in savedLog.Units)
            {
                unit.LogId = savedLog.LogId;
                var savedLogUnit = _logUnitsRepository.SaveOrUpdateAsync(unit, cancellationToken, true);
            }

            foreach (var user in savedLog.Users)
            {
                user.LogId = savedLog.LogId;
                var savedLogUser = _logUsersRepository.SaveOrUpdateAsync(user, cancellationToken, true);
            }

            return(savedLog);
        }
Ejemplo n.º 2
0
        public async Task <Log> SaveLogAsync(Log log, CancellationToken cancellationToken = default(CancellationToken))
        {
            log.LoggedOn = DateTime.UtcNow;

            return(await _logsRepository.SaveOrUpdateAsync(log, cancellationToken));
        }