public async Task <OgrenciResponse> GetAsync(int id) { OgrenciResponse ogrenciResponse = new OgrenciResponse(); var ogrenci = await _ogrenciRepository.GetAsync(id); if (ogrenci == null) { ogrenciResponse.Message = "Product not found."; } else { ogrenciResponse.Entities.Add(ogrenci); } return(ogrenciResponse); }
public async Task <OgrenciResponse> GetAllAsync() { //TODO: Paging... OgrenciResponse ogrenciResponse = new OgrenciResponse(); IEnumerable <Models.Ogrenci> ogrenciler = await _ogrenciRepository.GetAllAsync(); if (ogrenciler.ToList().Count == 0) { ogrenciResponse.Message = "Products not found."; } else { ogrenciResponse.Entities.AddRange(ogrenciler); } return(ogrenciResponse); }