Example #1
0
 public void Add()
 {
     if (IsValid == true)
     {
         _dataAccessLayer.Add("SAT-A");
     }
 }
        public ActionResult Create([FromBody] Item item)
        {
            dal.Add(item);

            // Return a created at route to indicate where the resource can be found
            return(CreatedAtRoute("GetItem", new { id = item.Id }, item));
        }
Example #3
0
        public ActionResult Create([FromBody] Item item)
        {
            dal.Add(item);

            //using parent's created at route and passing in: 1. The name of the action the client uses to get the resource
            //2. the input parameter needed to get the resource 3. the new object that was created
            //throw new Exception();
            return(CreatedAtRoute("GetItem", new { id = item.Id }, item));
        }
Example #4
0
        public ActionResult Create([FromBody] ProductReview productReview)
        {
            dal.Add(productReview);

            //using parent's created at route and passing in: 1. The name of the action the client uses to get the resource
            //2. the input parameter needed to get the resource 3. the new object that was created
            //throw new Exception();
            return(CreatedAtRoute("GetProductReview", new { id = productReview.Id }, productReview));
        }
 public ActionResult Create([FromBody] Item item)
 {
     dal.Add(item);
     count++;
     return(CreatedAtRoute("GetItem", new { id = count }, item));
 }