Okay, so now it's time to refactor what we have written down here, right?
Because we have one single C-sharp file and we have a lot of classes inside here.
So let's first of all, move the booking service to the application layer.
So scroll a little bit down until you come to the booking service.
Got that right here in line 39 for me and control on that.
And let's move to namespace here and now select application and then hit.
Okay.
Now you can see we have that in namespace application.
So let me just collapse it here.
Let me go to application on the right side and you can see that we have a class here, class one, right?
So let's simply go ahead to our flight application specification.
Again, let me just copy over that what we have just created.
Go to class one again, let me paste it inside here.
We can do that even manually.
It doesn't really matter.
And now you can see booking service.
We got that right here.
Let's just rename the class file booking service and that's basically what we have to do.
Now you can see that we for sure have some missing references.
So hold the cursor above this show potential fixes.
You can see that we need to add a reference to data here.
No problem.
Let's do this.
Great.
Save it.
You can see a missing reference in book DTO and book.
We will take care about that just in a second.
So let's move the booking DTO right here.
Let's create in the application two new classes which we can use.
That's a little bit easier right now.
Let's call it book DTO.
And we create another one add.
Class.
Book are an awesome.
Now go to our flight specification.
Here we got the public class book DTO.
Now let's simply collapse the classes.
Both of them take the book, DTO press, Ctrl X to cut it out and bring it into the book DTO but make
sure that you really bring it into the correct one.
So book DTO will get the book DTO check the file names first and second one is booking REM, Ctrl X.
We can now delete this here, go to booking REM and paste it inside here so that we got inside of the
booking C sharp file, the booking, REM, C sharp class.
Now let's go to our flight specifications and you can see that we now have for sure here some missing
references because we need to link the project right click on application tests project and add a project
reference and we're going to add the application project as a reference.
So simply hit.
Okay.
And now you can see that all the missing types are for sure covered again.
Let's check because, you know, refactoring can be risky, right?
So maybe we change something, but we are not aware of that.
And in a different scenario, maybe you would get an error.
But this is why we're using TDD, right?
So we can simply go ahead.
Test test explorer and just run all tests and see if our application is still working.
Great.
And as you can see, application test is working fine and flight here is also working fine.
Perfect.
So now we know that our refactoring worked as intended.