© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
4 replies
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();
     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>();
 modelBuilder.Entity<ScrapedUser>()
   .Property(su => su.LastProcessed)
   .HasConversion<long>();
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Npgsql.PostgresException
C#CC# / help
2y ago
Npgsql 8.0 + EFCore 8.0 + JSON Colums with type List<T> not working
C#CC# / help
3y ago
SQL EFCore
C#CC# / help
2y ago
❔ efcore querying
C#CC# / help
3y ago