示例#1
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,Username,Attribute,Op,Value")] Radreply radreply)
        {
            if (id != radreply.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(radreply);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RadreplyExists(radreply.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(radreply));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Id,Username,Attribute,Op,Value")] Radreply radreply)
        {
            if (ModelState.IsValid)
            {
                _context.Add(radreply);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(radreply));
        }
        private void SetUpInsertBaseDataForRadiusDb()
        {
            var radreply = new Radreply
            {
                Username  = "******",
                Op        = "=",
                Attribute = "RadreplyAttribute1",
                Value     = "Nw1Address"
            };

            _radiusDbContext.Radreply.Add(radreply);
            _radiusDbContext.SaveChanges();
        }