コード例 #1
0
        // GET: Ilces
        //public async Task<IActionResult> Index()
        //{
        //    var Ilcelar = await _IlceServis.GetListAsync();
        //    return View(Ilcelar);
        //}

        public async Task <IActionResult> Index(int id)
        {
            IlceListDto         ilceListDto = new IlceListDto();
            Task <Il>           tIl         = _IlServis.GetByIdAsync(id);
            Task <List <Ilce> > tIlce       = _IlceServis.GetListAsync(i => i.IlId == id);

            ilceListDto.Il      = await tIl;
            ilceListDto.Ilceler = await tIlce;

            return(View(ilceListDto));
        }
コード例 #2
0
        // GET: Ils/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var entity = await _IlServis.GetByIdAsync(id.Value);

            if (entity == null)
            {
                return(NotFound());
            }

            return(View(entity));
        }