title: Can't figure out how to resolve with Func<TResult>' requires 1 type arguments
body: <p>It gives to me:</p>
  
  <blockquote>
    <p>/Users/asifahmed/Projects/test/test/CryptExtensions.cs(3,3): Error
    CS0305: Using the generic type 'Func' requires 1 type
    arguments (CS0305)</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>using System;
  using System.IO;
  using System.Linq;
  using System.Net;
  using System.Security.Cryptography;
  using System.Text;
  
  public static class CryptExtensions
  {
      public static string Decrypt(this string inputString, string password, bool removeUrlEncoding = true)
      {
          return inputString.Decrypt(password.PassToAESHash(), removeUrlEncoding);
      }
  
      public static string Decrypt(this string inputString, byte[] hash, bool removeUrlEncoding = true)
      {
          // Convert URL escape sequences back to their normal representations, then base64 decode
          if (removeUrlEncoding) { inputString = WebUtility.UrlDecode(inputString); }
          byte[] input = Convert.FromBase64String(inputString);
  
          using (RijndaelManaged aes = new RijndaelManaged
          {
              IV = new byte[16],
              Mode = CipherMode.CBC,
              Padding = PaddingMode.PKCS7,
              KeySize = 128,
              Key = hash
          })
          using (MemoryStream memStream = new MemoryStream(input))
          using (CryptoStream decryptStream = new CryptoStream(memStream, aes.CreateDecryptor(), CryptoStreamMode.Read))
          using (StreamReader plainTextReader = new StreamReader(decryptStream))
          {
              return plainTextReader.ReadToEnd();
          }
  
      }
  
      // See https://msdn.microsoft.com/en-us/library/windows/desktop/aa379916(v=vs.85).aspx
      public static byte[] PassToAESHash(this string pass, int keySize = 128)
      {
          SHA1 sha1 = SHA1.Create();
          byte[] hashedPass = sha1.ComputeHash(Encoding.UTF8.GetBytes(pass));
  
  
          Func&lt;int, string&gt; projection = x =&gt; "Value=" + x;
          int[] values = { 3, 7, 10 };
          var strings = values.Select(projection);
  
          // A lambda that will take a byte &amp; position in the sequence, and XOR the supplied byte with the corresponding 
          // byte of the SHA-1 hashed pass.
          Func  XORWithHashedPass = (val, ix) =&gt; ix &lt; hashedPass.Length ? (byte)(val ^ hashedPass[ix]) : val;
  
          return sha1.ComputeHash(           // First buffer per MSDN is 64 bytes of (0x36 ^ hashedPass[i])
                          Enumerable.Repeat(0x36, 64).Select(XORWithHashedPass).ToArray()
                      )
                      .Concat(
                          sha1.ComputeHash(  // Second buffer per MSDN is 64 bytes of (0x5C ^ hashedPass[i])
                                  Enumerable.Repeat(0x5C, 64).Select(XORWithHashedPass).ToArray()
                              )
                      )
                      .Take(keySize / 8).ToArray();
      }
  }
  </code></pre>