コード例 #1
0
        public Challenge Add(ChallengeInputModel challenge)
        {
            var entry = new Challenge()
            {
                Name = challenge.Name,
                Description = challenge.Description,
                StartDate = challenge.StartDate,
                MinimumWordsRestriction = challenge.MinimumWordsRestriction,
                Reward = challenge.Reward
            };

            return this.dbContext.Challenges.Add(entry);
        }
コード例 #2
0
 public Challenge Delete(Challenge challenge)
 {
     return this.dbContext.Challenges.Remove(challenge);
 }
コード例 #3
0
 public void Update(Challenge challenge)
 {
     this.dbContext.Entry(challenge).State = EntityState.Modified;
 }