I have the following method with generic type:
T GetValue();
I would like to limit T to primitive types such as int, string, float
You can use this to limit it to value types:
where C: struct
You also mention string. Unfortunately, strings won't be allowed as they are not value types.