public static Bookable GetBookableById(Guid bookableId) { var bookableString = bookableStore.Get(bookableId); if (string.IsNullOrWhiteSpace(bookableString)) { var bookable = new Bookable(bookableId); bookable.BookedSlots = new List <BookedSlot>(); return(bookable); } return(FromJson(bookableString)); }
private static string ToJson(Bookable bookable) { return(Newtonsoft.Json.JsonConvert.SerializeObject(bookable)); }
public static void Save(Bookable bookable) { bookableStore.Save(bookable.Id, ToJson(bookable)); }