I have a class that interacts with the linq class and uses the System.Data.Linq.Binary data type. I am trying to write a simple class that accepts a general schema that denotes a data type stored as binary:
public class DataType<T> where T : class
{
public T Value
{
get
{
return from d in Database
where d.Value = [Some Argument Passed]
select d.Value as T;
}
}
}
public class StringClass : DataType<string>
{
}
public class ByteClass : DataType<byte[]>
{
}
Will it StringClass.Valuecorrectly display and return stringfrom the database?
Will it ByteClass.Valuecorrectly display and return byte[]from the database?
My main question basically decides how to use System.Data.Linq.Binary.
Edit: How to convert System.Data.Linq.Binary to T, where T can be anything. My code actually doesn't work, because I cannot use Binary to T with as.
source
share