Reputation: 65
I was given SQL sever database to rebuild a website for someone it has these data types:
I am currently creating an MVC model and the data types are not recognized in MVC
public class Beds
{
public int BedID { get; set; }
public Bit Private { get; set; } <------not recognized
public Money OccupiedRate { get; set; } <------not recognized
public Bit HoldingRate { get; set; } <------not recognized
}
What are the best alternative datatypes in MVC?
Upvotes: 1
Views: 205
Reputation: 6884
Your datatype mappings are dependent on the language (C#), not the framework (MVC).
In your case the mappings are:
Bit
is Boolean
Money
is Decimal
For a full list of conversion types see this list on MSDN. The C# column is headed .NET Framework type
Upvotes: 1