Exemplo n.º 1
0
        public async Task <IActionResult> PutRrsVNExpress(int id, RrsVNExpress rrsVNExpress)
        {
            if (id != rrsVNExpress.Id)
            {
                return(BadRequest());
            }

            _context.Entry(rrsVNExpress).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RrsVNExpressExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <RrsVNExpress> > PostRrsVNExpress(RrsVNExpress rrsVNExpress)
        {
            _context.RrsVNExpresss.Add(rrsVNExpress);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetRrsVNExpress", new { id = rrsVNExpress.Id }, rrsVNExpress));
        }
Exemplo n.º 3
0
 public static Boolean CheckDuplicate(ApplicationDbContext _context, RrsVNExpress news)
 {
     return(_context.RrsVNExpresss.Any(item => item.Category == news.Category && item.Title == news.Title));
 }