|
A Practical Lambda Expression Example For The UPS Tracking Web Service Call |
|
|
By Joe Rattz on
2/3/2010 3:17:28 PM
|
|
|
A Practical Lambda Expression Example For The UPS Tracking Web Service Call
In "Pro LINQ: Language Integrated Query in C# 2008" I provided an example of the evolution of named methods to anonymous methods and finally to lambda expressions. I was illustrating the brevity that anonymous methods provide over named methods, and that lambda expressions provide over anonymous methods. Just this week, while consuming the UPS Tracking web service, I have yet again found lambda expressions to be useful for this purpose.
When compiling the UPS-provided test code, I received the following warning:
'System.Net.ServicePointManager.CertificatePolicy' is obsolete: 'CertificatePolicy is obsoleted for this type, please use ServerCertificateValidationCallback instead.
While it's just a warning and the code worked just fine, the code causing the warning has been obsolete for quite a while now so I thought I ...
|
 |
|
Comments (0)
|
More...
|
|
|
Using LINQ to Generate Test Data with the Range Operator |
|
|
By Joe Rattz on
10/21/2009 12:27:41 PM
|
|
|
Using LINQ to Generate Test Data with the Range Operator
When working on Pro LINQ, one of the operators that caught my attention is the Range operator. The Range operator generates a sequence of integers. At the time, this seemed like it could be very useful for generating test data. I just used this again for a sample application I was working on and thought I should make a blog post about it.
int numItems = 200;
var list = Enumerable.Range(1, numItems) .Select(i => new &a ...
|
 |
|
Comments (0)
|
More...
|
|
|
|
|
Using LINQ to Obtain a Control Reference in an ASP.NET Repeater Item's ControlCollection |
|
|
By Joe Rattz on
1/23/2009 2:22:41 PM
|
|
|
|
I haven't been blogging about LINQ much, but I am making it a new year's resolution to blog more frequently about LINQ. Now, don't expect daily or even weekly blog posts because I am just not as prolific as some bloggers. I don't know how some bloggers do it. But, I do plan on blogging more frequently.
One of my favorite, but under-utilized, ASP.NET controls is the Repeater. I think it exemplifies what it is that we like so much about the web; that is, the graphic representation of data. Sure, I use web grids more frequently, but when you have multiple instances of data that just doesn't fit in a single line well, the Repeater is the answer. Consider listings of homes for sale, or cars. You typically see an image of the house or car, and several fields of information. There are usually so many fields, that the data will just not fit in a single line in a grid. Plus, the image would make the l ...
|
 |
|
Comments (2)
|
More...
|
|
|
LINQ to SQL Has a Future Despite the Rumors |
|
|
By Joe Rattz on
9/22/2008 10:15:51 AM
|
|
|
|
For the last several months, I have repeatedly heard a rumor that there was no future for LINQ to SQL. One reader even informed me that they heard LINQ to SQL was going to be snuffed and that because of this, their company changed architectural direction away from LINQ to SQL.
Concerned that the rumors may be either true and some developers are on a dead end path, or false and LINQ to SQL adoption may be suffering unnecessarily as a result of the rumors, I emailed Scott Guthrie at Microsoft to get his position on the future of LINQ to SQL.
Scott told me "Regarding LINQ to SQL, we definitely don't have plans to drop this. We plan to continue to fully support this going forward.".
Scott continued with "I actually blog most of my samples using LINQ to SQL these days (I just did one last week on ASP.NET MVC form scenarios and used LINQ to SQL for the data access). Expect to see me continue to blog mor ...
|
 |
|
Comments (0)
|
More...
|
|
|
|
Using Lambda Expressions |
|
|
By Joe Rattz on
7/4/2008 12:28:11 PM
|
|
|
I have had very positive feedback about my book, and my coverage of lambda expressions has specifically been mentioned on occasion. I have also noticed that some developers are a bit uncomfortable with lambda expressions, so I thought that by sharing the lambda expression portion of my book, perhaps it would help alleviate concern for some developers. Hopefully this portion will help them embrace what lambda expressions can do for them.
The portion that I am sharing here is only part of what I cover in my book. In the book, I show the journey from using named methods to anonymous methods and then finally to lambda expressions. I begin with the premise that a common code developer has created a common method named FilterArrayOfInts and that it is another developer's task to utilize that common method to filter an array so that only odd integers remain.&am ...
|
 |
|
Comments (0)
|
More...
|
|
|
LINQ for Java? |
|
|
By Joe Rattz on
5/6/2008 4:36:49 PM
|
|
|
|
Carl Rosenberger has posted a call to arms to elicit support for a LINQ for Java project. If you would like to see this project come to fruition, you can read the details on Carl's blog here.
You can vote to show your support as well as volunteer to participate in the implementation.
Good luck Carl!
|
 |
|
Comments (0)
|
|
|
|
Making a Project LINQ to SQL Enabled |
|
|
By Joe Rattz on
3/28/2008 9:53:27 AM
|
|
|
|
I was talking to another developer recently and detected a slight intimidation at the thought of trying to adopt LINQ to SQL in his project. I can certainly understand that. Many times in the past there has been some new technology I knew I should start investigating, but the hassle I expected squelched my desire. So, I decided to make a video demonstrating just how easy it can be to make a project LINQ to SQL enabled. Notice I said "it can be". This doesn't mean to imply that every project will be this simple. Unlike most of the other LINQ APIs, adopting LINQ to SQL is an architectural decision that needs to be made. It has its benefits, and its limitations. So, for any given project, adopting LINQ to SQL may be more difficult than in the sample project in my video. Also, concerning the video, I am just getting started with the video software, so please show some mercy. Steven Spielberg I ain't.
|
 |
|
Comments (17)
|
More...
|
|