Exemple #1
0
        public T[] GetParamArray <T>() where T : new()
        {
            var typeName = typeof(T).Name;
            var entity   = JsonParams.Find(typeName + "[]");

            if (entity == null)
            {
                return(new T[0]);
            }
            else
            {
                return(JsonConvert.DeserializeObject <T[]>(entity.JsonBody));
            }
        }
Exemple #2
0
        public void SetParamArray <T>(T[] args) where T : new()
        {
            var typeName = typeof(T).Name + "[]";
            var entity   = JsonParams.Find(typeName);

            if (entity == null)
            {
                entity = new JsonParam
                {
                    Id = typeName
                };
                JsonParams.Add(entity);
            }
            entity.JsonBody = JsonConvert.SerializeObject(args);
        }