/// <summary> /// Adds Organization to DB and submit changes /// </summary> /// <param name="model"></param> public void Save(Organization model) { var db = _dataContext.GetTable<Organization>(); if(model.Id < 1) { db.InsertOnSubmit(model); } else { //Organization record = db.SingleOrDefault(x => x.Id == model.Id); db.Attach(model); //record = model; } db.Context.SubmitChanges(); }
partial void UpdateOrganization(Organization instance);
partial void DeleteOrganization(Organization instance);
partial void InsertOrganization(Organization instance);