Git Product home page Git Product logo

Comments (3)

iayti avatar iayti commented on July 30, 2024

Hi @milyas-salik ,

I didn't have enough time to test what you wrote. Can you try updating the Models folder to look at the Entities folder in the Domain project while doing Database Scaffolding? Db first runs as database-dependent at startup. In this example, we are trying to make it database-independent.

If you have time, could you create an example project with the steps you followed and share it with me? Let's try to solve the error together.

from cleanarchitecture.

milyas-salik avatar milyas-salik commented on July 30, 2024

@iayti : here is my source code.
https://gitlab.com/mail2mdilyas/workcontinent/-/tree/master

The one way, I am thinking is to get rid of the dependency with infrastructure entities (generated from the database using scaffolding) and use the domain entities with the model builder ==> modelBuilder.Entity - Professional class should be the one coming from your domain instead of infrastructure

As per me, this is the easier solution for DB's first approaches using clean architecture. I need your advice on it, is it a valid adjustment or do you advise using any other alternative solution? At the same time, I don't want to break the clean architecture rules as I want scalable and maintainable applications in the future.

from cleanarchitecture.

wahabalemi avatar wahabalemi commented on July 30, 2024

hi when use " dotnet ef migrations add "CreateDb" --project src\Common\CleanArchitecture.Infrastructure.SqlServe --startup-project src\Apps\CleanArchitecture.Api " command cli returns "The entity type 'DomainEvent' requires a primary key to be defined."

from cleanarchitecture.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.