Hi,
View, Insert, update work fine however I cannot get the delete to work exception [The instance is transient]. I copied the code from an example.
See attached file.
Thanks
Mark Brewer
View, Insert, update work fine however I cannot get the delete to work exception [The instance is transient]. I copied the code from an example.
See attached file.
Thanks
Mark Brewer
6 Answers, 1 is accepted
0
Hi Mark,
From the provided information it seems that you are trying to delete object that is not part of the context due to the way you are creating new Customer from the received ViewModel. In current case I would suggest to use the approach demonstrated in the following help topic:
Regards,
Vladimir Iliev
Telerik
From the provided information it seems that you are trying to delete object that is not part of the context due to the way you are creating new Customer from the received ViewModel. In current case I would suggest to use the approach demonstrated in the following help topic:
Regards,
Vladimir Iliev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
MarkBr
Top achievements
Rank 2
answered on 23 Apr 2014, 01:09 PM
I created the same table as per the example you referenced and it work fine except it is not using Kendo Grid with Ajax. I took the original code from an example and all works well except the delete. As I an new to asp.net mvc and Kendo I am a bit lost. I have googled quite a bit to try to find other examples and have failed to find any others.
Can you point me to an example using Fluent OpenAccess, UI for Asp.Net MVC?
Can you point me to an example using Fluent OpenAccess, UI for Asp.Net MVC?
0
Hi Mark,
Could you please provide runable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.
Kind Regards,
Vladimir Iliev
Telerik
Could you please provide runable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.
Kind Regards,
Vladimir Iliev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
MarkBr
Top achievements
Rank 2
answered on 07 May 2014, 10:59 AM
Hi Vladimir,
Please find attached solution. I had to remove all the binaries and Kendo scripts.
Best regards,
Mark Brewer
Please find attached solution. I had to remove all the binaries and Kendo scripts.
Best regards,
Mark Brewer
0
Accepted
Hello Mark,
The exception is thrown because the object used for the Delete method is not attached to the context. You should use an attached object for the Delete method e.g.
Regards,
Daniel
Telerik
The exception is thrown because the object used for the Delete method is not attached to the context. You should use an attached object for the Delete method e.g.
public
ActionResult Customers_Destroy([DataSourceRequest] DataSourceRequest request, Customer customer)
{
if
(ModelState.IsValid)
{
using
(var vwVortex =
new
FluentModel())
{
var entity = vwVortex.AttachCopy(customer);
vwVortex.Delete(customer);
vwVortex.SaveChanges();
}
Regards,
Daniel
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
MarkBr
Top achievements
Rank 2
answered on 10 May 2014, 09:51 AM
Sorted thanks Daniel