private static void AddPlant(GardeningContext context, string name, params string[] types)
        {
            Plant p = new Plant()
            {
                Name = name, HardinessZone = context.HardinessZone.Where(m => m.Name == "0a").Single()
            };

            context.Plant.Add(p);
            foreach (string s in types)
            {
                context.PlantPlantType.Add(new PlantPlantType()
                {
                    Plant = p, PlantType = context.PlantType.Where(m => m.Name.Equals(s)).Single()
                });
            }
        }
Ejemplo n.º 2
0
 public PlanController(GardeningContext context)
 {
     _context = context;
 }
 public HardinessZonesController(GardeningContext context)
 {
     _context = context;
 }