public IHttpActionResult GetIPAddress(int id) { IIPAddressBS bs = DIFactoryDesigntime.GetInstance <IIPAddressBS>(); PingCo.Model.IPAddress IPAddress = bs.GetIPAddressesById(id); if (IPAddress == null) { return(NotFound()); } return(Ok(IPAddress)); }
public IHttpActionResult PostIPAddress(PingCo.Model.IPAddress IPAddress) { ModelState.Remove("IPAddress.Id"); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } IIPAddressBS bs = DIFactoryDesigntime.GetInstance <IIPAddressBS>(); bs.AddIPAddresses(IPAddress); return(CreatedAtRoute("DefaultApi", new { id = IPAddress.Id }, IPAddress)); }
public IHttpActionResult PutIPAddress(int id, PingCo.Model.IPAddress IPAddress) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != IPAddress.Id) { return(BadRequest()); } IIPAddressBS bs = DIFactoryDesigntime.GetInstance <IIPAddressBS>(); bs.UpdateIPAddresses(IPAddress); return(StatusCode(HttpStatusCode.NoContent)); }
//GET: api/IPAddresss public IQueryable <PingCo.Model.IPAddress> GetIPAddresses() { IIPAddressBS bs = DIFactoryDesigntime.GetInstance <IIPAddressBS>(); return(bs.GetIPAddresses()); }