public static List <KeahlianViewModel> GetAll() { var csvKeahlian = helper.ReadBidangKeahlian(); if (csvKeahlian.Count == 0) { return(new List <KeahlianViewModel>()); } //var csvProgram = helper.ReadProgramKeahlian(); //var csvKeahlianDanProgram = helper.ReadKeahliandDanProgram(); var result = new List <KeahlianViewModel>(); foreach (var keahlian in csvKeahlian) { var keahlianViewModel = new KeahlianViewModel(); keahlianViewModel.Nama = keahlian.Nama; keahlianViewModel.Kode = keahlian.Kode; /*var programs = csvKeahlianDanProgram.Where(x => x.Bidang == keahlian.Kode).ToList(); * var programKodes = programs.SelectMany(x => x.Program.Split(',').ToArray()).ToArray(); * if (programKodes.Length > 0) * { * var programViewModels = csvProgram.Where(x => programKodes.Contains(x.Kode)).ToArray(); * if (programViewModels.Length > 0) * { * keahlianViewModel.Programs = programViewModels.Select(x => new ProgramViewModel * { * Nama = x.Nama * }).ToList(); * } * }*/ result.Add(keahlianViewModel); } return(result); }
public PeminatanDetailPage(KeahlianViewModel keahlian) { InitializeComponent(); _keahlian = keahlian; Title = keahlian?.Nama; }