Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 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);
             }
         }
     }
 }