public IDomainObject VratiObjekat(SqlDataReader reader) { try { Drzava country = new Drzava(); while (reader.Read()) { country.Id = (long)reader[0]; country.NazivDrzave = reader[1].ToString(); break; } return(country); } catch (Exception) { return(null); } }
public List <IDomainObject> VratiListu(SqlDataReader reader) { try { List <IDomainObject> countries = new List <IDomainObject>(); while (reader.Read()) { Drzava country = new Drzava { Id = (long)reader[0], NazivDrzave = reader[1].ToString() }; countries.Add(country); } return(countries); } catch (Exception) { return(null); } }