Beispiel #1
0
        /// <summary>
        /// Returns the last updated time, null if there has never been an update
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static DateTime?GetLastUpdate(string userId)
        {
            LastUpdateModel lastUpdate = CosmosDBClient.Query <LastUpdateModel>()
                                         .Where(lu => lu.UserId == userId).Where(lu => lu.Id == GetId(userId)).AsEnumerable().FirstOrDefault();

            if (lastUpdate == default(LastUpdateModel))
            {
                return(null);
            }
            return(lastUpdate.LastUpdateTime);
        }
Beispiel #2
0
        public static void SetLastUpdate(string userId)
        {
            LastUpdateModel lastUpdate = new LastUpdateModel(userId);

            CosmosDBClient.InsertOrReplace(lastUpdate);
        }