/// <summary> /// Validates using task chains. /// </summary> private void Validate() { ValidatedItems = Redirects.Select(ValidateItems()).ToList(); foreach (var item in ValidatedItems) { File.Rows[item.Index].AddCell(item.Status.ToString()); File.Rows[item.Index].AddCell(string.Join(",", item.ValidationResults.Select(a => a.ErrorMessage))); } File.Save(FileName, Seperator); }
/// <summary> /// Validates using task chains. /// </summary> private void Validate() { ValidatedItems = Redirects.Select(ValidateItems()).ToList(); foreach (var item in ValidatedItems) { //TODO: bit odd //File.AddValue(item.Index+1,5,item.Status.ToString()); //File.AddValue(item.Index+1, 5, string.Join(",", item.ValidationResults.Select(a => a.ErrorMessage))); } //using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(inputFile)) //{ // fastExcel.Write(File); //} }
private Uri FindMatchingRedirect(Uri source) { var result = Redirects .Select(x => new { key = x.Key, value = x.Value }) .FirstOrDefault(redirect => { var path = HttpUtility.UrlDecode(source.AbsolutePath); return(Match(path, redirect.key)); }); if (result != null) { var builder = new UriBuilder(result.value) { Query = source.Query }; return(builder.Uri); } return(null); }