Created
August 19, 2016 02:33
-
-
Save CuddleBunny/4490e9a0816c6e4467f4e08fb122cfdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public async Task<JsonResult> Get() | |
{ | |
var users = dataContext.TrackingUsers.Include(u => u.TrackingVisits).ThenInclude(v => v.TrackingDevice); | |
var newton = JsonConvert.SerializeObject(users); | |
var json_net = Json(users); | |
return json_net; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TrackingUserModel : Entity { | |
public TrackingUserModel() { | |
IsBanned = false; | |
} | |
public String Email { get; set; } | |
public Boolean IsBanned { get; set; } | |
public List<TrackingVisitModel> TrackingVisits { get; set; } | |
} | |
public class TrackingDeviceModel : Entity { | |
public String HardwareModel { get; set; } | |
public String OS { get; set; } | |
public String OSVersion { get; set; } | |
public List<TrackingVisitModel> TrackingVisits { get; set; } | |
} | |
public class TrackingVisitModel : Entity { | |
public TrackingVisitModel() { | |
DateTime = DateTime.Now; | |
} | |
public Guid TrackingUserId { get; set; } | |
public TrackingUserModel TrackingUser { get; set; } | |
public Guid TrackingDeviceId { get; set; } | |
public TrackingDeviceModel TrackingDevice { get; set; } | |
public Guid AppId { get; set; } | |
public String AppVersion { get; set; } | |
public DateTime DateTime { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment