Exemplo n.º 1
0
 public IHttpActionResult UpdateShipper(ShipperModel existing)
 {
     var entity = new Shipper
     {
         CompanyName = existing.CompanyName,
         Phone = existing.Phone
     };
     _repository.UpdateShipper(entity);
     return Ok<ShipperModel>(existing);
 }
Exemplo n.º 2
0
 public IHttpActionResult CreateShipper(ShipperModel newShipper)
 {
     var entity = new Shipper
     {
         CompanyName = newShipper.CompanyName,
         Phone = newShipper.Phone
     };
     entity = _repository.CreateShipper(entity);
     newShipper.ShipperID = entity.ShipperID;
     String loc = Url.Link("api/shippers/{shipperID}", new { shipperID = entity.ShipperID });
     return Created<ShipperModel>(loc, newShipper);
 }
Exemplo n.º 3
0
 public static ShipperModel GetShipper(Shipper s)
 {
     return new ShipperModel
     {
         ShipperID = s.ShipperID,
         CompanyName = s.CompanyName,
         Phone = s.Phone
     };
 }