Esempio n. 1
0
        public async Task <Call> SaveCallAsync(Call call, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (String.IsNullOrWhiteSpace(call.Number))
            {
                call.Number = await GetCurrentCallNumberAsync(call.DepartmentId);
            }

            if (String.IsNullOrWhiteSpace(call.Name))
            {
                call.Name = "New Call " + DateTime.UtcNow.ToShortDateString();
            }

            return(await _callsRepository.SaveOrUpdateAsync(call, cancellationToken));
        }