Customize context.service.ts

Hi ,
Is it possible for us to modify or create an additional .service.custom.ts where we can add some custom metods. ?

I have database tabels without a primary key definend , the key fields are definend conceptual, Radzen wont generate the getTablebyId services for these tables.

I'm not sure if I have asked the right question , hope you understand.

Best regards

If you don't have primary keys not sure how you get record by Id. Ifgenerated methods are not suitable for your case you can use custom method:

What I ment was : Table has key field but not marked as a key in the database ( that is how they designed the database ).

I want the custom mehtod to return the entire record in a way that Radzen can handle like the return type from the reqular getById methods generated.

This is not possible because TypeScript does not support partial classes or classes defined in multiple files.

Even if you add a custom function to that file Radzen won't see it design time. You can try creating a stored procedure that retrieves the item by id. However without a primary key constrain't none of Radzen's CRUD features will work. The primary key is crucial.

1 Like