Example #1
0
        public ActionResult Create(PlayerViewModel player)
        {
            if (ModelState.IsValid)
            {
                player.Team     = teamServices.ReturnTeam(player.ViewTeamId);
                player.Position = positionServices.ReturnPosition(player.ViewPositionId);
                playerServices.CreatePlayer(player);
                return(RedirectToAction("Index"));
            }

            return(View(player));
        }
Example #2
0
        private async Task ExecuteAsync()
        {
            var sqliteDapper = new SqliteDapper();

            using var dbConnection = sqliteDapper.Facyory();

            var aPlayerServices = new PlayerServices(dbConnection);
            await aPlayerServices.CreatePlayer(sqliteDapper.DbPath);

            await aPlayerServices.AddPlayer();

            await aPlayerServices.GetPlayersAsync();
        }