partial void DeleteWorkflowScheme(WorkflowScheme instance);
partial void InsertWorkflowScheme(WorkflowScheme instance);
partial void UpdateWorkflowScheme(WorkflowScheme instance);
public ActionResult Edit(SettingsModel model) { using (var context = new DataModelDataContext()) { var wfSheme = context.WorkflowSchemes.FirstOrDefault(c => c.Code == "SimpleWF"); if(wfSheme == null) { wfSheme = new WorkflowScheme() { Code = "SimpleWF", Scheme = string.Empty }; context.WorkflowSchemes.InsertOnSubmit(wfSheme); } wfSheme.Scheme = model.WFSchema ?? string.Empty; model.WFSchema = wfSheme.Scheme; context.SubmitChanges(); } return View(GetModel()); }