Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using EpicCars;
- using System.IO;
- using Newtonsoft.Json;
- namespace EpicCars
- {
- public class BidService
- {
- private string _filePath = @"C:\Users\2015A320\Source\Repos\EpicU_JoseHernandez\EpicCars\EpicCars";
- public Bid GetBidders()
- {
- string fullName = Path.Combine(_filePath, "Bid.json");
- if (!File.Exists(fullName))
- return null;
- string bidContents = File.ReadAllText(fullName);
- return JsonConvert.DeserializeObject<Bid>(bidContents);
- }
- public void SaveBidders(Bid bidders)
- {
- string fullName = Path.Combine(_filePath, "Bid.json");
- string biddersContents = JsonConvert.SerializeObject(bidders);
- File.WriteAllText(fullName, biddersContents);
- }
- public void SaveStartingBid(Bid bid)
- {
- throw new NotImplementedException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment