private int GetPositionFromCursor(string cursor)
        {
            Dictionary <string, object> properties = Base64Serializer
                                                     .Deserialize <Dictionary <string, object> >(cursor);

            return(Convert.ToInt32(properties["__position"]));
        }
Пример #2
0
        private static Dictionary <string, object> TryDeserializeCursor(
            string cursor)
        {
            if (cursor == null)
            {
                return(null);
            }

            var properties = Base64Serializer
                             .Deserialize <Dictionary <string, object> >(cursor);

            return(properties);
        }
        public static IDictionary <string, object> GetCursorProperties(
            this IResolverContext context)
        {
            string cursor = context.Argument <string>("after")
                            ?? context.Argument <string>("before");

            if (cursor == null)
            {
                return(new Dictionary <string, object>());
            }

            return(Base64Serializer
                   .Deserialize <Dictionary <string, object> >(cursor));
        }
Пример #4
0
 private T Act <T>(string input)
 {
     return(_sut.Deserialize <T>(input));
 }