示例#1
0
        public static TValue GetValue <TValue>(this ETag etag, string name)
        {
            Arg.NotNullOrEmpty(name, nameof(name));

            if (etag == null)
            {
                return(default(TValue));
            }

            var    binder = new SimpleMemberBinder(name);
            object value;

            if (etag.TryGetMember(binder, out value))
            {
                return((TValue)value);
            }

            return(default(TValue));
        }