private void notify(Domain.Cursa cursa, List <Domain.Rezervare> rezervari) { foreach (var obs in observers.Values) { Task.Run(() => { obs.seatsDecremented(ThriftUtils.fromNativeCursa(cursa)); obs.newBookings(ThriftUtils.fromNativeRezervari(rezervari)); }); } }
List <Thrift.Cursa> ThriftService.ISync.getAllCurse() { List <Domain.Cursa> all = cursaRepo.FindAll().ToList <Domain.Cursa>(); List <Thrift.Cursa> result = new List <Thrift.Cursa>(); all.ForEach(x => { result.Add(ThriftUtils.fromNativeCursa(x)); }); return(result); }
public Thrift.Cursa findByDestinationAndDate(string destination, string date) { DateTime d; DateTime.TryParse(date, out d); var curse = cursaRepo.FindByDestinationAndDate(destination, d); if (curse.ToList <Domain.Cursa>().Count == 0) { return(null); } return(ThriftUtils.fromNativeCursa(cursaRepo.FindByDestinationAndDate(destination, d).ElementAt(0))); }