Beispiel #1
0
        public async Task<IActionResult> AddUrun(UrunResource urunResource)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState.GetErrorMessage());
            }
            Urun urun = mapper.Map<UrunResource, Urun>(urunResource);

            UrunResponse urunResponse = await urunService.AddUrunAsync(urun);
            if (urunResponse.Success)
            {
                return Ok(urunResponse.Success);
            }
            else
            {
                return BadRequest(urunResponse.Message);
            }
        }