Beispiel #1
0
 public void VolunteerEdited(Volunteer volunteer)
 {
     db.Entry(volunteer).State = EntityState.Modified;
     foreach (Match match in volunteer.Matches)
     {
         db.Entry(match).State = EntityState.Modified;
     }
     db.Entry(volunteer.Location).State = EntityState.Modified;
     db.SaveChanges();
 }
Beispiel #2
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);
            }
        }