Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 private static string ToJson(Bookable bookable)
 {
     return(Newtonsoft.Json.JsonConvert.SerializeObject(bookable));
 }
Esempio n. 3
0
 public static void Save(Bookable bookable)
 {
     bookableStore.Save(bookable.Id, ToJson(bookable));
 }