In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what are the shortcomings of LINQ". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
LINQ prospect
The current LINQ is still very imperfect, whether it is the LINQ TO SQL of the LINQ team or the LINQ TO ENTITY of ADO.Net, Microsoft does not even Dynamic the SP1 of VS2008. Cs is encapsulated. Is it true that LINQ is dying, as rumors have it?
In fact, any situation is unknown, just as Blizzard always likes to play its cards out of common sense. Microsoft has also suffered considerable trauma in this year's financial crisis, so who can say what the future of LINQ is? it was not officially made public. Before Net4.0, not only LINQ, but also Flying, everything was a mystery.
Can LINQ still be used? When you install a heavy VS2008, advertisements will constantly show the new features of VS2008, with emphasis on LINQ. As a global development software, focus on LINQ, then it must have its status and significance.
I began to use LINQ when VS2008 was still in CTP. I have been learning and realizing its convenience for so long. At the same time, with the continuous deepening, while experiencing the pleasure brought to us by the LINQ language, the disadvantages of LINQ have gradually begun to leak out. I personally found that the shortcomings of LINQ are as follows:
1.LINQ non-delayed loading requires immediate loading, then it needs to be converted to List, but at the same time it brings that List is unordered, so if you bind it as a data source, automatic sorting will not exist, then the current solution can only rewrite List's Sort () method, there are relevant articles on the Internet for reference, how to make it serialized.
The dynamic query effect of 2.LINQ is similar to the reflection of C #, so you must download a Dynamic from the Internet. Cs, I don't understand why even SP1 doesn't wrap it?
3.LINQ 's dbml is very annoying, why can't you do it as intelligently as Dataset? if you use VS's object-relational designer to manually change the dbml code, then you will find that all your original modified things have been covered, which will infuriate you. Who would be bored enough to handwrite a very complex dbml? At present, the only solution is to use plinqo,CodeSmith products. I should be very familiar with CodeSmith. I really rejected it from the very beginning.
The 4.LINQ read stored procedure does not recognize the exec command if the end of your stored procedure is not similar to select * from. , but exec. Okay, so if you drag it into dbml, you'll find that no matter what you write, the return value is of type int, so someone said, I can manually change int to IsingleSource, but that goes back to point (3), doesn't it? What does that mean? If you want to use stored procedures with LINQ, you can not use spliced general stored procedures, but must honestly write down the table names, column names and so on in the stored procedures, which also means that the development efficiency can not be improved.
If 5.LINQ does not use stored procedures, then its performance can only be said to be better than the traditional connection connection, fortunately, IQueryable built-in cache function, but still can not achieve the effect of database functions and stored procedures, after all, LINQ is only a way to improve development efficiency, a fresh and simplified query language.
Considering the current disadvantages of LINQ, you can imagine that LINQ can only adapt to small and medium-sized project development, but if you are very proficient in using LINQ query statements and Lambda expressions, then your small and medium-sized project development will be very efficient and secure. After all, LINQ is based on 2.0generics, and the advantages of LINQ are as eye-catching as its disadvantages. I especially like LINQ's Lambda expression. That's the art of programmers. I mean, if one day LINQ can compile our Lambda expressions directly into stored procedures, such as if exist () drop, it will be invincible. The future of LINQ is not very optimistic, let's look forward to .net 4.0.
This is the end of the content of "what are the shortcomings of LINQ". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.