Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Aaron 57 posts 405 karma points MVP c-trib
    Sep 08, 2022 @ 07:50
    Aaron
    0

    Konstruct with custom service / api

    Is it possible to use Konstruct with a custom / service api?

    I'm adding an integration to Fresh Desk onto my site, so it's a very simple api which in a lot of ways is similar to a basic database table structure. Would it be possible to consume this service with Konstruct in place of the database?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Sep 08, 2022 @ 08:04
    Matt Brailsford
    100

    Hey Aaron,

    Yes you can. Take a look at repositories documentation here https://docs.getkonstrukt.net/advanced/repositories

    Top level you can implement your own repository and tell Konstrukt to use that instead and so this way you can work with any data source, not just the database.

    Hope this helps

    Matt

  • Aaron 57 posts 405 karma points MVP c-trib
    Sep 08, 2022 @ 08:05
    Aaron
    0

    Perfect, just what I needed!

    Thanks Matt!

  • Aaron 57 posts 405 karma points MVP c-trib
    Sep 08, 2022 @ 08:53
    Aaron
    0

    One more question Matt... This ticket system uses long for the ids and not int...

    Is it possible to change the repository to use long?

    enter image description here

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Sep 08, 2022 @ 09:31
    Matt Brailsford
    0

    Hey Aaron,

    Yup, you'll want to change the type of the second generic argument passed to the KonstruktRepository<TEntity, TId> base class to long.

    public class TicketRepository : KonstruktRepository<Ticket, long>
    {
        // Base class implementation here
    }
    

    Matt

  • Aaron 57 posts 405 karma points MVP c-trib
    Sep 08, 2022 @ 09:34
    Aaron
    0

    Perfect!

    That was easy 👍

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Sep 08, 2022 @ 09:35
    Matt Brailsford
    0

    I aim to please 😁

Please Sign in or register to post replies

Write your reply to:

Draft