Beispiel #1
0
        public async Task <ActionResult> Create(Source Source)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _logger.LogInformation("Registering Source named {0}", Source.Name);
                    await _dataAccessProvider.AddSourceRecord(Source);

                    _logger.LogInformation("Source named {0} registered succesfully", Source.Name);
                    return(Ok());
                }
                else
                {
                    return(BadRequest());
                }
            }
            catch (Exception ex)
            {
                _logger.LogError($"Something went wrong: {ex}");
                return(CreatedAtAction(nameof(Create), ex));
            }
        }