My EF insert method is defined as follows:
public void Add(params T[] items)
How can it be used with ObjectDataSource to insert objects?
My EF insert method is defined as follows:
public void Add(params T[] items)
How can it be used with ObjectDataSource to insert objects?
According to the documentation, the insert method for an ObjectDataSource
is designed to call a method that has parameters for each value of the item being inserted, not the item itself (let alone an array of items).
I would either add an overload to your repository that accepts the value for a single item (and perhaps calls Add
), or add a mapper somewhere that maps the values to a new item and calls your Add
method.