Raw SQL queries & stored procedures in Entity Framework Core

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

Комментарии • 7

  • @cissemy
    @cissemy 8 месяцев назад +2

    Great.
    How to create the pagination version of stored procedure ?

    • @RoundTheCode
      @RoundTheCode  8 месяцев назад +2

      You can use OFFSET in newer versions of SQL Server. I would pass in the skip and take as parameters. Use the skip for the OFFSET and for the take, you can maybe use SELECT TOP @Take FROM...
      Haven't tried it though. Here is some info about OFFSET in SQL Server to help you.
      www.red-gate.com/simple-talk/databases/sql-server/t-sql-programming-sql-server/paging-data-in-t-sql/

    • @MykolaEp
      @MykolaEp 5 месяцев назад

      How to pass parameters for query for operation WHERE StatusOfProduct IN ("InStock", "Ordered") and count of parameter are different for each request and comes from UI filter? First request ("InStock", "Ordered"), another request - ("InStock", "Ordered", "OutOfStock"), third ("Ordered").

  • @Tamer_Ali
    @Tamer_Ali 8 месяцев назад

    Thanks a lot for the useful video
    Can we use DTO class instead of existing entity with FromSqlRaw ?

    • @RoundTheCode
      @RoundTheCode  8 месяцев назад

      I don't think that would work as the SQL statement is sent to the database for querying. A DTO won't have any direct relationship with the database, so that's where it won't work.

  • @antoniatromp2827
    @antoniatromp2827 7 месяцев назад

    😄 Promo>SM