public static ReservedArguments CreateReservedArguments(string query) {
     NameValueCollection collection = HttpUtility.ParseQueryString(query);
     var args = new ReservedArguments();
     PopulateReservedArgs(collection, args);
     return args;
 }
        private static void PopulateReservedArgs(NameValueCollection collection, ReservedArguments args) {
            try {
                string voFlag = collection[RestControlFlags.ValidateOnlyReserved];
                string domainModel = collection[RestControlFlags.DomainModelReserved];
                string page = collection[RestControlFlags.PageReserved];
                string pageSize = collection[RestControlFlags.PageSizeReserved];
                string inlineFlag = collection[RestControlFlags.InlinePropertyDetailsReserved];
                string inlineItemsFlag = collection[RestControlFlags.InlineCollectionItemsReserved];

                args.ValidateOnly = voFlag != null && bool.Parse(voFlag);
                args.DomainModel = domainModel;
                args.Page = page != null ? int.Parse(page) : 0;
                args.PageSize = pageSize != null ? int.Parse(pageSize) : 0;
                args.InlinePropertyDetails = inlineFlag != null ? bool.Parse(inlineFlag) : (bool?)null;
                args.InlineCollectionItems = inlineItemsFlag != null ? bool.Parse(inlineItemsFlag) : (bool?)null;
            }
            catch (Exception e) {
                Logger.ErrorFormat("Malformed reserved arguments: {0}", e.Message);
                args.IsMalformed = true;
            }
        }