Beispiel #1
0
 public IActionResult New([FromBody] Comments comment)
 {
     try
     {
         _context.Comments.Add(comment);
         _context.SaveChanges();
         return(Ok("Message received successful.."));
     }
     catch (System.Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Beispiel #2
0
 public IActionResult NewService(Services service)
 {
     try
     {
         _context.Services.Add(service);
         _context.SaveChanges();
         return(Ok("Message received successfully.."));
     }
     catch (System.Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }