Example #1
0
        public IPropertyMapping GetMappingForType(PropertyInfo info)
        {
            var mapping = PropertyMappings.FirstOrDefault(x => x.PropertyInfo.GetMethod == info.GetMethod);

            if (mapping == null)
            {
                mapping = new PropertyMapping(info);
                PropertyMappings.Add(mapping);
            }

            return(mapping);
        }
Example #2
0
        private IPropertyMapping DefineMapping(LambdaExpression lambda)
        {
            var info = (PropertyInfo)GetMemberInfo(lambda);

            var mapping = PropertyMappings.FirstOrDefault(x => x.PropertyInfo.GetMethod == info.GetMethod);

            if (mapping == null)
            {
                mapping = new PropertyMapping(info);
                PropertyMappings.Add(mapping);
            }

            return(mapping);
        }