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?
340 Views Asked by Ben Junior At
1
There are 1 best solutions below
Related Questions in ENTITY-FRAMEWORK-6
- EF6 Find function always go to the DB
- Using EF (not EF Core) with .NET 6 or above
- EF generates query with not supported minus sign in MS SQL (f.e. norvegian culture)
- Why ConfigurationManager.ConnectionStrings returns only a default LocalDb ASP.Net Cnx?
- HasComputedColumnSql() method not working as Expected
- How to establish 1:1 relationship with 2 composite keys in EF6 (not core)
- Error adding an owned entity to the parent entity using ASP.NET Core 6 Web API
- Injecting UserStore and UserManager into Controller throws exception
- What is difference between ComplexType and OwnsOne in Entity Framework Core?
- Entity Framework 6 - modify nested collection by using DbCommandInterceptor
- Entity Framework 6 - update entity value during loading
- How to generate Concurrency exceptions in Entity Framework?
- How is the DeleteStatus in associated tables updated when DeleteStatus is true in a table?
- Update modified date when referenced entities are edited
- Disable only Inserts and Updates for one entity in EF 6
Related Questions in BLAZOR
- Failed to fetch dynamically imported module on Blazor JS Interop
- Implementing Azure AD B2C Authentication in .NET 8 Blazor Project (RenderMode: InteractiveAuto)
- New Blazor Web App, Password Reset "A valid antiforgery token was not provided"
- How to share authorization implemented in the server project with the client project in Blazor Web App Auto project?
- My Blazor UI is not responding on a domain, but working on another domain
- Telerik Blazor GridCommandButton not working
- How to set language in a server-side rendering blazor app
- Stopwatch loosing time in a browser using blazor and web assembly when browser put in background
- How to Nest a TelerikGrid inside TelerikForm with Blazor
- Blazor/Razor resolve components using dependency injection
- UI not updating after resetting object
- 3rd Party cookies error on deployment server
- Blazor DbContext in a service
- Blazor Web App (.Net 8) with oidc loses auth when switching to client
- Why Blazor 8 prerendering does not render all of the page?
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.