public NormalIplikContainerDto GetCard(int id, string companyId) { var container = new NormalIplikContainerDto(); var normalIplik = _repository.QueryableNoTracking().FirstOrDefault(x => x.Id == id); if (normalIplik == null) { return(container); } container.NormalIplik = normalIplik; if (!string.IsNullOrWhiteSpace(normalIplik.SirketId)) { var company = _companyService.GetCompanyById(normalIplik.SirketId); container.Company = company; } container.Renk = _renkService.GetRenkById(normalIplik.Renkid); container.PantoneRenk = _pantoneRenkService.GetPantoneRenkById(normalIplik.PantoneId); container.RafyeriTurkiye = _termService.GetTermById(normalIplik.RafyeriTurkiyeId); container.RafyeriYunanistan = _termService.GetTermById(normalIplik.RafyeriYunanistanId); container.Ulke = _othersService.GetCountryById(normalIplik.UlkeId); container.IplikNoDtos = _iplikNoService.GetNormalIplikIplikNolar(normalIplik.Id); return(container); }
public FanteziIplikContainerDto GetCard(int id, string compantId) { var container = new FanteziIplikContainerDto(); var fanteziIplik = _repository.QueryableNoTracking().FirstOrDefault(x => x.Id == id); if (fanteziIplik == null) { return(container); } var picture = _repoFanteziIplikPicture.QueryableNoTracking().FirstOrDefault(x => x.ZetaCodeFanteziIplikId == fanteziIplik.Id && x.CompanyId == fanteziIplik.SirketId); if (picture != null) { container.PictureUrl = picture.Name; } container.FanteziIplik = fanteziIplik; container.AnaIplikKategorileri = _termService.GetAllParentsById(fanteziIplik.IplikKategosiId); container.AnaIplikKategorileri.Reverse(); if (!string.IsNullOrWhiteSpace(fanteziIplik.SirketId)) { var company = _companyService.GetCompanyById(fanteziIplik.SirketId); container.Company = company; } container.Renk = _renkService.GetRenkById(fanteziIplik.Renkid); container.PantoneRenk = _pantoneRenkService.GetPantoneRenkById(fanteziIplik.PantoneId); container.RafyeriTurkiye = _termService.GetTermById(fanteziIplik.RafyeriTurkiyeId); container.RafyeriYunanistan = _termService.GetTermById(fanteziIplik.RafyeriYunanistanId); container.Ulke = _othersService.GetCountryById(fanteziIplik.UlkeId); return(container); }