Alrighty.
So now let's talk about how to organize files.
So let's just explore what I have prepared.
We have several files in our project.
We have a customer class, a product class, a product service class and a customer service class.
So again product customer product service customer service.
So maybe you have noticed that we have two kind of models product and customer.
And we have two types of services customer service product service.
Alrighty.
So we can separate them.
So what we should do here is we should create two namespaces one models namespace where we put in all
of our data models, products and customers.
And for our services we can group them together to in a service namespace where we can put in our customer
service and our product service.
Great.
I have to mention that you want to put those each in their own file.
We should have a file for customer.
We should have a file for customer service.
We should have a file for product.
We should have a file for product service.
Alrighty.
So let's create a namespace here at our customer service.
My application is called my application.
That's just the default name that I picked for this kind of demo project.
I want to extend that and I want to add a namespace into my application.
You know, you can put in the name of your project here, then add dot services.
So now we have created a new namespace.
And inside there we got the customer service.
So let's just copy that.
Go to the product service at the dot here and put it into the same namespace.
Now let's go to the product that we have here in Product my application dot models.
Same for the customer.
My application dot models.
So now we have two namespaces services and models.
And each of them holds the data structure.
So the classes that they should hold in order to make it even more obvious, we want to create two new
folders now because we have separated them by namespaces.
So one thing that you can do is to create a folder.
You can call them just like the namespaces that we've created.
So services right click Add Folder Models and then put the customer into the models folder.
You can do it that way yes.
Adjust the namespace.
You can see that this is automatically done right.
So we don't want to show it again.
Yes working fine.
So put in the model for the product here.
Then pick the customer service for services and product service into the service folder too.
So now we have a great structure here.
We clearly can see that we have models customer products services, customer service, product service.
And in that way, every new developer that joins your team or whenever you have to set up a new service
or model, you will automatically create that file, place it in the correct namespace and inside of
that folder.
Great.
So take a look again.
Customer service inside services product service inside service, and so on.
If we now want to use all of this inside of our program right here, you can see that as soon as we
want to create a new product, for example, let's say a product.
See, in that moment I want to do that.
He has now imported my application here that using directive using my application models, we have to
use that namespace so that we can get access to the classes which are inside of that namespace.
The same applies as soon if I want to use a customer service, for example, customer service.
You can see that's coming from the My Application service namespace.
So in that moment I want to use it.
He will automatically import it here at the top with another using directive.
Great.
So now we have structured that in a great way.
It makes sense inside of our code.
And it also makes sense in the visual hierarchy that you can see here in the Solution Explorer.