IT:AD:LinqPad:HowTo:Insert Or Update Data

Summary

Most uses of LinqPad is to Query/Select records.

But it can be used to update records as well.

You just need to know about the InsertOnSubmit extension method and globally available 'SubmitChanges` method.

void Main()
{
	XActLib_MessageTag x = new XActLib_MessageTag(){Id=Guid.NewGuid(), Enabled=true,Order=0,Name="Foo"};
	XActLib_MessageTags.InsertOnSubmit(x);
	SubmitChanges();
	
	XActLib_MessageTags.Dump();
}

  • /home/skysigal/public_html/data/pages/it/ad/linqpad/howto/insert_or_update_data.txt
  • Last modified: 2023/11/04 01:48
  • by 127.0.0.1