예제 #1
0
 public void AddSportDetail(SportDetail sportDetail)
 {
     _sportDetails.Add(sportDetail);
 }
예제 #2
0
        public void DeleteSportDetail(int sportDetailId)
        {
            var sportDetail = new SportDetail { Id = sportDetailId };

            _sportDetails.Attach(sportDetail);

            _sportDetails.Remove(sportDetail);
        }
예제 #3
0
        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);
        }