public static string GetString(this DataLineViewModel dataLineViewModel) { var result = string.Empty; foreach (var fragment in dataLineViewModel.Fragments) { result = string.Concat(result, fragment.Value, FragmentSeparator); } return(result); }
public IActionResult Index() { var sortedDataLines = DataLineManagerBll.GetSortedDataLines(ApplicationEnvironment.InputFilePath); var dataLineViewModels = new List <DataLineViewModel>(); if (sortedDataLines == null) { } else { foreach (var dataLine in sortedDataLines) { var dataLineViewModel = new DataLineViewModel(); dataLineViewModel = Mapper.Map <DataLineViewModel>(dataLine); dataLineViewModels.Add(dataLineViewModel); } } return(View(dataLineViewModels)); }
private static void ShowMatrix(IEnumerable <DataLine> dataLines) { var dataLineViewModels = new List <DataLineViewModel>(); if (dataLines == null) { } else { foreach (var dataLine in dataLines) { var dataLineViewModel = new DataLineViewModel(); dataLineViewModel = Mapper.Map <DataLineViewModel>(dataLine); dataLineViewModels.Add(dataLineViewModel); } } foreach (var dataLineViewModel in dataLineViewModels) { Console.WriteLine(dataLineViewModel.GetString()); } }