public ActionResult Create()
        {
            var developers = developerService.GetAll().Select(x => new SelectListItem {
                Text = x.Name, Value = x.Id.ToString()
            }).ToList();
            var genres = genreService.GetAll().Select(x => new SelectListItem {
                Text = x.Type, Value = x.Id.ToString()
            }).ToList();

            var model = new GameViewModel {
                Developers = developers, Genres = genres
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public async Task <IEnumerable <string> > Get()
        {
            var developerService = new DeveloperService(new DeveloperRepository());
            var developers       = await developerService.GetAll();

            return(developers.Select(x => x.ToString()));
        }
Exemplo n.º 3
0
 public IHttpActionResult GetDeveloper()
 {
     try
     {
         return(Ok(DeveloperService.GetAll()));
     }
     catch (RepositoryException ex)
     {
         return(InternalServerError(ex));
     }
 }
Exemplo n.º 4
0
        // GET: Developers
        public ActionResult Index()
        {
            var allDevelopers = developerService.GetAll().Select(d => new DeveloperViewModel(d)).ToList();

            if (allDevelopers == null)
            {
                return(View("Index"));
            }

            return(View(allDevelopers));
        }
Exemplo n.º 5
0
        public async Task GetAllTest()
        {
            var result = await developerService.GetAll();

            Assert.Collection(result, developer =>
            {
                Assert.Equal(developers[0].name, developer.name);
            },
                              developer =>
            {
                Assert.Equal(developers[1].name, developer.name);
            });
        }
 public GameViewModel()
 {
     using (var developerService = new DeveloperService())
     {
         Developers = developerService.GetAll().Select(x => new SelectListItem {
             Text = x.Name, Value = x.Id.ToString()
         }).ToList();
     };
     using (var genreService = new GenreService())
     {
         Genres = genreService.GetAll().Select(x => new SelectListItem {
             Text = x.Type, Value = x.Id.ToString()
         }).ToList();
     };
 }
Exemplo n.º 7
0
        // GET: Biz/Developer
        public ActionResult Index()
        {
            var models = _service.GetAll();

            return(View(models));
        }
Exemplo n.º 8
0
 // GET: Developer
 public async Task <IActionResult> Index()
 {
     return(View(await _developerService.GetAll()));
 }
Exemplo n.º 9
0
 public List <Developer> GetData() => _service.GetAll();