Open Closed

SQL View as ABP entity so I can access as repository? #517


User avatar
0
joe@tronactive.com created
  • ABP Framework version: v3.1.0
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): no

I have a view in the DB and a class that I have no problem adding to my DBContext and accessing through a different entity reposittory through the dbsets. But I want to create a repository specifically for this view. But I am unsure the best method for it.

I was thinking just base : Entity with no ID but I have to use a composit keys then and technically I do not have any setup. Any suggestions would be greatly appreciated. Thank you


4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I will check it out.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    See https://docs.microsoft.com/en-us/ef/core/modeling/keyless-entity-types?tabs=data-annotations#example. may it will work for you.

  • User Avatar
    0
    joe@tronactive.com created

    Thank you for the suggestion, I can do it that way but I want it to work like a ABP entity and work wth ABPs repository system.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I made an exmaple for you: https://github.com/realLiangshiwei/Qa517. It integrates seamlessly with ABP.

    See also: https://github.com/abpframework/abp-samples/tree/master/StoredProcedureDemo. ABP provide an example that explaining how to call stored procedures, views and functions

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11