public void DeleteDirectorAllocation(int LMID, int DirectorID) { try { DirectorAllocation directorallocation = new DirectorAllocation() { DirectorID=DirectorID, LMId=LMID}; context.DirectorAllocations.DeleteObject(directorallocation); context.SaveChanges(); } catch (Exception ex) { //Include catch blocks for specific exceptions first, //and handle or log the error as appropriate in each. //Include a generic catch block like this one last. throw ex; } }
public void InsertDirectorAllocation(DirectorAllocation directorallocation) { try { context.DirectorAllocations.AddObject(directorallocation); context.SaveChanges(); } catch (Exception ex) { //Include catch blocks for specific exceptions first, //and handle or log the error as appropriate in each. //Include a generic catch block like this one last. throw ex; } }