/// <summary>
 ///   Gets the id member for the class type.
 /// </summary>
 /// <param name = "classType">Type of the entity.</param>
 /// <returns></returns>
 public MemberInfo FindIdMember(Type classType)
 {
     return(GetIdOverrideValue(
                classType,
                o => o.Member,
                m => m != null,
                _profile.FindIdMember(classType)));
 }
Exemplo n.º 2
0
        private IdMap CreateIdMap(Type classType)
        {
            var idMember = _profile.FindIdMember(classType);

            if (idMember == null)
            {
                return(null);
            }

            var memberReturnType = idMember.GetReturnType();

            return(new IdMap(
                       idMember.Name,
                       memberReturnType,
                       MemberReflectionOptimizer.GetGetter(idMember),
                       MemberReflectionOptimizer.GetSetter(idMember),
                       _profile.GetIdGenerator(classType, idMember),
                       _profile.GetIdUnsavedValue(classType, idMember)));
        }