예제 #1
0
 public IActionResult Edit([FromBody] ChallengeSponsorship chsponsorship)
 {
     if (ModelState.IsValid)
     {
         _dataAccessProvider.UpdateChallengeSponsorshipRecord(chsponsorship);
         return(Ok());
     }
     return(BadRequest());
 }
예제 #2
0
 public IActionResult Create([FromBody] ChallengeSponsorship chsponsorship)
 {
     if (ModelState.IsValid)
     {
         Guid obj = Guid.NewGuid();
         chsponsorship.id = obj.ToString();
         _dataAccessProvider.AddChallengeSponsorshipRecord(chsponsorship);
         return(Ok());
     }
     return(BadRequest());
 }
예제 #3
0
 /*
  * Description:Updates a ChallengeSponsorship to ChallengeSponsorship table
  * Params:Object ChallengeSponsorship
  * Output:None
  */
 public void UpdateChallengeSponsorshipRecord(ChallengeSponsorship chsponsorship)
 {
     _context.challengehassponsor.Update(chsponsorship);
     _context.SaveChanges();
 }
예제 #4
0
 /*
  * Description:Adds a ChallengeSponsorship to ChallengeSponsorship table
  * Params:Object ChallengeSponsorship
  * Output:None
  */
 public void AddChallengeSponsorshipRecord(ChallengeSponsorship chsponsorship)
 {
     _context.challengehassponsor.Add(chsponsorship);
     _context.SaveChanges();
 }