public string GetRecommendedPath(FileInformation fileInformation) { var values = FilePlaceholderFiller.GetPlaceholders( _photoFilenameTemplate.Fragments.OfType <PlaceholderFragment>().Select(x => x.Value), fileInformation); var path = _photoFilenameTemplate.ToString(values.ToDictionary(x => x.Key, x => x.Value ?? string.Empty)); return(ClearPath(path)); }
public TemplateString GetFilenameTemplate(FileInformation fileInformation) { var values = FilePlaceholderFiller.GetPlaceholders( _photoFilenameTemplate.Fragments.OfType <PlaceholderFragment>().Select(x => x.Value), fileInformation); var nonNullValues = values.Where(x => x.Value != null).ToDictionary(x => x.Key, x => x.Value !); var path = _photoFilenameTemplate.ToString(nonNullValues).ToForwardSlashes(); return(TemplateString.Parse(path)); }