public ActionResult Apply() { var user = _ctx.DVUserProfiles.First(x => x.UserName == User.Identity.Name); var app = new DEventParticipant(); app.Id = Guid.NewGuid(); app.EventId = Guid.Parse("44EC20AA-CE3A-4BD2-B48B-E8EBDA5D2E5B"); app.UserId = user.UserId; app.Created = DateTime.UtcNow; _ctx.DEventParticipants.AddObject(app); _ctx.SaveChanges(); return RedirectToAction("Profile", "Account"); }
/// <summary> /// Deprecated Method for adding a new object to the DEventParticipants EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToDEventParticipants(DEventParticipant dEventParticipant) { base.AddObject("DEventParticipants", dEventParticipant); }
/// <summary> /// Create a new DEventParticipant object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="eventId">Initial value of the EventId property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="created">Initial value of the Created property.</param> public static DEventParticipant CreateDEventParticipant(global::System.Guid id, global::System.Guid eventId, global::System.Int32 userId, global::System.DateTime created) { DEventParticipant dEventParticipant = new DEventParticipant(); dEventParticipant.Id = id; dEventParticipant.EventId = eventId; dEventParticipant.UserId = userId; dEventParticipant.Created = created; return dEventParticipant; }