예제 #1
0
        public ActionResult <EstimatedShipping> Create(EstimatedShipping estimatedShipping)
        {
            estimatedShipping.EstimatedDate = DateTime.Now.Date;

            estimatedShipping.EstimatedDate = estimatedShipping.EstimatedDate.AddDays(4);

            _estimatedShippingService.Create(estimatedShipping);

            return(CreatedAtRoute("GetEstimatedShipping", new { id = estimatedShipping.Id.ToString() }, estimatedShipping));
        }
예제 #2
0
        public IActionResult Update(string id, EstimatedShipping estimatedShippingIn)
        {
            var estimatedShipping = _estimatedShippingService.Get(id);

            if (estimatedShipping == null)
            {
                return(NotFound());
            }

            _estimatedShippingService.Update(id, estimatedShippingIn);

            return(NoContent());
        }
예제 #3
0
 public void Remove(EstimatedShipping estimatedShippingIn) =>
 _estimatedShipping.DeleteOne(estimatedShipping => estimatedShipping.Id == estimatedShippingIn.Id);
예제 #4
0
 public void Update(string id, EstimatedShipping estimatedShippingIn) =>
 _estimatedShipping.ReplaceOne(estimatedShipping => estimatedShipping.Id == id, estimatedShippingIn);
예제 #5
0
 public EstimatedShipping Create(EstimatedShipping estimatedShipping)
 {
     _estimatedShipping.InsertOne(estimatedShipping);
     return(estimatedShipping);
 }