Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. private void InsertIntoDatabase (ICollection<PricelistEntry> entries) {
  2.             using (var session = _sessionFactory.OpenSession ())
  3.             using (var transaction = session.BeginTransaction ()) {
  4.                 foreach (var entry in entries) {
  5.                     session.SaveOrUpdate (entry);
  6.                 }
  7.                 transaction.Commit ();
  8.             }
  9.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement