예제 #1
0
        public static Type[] ParseTypes(string types)
        {
            if (string.IsNullOrEmpty(types))
            {
                return(null);
            }

            return(types.Split(',').Select(tn => Navigator.ResolveType(tn)).NotNull().ToArray());
        }
예제 #2
0
        public static RuntimeInfo FromFormValue(string formValue)
        {
            if (string.IsNullOrEmpty(formValue))
            {
                return(null);
            }

            string[] parts = formValue.Split(new[] { ";" }, StringSplitOptions.None);
            if (parts.Length != 4)
            {
                throw new ArgumentException("Incorrect sfRuntimeInfo format: {0}".FormatWith(formValue));
            }

            string entityTypeString = parts[0];

            Type type = Navigator.ResolveType(entityTypeString);

            return(new RuntimeInfo(
                       type,
                       (parts[1].HasText()) ? PrimaryKey.Parse(parts[1], type) : (PrimaryKey?)null,
                       parts[2] == "n",
                       parts.Length == 4 && parts[3].HasText() ? long.Parse(parts[3]) : (long?)null
                       ));
        }