public List <DomenskiObjekat> GetEntities(SqlDataReader reader) { List <DomenskiObjekat> list = new List <DomenskiObjekat>(); while (reader.Read()) { Termin termin = new Termin { TerminID = reader.GetInt32(0), DanTermina = reader.GetString(1), VremeTermina = reader.GetString(2), Grupa = new GrupaZaTrening { GrupaID = reader.GetInt32(3) }, Trener = new Trener { TrenerID = reader.GetInt32(4) } }; list.Add(termin); } reader.Close(); return(list); }
public DomenskiObjekat GetEntity(SqlDataReader reader) { Termin termin = new Termin(); while (reader.Read()) { termin.TerminID = reader.GetInt32(0); termin.DanTermina = reader.GetString(1); termin.VremeTermina = reader.GetString(2); termin.Grupa = new GrupaZaTrening { GrupaID = reader.GetInt32(3) }; termin.Trener = new Trener { TrenerID = reader.GetInt32(4) }; } return(termin); }