Example #1
0
 public async Task <decimal> GetCurrentPrice(long itemId, CancellationToken cts = new CancellationToken())
 {
     return(await Task.Run(() =>
     {
         cts.ThrowIfCancellationRequested();
         return EntityFrameworkQueryableExtensions.FirstOrDefaultAsync(
             Db.MovmentGoodTypes.Select(p => AutomationAccountingGoodsContext.GetCurrentPrice(itemId)), cts);
     }, cts));
 }
 public async Task <bool> CheckProperty(int idProperty, int?idCategory, string title, CancellationToken cts = new CancellationToken())
 {
     return(await Task.Run(() =>
     {
         cts.ThrowIfCancellationRequested();
         return Db.MovmentGoodTypes.Take(1)
         .Select(p => AutomationAccountingGoodsContext.CheckProperty(idProperty, idCategory, title))
         .SingleOrDefaultAsync(cts);
     }, cts));
 }
Example #3
0
 protected SqlRepository()
 {
     Db = new AutomationAccountingGoodsContext(ConnectionTools.ConnectionString);
 }