Example #1
0
        public object GetPropertyFastMember([NotNull] object obj)
        {
            FastMember.TypeAccessor accessor = FastMember.TypeAccessor.Create(obj.GetType());
            bool hasProperty = accessor.GetMembers().Any(m => m.Name == UIntArrayPropertyName);

            if (!hasProperty)
            {
                return(null);
            }

            return(accessor[obj, UIntArrayPropertyName]);
        }
        public void SetPropertyFastMember([NotNull] object obj)
        {
            FastMember.TypeAccessor accessor = FastMember.TypeAccessor.Create(obj.GetType());
            bool hasProperty = accessor.GetMembers().Any(m => m.Name == UIntArrayPropertyName);

            if (!hasProperty)
            {
                return;
            }

            accessor[obj, UIntArrayPropertyName] = ValueToSet;
        }