/// <summary> /// Adds animal to the wagon /// </summary> /// <param name="animal"></param> public void AddAnimal(Animal animal) { animalsInWagon.Add(animal); occupation += animal.Size; IAnimalDal dal = AnimalFactory.GetAnimalDal(); dal.Add(new AnimalDto { Name = animal.Name, Size = animal.Size, IsCarnivore = animal.IsCarnivore }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAnimalDal animalService) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public CreateAnimalCommandHandler(IAnimalDal animalDal) { _animalDal = animalDal; }
public GetAnimalQueryHandler(IAnimalDal animalDal) { _animalDal = animalDal; }
public DeleteAnimalCommandHandler(IAnimalDal animalDal) { _animalDal = animalDal; }
public IActionResult GetAnimals([FromServices] IAnimalDal _animalDal) { return(Ok("halo")); }