Esempio n. 1
0
 protected IDbCommandBuilder ToCommand()
 {
     if (_context == null)
     {
         throw new InvalidOperationException("No context to execute against.");
     }
     return(_context
            .Command(Build())
            .WithParameters(_parameters));
 }
Esempio n. 2
0
 public async Task <IList <PurchaseOrder> > GetPurchaseOrdersToadstool()
 {
     return(await _context
            .Command(_select)
            .ToListAsync <PurchaseOrder>());
 }
Esempio n. 3
0
 public Result <object> Add(T entity)
 => _context.Command(db => db.Insert <T>(entity));
Esempio n. 4
0
 public Result <IEnumerable <T> > Get(object filter = null)
 => filter == null
     ? _context.Command(db => db.Query <T>())
     : _context.Command(db => db.Query <T>(filter));