protected override void OnTimeRangeSelected(TimeRangeSelectedArgs e) { var toBeCreated = new TimmApp.Models.Event { eventStart = e.Start, eventEnd = e.End, text = (string)e.Data["name"] }; db.events.Add(toBeCreated); db.SaveChanges(); Update(); }