Search found 126 matches

by bairog
Wed 13 Oct 2021 11:58
Forum: dotConnect for SQLite
Topic: Entity Framework Core VNext support status
Replies: 6
Views: 34231

Re: Entity Framework Core VNext support status

Hello again.
What is estimated timeframe for supporting EF Core 6.0 (RC2 was released and is supported in production)?
Thank you.
by bairog
Wed 27 Jan 2021 12:25
Forum: dotConnect for SQLite
Topic: How to use .NET Framework 4.8 class library (that uses Devart.Data.SQLite.EF6 provider) in .NET 5.0 WinForms application
Replies: 2
Views: 17826

Re: How to use .NET Framework 4.8 class library (that uses Devart.Data.SQLite.EF6 provider) in .NET 5.0 WinForms applica

Shalex wrote: Tue 26 Jan 2021 15:48Therefore, we recommend you to use the same approach as other developers - in parallel, maintain 2 versions of the library for the .NET Framework and for .NET Standard / .NET Core / .NET 5.
Is it possible to have only one version of my library that target .NET Standard 2.0 (so it can be consumed from both .NET Framework 4.8 and .NET Core 3.1/.NET 5.0 applications)?

UPDATE I see now that your NuGet package targets .NET Standard 2.1.
Obviously because Entity Framework 6.4.4 targets .NET Standard 2.1 (and it is not going to target .NET Standard 2.0).
Looks like it is not going to have new versions at all.
So the only option to support both .NET Framework 4.8 and .NET Core 3.1/.NET 5.0 in a class library - is multi-targetting.
by bairog
Mon 25 Jan 2021 12:43
Forum: dotConnect for SQLite
Topic: How to use .NET Framework 4.8 class library (that uses Devart.Data.SQLite.EF6 provider) in .NET 5.0 WinForms application
Replies: 2
Views: 17826

How to use .NET Framework 4.8 class library (that uses Devart.Data.SQLite.EF6 provider) in .NET 5.0 WinForms application

Hello.
I have .NET Framework 4.8 class library that uses Devart.Data.SQLite.EF6 provider (obtained via windows installer). It's was used for a couple of years in many .NET Framework 4.8 GUI applications.
Now we are moving forward to .NET 5.0 and creating some .NET 5.0 applications. But when I've tried to use .NET Framework 4.8 class library in .NET 5.0 WinForms application - I received an error:
Method not found: 'System.String System.AppDomainSetup.get_LicenseFile()'
Specific line of code that raises this exception is:

Code: Select all

SQLiteProviderFactory.Instance.CreateConnection();
Looks like it is a runtimes combination problem.
I cannot retarget class library from .NET Framework 4.8 to .NET 5.0 - there are lots of .NET Framework 4.8 applications that uses that class library.
I cannot use EF Core 5.0 instead of EF6.4.4 because it lacks Entity splitting support (it is used in our class library).
So how can I solve that problem?
by bairog
Thu 22 Oct 2020 12:15
Forum: dotConnect for SQLite
Topic: Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity.EF6
Replies: 9
Views: 8233

Re: Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity

Shalex wrote: Thu 22 Oct 2020 09:32Our implementation in dotConnect for SQLite avoids generation of OUTER APPLY if it is possible, but some LINQ queries cannot be translated without employing OUTER APPLY. In this case, you should rewrite your LINQ statement.
Let's clarify: Devart.Data.SQLite.Entity.EFCore.dll is able to translate my LINQ query to SQL without OUTER APPLY, but Devart.Data.SQLite.Entity.EF6.dll cannot do the same thing?
Shalex wrote: Thu 22 Oct 2020 09:32Different versions of ORMs (EF6 and EF Core) translate similar queries in different ways. EF6 is more likely to try to generate an OUTER APPLY that is not supported in SQLite.
Do you mean that the LINQ-to-SQL translation bug (gereration of OUTER APPLY when specific DBMS doesn't support it) is located inside EF6 codebase (EntityFramework.dll) and you provider can do nothing with that (change that behavoir)?
by bairog
Mon 19 Oct 2020 13:34
Forum: dotConnect for SQLite
Topic: Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity.EF6
Replies: 9
Views: 8233

Re: Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity

Shalex wrote: Mon 19 Oct 2020 09:50 If each role always has at least one user, then you can get by with 1 request:

Code: Select all

      var users = DbAccess.ActiveContext.Users
          .Include(u => u.UserRole)
          .Include(u => u.Messages)
          .Include(u => u.Pictures)
          .ToList();

      var userRoles = users.Select(u => u.UserRole).Distinct().ToList();
As I can see in your code you avoid using TEntity.Select() inside IQueryable<T>.Include() method (it is one of accepted ways of loading multiple levels of related entities in EF6 according to Microsoft docs - Eagerly loading multiple levels section).
That was the cause of the problem (that leads to the {"OUTER APPLY is not supported by SQLite."} exception)?
Is that a limitation of SQLite engine itself or it is Devart provider bug?

P. S. In EF Core 3.1.9 I can get all I need in one query using ThenInclude method:

Code: Select all

context.UserRoles.Include(ur => ur.Users).ThenInclude(u => u.Messages)
.Include(ur => ur.Users).ThenInclude(u => u.Pictures).ToList();
So that problem is not a limitation of SQLite engine itself..
by bairog
Tue 06 Oct 2020 10:37
Forum: dotConnect for SQLite
Topic: Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity.EF6
Replies: 9
Views: 8233

Re: Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity

Shalex wrote: Mon 05 Oct 2020 16:55If navigation property is null, lazy loading is disabled (correct behavior).
I was mistakenly thinking that disabling Lazy Loading will result in Explicit Loading.
Shalex wrote: Mon 05 Oct 2020 16:55Could you try to rewrite your LINQ query to avoid generation of OUTER APPLY?
What exactly do you mean? In my query with Eager Loading

Code: Select all

var userRoles = DbAccess.ActiveContext.UserRoles.AsNoTracking().Include(ur => ur.Users.Select(us => us.Messages))
                .Include(ur => ur.Users.Select(us => us.Pictures)).ToList();
I simply want to get all UserRoles with all chidren Users and grand children entities Messages and Pictures. As far as I know that query is the only way to get all that entites. Am I wrong?
by bairog
Mon 28 Sep 2020 08:51
Forum: dotConnect for SQLite
Topic: Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity.EF6
Replies: 9
Views: 8233

Disabling Lazy loading in not working (and Eager loading multiple same-leveled entites) in Devart.Data.SQLite.Entity.EF6

Hello.
Assume we have the following entities:

Code: Select all

public class UserRole
    {
        public Guid Id { get; set; }
        public String Name { get; set; }
        public virtual IList<User> Users { get; set; }
    }
    public class User
    {
        public Guid Id { get; set; }
        public String Name { get; set; }
        public Guid UserRoleId { get; set; }
        public virtual UserRole UserRole { get; set; }
        public virtual IList<Message> Messages { get; set; }
        public virtual IList<Picture> Pictures { get; set; }
    }
    public class Message
    {
        public Guid Id { get; set; }
        public String Text { get; set; }
        public Guid UserId { get; set; }
        public virtual User User { get; set; }
    }
    public class Picture
    {
        public Guid Id { get; set; }
        public String Name { get; set; }
        public Guid UserId { get; set; }
        public virtual User User { get; set; }
    } 
I'm trying to load all data from database (including all related entites).
First I've tried to disable Lazy loading:

Code: Select all

DbAccess.ActiveContext.Configuration.LazyLoadingEnabled = false;
            var userRoles = DbAccess.ActiveContext.UserRoles.AsNoTracking().ToList();
But userRoles.Users is null (looks like Lazy loading still working despite of my configuration setting).
After that I've tried Eager loading:

Code: Select all

var userRoles = DbAccess.ActiveContext.UserRoles.AsNoTracking().Include(ur => ur.Users.Select(us => us.Messages))
                .Include(ur => ur.Users.Select(us => us.Pictures)).ToList();
but I've got an exception
{"OUTER APPLY is not supported by SQLite."}
Sample project I've uploaded here (I'm using Devart.Data.SQLite.Entity.EF6 5.15.1587)
Click FillDatabase button first to create database (on disk D).
by bairog
Mon 21 Sep 2020 06:19
Forum: dotConnect for SQLite
Topic: Entity Framework Core VNext support status
Replies: 6
Views: 34231

Entity Framework Core VNext support status

