.NET Override Create and return data

.NET Override Create and return data

QuillSecurityQuillSecurity Posts: 3Questions: 2Answers: 0

I'm using .NET Core 3.1 with Entity Framework and Datatables for CRUD operations on some of the tables. The editor works perfectly, however with the Create I'd like to override the create method to create the item via Entity Framework then return the data like usual to the datatable.

I can accomplish this with the PreCreate event it seems, however, I'm not sure how I would cancel the edtior's create and just refresh the SQL data to return. Can someone point me in the right direction to accomplish this?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 52,268Questions: 1Answers: 7,958 Site admin
    Answer ✓

    If you are looking to use EF, I would suggest bypassing our provided libraries entirely - I think they will just get in the way, since they use an ADO.NET connection and there is no way to tell it that you are going to replace its SQL updates with something else.

    You might be able to use the DtRequest class from it (to decode the Editor HTTP request into a .NET class), but I would suggest nothing else.

    The client / server data interchange is documented here if you do go down this route.

    Allan

  • QuillSecurityQuillSecurity Posts: 3Questions: 2Answers: 0

    Alan, thanks for the response. I was able to accomplish what I need just by specifying the ajax for create to be a different controller action, then trigger ajax.reload() after success. The data is easy enough to get from the request Form.

Sign In or Register to comment.