예제 #1
0
        public static BllUserEntity ToBal(this DalUserEntity user)
        {
            if (user == null)
            {
                return(null);
            }

            return(new BllUserEntity
            {
                Id = user.Id,
                Name = user.Name,
                Password = user.Password,
                BllRole = user.DalRole.ToBal(),
            });
        }
예제 #2
0
        public static User ToModel(this DalUserEntity item)
        {
            if (item == null)
            {
                return(null);
            }

            User userEntity = new User
            {
                Id       = item.Id,
                Name     = item.Name,
                Password = item.Password,
                RoleId   = item.DalRole.Id
            };

            return(userEntity);
        }
예제 #3
0
        public static DalUserEntity ToDal(this User item)
        {
            if (item == null)
            {
                return(null);
            }

            DalUserEntity userDalEntity = new DalUserEntity
            {
                Id       = item.Id,
                Name     = item.Name,
                Password = item.Password,
                DalRole  = item.Role.ToDal()
            };

            return(userDalEntity);
        }
예제 #4
0
        //public static IDalEntity ToDal(this IBllEntity itemEntity)
        //{
        //    return null;
        //}

        public static DalUserEntity ToDal(this BllUserEntity itemUserEntity)
        {
            if (itemUserEntity == null)
            {
                return(null);
            }

            DalUserEntity dalUserEntity = new DalUserEntity
            {
                Id       = itemUserEntity.Id,
                Name     = itemUserEntity.Name,
                Password = itemUserEntity.Password,
                DalRole  = itemUserEntity.BllRole.ToDal()
            };

            return(dalUserEntity);
        }