Exemplo n.º 1
0
        /// <summary>
        /// Transform a user database object to a User view Obj
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static ViewObj.User TransformDbtoViewObj(DbObj.User user)
        {
            ViewObj.User newUser = null;
            if (user != null)
            {
                newUser = new ViewObj.User
                {
                    UserId    = user.UserId,
                    UserEmail = user.UserEmail,
                    Name      = user.Name
                };
            }

            return(newUser);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Transform a user view object to a User EF Obj
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static DbObj.User TransformViewToDbObj(ViewObj.User user)
        {
            DbObj.User newUser = null;
            if (user != null)
            {
                newUser = new DbObj.User
                {
                    UserId    = user.UserId,
                    UserEmail = user.UserEmail,
                    Name      = user.Name
                };
            }

            return(newUser);
        }