Example #1
0
 public IActionResult OnGet(int?PlayerSupportId)
 {
     if (PlayerSupportId.HasValue)
     {
         PlayerSupport = playerSupport.GetPlayerSupportById(PlayerSupportId.Value);
         if (PlayerSupport == null)
         {
             return(RedirectToPage("./NotFound"));
         }
     }
     else
     {
         PlayerSupport = new WebProjectCore.PlayerSupport.PlayerSupport();
     }
     Technical = htmlHelper.GetEnumSelectList <Technical>();
     return(Page());
 }
        public IActionResult Create(PlayerSupportDto playerSupportDto)
        {
            if (playerSupportDto == null)
            {
                return(BadRequest());
            }

            var playersupport = new WebProjectCore.PlayerSupport.PlayerSupport();

            playersupport.InGame      = (InGame)playerSupportDto.InGame;
            playersupport.Technical   = (Technical)playerSupportDto.Technical;
            playersupport.Account     = (Account)playerSupportDto.Account;
            playersupport.Description = playerSupportDto.Description;
            playersupport.Username    = playerSupportDto.Username;
            playersupport.Subject     = playerSupportDto.Subject;



            PSData.Create(playersupport);
            PSData.Commit();

            return(CreatedAtRoute("GetPlayerSupport", new { id = playersupport.Id }, playersupport));
        }