mercredi 10 juillet 2019

Domain Driven Design - ASP Core Rest (EF Core, DTO, UoW, Business, Validation)

I posted another question yesterday about Domain Driven Design, because i have got this big assignment at work and i don't really know how i should go about solving it. We are making a big Rest-API with thousands of models, some models have upto many hundred columns.

I have tryed to make a "simple" sample project to explain my problems a little more clear. I have googled and looked all over stackoverflow to find some examples, but all of them are for small projects and the problem seems easier to tackle, can't just sit down and type an API for thousand's of models without knowing the outcome will be good.

My plan:

  • Each entity has a repository.
  • Each entity has it's own service, where business logic is handles and calls repository.
  • Each entity has it's own controller, where the service is called.

Where should i have my validation? I feel the code it a little smelly.

I want all the feedback i can get, really struggeling with this problem alone, so good to have some other opinions.

  • What can i do better?
  • Smelly code?
  • Bad practise?

NB! Keep in mind this project is not complete, it's just for testing purposes so i can somewhere in the near future land on a solution i like and prefer.

If you go to the CustomersController.cs

You will find 2 methods for creating a customer, is one of these alright?

https://github.com/PapaBigBear/EntityFrameworkProject

Thank you so much in advance.

Aucun commentaire:

Enregistrer un commentaire