Dmslinq expression Framework Implementation (total)

Source: Internet
Author: User

1. I would like to thank the previous companies for writing this framework, which forced me to learn more about some of the functions of LINQ. the framework is not similar to the iqueryable query, but it is not written based on iqueryable, so it is very convenient to expand, finally, multi-Table query is implemented and some LINQ from syntaxes are supported (lazy loading technology does not support the into syntax ).

For example:

             VaR Q1 = From X In DMS. Create <sysrole> ( False , False  )  Where X. sysroleid> 0 & Amp; X. rolename. Like ( "  S  " )  Select  X;  VaR Q2 = From X In DMS. Create <sysrole> ( False , False  ) Join y  In DMS. Create <sysrolepower> () On X. sysroleid equals Y. sysroleid  Select   New {X. sysroleid, Y. sysrolepowerid, X. rolename }; 

 

2. Support the subquery syntax (as must be performed on the table name in the subquery)

  var  query = DMS. create 
  
    (). where (q => q. sysrolepowerid> 
    0  & Q. remark. like (
    " 
    QQ  
   "  )). select (q => 
    New  
    {q. sysrolepowerid, rolename  = DMS. create 
   
     (). as (
     " 
     x  
    "  ). where (x => X. sysroleid = Q. sysroleid & X. rolename. like (
     " 
     S  
    "  
     )). tocolumn  
     string  
     (),});  
   
  

3. the default data return type is datatable. Generally, you can use tolist <any type> () to set the value based on the attribute fields of the type. Unlike the tolist in iqueryable, data cannot be of the type. Select must be assigned a value. greatly reducedCodeQuantity
4. Supports the data filtering interface. You can implement the idmslinqqueryfilter interface outside the framework to configure the vertical data permission for filtering tables. Horizontal data permissions can be adjusted by splicing columnsclip.

 <  Configuration  >      <  Configsections  >          <  Section  Name  = "Dmslinqqueryprovider"  Type = "Kingnet. dmsframe. dmslinq. dmslinqqueryprovider, kingnet. dmsframe. dmslinq"  />      </  Configsections  >      <  Dmslinqqueryprovider  >          <  Add  Key  = "Query1"  Value  = "Kingnet. dmsframe. Business. queryfilterbll, kingnet. dmsframe. Business"  />     </  Dmslinqqueryprovider  >  </  Configuration  > 

5. Supports field concatenation query or as a condition

 
VaR query2 = DMS. Create<Userinfo>(). Select (q => q. Columns (Q. Title + q. username). As ("username ")));

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.