Is it possible to add EF6 to a razor class library ? The goal is to have many components shared by other BLAZOR projects, but a lot of these controls require access to the database, which is the same for all the projects inside this solution. Also, I assume that the db access will be via a controller since it is not possible to inject as a service. Is this correct ?
Add EF6 to a razor class library project to be shared by many BLAZOR projects?
337 Views Asked by Ben Junior At
1
There are 1 best solutions below
Related Questions in ENTITY-FRAMEWORK-6
- EF 6 interceptor to set connectionstring
- Updating Entity Framework 6 Database C#
- ObjectContext is disposed, can not longer used
- EF6 model first - The entity type is not part of the model for the current context
- Integration testing the entity framework - separate the seed method call only for PROD -
- Entity framework conditional entity relation
- Entity Framework Decimal Truncation Issue
- Auto Increment ID in Composite key Entity Framework
- Using an 'if statement' correctly in a variable
- Updating entity with many to many relationship
- Entity Framework: Lazyloading appears to be off despite explicitly turning it on?
- Combining results from two classes
- EF Code First - Multiple Application Versions Sharing A Database
- Elegant way to model multiple reviewers for a form in MVC with Entity First
- After changing the table Entity Name in EF edmx designer then Not able to Create controller with Scaffolding options?
Related Questions in BLAZOR
- How to store data related to a Blazor Server circuit?
- MatTooltip not working with MatAutocompleteList in Blazor
- Blazor - Prevent double HTTP call and wait first one
- Blazor Webassembly Authentication is verry slow
- Blazor WASM Hosted - How to download a file using HttpPost
- How do I set my RadzenTextBox to String.Empty if a toggle is clicked
- Blazor clear memory with IDisposable
- CascadedParameter: When is its value applied to my components property
- Blazor child to parent two-way binding on input-text field
- How to apply signalR.js in a Screen sharing html page
- In a Blazor page (Not a Blazor component) why all methods and variables are private inside @code?
- Blazor not discovering new pages in subfolders
- Blazor app with ASP.NET Identity UI shared layuout template
- Blazor get a reference to clicked element
- C# Blazor This works but I am getting errors
Related Questions in BLAZOR-SERVER-SIDE
- How to store data related to a Blazor Server circuit?
- MatTooltip not working with MatAutocompleteList in Blazor
- Uploading to Azure WebApp throws `ConnectionResetException: The client has disconnected`
- Response already started Exception has been thrown on HttpContext.SignOutAsync() method call in Blazor
- Blazor clear memory with IDisposable
- CascadedParameter: When is its value applied to my components property
- Is there a better way of displaying data in a table in Blazor?
- Getting SameSite cookie issues with Azure AD authentication with downstream WebAPI
- How to enforce HTTP (instead of HTTPS) while calling gRPC service from Server-Side Blazor
- Why does authorizeview roles="admin" crash my app?
- Troubleshooting ASP.NET Core Role-based Authorization with Windows Authentication
- OnInitializedAsync method is not getting call while changing the query string value
- Blazor loading animation for API vs. EF
- Update models in EF core after DBA change database schema
- Blazor sharing css style sheet and svg across multiple project
Related Questions in ASP.NET-BLAZOR
- MatTooltip not working with MatAutocompleteList in Blazor
- Add validation to InputSelect with default placeholder string
- Add EF6 to a razor class library project to be shared by many BLAZOR projects?
- Problem with adding a blazor component to an exsiting Asp.net core project
- How to display data in child component when passed from parent component in Blazor?
- MediatR Notifications with Blazor (WASM) - Event handler does not update UI
- I'm getting an DirectoryNotFoundException error after published an blazor assembly application ASP.NET CORE hosted in IIS
- How to use IJSRuntime from class library
- blazor hosted wasm local identity - error on scaffold login page
- Blazor Webassembly - JWT in headers (before my app)
- Blazor Server Page Unit Testing - How to mock secondary signalR client connection used in Blazor Server Page
- How to use same login page in multiple projects in blazor webassembly?
- Blazor render-mode="Server" for displaying the component not working
- System.InvalidOperationException: Unable to resolve service for type - Dependency Injection
- Blazor Rest Api call using httpClient.GetJsonAsync Errors
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Yes but you would immediately restrict that library ro Blazor Server side.
That is not a great architecture
Not necessary with server-side, you can inject a DbContext into your pages and components
When you have components that depend strongly on your Entity classes and business logic then a Razor Class Library is maybe not the best choice.
When you do want this, create a specific layer with storage-agnostic models and interfaces for services. It's the 2 layers at the core in the Onion architecture.
Your component can depend on the interfaces and the main app can implement them.