Ejemplo n.º 1
0
        public MainWindowVModel(IDetailService detailService, ICarService carService)
        {
            _detailService = detailService;
            _carService    = carService;

            Details = new ObservableCollection <DetailModel>(detailService.GetAll());
            Car     = new ObservableCollection <DetailModel>();

            player      = new PlayerModel();
            player.Name = "Garik";
            player.Car  = car;
            player.Cash = 1000;
        }
Ejemplo n.º 2
0
        public IEnumerable <DetailViewModel> GetAll()
        {
            var detailViewModel = from detail in _dbDetail.GetAll()
                                  select new DetailViewModel
            {
                Name         = detail.Name,
                Cost         = detail.Cost,
                CarViewModel = new CarViewModel
                {
                    Id    = detail.CarModel.Id,
                    Model = detail.CarModel.Model,
                },
                CarId = detail.CarId
            };

            return(detailViewModel.ToList());
        }
Ejemplo n.º 3
0
 public IEnumerable<DetailViewModel> GetAll()
 {
     var detailViewModel = from detail in _dbDetail.GetAll()
                           select new DetailViewModel
                           {
                               Name = detail.Name,
                               Cost = detail.Cost,
                               CarViewModel = new CarViewModel
                               {
                                   Id = detail.CarModel.Id,
                                   Model = detail.CarModel.Model,
                               },
                               Type = (DetailTypeEnum)detail.Type,
                               CarId = detail.CarId,
                               Manufacturer = new ManufacturerViewModel
                               {
                                   Id = detail.Manufacturer.Id,
                                   Name = detail.Manufacturer.Name
                               }
                           };
     return detailViewModel.ToList();
 }
Ejemplo n.º 4
0
 public async Task <ActionResult <IEnumerable <DetailModel> > > GetAll()
 {
     return(View(_detailService.GetAll()));
 }