Before we create the repository, we will create a model class that will represent a user location. Follow these steps to do so:
- Create a new folder that we can use for this and other models called Models.
- Create a class called Location in the Models folder and add properties for Id, Latitude, and Longitude.
- Create two constructors – one that's empty and one that takes latitude and longitude as arguments. Use the following code to do so:
using System;
namespace MeTracker.Models
{
public class Location
{
public Location() {}
public Location(double latitude, double longitude)
{
Latitude = latitude;
Longitude = longitude;
}
public int Id { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
}
}