LINQ to SQL Partial method does not override auto generated method

162 Views Asked by At

I am looking to get create a partial method to override an auto generated method in linq to sql. From my reading i assume that my method should be used over the auto generated method. if that is the case why am i getting this error? "Type X already defines a member called ZZZ with the same parameter types"

When i run the program the autogenerated method is used instead of my one.

 public partial class HospitalDataContext
{
     partial  void  DeleteHospitalStaff(HospitalStaff staffMember)
    {
        staffMember.Patients.ToList().ForEach(
            patient => DeletePatientCustom(patient.PatientID));

        DeleteStaff(staffMember.HospitalStaffID);
    }
}

Thanks, Tim

0

There are 0 best solutions below