Skip to content

Commit cfa7a0e

Browse files
Update comments
Co-authored-by: Frédéric Delaporte <[email protected]>
1 parent 9ceedea commit cfa7a0e

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

src/NHibernate/ISession.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public static ITransaction GetCurrentTransaction(this ISession session)
5454
/// if there is no such persistent instance. (If the instance, or a proxy for the instance, is
5555
/// already associated with the session, return that instance or proxy.)
5656
/// </summary>
57+
/// <param name="session">The session.</param>
58+
/// <param name="entityName">The entity name.</param>
59+
/// <param name="id">The entity identifier.</param>
60+
/// <param name="lockMode">The lock mode to use for getting the entity.</param>
61+
/// <returns>A persistent instance, or <see langword="null" />.</returns>
5762
public static object Get(this ISession session, string entityName, object id, LockMode lockMode)
5863
{
5964
return
@@ -68,6 +73,12 @@ public static object Get(this ISession session, string entityName, object id, Lo
6873
/// if there is no such persistent instance. (If the instance, or a proxy for the instance, is
6974
/// already associated with the session, return that instance or proxy.)
7075
/// </summary>
76+
/// <typeparam name="T">The entity class.</typeparam>
77+
/// <param name="session">The session.</param>
78+
/// <param name="entityName">The entity name.</param>
79+
/// <param name="id">The entity identifier.</param>
80+
/// <param name="lockMode">The lock mode to use for getting the entity.</param>
81+
/// <returns>A persistent instance, or <see langword="null" />.</returns>
7182
public static T Get<T>(this ISession session, string entityName, object id, LockMode lockMode = null)
7283
{
7384
return (T) session.Get(entityName, id, lockMode);

src/NHibernate/IStatelessSession.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ public static ITransaction GetCurrentTransaction(this IStatelessSession session)
3333
=> session.GetSessionImplementation().ConnectionManager.CurrentTransaction;
3434

3535
//NOTE: Keep it as extension
36+
/// <summary>
37+
/// Return the persistent instance of the given entity name with the given identifier, or null
38+
/// if there is no such persistent instance. (If the instance, or a proxy for the instance, is
39+
/// already associated with the session, return that instance or proxy.)
40+
/// </summary>
41+
/// <typeparam name="T">The entity class.</typeparam>
42+
/// <param name="session">The session.</param>
43+
/// <param name="entityName">The entity name.</param>
44+
/// <param name="id">The entity identifier.</param>
45+
/// <param name="lockMode">The lock mode to use for getting the entity.</param>
46+
/// <returns>A persistent instance, or <see langword="null" />.</returns>
3647
public static T Get<T>(this IStatelessSession session, string entityName, object id, LockMode lockMode = null)
3748
{
3849
return (T) session.Get(entityName, id, lockMode);

src/NHibernate/Impl/SessionImpl.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,11 +1187,7 @@ public object Get(System.Type clazz, object id, LockMode lockMode)
11871187
return Get(clazz.FullName, id, lockMode);
11881188
}
11891189

1190-
/// <summary>
1191-
/// Return the persistent instance of the given entity name with the given identifier, or null
1192-
/// if there is no such persistent instance. (If the instance, or a proxy for the instance, is
1193-
/// already associated with the session, return that instance or proxy.)
1194-
/// </summary>
1190+
/// <inheritdoc />
11951191
public object Get(string entityName, object id, LockMode lockMode)
11961192
{
11971193
using (BeginProcess())

0 commit comments

Comments
 (0)