/// <summary> /// Creates or updates a package /// </summary> /// <param name="model"></param> /// <returns></returns> public ActionResult <PackageDefinition> PostSavePackage(PackageDefinition model) { if (ModelState.IsValid == false) { return(ValidationProblem(ModelState)); } //save it if (!_packagingService.SaveCreatedPackage(model)) { return(ValidationProblem( model.Id == default ? $"A package with the name {model.Name} already exists" : $"The package with id {model.Id} was not found")); } _packagingService.ExportCreatedPackage(model); //the packagePath will be on the model return(model); }