Exemplo n.º 1
0
 public ActionResult Edit(Prize prize)
 {
     var prizeDto = _prizeRepo.Find(p => p.Id == prize.Id);
     prizeDto.Description = prize.Description;
     prizeDto.MaxAmount = prize.MaxAmount;
     prizeDto.MinAmount = prize.MinAmount;
     return RedirectToAction("Index");
 }
Exemplo n.º 2
0
 public ActionResult Create(Prize prize)
 {
     var dto = new PrizeDto()
         {
             Description = prize.Description,
             MaxAmount = prize.MaxAmount,
             MinAmount = prize.MinAmount
         };
     _prizeRepo.Save(dto);
     return RedirectToAction("Index");
 }
Exemplo n.º 3
0
 private static PrizeDto MapToPrizeDto(Prize pr)
 {
     return new PrizeDto()
         {
             Description = pr.Description,
             Id = pr.Id,
             MaxAmount = pr.MaxAmount,
             MinAmount = pr.MinAmount
         };
 }