public async Task <ActionResult <Feature> > PostAsync(Feature feature, string branchName, string groupName, string title) { if (!feature.Title.Equals(title, StringComparison.OrdinalIgnoreCase)) { return(BadRequest("The title provided by the POST data and the title in uri do not match!")); } // NOTE: Using the branchName as product name because of backwards compatability await _featureManager.InsertOrUpdateFeatureAsync(feature, branchName, groupName, UNKNOWN_VERSION); return(CreatedAtRoute("GetFeature", feature)); }
public async Task <ActionResult <Feature> > PostAsync([FromBody] Feature feature, string productName, string groupName, string title, string version) { if (!feature.Title.Equals(title, StringComparison.OrdinalIgnoreCase)) { return(BadRequest("The title provided by the POST data and the title in uri do not match!")); } DbFeature dbFeature = await _featureManager.InsertOrUpdateFeatureAsync(feature, productName, groupName, version); // Run the analysis for this feature if (dbFeature != null) { try { await _analyzer.AnalyzeAndPeristResultsAsync(productName, version, dbFeature); } catch { // Don't do anything, a broken analysis is no reason to report an error } } return(Accepted()); }