Answers for "c# cast to type variable"

C#
0

c# cast to type variable

using System;

public T CastObject<T>(object input) {   
    return (T) input;   
}

public T ConvertObject<T>(object input) {
    return (T) Convert.ChangeType(input, typeof(T));
}
Posted by: Guest on August-05-2021

C# Answers by Framework

Browse Popular Code Answers by Language