예제 #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();
 }
예제 #2
0
파일: Admin.cs 프로젝트: bossen/P3-Program
        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);
            }
        }