Page 1 of 1

insertonsubmit in entityframework

Posted: Sat 04 May 2013 14:47
by nicck
I'm trying to convert this sample to entityframework.
I dont get the insertonsubmit and deleteonsubmit in entity.
http://scheduler-net.com/docs/simple_.n ... duler.html
please help with the controller part.

switch (action.Type)
{
case DataActionTypes.Insert: // your Insert logic
context.Events.InsertOnSubmit(updatedEvent);
break;
case DataActionTypes.Delete: // your Delete logic
updatedEvent = context.Events.SingleOrDefault(ev => ev.id == updatedEvent.id);
context.Events.DeleteOnSubmit(updatedEvent);
break;
default:// "update" // your Update logic
updatedEvent = context.Events.SingleOrDefault(
ev => ev.id == updatedEvent.id);
UpdateModel(updatedEvent);
break;
}

Re: insertonsubmit in entityframework

Posted: Tue 14 May 2013 11:26
by Shalex
Please specify the template (and its non-default settings) you are using in your Entity Framework model.