public Organization CreateOrganization(string name, Location location, string email) { using (var db = new VolunteerOrgContext()) { Organization newOrganization = new Organization(name, location, email); this.Association = newOrganization; db.Organizations.Add(newOrganization); db.SaveChanges(); return(newOrganization); } }
private void SuggestVolunteers() { using (var db = new VolunteerOrgContext()) { foreach (Volunteer volunteer in db.Volunteers.Include("Location")) { if (CheckVolunteerSuggest(volunteer) == true) { Suggestion newSuggestion = volunteer.AddSuggestion(this); Matches.Add(newSuggestion); } } } }