Solved

Question on delegate Func<CustType, string, string, byte[]>

Posted on 2013-11-12
1
206 Views
Last Modified: 2014-02-20
The VS2012 (.NET 4.5) compiler complains the following code:

public Func<CustType, String, String, byte[]> TokenServiceImpl { get; set; }

SomeType GetToken(CustType c, String server, string app, out byte[] key)
{
    if (TokenServiceImpl == null) {throw new exception("xxxxx");
   
    // This is the line where it gets compiler error
    return  TokenServiceImpl (c, server, app, out key);
}

Error:  Delegate "Func" does not take 4 arguments.

I have spend quite some on it but still cannot figure it out.
Can someone offer any suggestion? Big thanks in advance.
0
Comment
Question by:chuang4630
1 Comment
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39642682
Two things:  1) The error is correct:  Your delegate does not take 4 parameters; it takes 3, with a return type of byte[]    2) The out that you see in Intellisense:

Screenshot
...has to do with the result being covariant, and not as a direct reference to the object in memory like you have with the out keyword. In other words, you don't need out in that statement.

As to how to fix your error, you would need to describe more about what you are trying to accomplish.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now