In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 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 "how to achieve LINQ to SQL mapping". In the operation of actual cases, many people will encounter such a dilemma, so 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 to SQL mapping functions and stored procedures
LINQ to SQL supports stored procedures and user-defined functions. In LINQ to SQL, you should map these abstractions defined by the database to client objects so that you can access them in a strongly typed manner from client code. Method signatures are as similar as possible to the signatures of procedures and functions defined in the database.
The result set returned by calling the mapping procedure is a strongly typed collection.
LINQ to SQL maps stored procedures to LINQ to SQL function methods by using the FunctionAttribute and ParameterAttribute properties. Methods that represent stored procedures are distinguished from those that represent user-defined functions by the IsComposable attribute. If this property is set to false (the default), this method represents a stored procedure. If it is set to true, this method represents the database function.
[Function (Name = "GetScores")]
Public ISingleResult getset ([Parameter (DbType= "int")] int stuid)
{
IExecuteResult result = this.ExecuteMethodCall (this
((MethodInfo) (MethodInfo.GetCurrentMethod (), stuid)
Return ((ISingleResult) (result.ReturnValue))
}
LINQ to SQL is part of a series of ADO.NET technologies. It is based on the services provided by the ADO.NET provider model. Therefore, you can mix LINQ to SQL code with existing ADO.NET applications to migrate the current ADO.NET solution to LINQ to SQL.
That's all for the content of "how to implement LINQ to SQL Mapping". 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.