public Bag Translate(Thee source) { var teabrand = Brands.FirstOrDefault(brand => brand.Name == source.TheeMerk.Trim()); var teabagType = BagTypes.FirstOrDefault(bagType => bagType.Name == source.TheeSoortzakje.Trim()); var teacountry = Countries.FirstOrDefault(country => country.Name == source.TheeLandvanherkomst.Trim()); return(new Bag(null, "36544cc9-36ae-42c0-b614-a5a2010d4258", source.MainID, new Domain.RefValue(teabrand.Id, teabrand.Name), source.TheeSerie.Trim(), source.TheeSmaak.Trim(), source.TheeKenmerken.Trim(), teabagType != null ? new Domain.RefValue(teabagType.Id, teabagType.Name) : null, teacountry != null ? new Domain.RefValue(teacountry.Id, teacountry.Name) : null, source.TheeSerienummer.Trim(), ParseInvoerDatum(source), Images.FirstOrDefault(image => image.Filename == $"{source.MainID}.jpg")?.Id)); }
internal BagType GetDefaultBoundedBagType() { return(BagTypes.First(x => x.Id != Rucksack.RucksackTypeId && x.Id != OmniBag.OmniBagTypeId && x.Id != BundleBag.BundleBagTypeId)); }