Exemple #1
0
        public async Task <IActionResult> UpdateSalesRecord([FromBody] SalesRecordDto salesRecordDto)
        {
            try
            {
                var records = _mapper.Map <SalesRecord>(salesRecordDto);
                var updated = await _salesRecordsService.UpdateSalesRecord(records);

                return(updated ? (IActionResult)Ok() : NotFound());
            }
            catch (Exception e)
            {
                _logger.Error(e, $"Unexpected exception in method {nameof(UpdateSalesRecord)}.");
                throw;
            }
        }
Exemple #2
0
 public async Task UpdateSalesRecord_WhenOptionsIsNull_ShouldThrowException()
 {
     await _salesRecordsService.UpdateSalesRecord(null);
 }