I'm using .Net Framework 3.5
.
I need something like a Tuple
, but how I don't have it, I created my own Tuple using this
So, I have
public class Tupla<T1, T2>
{
public T1 First { get; private set; }
public T2 Second { get; private set; }
internal Tupla(T1 first, T2 second)
{
First = first;
Second = second;
}
}
public static class Tupla
{
public static Tupla<T1, T2> New<T1, T2>(T1 first, T2 second)
{
var tuple = new Tupla<T1, T2>(first, second);
return tuple;
}
}
Then, I need to use something like a Dictionary
with some other code mine.
For each Key
, I need to return a Tupla
, filled with values.
So, I created my class
public class ParametrosMultiples : Dictionary<String, Tupla>
{
}
But It doesn't recognize my Tupla class
.
As far as I can see, I can use custom clases
(and not only types
, like String
, Int32
, etc)
The error I get is
type or namespace name 'Tupla' could not be found (are you missing a using directive or an assembly reference?)
But they are in the same namespace, even in the same .cs
(I only mention that to make sure that is in the same namespace
, because we use only one namespace
for .cs
for convention)
If I can't use that Tupla
, how I can retrieve two values from a Key
?
Edit:
To show how I got my class:
namespace ReportesWeb.WebApp.App_Shared
{
public class ParametrosMultiples : Dictionary<String, Tupla<Int32, Int32>>
{
}
// here goes the Tupla code showed above, the two classes
}
Edit2:
I have removed the Static Tupla
(leaving only One Tupla Class
) and still get the same error, so is not a problem of conflict with the names