public Asset Save(Asset asset) { var url = string.Format("Asset/Save?apikey={0}&companyid={1}", _apiKey, _companyId); var request = new RestRequest(url, Method.POST) { JsonSerializer = new JsonSerializer() }; request.RequestFormat = DataFormat.Json; request.AddBody(asset); var response = _client.Execute<Asset>(request); return response.Data; }
public void SaveAsset() { var asset = new Asset { Description = "Highback chair", DatePurchased = DateTime.Now.ToShortDateString(), SerialNumber = "12345CH", BoughtFrom = "ABC Furniture", PurchasePrice = 5000, ReplacementValue = 3000, CurrentValue = 4000 }; var newAsset = Api.AssetRequest.Save(asset); }