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