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