public async Task <IActionResult> GetItem(string model, string id) { try { ICoreAdminService coreAdminService = new CoreAdminService(Area, _serviceProvider); var modelType = coreAdminService.GetModelType(model); if (modelType == null) { return(BadRequest($"Model {model} is not found")); } var result = await coreAdminService.GetItemFor(modelType, id); //_adminRepository.GetItemFor(model, id); if (result != null) { return(Ok(result)); } return(NotFound()); } catch (Exception ex) { _logger.LogError($"Error occured while getting a record for model: {model}", ex); return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }