Base solution for your next web application
Open Closed

Multiple Database - Read Write Only - No Schema Updates #5371


User avatar
0
maharatha created

I have a system where I want to store only the user information Authentication , Authroization and all the good stuff in Aspnet Zero project , but I would be heavily interacting with another MS SQL database. I would still want to use the repository pattern to update and access the other database tables, but I would like to prevent updating the other database which I am trying to access.

  1. Now I would be accessing only few tables and columns from the other database, so do I need to create those entities with the selected columns in the Core project

  2. How do I stop accidental migration scripts to be run on the secondary database.


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    You can refer to this sample[https://github.com/aspnetboilerplate/aspnetboilerplate-samples/tree/master/MultipleDbContextEfCoreDemo]) to use multiple database contexts.

  • User Avatar
    0
    fguo created

    I like to study the code on that link, but it seems no way for me to download/clone. Can you give me a hent how to do it?

    Thanks,

  • User Avatar
    0
    aaron created
    Support Team

    You can clone the repo.

  • User Avatar
    0
    fguo created

    There is no "Clone or download" button.

  • User Avatar
    0
    aaron created
    Support Team

    You cannot clone a folder. You can clone the repo, accessible by clicking on aspnetboilerplate-samples.

  • User Avatar
    0
    fguo created

    Understand. Thanks!