Esempio n. 1
0
        public async Task sendStatusOfVehicle(Notification notification, statusOfVehicle statusOfVehicle)
        {
            statOfVehicleRepository.Add(statusOfVehicle);
            var stat = statOfVehicleRepository.statusOfVehicles.Single(s => s.description == statusOfVehicle.description);
            var s    = typeof(statusOfVehicle).ToString();

            notification.type     = s.Split(".").Last();
            notification.objectId = stat.Id;
            notificationRepository.Add(notification);
            var notif = notificationRepository.notifications.Last();
            await Clients.All.SendAsync("ReceiveStat", notif, stat);
        }
Esempio n. 2
0
 public bool createStatus(statusOfVehicle stat)
 {
     stat.date = DateTime.Now;
     return(statOfVehicle.Add(stat));
 }