public PatchInstruction(DbContext context, PatchInstructionParams <TEntity, TId> options)
 {
     this.context              = context;
     this.id                   = options.Id;
     this.deltaEntity          = options.DeltaEntity;
     this.navigationProperties = options.NavigationProperties;
     this.filterExpr           = x => x.Id.Equals(this.id);
 }
示例#2
0
 public PatchUserContextedInstruction(DbContext context, PatchInstructionParams <TEntity, TId> options, TUserId userId)
     : base(context, options, x => x.Id.Equals(options.Id) && x.UserId.Equals(userId))
 {
     if (userId == null)
     {
         throw new InstructionException("User ID must be provided for the instruction!", HttpStatusCode.BadRequest);
     }
 }
 protected PatchInstruction(DbContext context, PatchInstructionParams <TEntity, TId> options, Expression <Func <TEntity, bool> > filterExpr) : this(context, options)
 {
     this.filterExpr = filterExpr;
 }