PageRenderTime 486ms queryFilters 0ms Sphinxql 408ms app.CodeModel.GetByIds 21ms findMatchingLines 33ms GetByIds 54ms meta 0ms repositoryFilters 18ms languageFilters 0ms sourceFilters 3ms

1,015,401 results for 'using System.Linq;' (486 ms)

Source

Language

Repository

MultipleEnumerationIssueTests.cs https://github.com/davidroth/ILSpy.git | C# | 679 lines
39using System.Collections.Generic;
40using System.Linq;
41class TestClass
321using System.Collections.Generic;
322using System.Linq;
323class TestClass
596using System.Collections.Generic;
597using System.Linq;
598class TestClass
615using System.Collections.Generic;
616using System.Linq;
617class TestClass
638using System.Collections.Generic;
639using System.Linq;
640class TestClass
MultipleEnumerationIssueTests.cs https://github.com/EdwardWu99/ILSpy.git | C# | 679 lines
39using System.Collections.Generic;
40using System.Linq;
41class TestClass
321using System.Collections.Generic;
322using System.Linq;
323class TestClass
596using System.Collections.Generic;
597using System.Linq;
598class TestClass
615using System.Collections.Generic;
616using System.Linq;
617class TestClass
638using System.Collections.Generic;
639using System.Linq;
640class TestClass
QueryTests.cs https://github.com/EkardNT/Roslyn.git | C# | 2,050 lines
4using System.IO;
5using System.Linq;
6using Microsoft.CodeAnalysis.CSharp.Symbols;
917using System;
918using System.Linq;
919
1743            string source =
1744@"using System.Linq;
1745
1965            string sourceCode = @"
1966using System.Linq; // Needed for speculative code.
1967
1989                // using System.Linq; // Needed for speculative code.
1990                Diagnostic(ErrorCode.INF_UnusedUsingDirective, "using System.Linq;"));
1991
LinqTests.cs https://github.com/davidroth/ILSpy.git | C# | 396 lines
207		{
208			string program = @"using System; using System.Linq;
209class TestClass {
258		{
259			string program = @"using System; using System.Linq;
260class TestClass {
322		{
323			string program = @"using System; using System.Linq;
324class TestClass
341		{
342			string program = @"using System; using System.Linq;
343class TestClass
363		{
364			string program = @"using System; using System.Linq;
365class TestClass
LinqTests.cs https://github.com/EdwardWu99/ILSpy.git | C# | 396 lines
207		{
208			string program = @"using System; using System.Linq;
209class TestClass {
258		{
259			string program = @"using System; using System.Linq;
260class TestClass {
322		{
323			string program = @"using System; using System.Linq;
324class TestClass
341		{
342			string program = @"using System; using System.Linq;
343class TestClass
363		{
364			string program = @"using System; using System.Linq;
365class TestClass
CodeGenImplicitlyTypeArraysTests.cs https://github.com/EkardNT/Roslyn.git | C# | 1,042 lines
353            var source = @"
354using System.Linq;
355
710            var source = @"
711using System.Linq;
712
852            var source = @"
853using System.Linq;
854
887using System.Collections.Generic;
888using System.Linq;
889
920using System;
921using System.Linq;
922
Bowling.Domain.XML https://github.com/edqwerty1/Bowling.git | XML | 1,452 lines
25            using System.Collections.Generic;
26            using System.Linq;
27            using System.Threading;
149            using System.Collections.Generic;
150            using System.Linq;
151            using System.Threading;
401            using System.Collections.Generic;
402            using System.Linq;
403            using System.Threading;
441            using System.Collections.Generic;
442            using System.Linq;
443            using System.Threading;
1082            using System.Collections.Generic;
1083            using System.Linq;
1084            
Bowling.XML https://github.com/edqwerty1/Bowling.git | XML | 1,462 lines
25            using System.Collections.Generic;
26            using System.Linq;
27            using System.Threading;
149            using System.Collections.Generic;
150            using System.Linq;
151            using System.Threading;
401            using System.Collections.Generic;
402            using System.Linq;
403            using System.Threading;
441            using System.Collections.Generic;
442            using System.Linq;
443            using System.Threading;
1082            using System.Collections.Generic;
1083            using System.Linq;
1084            
LinqTests.cs https://gitlab.com/N3X15/ILSpy.git | C# | 337 lines
31		{
32			string program = @"using System; using System.Linq;
33class TestClass {
188		{
189			string program = @"using System; using System.Linq;
190class TestClass {
222		{
223			string program = @"using System; using System.Linq;
224class TestClass {
239		{
240			string program = @"using System; using System.Linq;
241class TestClass {
256		{
257			string program = @"using System; using System.Linq;
258class TestClass {
C#.aspx https://github.com/pvencill/amptools.git | ASP.NET | 882 lines
406			 <div class="blog-content">
407				<p>Even though there are quite a few opensource .Net libraries REST API out there, and a really impressive one for Flickr, they tend to never evolve or fork to use the newer framework technologies.&#160; I think its great that they support 1.0, 2.0, and mono, but why not fork and support WCF?&#160; I think part of the problem that .Net 3.5 use is not wide spread as it should be is not only information overload and bad naming for extension libraries, but also lack of opensource support to provide libraries and basis for current technology.&#160; </p>  <p>Flickr tends to be a little more tricky to use when calling it than some other REST APIs. WCF is a cool technology, but needs to be massaged when using it with Flickr due to a couple of gotchas and not so obvious things about WCF. In order to use Flickr, you need to register for an api_key and a shared secret code which is used to create an MD5 hash. You also need to create that MD5 each time you call a method, using the url parameters in a certain way. </p>  <p>There are also a few not so obvious factors about using the JSON part of Flickr. All of the .Net libraries I've seen so far, use XML. While C# is king of parsing&#160; XML, JSON tends to be more compact, which means less expense over the wire, though it might mean more time parsing once on the developers end point. So there are tradeoffs to using it. </p>  <p>When I created the classes needed to use WCF to call Flickr, I have the actual &quot;DataContract&quot; object (DTO, Data Transfer Object), A Hash (Dictionary&lt;string, object&gt;) for adding the parameters to create the MD5 signature, A base class for creating the WCF proxy, a custom &quot;WebContentTypeMapper&quot;, The &quot;ServiceContract&quot; interface, the actual &quot;Client class&quot;, and a mixins class for creating the MD5. </p>  <p>Here are some of the gotchas that I ran into while getting WCF to work with Flickr. </p>  <p></p>  <ol>   <li>Flickr makes you create a md5 hash to send with every call for ALL parameters in alphabetical order using your &quot;Shared Secret&quot; Code as part of the md5.&#160;&#160; </li>    <li>Flickr's Json response &quot;Content-Type&quot; header is sent not as &quot;application/json&quot; but as &quot;text/plain&quot; which equates to &quot;Raw&quot; in WCF lingo.&#160; </li>    <li>The response object is wrapped and not obvious when it comes to json how the DataContract object should be formed.&#160; </li>    <li>Flickr will wrap the json response in a javascript function unless you pass in the parameter &quot;nojsoncallback=1&quot; </li> </ol>  <p>To get around number one, I created an extension method that takes a Hash (Dictionary&lt;string, object&gt;) and adds method that converts the parameters into a MD5 string. </p>  <pre class="code csharp">namespace Amplify.Linq
408{
542	using System.Collections.Generic;
543	using System.Linq;
544	using System.Text;
575	using System.Collections.Generic;
576	using System.Linq;
577	using System.Text;
603	using System.Collections.Generic;
604	using System.Linq;
605	using System.Text;
751			 <div class="blog-content">
752				<p>After trying <a href="http://msdn.microsoft.com/en-us/library/bb425822.aspx" rel="tag">linq to sql</a>, <a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx" rel="tag">the ado.net entity framework</a>, php's <a href="http://codeigniter.com/">code igniter</a> framework, php's <a href="http://www.cakephp.org/" rel="rel">cake framework</a>; I'm realizing how much of rails really depends on the inner workings of ruby itself to do what it is able to do.&#160; I've looked and poked around <a href="http://www.cakephp.org/" rel="rel">Castle's Active Record</a> and it does some heavy lifting, but it still seems to deviate too much from rails's version of active record.&#160; One of the key things of porting a concept, is to keep it as close as possible so that developers can rely more on the same convention without having to relearn the concept in a different domain specific language.&#160; Plus, I cringe a little when it leans too much on using <a href="http://www.hibernate.org/343.html" rel="tag">NHibernate</a>. </p>  <p>It goes back to the whole &quot;Don't make me think principle&quot;, that developers often to have to keep in mind when developing for an end user.&#160; At first, I was thinking about creating a port would be simpler using linq with either &quot;linq to sql&quot; or the currently released &quot;ado.net entity framework&quot;. After investigating, it would take a ton of invested time to either write a code generator for visual studio that would changed the way the pocos (plain old c# objects) are generated in order in corporate the changes. Also not to mention that these frameworks heavily rely on a repository pattern, that would probably cause too much pain to change for just one developer.&#160; </p>  <p>Square one?&#160; Well close enough. C# and ruby have different strengths and weaknesses. However with enough thought and using C#3.0, I think its completely possible to get something that closely resembles rails enough to give anyone who has worked with rails, something that would be familiar if they needed to work on a project in .Net.&#160; </p>  <p class="blogger-labels">Labels: <a rel='tag' href="http://www.amptools.net/labels/Active Record.aspx">Active Record</a>, <a rel='tag' href="http://www.amptools.net/labels/BHAG.aspx">BHAG</a>, <a rel='tag' href="http://www.amptools.net/labels/C#.aspx">C#</a>, <a rel='tag' href="http://www.amptools.net/labels/CSharp.aspx">CSharp</a>, <a rel='tag' href="http://www.amptools.net/labels/Linq To Sql.aspx">Linq To Sql</a>, <a rel='tag' href="http://www.amptools.net/labels/Rails.aspx">Rails</a></p>
753			 </div>
CSharp.aspx https://github.com/pvencill/amptools.git | ASP.NET | 882 lines
406			 <div class="blog-content">
407				<p>Even though there are quite a few opensource .Net libraries REST API out there, and a really impressive one for Flickr, they tend to never evolve or fork to use the newer framework technologies.&#160; I think its great that they support 1.0, 2.0, and mono, but why not fork and support WCF?&#160; I think part of the problem that .Net 3.5 use is not wide spread as it should be is not only information overload and bad naming for extension libraries, but also lack of opensource support to provide libraries and basis for current technology.&#160; </p>  <p>Flickr tends to be a little more tricky to use when calling it than some other REST APIs. WCF is a cool technology, but needs to be massaged when using it with Flickr due to a couple of gotchas and not so obvious things about WCF. In order to use Flickr, you need to register for an api_key and a shared secret code which is used to create an MD5 hash. You also need to create that MD5 each time you call a method, using the url parameters in a certain way. </p>  <p>There are also a few not so obvious factors about using the JSON part of Flickr. All of the .Net libraries I've seen so far, use XML. While C# is king of parsing&#160; XML, JSON tends to be more compact, which means less expense over the wire, though it might mean more time parsing once on the developers end point. So there are tradeoffs to using it. </p>  <p>When I created the classes needed to use WCF to call Flickr, I have the actual &quot;DataContract&quot; object (DTO, Data Transfer Object), A Hash (Dictionary&lt;string, object&gt;) for adding the parameters to create the MD5 signature, A base class for creating the WCF proxy, a custom &quot;WebContentTypeMapper&quot;, The &quot;ServiceContract&quot; interface, the actual &quot;Client class&quot;, and a mixins class for creating the MD5. </p>  <p>Here are some of the gotchas that I ran into while getting WCF to work with Flickr. </p>  <p></p>  <ol>   <li>Flickr makes you create a md5 hash to send with every call for ALL parameters in alphabetical order using your &quot;Shared Secret&quot; Code as part of the md5.&#160;&#160; </li>    <li>Flickr's Json response &quot;Content-Type&quot; header is sent not as &quot;application/json&quot; but as &quot;text/plain&quot; which equates to &quot;Raw&quot; in WCF lingo.&#160; </li>    <li>The response object is wrapped and not obvious when it comes to json how the DataContract object should be formed.&#160; </li>    <li>Flickr will wrap the json response in a javascript function unless you pass in the parameter &quot;nojsoncallback=1&quot; </li> </ol>  <p>To get around number one, I created an extension method that takes a Hash (Dictionary&lt;string, object&gt;) and adds method that converts the parameters into a MD5 string. </p>  <pre class="code csharp">namespace Amplify.Linq
408{
542	using System.Collections.Generic;
543	using System.Linq;
544	using System.Text;
575	using System.Collections.Generic;
576	using System.Linq;
577	using System.Text;
603	using System.Collections.Generic;
604	using System.Linq;
605	using System.Text;
751			 <div class="blog-content">
752				<p>After trying <a href="http://msdn.microsoft.com/en-us/library/bb425822.aspx" rel="tag">linq to sql</a>, <a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx" rel="tag">the ado.net entity framework</a>, php's <a href="http://codeigniter.com/">code igniter</a> framework, php's <a href="http://www.cakephp.org/" rel="rel">cake framework</a>; I'm realizing how much of rails really depends on the inner workings of ruby itself to do what it is able to do.&#160; I've looked and poked around <a href="http://www.cakephp.org/" rel="rel">Castle's Active Record</a> and it does some heavy lifting, but it still seems to deviate too much from rails's version of active record.&#160; One of the key things of porting a concept, is to keep it as close as possible so that developers can rely more on the same convention without having to relearn the concept in a different domain specific language.&#160; Plus, I cringe a little when it leans too much on using <a href="http://www.hibernate.org/343.html" rel="tag">NHibernate</a>. </p>  <p>It goes back to the whole &quot;Don't make me think principle&quot;, that developers often to have to keep in mind when developing for an end user.&#160; At first, I was thinking about creating a port would be simpler using linq with either &quot;linq to sql&quot; or the currently released &quot;ado.net entity framework&quot;. After investigating, it would take a ton of invested time to either write a code generator for visual studio that would changed the way the pocos (plain old c# objects) are generated in order in corporate the changes. Also not to mention that these frameworks heavily rely on a repository pattern, that would probably cause too much pain to change for just one developer.&#160; </p>  <p>Square one?&#160; Well close enough. C# and ruby have different strengths and weaknesses. However with enough thought and using C#3.0, I think its completely possible to get something that closely resembles rails enough to give anyone who has worked with rails, something that would be familiar if they needed to work on a project in .Net.&#160; </p>  <p class="blogger-labels">Labels: <a rel='tag' href="http://www.amptools.net/labels/Active Record.aspx">Active Record</a>, <a rel='tag' href="http://www.amptools.net/labels/BHAG.aspx">BHAG</a>, <a rel='tag' href="http://www.amptools.net/labels/C#.aspx">C#</a>, <a rel='tag' href="http://www.amptools.net/labels/CSharp.aspx">CSharp</a>, <a rel='tag' href="http://www.amptools.net/labels/Linq To Sql.aspx">Linq To Sql</a>, <a rel='tag' href="http://www.amptools.net/labels/Rails.aspx">Rails</a></p>
753			 </div>
Code.aspx https://github.com/pvencill/amptools.git | ASP.NET | 836 lines
349	using System.Collections.Generic;
350	using System.Linq;
351	using System.Text;
429			 <div class="blog-content">
430				<p>Even though there are quite a few opensource .Net libraries REST API out there, and a really impressive one for Flickr, they tend to never evolve or fork to use the newer framework technologies.&#160; I think its great that they support 1.0, 2.0, and mono, but why not fork and support WCF?&#160; I think part of the problem that .Net 3.5 use is not wide spread as it should be is not only information overload and bad naming for extension libraries, but also lack of opensource support to provide libraries and basis for current technology.&#160; </p>  <p>Flickr tends to be a little more tricky to use when calling it than some other REST APIs. WCF is a cool technology, but needs to be massaged when using it with Flickr due to a couple of gotchas and not so obvious things about WCF. In order to use Flickr, you need to register for an api_key and a shared secret code which is used to create an MD5 hash. You also need to create that MD5 each time you call a method, using the url parameters in a certain way. </p>  <p>There are also a few not so obvious factors about using the JSON part of Flickr. All of the .Net libraries I've seen so far, use XML. While C# is king of parsing&#160; XML, JSON tends to be more compact, which means less expense over the wire, though it might mean more time parsing once on the developers end point. So there are tradeoffs to using it. </p>  <p>When I created the classes needed to use WCF to call Flickr, I have the actual &quot;DataContract&quot; object (DTO, Data Transfer Object), A Hash (Dictionary&lt;string, object&gt;) for adding the parameters to create the MD5 signature, A base class for creating the WCF proxy, a custom &quot;WebContentTypeMapper&quot;, The &quot;ServiceContract&quot; interface, the actual &quot;Client class&quot;, and a mixins class for creating the MD5. </p>  <p>Here are some of the gotchas that I ran into while getting WCF to work with Flickr. </p>  <p></p>  <ol>   <li>Flickr makes you create a md5 hash to send with every call for ALL parameters in alphabetical order using your &quot;Shared Secret&quot; Code as part of the md5.&#160;&#160; </li>    <li>Flickr's Json response &quot;Content-Type&quot; header is sent not as &quot;application/json&quot; but as &quot;text/plain&quot; which equates to &quot;Raw&quot; in WCF lingo.&#160; </li>    <li>The response object is wrapped and not obvious when it comes to json how the DataContract object should be formed.&#160; </li>    <li>Flickr will wrap the json response in a javascript function unless you pass in the parameter &quot;nojsoncallback=1&quot; </li> </ol>  <p>To get around number one, I created an extension method that takes a Hash (Dictionary&lt;string, object&gt;) and adds method that converts the parameters into a MD5 string. </p>  <pre class="code csharp">namespace Amplify.Linq
431{
433	using System.Collections.Generic;
434	using System.Linq;
435	using System.Text;
565	using System.Collections.Generic;
566	using System.Linq;
567	using System.Text;
626	using System.Collections.Generic;
627	using System.Linq;
628	using System.Text;
IndexExtensionFromClient.cs git://github.com/ravendb/ravendb.git | C# | 2,253 lines
1204using System.Collections.Generic;
1205using System.Linq;
1206namespace ETIS
1790using System.Collections.Generic;
1791using System.Linq;
1792namespace ETIS
1829using System.Collections.Generic;
1830using System.Linq;
1831namespace ETIS
1874using System.Collections.Generic;
1875using System.Linq;
1876namespace ETIS
1949using System.Collections.Generic;
1950using System.Linq;
1951namespace ETIS
linq-guide.md https://github.com/2sic/2sxc.git | Markdown | 223 lines
18```razor
19@using System.Linq;
20@{
73```razor
74@using System.Linq;
75@{
96```razor
97@using System.Linq;
98@using Dynlist = System.Collections.Generic.IEnumerable<dynamic>;
156```razor
157@using System.Linq;
158@using Dynlist = System.Collections.Generic.IEnumerable<dynamic>;
204```razor
205@using System.Linq;
206@using Dynlist = System.Collections.Generic.IEnumerable<dynamic>;
Bowling.xml https://github.com/edqwerty1/Bowling.git | XML | 943 lines
31            using System.Collections.Generic;
32            using System.Linq;
33            using System.Threading;
565            using System.Collections.Generic;
566            using System.Linq;
567            using System.Threading;
690            using System.Collections.Generic;
691            using System.Linq;
692            using System.Threading;
719            using System.Collections.Generic;
720            using System.Linq;
721            using System.Threading;
748            using System.Collections.Generic;
749            using System.Linq;
750            using System.Threading;
XmlDocument.xml https://github.com/edqwerty1/Bowling.git | XML | 943 lines
31            using System.Collections.Generic;
32            using System.Linq;
33            using System.Threading;
565            using System.Collections.Generic;
566            using System.Linq;
567            using System.Threading;
690            using System.Collections.Generic;
691            using System.Linq;
692            using System.Threading;
719            using System.Collections.Generic;
720            using System.Linq;
721            using System.Threading;
748            using System.Collections.Generic;
749            using System.Linq;
750            using System.Threading;
XmlDocument.xml https://github.com/edqwerty1/Bowling.git | XML | 943 lines
31            using System.Collections.Generic;
32            using System.Linq;
33            using System.Threading;
565            using System.Collections.Generic;
566            using System.Linq;
567            using System.Threading;
690            using System.Collections.Generic;
691            using System.Linq;
692            using System.Threading;
719            using System.Collections.Generic;
720            using System.Linq;
721            using System.Threading;
748            using System.Collections.Generic;
749            using System.Linq;
750            using System.Threading;
Flickr.aspx https://github.com/pvencill/amptools.git | ASP.NET | 411 lines
51			 <div class="blog-content">
52				<p>Even though there are quite a few opensource .Net libraries REST API out there, and a really impressive one for Flickr, they tend to never evolve or fork to use the newer framework technologies.&#160; I think its great that they support 1.0, 2.0, and mono, but why not fork and support WCF?&#160; I think part of the problem that .Net 3.5 use is not wide spread as it should be is not only information overload and bad naming for extension libraries, but also lack of opensource support to provide libraries and basis for current technology.&#160; </p>  <p>Flickr tends to be a little more tricky to use when calling it than some other REST APIs. WCF is a cool technology, but needs to be massaged when using it with Flickr due to a couple of gotchas and not so obvious things about WCF. In order to use Flickr, you need to register for an api_key and a shared secret code which is used to create an MD5 hash. You also need to create that MD5 each time you call a method, using the url parameters in a certain way. </p>  <p>There are also a few not so obvious factors about using the JSON part of Flickr. All of the .Net libraries I've seen so far, use XML. While C# is king of parsing&#160; XML, JSON tends to be more compact, which means less expense over the wire, though it might mean more time parsing once on the developers end point. So there are tradeoffs to using it. </p>  <p>When I created the classes needed to use WCF to call Flickr, I have the actual &quot;DataContract&quot; object (DTO, Data Transfer Object), A Hash (Dictionary&lt;string, object&gt;) for adding the parameters to create the MD5 signature, A base class for creating the WCF proxy, a custom &quot;WebContentTypeMapper&quot;, The &quot;ServiceContract&quot; interface, the actual &quot;Client class&quot;, and a mixins class for creating the MD5. </p>  <p>Here are some of the gotchas that I ran into while getting WCF to work with Flickr. </p>  <p></p>  <ol>   <li>Flickr makes you create a md5 hash to send with every call for ALL parameters in alphabetical order using your &quot;Shared Secret&quot; Code as part of the md5.&#160;&#160; </li>    <li>Flickr's Json response &quot;Content-Type&quot; header is sent not as &quot;application/json&quot; but as &quot;text/plain&quot; which equates to &quot;Raw&quot; in WCF lingo.&#160; </li>    <li>The response object is wrapped and not obvious when it comes to json how the DataContract object should be formed.&#160; </li>    <li>Flickr will wrap the json response in a javascript function unless you pass in the parameter &quot;nojsoncallback=1&quot; </li> </ol>  <p>To get around number one, I created an extension method that takes a Hash (Dictionary&lt;string, object&gt;) and adds method that converts the parameters into a MD5 string. </p>  <pre class="code csharp">namespace Amplify.Linq
53{
55	using System.Collections.Generic;
56	using System.Linq;
57	using System.Text;
74	using System.Collections.Generic;
75	using System.Linq;
76	using System.Security.Cryptography;
220	using System.Collections.Generic;
221	using System.Linq;
222	using System.Text;
248	using System.Collections.Generic;
249	using System.Linq;
250	using System.Text;
Amplify.aspx https://github.com/pvencill/amptools.git | ASP.NET | 883 lines
345			 <div class="blog-content">
346				<p>Even though there are quite a few opensource .Net libraries REST API out there, and a really impressive one for Flickr, they tend to never evolve or fork to use the newer framework technologies.&#160; I think its great that they support 1.0, 2.0, and mono, but why not fork and support WCF?&#160; I think part of the problem that .Net 3.5 use is not wide spread as it should be is not only information overload and bad naming for extension libraries, but also lack of opensource support to provide libraries and basis for current technology.&#160; </p>  <p>Flickr tends to be a little more tricky to use when calling it than some other REST APIs. WCF is a cool technology, but needs to be massaged when using it with Flickr due to a couple of gotchas and not so obvious things about WCF. In order to use Flickr, you need to register for an api_key and a shared secret code which is used to create an MD5 hash. You also need to create that MD5 each time you call a method, using the url parameters in a certain way. </p>  <p>There are also a few not so obvious factors about using the JSON part of Flickr. All of the .Net libraries I've seen so far, use XML. While C# is king of parsing&#160; XML, JSON tends to be more compact, which means less expense over the wire, though it might mean more time parsing once on the developers end point. So there are tradeoffs to using it. </p>  <p>When I created the classes needed to use WCF to call Flickr, I have the actual &quot;DataContract&quot; object (DTO, Data Transfer Object), A Hash (Dictionary&lt;string, object&gt;) for adding the parameters to create the MD5 signature, A base class for creating the WCF proxy, a custom &quot;WebContentTypeMapper&quot;, The &quot;ServiceContract&quot; interface, the actual &quot;Client class&quot;, and a mixins class for creating the MD5. </p>  <p>Here are some of the gotchas that I ran into while getting WCF to work with Flickr. </p>  <p></p>  <ol>   <li>Flickr makes you create a md5 hash to send with every call for ALL parameters in alphabetical order using your &quot;Shared Secret&quot; Code as part of the md5.&#160;&#160; </li>    <li>Flickr's Json response &quot;Content-Type&quot; header is sent not as &quot;application/json&quot; but as &quot;text/plain&quot; which equates to &quot;Raw&quot; in WCF lingo.&#160; </li>    <li>The response object is wrapped and not obvious when it comes to json how the DataContract object should be formed.&#160; </li>    <li>Flickr will wrap the json response in a javascript function unless you pass in the parameter &quot;nojsoncallback=1&quot; </li> </ol>  <p>To get around number one, I created an extension method that takes a Hash (Dictionary&lt;string, object&gt;) and adds method that converts the parameters into a MD5 string. </p>  <pre class="code csharp">namespace Amplify.Linq
347{
423	using System.Collections.Generic;
424	using System.Linq;
425	using System.Text;
514	using System.Collections.Generic;
515	using System.Linq;
516	using System.Text;
542	using System.Collections.Generic;
543	using System.Linq;
544	using System.Text;
682	using System.Collections.Generic;
683	using System.Linq;
684	using System.Text;
WCF.aspx https://github.com/pvencill/amptools.git | ASP.NET | 500 lines
94			 <div class="blog-content">
95				<p>Even though there are quite a few opensource .Net libraries REST API out there, and a really impressive one for Flickr, they tend to never evolve or fork to use the newer framework technologies.&#160; I think its great that they support 1.0, 2.0, and mono, but why not fork and support WCF?&#160; I think part of the problem that .Net 3.5 use is not wide spread as it should be is not only information overload and bad naming for extension libraries, but also lack of opensource support to provide libraries and basis for current technology.&#160; </p>  <p>Flickr tends to be a little more tricky to use when calling it than some other REST APIs. WCF is a cool technology, but needs to be massaged when using it with Flickr due to a couple of gotchas and not so obvious things about WCF. In order to use Flickr, you need to register for an api_key and a shared secret code which is used to create an MD5 hash. You also need to create that MD5 each time you call a method, using the url parameters in a certain way. </p>  <p>There are also a few not so obvious factors about using the JSON part of Flickr. All of the .Net libraries I've seen so far, use XML. While C# is king of parsing&#160; XML, JSON tends to be more compact, which means less expense over the wire, though it might mean more time parsing once on the developers end point. So there are tradeoffs to using it. </p>  <p>When I created the classes needed to use WCF to call Flickr, I have the actual &quot;DataContract&quot; object (DTO, Data Transfer Object), A Hash (Dictionary&lt;string, object&gt;) for adding the parameters to create the MD5 signature, A base class for creating the WCF proxy, a custom &quot;WebContentTypeMapper&quot;, The &quot;ServiceContract&quot; interface, the actual &quot;Client class&quot;, and a mixins class for creating the MD5. </p>  <p>Here are some of the gotchas that I ran into while getting WCF to work with Flickr. </p>  <p></p>  <ol>   <li>Flickr makes you create a md5 hash to send with every call for ALL parameters in alphabetical order using your &quot;Shared Secret&quot; Code as part of the md5.&#160;&#160; </li>    <li>Flickr's Json response &quot;Content-Type&quot; header is sent not as &quot;application/json&quot; but as &quot;text/plain&quot; which equates to &quot;Raw&quot; in WCF lingo.&#160; </li>    <li>The response object is wrapped and not obvious when it comes to json how the DataContract object should be formed.&#160; </li>    <li>Flickr will wrap the json response in a javascript function unless you pass in the parameter &quot;nojsoncallback=1&quot; </li> </ol>  <p>To get around number one, I created an extension method that takes a Hash (Dictionary&lt;string, object&gt;) and adds method that converts the parameters into a MD5 string. </p>  <pre class="code csharp">namespace Amplify.Linq
96{
117	using System.Collections.Generic;
118	using System.Linq;
119	using System.Security.Cryptography;
230	using System.Collections.Generic;
231	using System.Linq;
232	using System.Text;
263	using System.Collections.Generic;
264	using System.Linq;
265	using System.Text;
291	using System.Collections.Generic;
292	using System.Linq;
293	using System.Text;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21