Unable to find package
See original GitHub issueHi, I decided to give Detached a try, but when trying to install it in my current project I get
PM> Install-Package Detached.Mappers.EntityFramework
Install-Package : Unable to find package 'Detached.Mappers.EntityFramework'
At line:1 char:1
+ Install-Package Detached.Mappers.EntityFramework
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:03.7855917
It seems it’s not present on the Nuget package Manager. Any workaround?
Issue Analytics
- State:
- Created 3 years ago
- Comments:23 (13 by maintainers)
Top Results From Across the Web
how to resolve "Unable to find package" nuget error
Open NuGet section · Add a Feed by clicking "+" sign · Restart JetBrains Rider and the problem should be resolved.
Read more >NuGet Error NU1101
Examine the project's dependencies in Visual Studio to be sure you're using the correct package identifier and version number. Check your NuGet.
Read more >Package manager cannot find package in offline resources
Open Visual Studio, go to "Debug" --> "Options.." · Search for "Nuget Package Manager" --> General · Click on "Clear All Nuget Cache(s)"...
Read more >Unable to find package, No packages exist in the nuget
Unable to find package, No packages exist in the nuget · Go to location %appdata%\Nuget on the machine and see Nuget. · If...
Read more >[Solved] "E: Unable to locate package" Error on Ubuntu
Fixing 'Unable to locate package error' on Ubuntu · 1. Check the package name (no, seriously) · 2. Update the repository cache ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi again @pinoli Good, I’m glad you were able to sort out all of the library issues.
If you look at this class: https://github.com/leonardoporro/Detached-Mapper/blob/main/src/Detached.Mappers.EntityFramework/Context/EntityFrameworkMapperContext.cs
There is a OnMapperAction method, it receives the entity, the DTO, the key and a MapperActionType: Load/Create/Update/Delete. For Load, a full query is run, in this state, all the entities should be in the ChangeTracker. For the mutation actions, detached tries to get the entity from the change tracker or create a new one, and set the EntityState. That is what you would normally do manually. I think that you could customize this class to suite your needs, but I need to re-read your sample to tell you exactly what (will do later). Once you have your customized mapper context, it can be passed to the mapper class without modifying the library. Take a look at https://github.com/leonardoporro/Detached-Mapper/blob/main/src/Detached.Mappers.EntityFramework/Extensions/DbContextExtensions.cs, line 30 to see how.
Anyway Detached does a kind of upsert, need to read your sample later to see why doesn’t work, my brain is burnt out now.
I think that Id is working ok, check my previous comment. Would be possible to change the property type to List<> ?