zoukankan      html  css  js  c++  java
  • 通过写后台权限领悟到的东西

    1.Tagbuilder 本身引用的是system.web.mvc但是在mvc3种如果单纯的引用system.web.mvc还是不够的,还需要应用system.web.WebPages

    2.linq中的let的使用方法:

      let的作用是产生一个用于存储查询表达式中的子表达式查询结果的范围变量 

      eg:

        var actions = _adminAcionService.GetAdminActionsWithRoles();
        var role = _adminRoleService.GetAdminRole(id);
        var sortedActions = from i in actions
                   orderby i.OrderId
                   where !i.ParentId.HasValue
                   let s = (from j in actions
                  where j.ParentId.HasValue && j.ParentId.Value == i.ActionId
                  select new AdminActionWithChecked() { AdminAction = j, IsChecked = j.Roles.Contains(role) })
                  select new EditRolePermissionComplexType() { ParentAction = i, SubActions = s.ToList() };

    return View(new EditRolePermissionViewModel()
    {
    ComplexAction = sortedActions.ToList(),
    Role = role
    });

    让我看了好一阵的代码,觉得很精辟

    3.数据表的设计

      

     

     

     

     

     

     

  • 相关阅读:
    华为机考--约瑟夫问题
    华为机考--字符串压缩
    2014华为校招机考模拟--求最大递增数
    2014华为校招机考模拟--记票统计
    插入排序与归并排序的C#实现
    步入C#--hello world
    shell 命令用法
    About compiling some source code on centos
    ubuntu Install packages
    ssh命令
  • 原文地址:https://www.cnblogs.com/douqiumiao/p/2932433.html
Copyright © 2011-2022 走看看