コード例 #1
0
        public tb_access_level ToDbModel(AccessLevelModel accessLevel)
        {
            tb_access_level tbAccessLevel = new tb_access_level();

            tbAccessLevel.id_access_level = accessLevel.Id;
            tbAccessLevel.ds_access_level = accessLevel.Name;

            return tbAccessLevel;
        }
コード例 #2
0
        public AccessLevelModel ToModel(tb_access_level tbAccessLevel)
        {
            AccessLevelModel accessLevel = new AccessLevelModel();

            accessLevel.Id = tbAccessLevel.id_access_level;
            accessLevel.Name = tbAccessLevel.ds_access_level;

            foreach (tb_permission permission in tbAccessLevel.tb_permission)
                accessLevel.Permissions.Add(new PermissionService().ToModel(permission));

            return accessLevel;
        }