-2

Please advise the modern architecture of ASP.NET WebApi application (better .NET Framework not Core) with the latest innovations. For example: Unit of work pattern, controller -> manager -> repository, Automapper, xUnit, Serilog or..., a reliable migration mechanism for Oracle - Liquibase or... Asynchronous execution - async / await. Requirements: authentication - AD / Windows, DB - Oracle. If there are code examples it would be ideal

UPDATE 1 What about ORM and migration system. In my opinion code first approach and EF migrations is good because the model suit to DB copletely, but it is risky. Previously I made Database Project for MS Sql Server and all change scripts was generated by comparing schemas of original DB and DB changed by EF migration, like this:

  1. create models
  2. apply migration to local (dev) database
  3. compare original DB and changed DB, ectract/generate change SQL scripts
  4. create deployment migration for CI/CD (DB project, liquibase or similar)
  5. rollback local DB and test deployment migration
  6. commit and push

It looks strange, but practice shows that using EFs migrations leads to data loss

Boris Gappov
  • 2,483
  • 18
  • 23
  • 1
    https://dotnet.microsoft.com/learn/dotnet/architecture-guides – Adrian K Sep 19 '21 at 20:22
  • Thank you for the response, you helped me a lot. But I cannot use Azure or any other cloud. So what about ORM and migration system. In my opinion code first approach and EF migrations is good but risky. Previously I made Database Project for MS Sql Server and all change scripta was generated by comparing chemas of original DB and changed by EF migration DB – Boris Gappov Sep 20 '21 at 16:31

1 Answers1

1

For me, an API (which your app exposes to consumers) can be thought of as just another type of presentation layer.

If you assume that's the case then any sensible .Net architecture would suit. Personally I follow an logical approach like this: 5 layer Architecture - https://morphological.files.wordpress.com/2011/08/5-layer-architecture-draft.pdf

Not sure if that answers your question though. I think if you get the logical architecture sorted out, then determining which technologies you use to implement isn't so hard.

The 5-Layer architecture referenced above uses dependency injection, so you can use whatever database technology you like.

Use of sync vs async depends on the nature of the actual functional and technical problems you're trying to solve.

Adrian K
  • 9,880
  • 3
  • 33
  • 59