Hello.
As far as I can see latest Devart.Data.SQLite.EFCore 5.16.1730 doesn't support Entity Framework Core 5.0 (it depends on Microsoft.EntityFrameworkCore.Relational (>= 3.1.8 && < 3.2.0)).
What is timeframe for supporting EF Core 5.0 (RC1 was released a week ago and it is supported in production)?
I'm especially interested in SQLite table rebuilds which is there since EF Core 5.0 preview 8 and negates all SQLite migration limitations according the docs.
Thank you.
by bairog
Thu 27 Feb 2020 06:06
Forum: dotConnect for SQLite
Topic: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)
Replies: 10
Views: 9403

Re: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)

Shalex wrote: Tue 25 Feb 2020 16:24No, the fix was implemented after releasing the public build. Contact us and specify your email used when registering the product for getting the internal build.
I've obtained and tested internal build (5.15.1587) - everything is working as expected. Looking forward for a public build.

P. S. If it's possbile - please update DbMonitor as well to show milliseconds for a DateTime on Parameters tab. It will be very helpfull for debugging in future. Many thanks.
by bairog
Fri 21 Feb 2020 04:55
Forum: dotConnect for SQLite
Topic: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)
Replies: 10
Views: 9403

Re: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)

Hello again.
Any progress for now - maybe in latest build (v.5.15.1583)?
by bairog
Thu 13 Feb 2020 05:39
Forum: dotConnect for SQLite
Topic: Entity Framework 6.3 + .NET Core 3 support status
Replies: 13
Views: 8816

Re: Entity Framework 6.3 + .NET Core 3 support status

reredev wrote: Wed 12 Feb 2020 17:01protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{

optionsBuilder.UseDB2(@"server=xxxx:446;Database=xxxx;UserID=xxxx;Password=xxxx;");
}
As far as I know for .Net Core/.NET Standart libraries License Key should be passed in a connection string.
by bairog
Thu 09 Jan 2020 07:32
Forum: dotConnect for SQLite
Topic: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)
Replies: 10
Views: 9403

Re: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)

Shalex wrote: Fri 06 Dec 2019 19:10Thank you for your report. We have reproduced the issue and are investigating it. We will notify you about the result.
Happy new year and merry christmas.
Any progress for now? More than a month has passed..
by bairog
Sat 07 Dec 2019 05:29
Forum: dotConnect for SQLite
Topic: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)
Replies: 10
Views: 9403

Re: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)

Shalex wrote: Fri 06 Dec 2019 19:10 Thank you for your report. We have reproduced the issue and are investigating it. We will notify you about the result.
Thank you, waiting for a solution ASAP.

P.S. If it's possbile - update DbMonitor as well to show milliseconds for a DateTime on Parameters tab. It will be very helpfull for debugging in future. Many thanks.
by bairog
Wed 04 Dec 2019 16:44
Forum: dotConnect for SQLite
Topic: WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)
Replies: 10
Views: 9403

WHERE clause compares dates with milliseconds incorrectly (EF6 Code-First)

Hello.
I use dotConnect for SQLite 5.14.1519 and EF 6.2.
My database has DateTime field with milliseconds like following:
Image

And I'm selecting items that are for example < DateTime.Parse("06.11.2019 1:00:00.020") and >= DateTime.MinDate.
When I select them using WHERE clause in Linq to Entities it works incorrectly and return me 1 item,
when cast ToList() first and then use WHERE clause in Linq to Objects - it works correctly and return me 2 items.

Code: Select all

//values is IQueryable<>
//maxDate is for example DateTime.Parse("06.11.2019 1:00:00.020")
//minDate is for example DateTime.MinDate

//WHERE INSIDE LINQ TO ENTITES IS NOT WORKING CORRECTLY (1 VALUE IS RETURNED INSTEAD OF 2)
var summableFieldsList1 = values.Where(v => (v.HistoricalMomentDate.CompareTo(maxDate) < 0) && (v.HistoricalMomentDate.CompareTo(minDate) >= 0)).ToList();

//CAST TO LIST FIRST AND THEN WHERE INSIDE LINQ TO OBJECTS IS WORKING CORRECTLY (2 VALUES ARE RETURNED)
var summableFieldsList = values.ToList().Where(v => (v.HistoricalMomentDate.CompareTo(maxDate) < 0) && (v.HistoricalMomentDate.CompareTo(minDate) >= 0)).ToList();
DbMonitor cannot help me because it doesn't show milliseconds on Parameters tab.
Image

I've uploaded my code to run as-is here - line 120 ans 123 in SysTypesDB.SQLITE.EF\LogBookStorage.cs. Sorry for too much code - just copy-pasted a part from my project :).