If I have an ObjectDataSource setting, for example:
<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 such as:
public class EmployeeDB { public void Insert(Employee emp) public int Update(Employee emp) public bool Delete(int id) }
How do I get an objectdatasource to use the Delete method with a parameter that is not an Employee object?
If this is not possible, then 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 the Employee object to be passed to some of the methods using DataObjectTypeName, then I apparently lose the ability, for example, some methods accept only integer identifier.
If I do not use the name DataObjectTypeName, then I have to put all the method parameters in an ObjectDataSource and change the methods on the data / business object to fit, this seems like a wrong design choice, because when changing the Employee object I will have to update each of these methods. Is there a better architecture?
source share