Can not resolve Symbol "ForSqliteHasDefaultValueSql" - entity-framework

I want to define a Timestamp in my EF Core Project with SQLite and wanted to use this function:
Click
I know that this function seems to be in the classic EF and maybe it is not available anymore but 3 days ago I found the right package and the extension method that I was searching. Unfortunatelly I had another problem with the code and reverted everything and now I do not find the right package anymore. It was during a hackathon during the last hours, so i really do not remember how I got it to work :/
Does anybody know which nuget package has this method? The only thing that I am referencing is Microsoft.EntityFrameworkCore.Sqlite. I allready tried the .Core and the classic EF dependencies and some random third party sqlite/ef packages, but I still can not compile this extension method :(

As you can see from the link, this method applies to EF Core versions 1.0 and 1.1.
Starting from v2.0, most of the provider specific ForAbcXyz methods have been replaced with the generic Xyz methods.
So the method you are looking for is HasDefaultValueSql. If you support multiple databases, use it inside a block enclosed with
if (Database.IsSqlite())
{
// ...
}

Related

.NET Standard 2.0 / EntityFrameworkCore / DB2 / IBM.EntityFrameworkCore issue

Does anyone here has experience with IBM.EntityFrameworkCore package? I've created a .NET Standard 2.0 library project in VS2017, added mentioned package, and tried to make it work by following this and this tutorial from IBM website, with no luck. I get the project compiled, but at the runtime I'm getting a System.TypeLoadException with the following message:
Method 'ApplyServices' in type 'IBM.EntityFrameworkCore.Infrastructure.Internal.Db2OptionsExtension' from assembly 'IBM.EntityFrameworkCore, Version=1.1.1.101, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation.
Any help will be appreciated!
Thanks!
Update: The exception happens as soon as I try to use the context. It means after the context is successfully created, but before DbContext.OnConfiguring call happens.
I've solved it. It turned out that this exception happens if actual entity types (i.e. MyType) aren't defined in the same assembly (project) as the context. In my solution I had entity types defined in one project, and DbContextdefined in a different project, that references the first one, of course.
The reason for me to have such design was in the fact that there are two different packages (depending on the actual OS): IBM.EntityFrameworkCore and IBM.EntityFrameworkCore-lnx. So I've created two different projects, each referencing one of these packages. Still, I wanted to have all the entity types defined once... But obviously it cannot work like that.
Update: Sadly, it turned out that this isn't the only issue. I've ran into another one, described here. Thumbs down for DB2 .NET team! It's always frustrating to work with...

Build error after updating framework xcode8

I've just converted my app to Swift 3, and as part of this I have updated the well known "Charts" framework. All of my converted code is fine and building/testing well, so I have no concerns about that.
I have embedded the binary to use the framework after unlinking the old one, cleaned the project, built the project before trying to use any framework code, and cleared derived data.
However I still get a "ChartViewDelegate" is not available, cannot
find swift declaration for this protocol.
This is odd to me, as the Charts module imports fine, and autocomplete recognised all member classes of the framework. Also, it doesn't seem to be an issue with the framework, as when implementing the framework on a "fresh" project, it works perfectly as expected.
I'm at a loss of what to try next, apart from rewriting an entire app into a fresh project where I know the framework works. The framework is an integral part of the app. Thanks!
EDIT: I have already tried cleaning/clearing derived data.
I've been having this problem recently with any frameworks I added to my project manually. I fixed this by totally removing the offending frameworks and then installing via cocoa pods.

Updated to EF 4.2. Then what?

Ok, so I installed EF 4.2 from NuGet. Just did Install-Package EntityFramework. That's all I've done.
Now what?
How do I know I'm using the new Framework and not the old one.
I have an existing project previously with EF 4.0. I'm also using precompiled views and custom text templates. Everything looks exactly the same after I did the update.
There will be no change in existing project. EFv4.2 contains code first mapping approach and DbContext API - neither of those affects existing EFv4.0 projection. It also contains few minor helpers like strongly typed Include but you must use them in your code. That is not something that will magically change existing code.

References to LOGNS in Microsoft Enterprise Library Code

I inherited a small Microsoft Enterprise Library project that supposedly worked a couple of months ago. From what I can tell, it has code that was lifted directly from the Enterprise Library source (?!) instead of linking the built DLLs.
Sigh.
So, there are classes that don't compile in the Microsoft.Practices.ENterpriseLibrary.* namespaces. There's a reference to a cryptic LOGNS namespace which has a static LogHelper class with a bunch of Log* methods.
I can't figure anything out about this class, other than that it's missing (and trivial to stub out), but I'm concerned that I may be missing some references (in my GAC?) or something.
This is one trivial error out of several; I have a feeling this code did work (since it's ten projects in a solution), and only that I'm missing something locally.
But what?
There's no such namespace or class in Enterprise Library. Sounds like you didn't get all the source code.
Well, no current versions - any idea what version of Entlib you're dealing with?

System.Data.MetadataException - seems more stubborn than most people's

I have gone through this post and the links, and still can't solve my issue.
I have changed my config to name the assembly, but it makes no odds.
We recently moved the projects and think that might be an issue - but how to solve it if so. I don't quite understand how EF when running finds the cdsl etc. files I thought they were embedded in the dll [it is set to do so]?
The service having the issue doesn't directly use EF itself, it uses another DLL which DOES. I also added a direct ref to the DLL but no joy.
Also, the same code (the dll that contains the functionality, not the wrapper service) using the same connections strings works fine in my system test project via the IDE.
Turned out to be down to incorrect initialisation of StructureMap and not really to do with EF itself.