M
MTomov
Hi fellas,
has anyone managed to get ObjectDataSource to work Datasets where the
Dataset is used as BusinessEntity class?
What I mean is the following architecture:
1.WebPage with ObjectDataSource
2. CustomBusinessObject which
* does validation,
* uses a Strongly Typed DataTable as a collection of BusinessEntity
items
* forwards data access to DataAdapters as a data layer
3. DataLayer based on DataAdapters
Ideally I would like to use the DataObjectTypeName property of the
ObjectDataSource
so that the methods of the CustomBusinessObject are with a single
parameter e.g.
Insert (Customer c);
The problem stems from the fact that the ObjectDataSouce requires the
BusinessEntity class (in this case this would be strongly typed data
row) should have a default constructor. Unfortunately, I could not
figure way of implementing a strongly typed data row with default
constructor.
Is there any way around this situation?
The only solution I could come up with so far is to not set the
DataObjectTypeName and handle the ObjectDataSource's Inserting,
Updating and Deleting events ... but this still requires a fair amount
of trivial code.
It would have been great if there was a way to plug into the creation
of BusinessEntity instances instead of relying on default constructors
....
Cheers,
Millen
has anyone managed to get ObjectDataSource to work Datasets where the
Dataset is used as BusinessEntity class?
What I mean is the following architecture:
1.WebPage with ObjectDataSource
2. CustomBusinessObject which
* does validation,
* uses a Strongly Typed DataTable as a collection of BusinessEntity
items
* forwards data access to DataAdapters as a data layer
3. DataLayer based on DataAdapters
Ideally I would like to use the DataObjectTypeName property of the
ObjectDataSource
so that the methods of the CustomBusinessObject are with a single
parameter e.g.
Insert (Customer c);
The problem stems from the fact that the ObjectDataSouce requires the
BusinessEntity class (in this case this would be strongly typed data
row) should have a default constructor. Unfortunately, I could not
figure way of implementing a strongly typed data row with default
constructor.
Is there any way around this situation?
The only solution I could come up with so far is to not set the
DataObjectTypeName and handle the ObjectDataSource's Inserting,
Updating and Deleting events ... but this still requires a fair amount
of trivial code.
It would have been great if there was a way to plug into the creation
of BusinessEntity instances instead of relying on default constructors
....
Cheers,
Millen