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 answers
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 can I overwrite the localization strings in a library
- 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
- How to set language in a server-side rendering blazor app
- How can I debug server side rendering blazor code in a component?
- Azure AD guest account in web app authentication user claims data
- 3rd Party cookies error on deployment server
- In Blazor app, how do I access the JWT from Google sign-in and set the verified user?
- Blazor - get relatedTarget on focus out event
- How can I call a method for a <button> where I build the html up as a string?
- Custom templet of Blazor8 project causes Antiforgery cookie error
- Blazorise SelectedTabChanged method called twice hence ends up selecting wrong tab
- Need to read a cookie in blazor server mainlayout.cs
- Blazor (InteractiveServer) + ASP.NET Identity library & GDPR
- Is DotNetStreamReference exhausting my memory?
Related Questions in ASP.NET-BLAZOR
- how to open a Save as Dialogue window from c# blazor web app?
- How do I reference a Blazor WASM project to another Blazor WASM?
- How to disable InputRadioGroup?
- How to upload and read an excel file (.xlsx) in a blazor server project
- Blazor one-way binding from child to parent component
- "TryParseValueFromString not implemented" even when it is
- Why is blazor.server.js blocking my other js files?
- Trouble passing eventcallback to component which inherits InputBase<TValue>
- Blazor 6.0 Publish doesn't produce the index.html file
- list of object is updating its values on updating another object in Blazor
- How to set a minimum width for MudBlazor MudDataGrid columns?
- How to keep a global variable's value when refreshing the page content in Asp.Net Blazor
- How to pass a funcion in Renderfragment
- OnParametersSet being called for every component instance?
- Securing a folder or page, to a role, in Blazor Server
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?
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)
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.