C#C
C#3y ago
Kroks

❔ EFCore NPGSQL: Date exception

Unhandled exception. Npgsql.PostgresException (0x80004005): 42883: function date_part(unknown, bigint) does not exist


When executing this piece of code:
     var users = ctx.ScrapedUsers
         .Where(user => user.Parents.Any(x => x.Id == target.Id) && user.StatusesCount > 0 && user.ScreenName != null
          && !ctx.Profiles
             .Where(x => x.Id == Context.Profile.Id)
             .Take(1)
             .Any(x => x.ProcessedUsers.Any(x => x.Id == user.Id)) && user.LastProcessed.Year == 1970)
         .OrderBy(user => user.LastProcessed)
         .Take(processingCount - scrapedUsers.Count)
         .ToList();


in context I have thise
 modelBuilder.Entity<ScrapedUser>()
   .Property(su => su.LastProcessed)
   .HasConversion<long>();
Was this page helpful?