提问人:Sid 提问时间:10/26/2023 更新时间:10/26/2023 访问量:72
在 Xamarin 窗体中使用当前坐标筛选 SQLite 表
Filter SQLite table with current coordinates in Xamarin forms
问:
我有 Xmarin 表单跨平台应用程序,其中有一个名为 Customers 的表存储在 SQLite 数据库中。此表包含每个客户的 Lattitude 和 Longitude。我可以得到最新的GPS。我想要的是用当前的 GPS 过滤最近的客户。
public class Customer
{
[PrimaryKey, AutoIncrement]
public long Id { get; set; }
public string Number { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string MobileNo { get; set; }
public string Email { get; set; }
public int CreditDays { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }
public string Note { get; set; }
}
public Contact GetContactById(long id)
{
return _db.Table<Contact>().Where(c => c.Id == id).FirstOrDefault();
}
我想使用当前的纬度和经度筛选 Customer 表,以查找 100 米内最近的客户。
有人可以使用任何示例代码来过滤带有实体框架的SQLite吗?
答: 暂无答案
评论