public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { Rezervari = new List <Rezervare>(); TList _list12 = iprot.ReadListBegin(); for (int _i13 = 0; _i13 < _list12.Count; ++_i13) { Rezervare _elem14; _elem14 = new Rezervare(); _elem14.Read(iprot); Rezervari.Add(_elem14); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }
public static List <Rezervare> fromNativeRezervari(List <Domain.Rezervare> rezervari) { var all = new List <Rezervare>(); rezervari.ForEach(x => { var r = new Rezervare(); r.Id = x.id; r.Client = x.client; r.IdCursa = x.idCursa; r.NrLoc = x.nrLoc; all.Add(r); }); return(all); }
List <Thrift.Rezervare> ThriftService.ISync.getAllBookings(int id) { List <Domain.Rezervare> all = rezervareRepo.FindByIdCursa(id).ToList <Domain.Rezervare>(); List <Thrift.Rezervare> result = new List <Thrift.Rezervare>(); all.ForEach(x => { Thrift.Rezervare r = new Thrift.Rezervare(); r.Client = x.client; r.Id = x.id; r.IdCursa = x.idCursa; r.NrLoc = x.nrLoc; result.Add(r); }); return(result); }