• Linq 执行概念


    Linq 在返回结果集后不会立该执行 而是在页面绑定时执行

    像这样

    getName(name,view)

    {

      return view?name:"";

    }

    var lq=from p in lqTable select new{//程序在这Stop

                        p.id=i++,//在前台页面 绑定ID时执行

                        p.name=getName(p.name,false);//在前台页面绑定name时执行

                      }

    想一次查出来?

    lq.ToArray() :转成数组

    /*

    (var query = from item in Pages
        
    where item.CategoryId == 1
        select item;
    IQueryable
    <int> updateAffactedLine = query.UpdateUgly(
        () 
    => new Page(){
            CategoryId 
    = GetCategoryId(NewCategoryDropDownList),
            LastModifyDate 
    = DateTime.Now,
         }
    );

    不到有用没用 记下吧

    */

  • 相关阅读:
    博客园代码
    前端
    1338. Reduce Array Size to The Half
    1220. Count Vowels Permutation
    363. Max Sum of Rectangle No Larger Than K
    366. Find Leaves of Binary Tree
    443. String Compression
    8 · Rotate String
    886. Possible Bipartition
    LT 183 wood cut
  • 原文地址:https://www.cnblogs.com/mattins/p/1922389.html
Copyright © 2020-2023  润新知