Exemplo n.º 1
0
        public void CharFeatsPass()
        {
            var Chara = new CharFeats()
            {
                FeatId      = 1,
                CharacterId = 1
            };

            Assert.Equal(1, Chara.CharacterId);
            Assert.Equal(1, Chara.FeatId);
        }
        public async Task <ActionResult> Create(Featpass selection)
        {
            var collection = new CharFeats()
            {
                CharacterId = selection.charID,
                FeatId      = selection.feat.FeatID
            };

            try
            {
                using (var httpClient = new HttpClient())
                {
                    var request  = CreateRequestToService(HttpMethod.Post, $"{Configuration["ServiceEndpoints:CharFeats"]}", collection);
                    var Response = await httpClient.SendAsync(request);
                }

                return(RedirectToAction(nameof(Details), new { id = selection.charID }));
            }
            catch
            {
                return(View(selection));
            }
        }
 public void Post([FromBody] CharFeats value)
 {
     Repo.CreateCharFeat(value);
     Repo.Save();
 }