Exemple #1
0
 public IdTable(TOwner owner)
 {
     {
         var argId    = Expression.Parameter(typeof(TId));
         var argOwner = Expression.Parameter(typeof(TOwner));
         var ctor     = typeof(T).GetConstructor(new[] { typeof(TId), typeof(TOwner) });
         var call     = Expression.New(ctor, argId, argOwner);
         dummyCreation = Expression.Lambda <Func <TId, TOwner, T> >(call, argId, argOwner).Compile();
     }
     {
         var argRaw   = Expression.Parameter(typeof(TRaw));
         var argOwner = Expression.Parameter(typeof(TOwner));
         var argTime  = Expression.Parameter(typeof(DateTimeOffset));
         var ctor     = typeof(T).GetConstructor(new[] { typeof(TRaw), typeof(TOwner), typeof(DateTimeOffset) });
         var call     = Expression.New(ctor, argRaw, argOwner, argTime);
         creation = Expression.Lambda <Func <TRaw, TOwner, DateTimeOffset, T> >(call, argRaw, argOwner, argTime).Compile();
     }
     this.owner  = owner;
     DefaultView = new BindableSnapshotCollection <T>(this, this.OrderBy(x => x.Id));
 }
Exemple #2
0
 public IdTable(TOwner owner)
 {
     this.owner  = owner;
     DefaultView = new BindableSnapshotCollection <T>(this, this.OrderBy(x => x.Id));
 }