How to save data to different table having same schema during runtime #5715
Unanswered
sammirdubey
asked this question in
Help
Replies: 1 comment
-
I haven't tried to do that on the fly, but what you could also do is create a new class public SaveResponse Create(IUnitOfWork uow, SaveRequest<MyRow> request)
{
public SaveResponse Create(IUnitOfWork uow, SaveRequest<MyRow> request)
{
var newEntity = new NewTableRow
{
ColumnA = request.Entity.ColumnA,
ColumnB = request.Entity.ColumnB
// etc
};
var saveRequest = new SaveRequest<NewTableRow> {Entity = newEntity};
return new SaveRequestHandler<NewTableRow>().Process(uow, saveRequest, SaveRequestType.Create);
}
} You can add some extra logic to determine whether you want to save the data in OldTable or NewTable accordingly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can i modify the table name inside SaveHandler based on condition in serenity?
Beta Was this translation helpful? Give feedback.
All reactions