public void UpdateMembership(MembershipModel membershipModel)
 {
     Models.DBObjects.Membership exisitngmembership = dbContext.Memberships.FirstOrDefault(x => x.IDMembership == membershipModel.IDMembershipType);
     if (exisitngmembership != null)
     {
         exisitngmembership.UpdateObject(membershipModel);
         dbContext.SubmitChanges();
     }
 }
 public void DeleteMembership(Guid ID)
 {
     Models.DBObjects.Membership membershipToDelete = clubmembershipDataContext.Memberships.FirstOrDefault
         (x => x.IDMembership == ID);
     if (membershipToDelete != null)
     {
         clubmembershipDataContext.Memberships.DeleteOnSubmit(membershipToDelete);
         clubmembershipDataContext.SubmitChanges();
     }
 }
        public MembershipModel GetMembershipsByID(Guid ID)
        {
            Models.DBObjects.Membership existingMember = dbContext.Memberships.FirstOrDefault(x => x.IDMembership == ID);

            if (existingMember != null)
            {
                return(existingMember.MapObject <MembershipModel>());
            }
            else
            {
                return(null);
            }
        }
 public void UpdateMembership(MembershipModel membershipModel)
 {
     Models.DBObjects.Membership existingMembership = clubmembershipDataContext.Memberships.FirstOrDefault
         (x => x.IDMembership == membershipModel.IDMembership);
     if (existingMembership != null)
     {
         existingMembership.IDMembership = membershipModel.IDMembership;
         existingMembership.StartDate = membershipModel.StartDate;
         existingMembership.EndDate = membershipModel.EndDate;
         existingMembership.IDMember = membershipModel.IDMember;
         existingMembership.IDMembershipType = membershipModel.IDMembershipType;
         existingMembership.Level = membershipModel.Level;
         
         clubmembershipDataContext.SubmitChanges();
     }
 }