Ejemplo n.º 1
0
 public static Sheep UpdateASheep(Sheep sheep)
 {
     if (Sheeps.ContainsKey(sheep.Id))
     {
         return(Sheeps[sheep.Id] = sheep);
     }
     return(sheep);
 }
Ejemplo n.º 2
0
        public static Sheep CreateRandomSheep()
        {
            Sheep sheep = new Sheep()
            {
                Id   = Sheeps.Count,
                Name = Guid.NewGuid().ToString("N"),
                Cost = (decimal)GetNumber(100)
            };

            Sheeps.Add(sheep.Id, sheep);
            return(sheep);
        }