Last updated
Last updated
Create the Book entity in Flowfy.Domain like below;
Create the BookModel (BookDto) inside of Flowfy.Application.Contracts
Create the BookService/ Book API in Flowfy.Application like below;
Auto map the Book entity and BookMode Dto in FlowfyApplicationAutoMapperProfile.cs file.
Add Books to FlowfyDbContext.cs under the Flowfy.EntityFrameworkCore/EntityFrameworkCore as below;
Configure the Books table in FlowfyDbContext.cs under the Flowfy.EntityFrameworkCore/EntityFrameworkCore as below;
Right clict the Flowfy.DbMigrator and Set as Startup Project then open the Package Manager Console and select Flowfy.EntityFrameworkCore project as Default project then write "add-migration MyBookTable" to migration.
Execute the generated migration
Run the Flowfy.DbMigrator console project to create Book table in database.
After running, refresh the database table, you will see Books table
Lastly, right click the Flowfy.HttpApi.Host and Set as Startup Project then Start without Debugging
Here is the your Book API.
Now we can call this api from client side.