public void AddSportDetail(SportDetail sportDetail) { _sportDetails.Add(sportDetail); }
public void DeleteSportDetail(int sportDetailId) { var sportDetail = new SportDetail { Id = sportDetailId }; _sportDetails.Attach(sportDetail); _sportDetails.Remove(sportDetail); }
public async Task<ActionResult> AddSportDetail(AddSportDetailViewModel sportDetailModel) { var sportDetail = new SportDetail { Name = sportDetailModel.SportDetailName, SportId = sportDetailModel.SportId }; _sportService.AddSportDetail(sportDetail); await _dbContext.SaveChangesAsync(); return Json(sportDetail.Id, JsonRequestBehavior.AllowGet); }