我在我的数据库(餐桌)中定义了纬度浮点数(24)和经度浮点数(24)。然后当我尝试使用它们时,我的模型中显示的代码如下
public class JsonDinner
{
public JsonDinner(){}
public JsonDinner(Dinner dinner)
{
DinnerID = dinner.DinnerID;
EventDate = dinner.EventDate.ToString();
Latitude = dinner.Latitude;
Longitude = dinner.Longitude;
Title = dinner.Title;
Description = dinner.Description;
RSVPCount = dinner.RSVPs.Count;
Url = "dinner/details/" + dinner.DinnerID.ToString();
}
public int DinnerID {get; set;}
public string EventDate {get; set;}
public float Latitude {get; set;}
public float Longitude {get; set;}
public string Title {get; set;}
public string Description {get; set;}
public int RSVPCount {get; set;}
public string Url {get; set;}
}
它说
无法将“float”隐式转换为“float”。存在显式转换(您是否缺少演员表)?
我做错了什么?我什至没有使用任何铸造。