Skip to content

Commit 9e8e631

Browse files
committed
Re-generate with latest version
1 parent 7e33de9 commit 9e8e631

38 files changed

+222
-76
lines changed
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by AsyncGenerator.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
11+
using System;
12+
using System.Collections;
13+
using NHibernate.Cache;
14+
using NHibernate.Cache.Entry;
15+
using NHibernate.Engine;
16+
using NHibernate.Event;
17+
using NHibernate.Id;
18+
using NHibernate.Mapping;
19+
using NHibernate.Metadata;
20+
using NHibernate.Persister.Entity;
21+
using NHibernate.Tuple.Entity;
22+
using NHibernate.Type;
23+
using NHibernate.Util;
24+
25+
namespace NHibernate.DomainModel
26+
{
27+
using System.Threading.Tasks;
28+
using System.Threading;
29+
/// <content>
30+
/// Contains generated async methods
31+
/// </content>
32+
public partial class CustomPersister : IEntityPersister
33+
{
34+
35+
#region IEntityPersister Members
36+
#region IOptimisticCacheSource Members
37+
38+
public Task<object[]> GetNaturalIdentifierSnapshotAsync(object id, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
39+
{
40+
try
41+
{
42+
return Task.FromResult<object[]>(null);
43+
}
44+
catch (Exception ex)
45+
{
46+
return Task.FromException<object[]>(ex);
47+
}
48+
}
49+
50+
public async Task<object> LoadAsync(object id, object optionalObject, LockMode lockMode, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
51+
{
52+
// fails when optional object is supplied
53+
Custom clone = null;
54+
Custom obj = (Custom)Instances[id];
55+
if (obj != null)
56+
{
57+
clone = (Custom)obj.Clone();
58+
TwoPhaseLoad.AddUninitializedEntity(session.GenerateEntityKey(id, this), clone, this, LockMode.None, false,
59+
session);
60+
TwoPhaseLoad.PostHydrate(this, id, new String[] {obj.Name}, null, clone, LockMode.None, false, session);
61+
await (TwoPhaseLoad.InitializeEntityAsync(clone, false, session, new PreLoadEvent((IEventSource) session),
62+
new PostLoadEvent((IEventSource) session), cancellationToken));
63+
}
64+
return clone;
65+
}
66+
67+
public Task LockAsync(object id, object version, object obj, LockMode lockMode, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
68+
{
69+
throw new NotSupportedException();
70+
}
71+
72+
public Task InsertAsync(object id, object[] fields, object obj, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
73+
{
74+
try
75+
{
76+
Instances[id] = ((Custom)obj).Clone();
77+
return Task.CompletedTask;
78+
}
79+
catch (Exception ex)
80+
{
81+
return Task.FromException<object>(ex);
82+
}
83+
}
84+
85+
public Task<object> InsertAsync(object[] fields, object obj, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
86+
{
87+
throw new NotSupportedException();
88+
}
89+
90+
public Task DeleteAsync(object id, object version, object obj, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
91+
{
92+
try
93+
{
94+
Instances.Remove(id);
95+
return Task.CompletedTask;
96+
}
97+
catch (Exception ex)
98+
{
99+
return Task.FromException<object>(ex);
100+
}
101+
}
102+
103+
public Task UpdateAsync(object id, object[] fields, int[] dirtyFields, bool hasDirtyCollection, object[] oldFields, object oldVersion, object obj, object rowId, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
104+
{
105+
try
106+
{
107+
Instances[id] = ((Custom)obj).Clone();
108+
return Task.CompletedTask;
109+
}
110+
catch (Exception ex)
111+
{
112+
return Task.FromException<object>(ex);
113+
}
114+
}
115+
116+
public Task<object[]> GetDatabaseSnapshotAsync(object id, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
117+
{
118+
try
119+
{
120+
return Task.FromResult<object[]>(null);
121+
}
122+
catch (Exception ex)
123+
{
124+
return Task.FromException<object[]>(ex);
125+
}
126+
}
127+
128+
public Task<object> GetCurrentVersionAsync(object id, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
129+
{
130+
try
131+
{
132+
return Task.FromResult<object>(Instances[id]);
133+
}
134+
catch (Exception ex)
135+
{
136+
return Task.FromException<object>(ex);
137+
}
138+
}
139+
140+
public Task<object> ForceVersionIncrementAsync(object id, object currentVersion, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
141+
{
142+
try
143+
{
144+
return Task.FromResult<object>(null);
145+
}
146+
catch (Exception ex)
147+
{
148+
return Task.FromException<object>(ex);
149+
}
150+
}
151+
152+
public Task ProcessInsertGeneratedPropertiesAsync(object id, object entity, object[] state, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
153+
{
154+
return Task.CompletedTask;
155+
}
156+
157+
public Task ProcessUpdateGeneratedPropertiesAsync(object id, object entity, object[] state, ISessionImplementor session, CancellationToken cancellationToken = default(CancellationToken))
158+
{
159+
return Task.CompletedTask;
160+
}
161+
162+
#endregion
163+
164+
#endregion
165+
}
166+
}

src/NHibernate.DomainModel/CustomPersister.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace NHibernate.DomainModel
1717
/// <summary>
1818
/// Summary description for CustomPersister.
1919
/// </summary>
20-
public class CustomPersister : IEntityPersister
20+
public partial class CustomPersister : IEntityPersister
2121
{
2222
private static readonly Hashtable Instances = new Hashtable();
2323
private static readonly IIdentifierGenerator Generator = new UUIDHexGenerator();

src/NHibernate.DomainModel/NHibernate.DomainModel.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
<Compile Include="AbstractProxy.cs" />
7979
<Compile Include="AssemblyInfo.cs" />
8080
<Compile Include="Assignable.cs" />
81+
<Compile Include="Async\CustomPersister.cs" />
8182
<Compile Include="B.cs" />
8283
<Compile Include="Bar.cs" />
8384
<Compile Include="BarProxy.cs" />

src/NHibernate/Async/Criterion/QueryOver.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public abstract partial class QueryOver<TRoot> : QueryOver, IQueryOver<TRoot>
6666
}
6767

6868

69-
Task<IList<TRoot>> IQueryOver<TRoot>.ListAsync(CancellationToken cancellationToken = default(CancellationToken))
69+
Task<IList<TRoot>> IQueryOver<TRoot>.ListAsync(CancellationToken cancellationToken)
7070
{ if (cancellationToken.IsCancellationRequested)
7171
{
7272
return Task.FromCanceled<
@@ -75,15 +75,15 @@ public abstract partial class QueryOver<TRoot> : QueryOver, IQueryOver<TRoot>
7575
}
7676
return ListAsync(cancellationToken); }
7777

78-
Task<IList<U>> IQueryOver<TRoot>.ListAsync<U>(CancellationToken cancellationToken = default(CancellationToken))
78+
Task<IList<U>> IQueryOver<TRoot>.ListAsync<U>(CancellationToken cancellationToken)
7979
{ if (cancellationToken.IsCancellationRequested)
8080
{
8181
return Task.FromCanceled<
8282
IList<U>>(cancellationToken);
8383
}
8484
return ListAsync<U>(cancellationToken); }
8585

86-
Task<int> IQueryOver<TRoot>.RowCountAsync(CancellationToken cancellationToken = default(CancellationToken))
86+
Task<int> IQueryOver<TRoot>.RowCountAsync(CancellationToken cancellationToken)
8787
{ if (cancellationToken.IsCancellationRequested)
8888
{
8989
return Task.FromCanceled<
@@ -99,7 +99,7 @@ public abstract partial class QueryOver<TRoot> : QueryOver, IQueryOver<TRoot>
9999
}
100100
}
101101

102-
Task<long> IQueryOver<TRoot>.RowCountInt64Async(CancellationToken cancellationToken = default(CancellationToken))
102+
Task<long> IQueryOver<TRoot>.RowCountInt64Async(CancellationToken cancellationToken)
103103
{ if (cancellationToken.IsCancellationRequested)
104104
{
105105
return Task.FromCanceled<
@@ -115,15 +115,15 @@ public abstract partial class QueryOver<TRoot> : QueryOver, IQueryOver<TRoot>
115115
}
116116
}
117117

118-
Task<TRoot> IQueryOver<TRoot>.SingleOrDefaultAsync(CancellationToken cancellationToken = default(CancellationToken))
118+
Task<TRoot> IQueryOver<TRoot>.SingleOrDefaultAsync(CancellationToken cancellationToken)
119119
{ if (cancellationToken.IsCancellationRequested)
120120
{
121121
return Task.FromCanceled<
122122
TRoot>(cancellationToken);
123123
}
124124
return SingleOrDefaultAsync(cancellationToken); }
125125

126-
Task<U> IQueryOver<TRoot>.SingleOrDefaultAsync<U>(CancellationToken cancellationToken = default(CancellationToken))
126+
Task<U> IQueryOver<TRoot>.SingleOrDefaultAsync<U>(CancellationToken cancellationToken)
127127
{ if (cancellationToken.IsCancellationRequested)
128128
{
129129
return Task.FromCanceled<

src/NHibernate/Async/Engine/Cascade.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace NHibernate.Engine
2121
{
2222
using System.Threading.Tasks;
2323
using System.Threading;
24-
using System;
2524

2625
/// <content>
2726
/// Contains generated async methods
@@ -162,7 +161,7 @@ public sealed partial class Cascade
162161

163162
return Task.CompletedTask;
164163
}
165-
catch (Exception ex)
164+
catch (System.Exception ex)
166165
{
167166
return Task.FromException<object>(ex);
168167
}
@@ -205,7 +204,7 @@ public sealed partial class Cascade
205204

206205
return Task.CompletedTask;
207206
}
208-
catch (Exception ex)
207+
catch (System.Exception ex)
209208
{
210209
return Task.FromException<object>(ex);
211210
}

src/NHibernate/Async/Engine/Collections.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace NHibernate.Engine
1818
{
1919
using System.Threading.Tasks;
2020
using System.Threading;
21-
using System;
2221
/// <content>
2322
/// Contains generated async methods
2423
/// </content>
@@ -48,7 +47,7 @@ public static partial class Collections
4847
return ProcessDereferencedCollectionAsync(coll, session, cancellationToken);
4948
}
5049
}
51-
catch (Exception ex)
50+
catch (System.Exception ex)
5251
{
5352
return Task.FromException<object>(ex);
5453
}
@@ -111,7 +110,7 @@ public static partial class Collections
111110
entry.CurrentKey = null;
112111
return PrepareCollectionForUpdateAsync(coll, entry, session.Factory, cancellationToken);
113112
}
114-
catch (Exception ex)
113+
catch (System.Exception ex)
115114
{
116115
return Task.FromException<object>(ex);
117116
}
@@ -131,7 +130,7 @@ public static partial class Collections
131130
entry.CurrentKey = entry.LoadedKey;
132131
return PrepareCollectionForUpdateAsync(coll, entry, session.Factory, cancellationToken);
133132
}
134-
catch (Exception ex)
133+
catch (System.Exception ex)
135134
{
136135
return Task.FromException<object>(ex);
137136
}
@@ -181,7 +180,7 @@ public static partial class Collections
181180

182181
return PrepareCollectionForUpdateAsync(collection, ce, factory, cancellationToken);
183182
}
184-
catch (Exception ex)
183+
catch (System.Exception ex)
185184
{
186185
return Task.FromException<object>(ex);
187186
}
@@ -241,7 +240,7 @@ public static partial class Collections
241240

242241
return Task.CompletedTask;
243242
}
244-
catch (Exception ex)
243+
catch (System.Exception ex)
245244
{
246245
return Task.FromException<object>(ex);
247246
}

src/NHibernate/Async/Event/Default/AbstractVisitor.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace NHibernate.Event.Default
1515
{
1616
using System.Threading.Tasks;
1717
using System.Threading;
18-
using System;
1918
/// <content>
2019
/// Contains generated async methods
2120
/// </content>
@@ -77,7 +76,7 @@ public abstract partial class AbstractVisitor
7776
return Task.FromResult<object>(null);
7877
}
7978
}
80-
catch (Exception ex)
79+
catch (System.Exception ex)
8180
{
8281
return Task.FromException<object>(ex);
8382
}
@@ -117,7 +116,7 @@ public abstract partial class AbstractVisitor
117116
{
118117
return Task.FromResult<object>(ProcessCollection(value, collectionType));
119118
}
120-
catch (Exception ex)
119+
catch (System.Exception ex)
121120
{
122121
return Task.FromException<object>(ex);
123122
}
@@ -139,7 +138,7 @@ public abstract partial class AbstractVisitor
139138
{
140139
return ProcessEntityPropertyValuesAsync(persister.GetPropertyValues(obj), persister.PropertyTypes, cancellationToken);
141140
}
142-
catch (Exception ex)
141+
catch (System.Exception ex)
143142
{
144143
return Task.FromException<object>(ex);
145144
}

src/NHibernate/Async/Event/Default/DirtyCollectionSearchVisitor.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace NHibernate.Event.Default
1616
{
1717
using System.Threading.Tasks;
1818
using System.Threading;
19-
using System;
2019
/// <content>
2120
/// Contains generated async methods
2221
/// </content>
@@ -33,7 +32,7 @@ public partial class DirtyCollectionSearchVisitor : AbstractVisitor
3332
{
3433
return Task.FromResult<object>(ProcessCollection(collection, type));
3534
}
36-
catch (Exception ex)
35+
catch (System.Exception ex)
3736
{
3837
return Task.FromException<object>(ex);
3938
}

src/NHibernate/Async/Event/Default/EvictVisitor.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace NHibernate.Event.Default
1818
{
1919
using System.Threading.Tasks;
2020
using System.Threading;
21-
using System;
2221
/// <content>
2322
/// Contains generated async methods
2423
/// </content>
@@ -35,7 +34,7 @@ public partial class EvictVisitor : AbstractVisitor
3534
{
3635
return Task.FromResult<object>(ProcessCollection(collection, type));
3736
}
38-
catch (Exception ex)
37+
catch (System.Exception ex)
3938
{
4039
return Task.FromException<object>(ex);
4140
}

0 commit comments

Comments
 (0)