Example #1
0
        /// <summary>
        /// 根据ID查询
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static RoleVM GetByID(int id)
        {
            Role role = RoleDAL.Find(id);

            Mapper.CreateMap <Role, RoleVM>();
            RoleVM roleVM = Mapper.Map <Role, RoleVM>(role);

            return(roleVM);
        }
 public Role Get(int id)
 {
     return(roledal.Find(u => u.ID == id));
 }