public async Task <IActionResult> Create(string model, [FromBody] object modelObject) { 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.CreateItemFor(modelType, modelObject); //_adminRepository.CreateItemFor(model, fieldObject); if (result != null) { return(Ok(result)); } return(NotFound()); } catch (Exception ex) { _logger.LogError($"Error occured while creating a record for model: {model}", ex); return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }