ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,622 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
HI,
I received this message : System.InvalidCastException: Unable to cast object of type 'System.Int64' to type 'System.Int32'.
In my class I've put :
public class FilePath
{
...
public int Size { get; set; }
...
}
this class is associated to the view FilePath
How can I convert the type of Size from type bigint
to type int
?
I think that it cannot be always converted. Try using long or Int64 instead of int in your class and other parts. (Or use int instead of bigint, if possible).