示例#1
0
 public static void Seed(ActivitySignupContext _db)
 {
     if (!_db.activities.Any())
     {
         // Adding Activities.
         _db.activities.AddRange(getInitialActivities());
         _db.SaveChanges();
     }
 }
示例#2
0
        public void Save(Signups signup)
        {
            var activity = _activity.getActivityById(signup.ActivityId);

            signup.Activity = activity;
            signup.Comment  = signup.Comment == null ? "" : signup.Comment;

            _db.signups.Add(signup);
            _db.SaveChanges();
        }