-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (32 loc) · 908 Bytes
/
Program.cs
File metadata and controls
36 lines (32 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Transactions;
using FluentNHibernate.Conventions.Inspections;
using FluentNHibernateExample.Models;
namespace FluentNHibernateExample
{
class Program
{
public static void Main(string[] args)
{
using (var session = NHibernateHelper.GetSession())
{
using (var transaction = session.BeginTransaction())
{
var product = new Product()
{
Id = 10,
Name = "Hi",
Units = 2,
Price = 3,
};
session.Save(product);
transaction.Commit(); // Commit transaction
}
}
}
}
}