public static void Seed(ActivitySignupContext _db) { if (!_db.activities.Any()) { // Adding Activities. _db.activities.AddRange(getInitialActivities()); _db.SaveChanges(); } }
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(); }