示例#1
0
        /// <summary>
        /// 转换成pocos 实体 纯净的P_Permission 没有导航属性
        /// </summary>
        /// <returns></returns>
        //public P_Permission ToPOCO()
        //{
        //    P_Permission poco = new P_Permission()
        //       {
        //           ID = this.ID,
        //           ParentID = this.ParentID,
        //           Name = this.Name,
        //           AreaName = this.AreaName,
        //           ControllerName = this.ControllerName,
        //           ActionName = this.ActionName,
        //           FormMethod = this.FormMethod,
        //           IsLink = this.IsLink,
        //           LinkURL = this.LinkURL,
        //           IsShow = this.IsShow,
        //           ICO = this.ICO,
        //           Remark = this.Remark,
        //           IsActive = this.IsActive,
        //           SN = this.SN
        //       };
        //    return poco;
        //}



        /// <summary>
        /// 转换成相对应的实体对象
        /// </summary>
        /// <returns></returns>
        public ViewModel.Permission ToViewModel()
        {
            ViewModel.Permission vModel = new ViewModel.Permission()
            {
                ID             = this.ID,
                ParentID       = this.ParentID,
                ParentName     = "无",
                Name           = this.Name,
                AreaName       = this.AreaName,
                ControllerName = this.ControllerName,
                ActionName     = this.ActionName,
                FormMethod     = this.FormMethod,
                SN             = this.SN,
                IsShow         = this.IsShow,
                Remark         = this.Remark
            };

            return(vModel);
        }
示例#2
0
        /// <summary>
        /// 转换成pocos 实体 纯净的P_Permission 没有导航属性   
        /// </summary>
        /// <returns></returns>
        //public P_Permission ToPOCO()
        //{
        //    P_Permission poco = new P_Permission()
        //       {
        //           ID = this.ID,
        //           ParentID = this.ParentID,
        //           Name = this.Name,
        //           AreaName = this.AreaName,
        //           ControllerName = this.ControllerName,
        //           ActionName = this.ActionName,
        //           FormMethod = this.FormMethod,
        //           IsLink = this.IsLink,
        //           LinkURL = this.LinkURL,
        //           IsShow = this.IsShow,
        //           ICO = this.ICO,
        //           Remark = this.Remark,
        //           IsActive = this.IsActive,
        //           SN = this.SN
        //       };
        //    return poco;
        //}
        /// <summary>
        /// 转换成相对应的实体对象
        /// </summary>
        /// <returns></returns>
        public ViewModel.Permission ToViewModel()
        {
            ViewModel.Permission vModel = new ViewModel.Permission()
            {
                ID = this.ID,
                ParentID = this.ParentID,
                ParentName = "无",
                Name = this.Name,
                AreaName = this.AreaName,
                ControllerName = this.ControllerName,
                ActionName = this.ActionName,
                FormMethod = this.FormMethod,
                SN = this.SN,
                IsShow = this.IsShow,
                Remark = this.Remark
            };

            return vModel;
        }