Contents tagged with LINQ
-
Mocking LINQ to SQL (Continued…) using OpenAccess
After making the post on mocking LINQ to SQL, this morning i was having a chat with Stephen forte and come to know that Telerik has a new product named Visual Entity Designer that enables you to define your domain model very easily through just few clicks and builds a nice LINQ to SQL model that mimics model similar to Entity framework / MS LINQ to SQL. Being curious, i thought of giving a spin with it and try to mock OpenAccess LINQ to SQL implementation using JustMock.
-
Unit testing LINQ to SQL
Unit testing LINQ to SQL repositories can be very challenging. Unit testing such requires faking hard to mock classes and requires simulation to return your custom data for a particular LINQ statement. In this post, i will show how you can mock your LINQ repositories easily without much digging in.
-
Introducing LINQ to M
-
Extending your existing API or legacy data classes to support LINQ
While developing LinqExtender, i have come across various scenarios that people don’t want to extent any query class or even implement any interface. Also, it is almost absurd when they have to add new extender specific attributes to their entity class. It is though not very important for people creating new provider with small codebase but with large codebase it soon becomes a pain to modify each class.
-
Create custom LINQ providers fluently
Just released LinqExtender 2.0. Over previous release , it contains generally bugs fixes. Overall, I have focused on striping out complexity as much as possible to keep you focused on your business logic. You can see the full list of features in the documentation that comes with it.
-
LinqExtender 1.4.2 - Supporting Complex type arguments
I just made a quick update to the existing release of LinqExtender. I recently found a bug while building a feature for FlickrXplorer is that if you use constant type query with orderby clause it does pretty well, but it simply does not do well with complex ones. I have used the same logic that I have used for where clause arguments. Also, it will be out of the scope for this post to drill it down all the LinqExtender logic fort hat. But I would put a brief overview on it that can help you out while building your own IQueryable implementation.
-
Athena - A LINQ to flickr API (Release 1.4)
Last week, I released a new version of LINQ.flickr, which I named as Athena from release 1.4. It covers few features from flickr service, also now I have updated it with the latest LINQExtender (pre release version) containing updated Object Tracking Service (OTS) that will enable it to update photos and comments as if like LINQ to SQL.
-
Making authenticated calls to flickr
There are few things to know , when getting photos from your stream , adding comments and overall doing adding and deletion of your photos. As with flickr you can take a look at this url => http://www.flickr.com/services/api/auth.spec.html for authentication spec to learn more. But with Athena (formerly known as LINQ.Flickr) it's pretty easy to get things going. Last week, I made an update to the FlickrXplorer (The MVC starter project you don't want to miss :-)) project that now enables you to add comments for photos. There is a one click login that will take you to flickr, ask you once for the permission to grant the app for data access and finally will take you back to the place from where you were left off.
-
Replace SortedDictionary with LINQ query - Part 2 (with comparison)
In my previous post, I have said that using LINQ query instead of SortedDictionary not only could be useful , elegant but also less processor intensive. In this post, I will show you a real comparison between the same the method but one with SortedDictionary and other with LINQ orderby query. I wrote a simple console application that mimics the action of GetSignature in LINQ.Flickr. Here, I will focus only on the sorting part that's why I removed the hashing and initialization of the method.
-
Replace SortedDictionary with LINQ query
With LINQ.Flickr it is quite necessary to get signature on parameters in order to do authenticated flickr photo get. As with the signature, it has to be sorted by parameter then to be hashed by MD5. Previously, I used to use SortedDictionary dictionary to do so, but thinking a little bit I learned that we actually don't need SortedDictionary anymore after we have LINQ. May be that's why the product team at Microsoft removed SortedDictionary from stripped down version of .net that comes with SilverLight.