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--
What is the clever way to delete data in LINQ? For this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.
Many friends in the implementation of LINQ delete data operation is often to read the data first, and then further consider deleting, then there is no easy way? Let's take a look at this simple method.
Linq to SQL delete data, do I have to read it first before deleting it? The answer is: not necessarily. Here is how to delete a key. The code is relatively simple and will not be explained, as follows:
LINQ deletes data instances through primary keys:
var user = new User{ID = 10}; db.Users.Attach(user); db.Users.Delete(user); db.SubmitChnages();
Is it easy to operate? What we need to pay attention to when executing LINQ to delete data is the relevance of the data.
About LINQ delete data clever way is what the answer to the question is shared here, I hope the above content can have some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.
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.