Answers for "how to cast into object type in c#"

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

Code answers related to "how to cast into object type in c#"

C# Answers by Framework

Browse Popular Code Answers by Language