static void Main(string[] args) { ICarManager carManager = new ICarManager(new InMemoryCarDal()); foreach (var car in carManager.GetAll()) { Console.WriteLine(car.Description); } }
public ActionResult List() { var model = new CarListViewModel { Cars = (List <Car>)_carManager.GetAll() }; return(View(model)); }
public IActionResult GetAll() { var result = _carManager.GetAll(); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IActionResult GetAll() { //Dependecy chain bağlımlılık zinciri car manager efcardal'a bağımlı //CarManager carManager = new CarManager(new EfCarDal()); var result = _carManager.GetAll(1234); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public async Task <IActionResult> GetAsync() { var cars = await _car.GetAll(); if (cars.Count != 0) { return(Ok(cars)); } else { return(NotFound(new ErrorMessageVM() { Message = "No Car Found in the Database!" })); } }
public async Task <IActionResult> GetAll() => Ok(await _carManager.GetAll());