/// <returns>A task that represents the asynchronous operation</returns>
        public virtual async Task <IActionResult> ManufacturerTemplateUpdate(ManufacturerTemplateModel model)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageMaintenance))
            {
                return(AccessDeniedView());
            }

            if (!ModelState.IsValid)
            {
                return(ErrorJson(ModelState.SerializeErrors()));
            }

            //try to get a manufacturer template with the specified id
            var template = await _manufacturerTemplateService.GetManufacturerTemplateByIdAsync(model.Id)
                           ?? throw new ArgumentException("No template found with the specified id");

            template = model.ToEntity(template);
            await _manufacturerTemplateService.UpdateManufacturerTemplateAsync(template);

            return(new NullJsonResult());
        }