public DomenskiObjekat Pronadji(DomenskiObjekat domenskiObjekat) { SqlCommand command = new SqlCommand("", connection, transaction); command.CommandText = $"SELECT * FROM {domenskiObjekat.TableName} where {domenskiObjekat.KriterijumPretrage}"; SqlDataReader reader = command.ExecuteReader(); DomenskiObjekat rezultat = domenskiObjekat.GetEntity(reader); reader.Close(); return(rezultat); }
public DomenskiObjekat VratiJedan(DomenskiObjekat objekat) { SqlCommand command = new SqlCommand("", connection, transaction); command.CommandText = $"SELECT * FROM {objekat.TableName} WHERE {objekat.KriterijumPretrage}"; SqlDataReader reader = command.ExecuteReader(); DomenskiObjekat rezultat = objekat.GetEntity(reader); reader.Close(); return(rezultat); }
public DomenskiObjekat VratiJedanJoin(DomenskiObjekat domenskiObjekat) { SqlCommand command = new SqlCommand("", connection, transaction); command.CommandText = $"SELECT {domenskiObjekat.PovratneVrednosti} FROM {domenskiObjekat.TableName} {domenskiObjekat.JoinFull} where {domenskiObjekat.JoinCondition}"; Console.Write(command.CommandText); SqlDataReader reader = command.ExecuteReader(); DomenskiObjekat rezultat = domenskiObjekat.GetEntity(reader); reader.Close(); return(rezultat); }