public static UavConnectLog[] GetSeederData() { var droneSeeder = new List <UavConnectLog>(); var rand = new Random(); for (var i = 0; i < 40; i++) { var ranDay = rand.Next(1, 3); var ranHour = rand.Next(1, 18); var ranMinute = rand.Next(1, 50); var apiType = Utility.GetRandomApiType(); string projectType = Models.ProjectType.GetRandomProjectType(); var droneLog = new UavConnectLog() { EntityLogPrimaryKeyId = i + 10, RegionId = MonitorRegionLog.GetRandomEntityId(), ProjectType = projectType, EntityId = UavConnectLog.GetRandomEntityId(), Type = apiType, AuthorId = UserLog.GetRandomEntityId(), Description = "Giám sát " + apiType.GetDescription(), Name = "Đợi giám sát quý " + rand.Next(1, 3), Timestamp = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0), State = i % 2 + "" }; droneSeeder.Add(droneLog); } return(droneSeeder.ToArray()); }
public static DroneLog[] GetSeederData() { var droneSeeder = new List <DroneLog>(); var rand = new Random(); for (var i = 0; i < 100; i++) { var ranDay = rand.Next(1, 3); var ranHour = rand.Next(1, 18); var ranMinute = rand.Next(1, 50); var apiType = Utility.GetRandomApiType(); var entityId = DroneLog.GetRandomEntityId(); string projectType = Models.ProjectType.GetRandomProjectType(); var droneLog = new DroneLog() { UavConnectId = UavConnectLog.GetRandomEntityId(), EntityLogPrimaryKeyId = i + 1, EntityId = entityId, Latitude = rand.Next(10, 50), Longitude = rand.Next(10, 50), AuthorId = UserLog.GetRandomEntityId(), Type = apiType, ProjectType = projectType, Description = "Drone " + apiType.GetDescription(), Name = "Drone " + entityId, Timestamp = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0) }; droneSeeder.Add(droneLog); } return(droneSeeder.ToArray()); }