//Unary public override Task <KorisnikMsg> DajJednogKorisnika(PraznaMsg request, ServerCallContext context) { var kor = _db.Korisniks.ToList(); _db.Adresas.Where(a => a.Korisnik_FK == kor[0].ID).ToList(); _log.LogInformation(kor[0].Ime); _log.LogInformation(kor[0].Adrese[0].Ulica); return(Task.FromResult(_kon.Konvert(kor[0]))); }
//Server stream public override async Task IzlistajKorisnike(PraznaMsg request, IServerStreamWriter <KorisnikMsg> responseStream, ServerCallContext context) { var kor = _db.Korisniks.ToList(); _db.Adresas.ToList(); foreach (Korisnik k in kor) { await responseStream.WriteAsync(_kon.Konvert(k)); await Task.Delay(1000); } }