Esempio n. 1
0
        public async Task <IActionResult> Post([FromBody] Product product)
        {
            await _db.SaveChangesAsync();

            var create = await _repo.AddItem(product);

            return(Ok(create));
        }
 public ActionResult <Customer> Post([FromBody] Customer value)
 {
     try
     {
         _repo.AddItem(value);
         return(Ok(value));
     }
     catch (Exception e)
     {
         return(BadRequest($"Error : {e.Message}"));
     }
 }
 public ActionResult <Customer> Post([FromBody] Customer customer)
 {
     try
     {
         _repo.AddItem(customer);
         return(Ok(customer));
     }
     catch (Exception e)
     {
         return(BadRequest("error" + e.Message));
     }
 }
Esempio n. 4
0
 public ActionResult <IEnumerable <Customer> > Post([FromBody] Customer value)
 {
     try
     {
         _repo.AddItem(value);
         return(Ok(value));
     }
     catch (Exception e)
     {
         return(BadRequest("oops error" + e.Message));
     }
 }
 public ActionResult <Customer> Post([FromBody] Customer value)
 {
     try
     {
         _repo.AddItem(value);
         return(Ok(value));
     }
     catch
     {
         return(BadRequest());
     }
 }
Esempio n. 6
0
 public ActionResult <Customer> Post([FromBody] Customer customer)
 {
     try
     {
         repository.AddItem(customer);
         return(Ok(customer));
     }
     catch (Exception)
     {
         return(BadRequest("not possible"));
     }
 }
 public Note Post(Note noteToAdd)
 {
     return(_noteRepo.AddItem(noteToAdd));
 }
 public NoteCategory Post(NoteCategory catgToAdd)
 {
     return(_categoryRepo.AddItem(catgToAdd));
 }
Esempio n. 9
0
        public async Task <IActionResult> Post([FromBody] SuperCategory super)
        {
            var create = await _repo.AddItem(super);

            return(Ok(create));
        }
Esempio n. 10
0
 public void AddItem(QuickLaunchItem item)
 {
     _repo.AddItem(item);
 }
Esempio n. 11
0
        public async Task <IActionResult> Post([FromBody] User user)
        {
            var create = await _repo.AddItem(user);

            return(Ok(create));
        }
Esempio n. 12
0
        public async Task <IActionResult> Post([FromBody] Category category)
        {
            var create = await _repo.AddItem(category);

            return(Ok(create));
        }