Esempio n. 1
0
        public override async Task GetAllDipendenti(Empty e, IServerStreamWriter <DipendenteReply> s, ServerCallContext context)
        {
            List <DipendenteReply> dip = new List <DipendenteReply>();

            for (int i = 0; i < 6; i++)
            {
                DipendenteReply d = new DipendenteReply();
                d.Comune     = "Roma " + i.ToString();
                d.Nominativo = "Giovanni " + i.ToString();
                await Task.Delay(3000);

                await s.WriteAsync(d);
            }
        }
Esempio n. 2
0
        public override async Task <DipendentiReply> GetAllDipendentiList(DipendenteRequest request, ServerCallContext context)
        {
            List <DipendenteReply> dips = new List <DipendenteReply>();

            for (int i = 0; i < 5; i++)
            {
                DipendenteReply d = new DipendenteReply();
                d.Comune     = "Roma " + i.ToString();
                d.Nominativo = "GioAppu" + i.ToString();
                dips.Add(d);
            }

            DipendentiReply dipend = new DipendentiReply();

            dipend.ListaDipendenti.Add(dips);
            return(dipend);
        }