-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathUpdatable.cs
More file actions
24 lines (21 loc) · 789 Bytes
/
Updatable.cs
File metadata and controls
24 lines (21 loc) · 789 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
using System.Linq.Expressions;
namespace Xtensive.Orm.BulkOperations
{
internal class Updatable<T> : IUpdatable<T> where T : IEntity
{
internal readonly List<Tuple<Expression, Expression>> Expressions;
internal readonly IQueryable<T> Query;
public Updatable(Updatable<T> updatable, Expression field, Expression update)
{
Query = updatable.Query;
Expressions = new List<Tuple<Expression, Expression>>(updatable.Expressions.Count + 1);
Expressions.AddRange(updatable.Expressions);
Expressions.Add(Tuple.Create(field, update));
}
public Updatable(IQueryable<T> query, Expression field, Expression update)
{
Query = query;
Expressions = new List<Tuple<Expression, Expression>>(1) {Tuple.Create(field, update)};
}
}
}