If I have an ObjectDataSource setup like:
<asp:ObjectDataSource
ID="ObjectDataSource1"
runat="server"
DataObjectTypeName="Employee"
InsertMethod="Insert"
UpdateMethod="Update"
DeleteMethod="Select"
TypeName="EmployeeDB">
</asp:ObjectDataSource>
and a data/business object with methods like:
public class EmployeeDB
{
public void Insert(Employee emp)
public int Update(Employee emp)
public bool Delete(int id)
}
How do I get the objectdatasource to use the Delete method with the parameter that is not an Employee object?
If this is not possible, what is the recommended alternative architecture?
Edit:
To clarify, I want to use the method signature on my data/business object as shown above, however if I try to allow an Employee object to be passed into some of the methods using DataObjectTypeName, then I seemingly lose the ability to have some methods take just an integer id for instance.
If I do not use the DataObjectTypeName, then I have to place all the method parameters in the ObjectDataSource and change the methods on the data/business object to match, this seems like a bad design choice because as the Employee object changes I will have to update each of these methods. Is there a better architecture?