Skip to main content

Posts

Showing posts from December, 2021

Seeding Data with reusing existing business logic in ASP

Problem There might be situations, when you need to seed some data with keeping the business logic in mind. Applying business logic and versioning of SQL migration scripts can be time-consuming. We should not forget about it would be great to be able to trace back the changes done in the database. Examples * You got a legacy project with a db schema you know you will need to modify during your upcoming implementations. You also know that, you will need to move some data from one table to another by applying business logic to it just before the app starts up for the first time with the latest migrations. * You have a missing feature in your system, and you have a repetitive data manipulation (inject) task. For example, you need to modify user access controlled via db tables, because you do not have a UI, feature in the app to do so. You also would like to apply the business logic regarding the User Access of the project and you also would like to be able to trace back who modified user