Beispiel #1
0
        protected T Bind <T>() where T : class, new()
        {
            Type type       = typeof(T);
            var  nameValues = GetRequestNameValueCollection();

            if (RequestBinder.Contains(type))
            {
                return((T)RequestBinder.GetBinder(type).Bind(nameValues, type));
            }
            else if (!type.IsValueType)
            {
                return(DtoBinder.CreateInstance <T>(nameValues));
            }
            else
            {
                return(default(T));
            }
        }