Ejemplo n.º 1
0
        public Present GetPresent(string name)
        {
            Present found = Data.FirstOrDefault(p => p.Name == name);

            return(found);
        }
Ejemplo n.º 2
0
        public Present GetHeaviestPresent()
        {
            Present heaviestPresent = Data.OrderByDescending(h => h.Weight).First();

            return(heaviestPresent);
        }
Ejemplo n.º 3
0
        public bool Remove(string name) // removes a present by given name, if such exists, and returns bool
        {
            Present present = presents.FirstOrDefault(x => x.Name == name);

            return(presents.Remove(present));
        }
Ejemplo n.º 4
0
        public Present GetPresent(string name)
        {
            Present wanted = list.FirstOrDefault(x => x.Name == name);

            return(wanted);
        }
Ejemplo n.º 5
0
        public bool Remove(string name)
        {
            Present present = data.Find(x => x.Name == name);

            return(data.Remove(present));
        }