/// <summary> /// Fetches the complete set of elements and returns this set as an IEnumerable. /// </summary> /// <returns>the set fetched</returns> public override IEnumerable <EF6.Bencher.EntityClasses.SalesOrderHeader> FetchSet() { using (var ctx = new AWDataContext()) { return(ctx.SalesOrderHeaders.ToList()); } }
/// <summary> /// Fetches the complete set of elements and returns this set as an IEnumerable. /// </summary> /// <returns>the set fetched</returns> public override IEnumerable <EFCore.Bencher.EntityClasses.SalesOrderHeader> FetchSet() { using (var ctx = new AWDataContext(this.ConnectionStringToUse)) { return(ctx.SalesOrderHeaders.AsNoTracking().ToList()); } }
/// <summary> /// Fetches the individual element /// </summary> /// <param name="key">The key of the element to fetch.</param> /// <returns>The fetched element, or null if not found</returns> public override EF6.Bencher.EntityClasses.SalesOrderHeader FetchIndividual(int key) { using (var ctx = new AWDataContext()) { return(ctx.SalesOrderHeaders.Single(e => e.SalesOrderId == key)); } }
protected override IEnumerable <CreditCard> FetchInserted(int amountInserted) { using (var ctx = new AWDataContext(this.ConnectionStringToUse)) { return(ctx.CreditCards.Where(c => c.CreditCardId > 19237).ToList()); } }
/// <summary> /// Fetches the individual element /// </summary> /// <param name="key">The key of the element to fetch.</param> /// <returns>The fetched element, or null if not found</returns> public override EFCore.Bencher.EntityClasses.SalesOrderHeader FetchIndividual(int key) { using (var ctx = new AWDataContext(this.ConnectionStringToUse)) { return(ctx.SalesOrderHeaders.AsNoTracking().Single(e => e.SalesOrderId == key)); } }
public void Get_All_Currency_Name() { using (var context = new AWDataContext()) { var countNames = context.Currencies.Count(x => !string.IsNullOrEmpty(x.Name)); Assert.Greater(countNames, 0); } }
public override void InsertSet(IEnumerable <CreditCard> toInsert, int batchSize) { using (var ctx = new AWDataContext(this.ConnectionStringToUse, batchSize)) { ctx.CreditCards.AddRange(toInsert); ctx.SaveChanges(); } }
/// <summary> /// Async variant of FetchGraph(). Fetches the complete graph using eager loading and returns this as an IEnumerable. /// </summary> /// <returns>the graph fetched</returns> public override async Task <IEnumerable <SalesOrderHeaderDto> > FetchGraphAsync() { using (var ctx = new AWDataContext(this.ConnectionStringToUse)) { return(await(from soh in ctx.SalesOrderHeaders where soh.SalesOrderId > 50000 && soh.SalesOrderId <= 51000 select soh).ProjectToSalesOrderHeaderDto().ToListAsync()); } }
/// <summary> /// Async variant of FetchGraph(). Fetches the complete graph using eager loading and returns this as an IEnumerable. /// </summary> /// <returns>the graph fetched</returns> public override async Task <IEnumerable <EF6.Bencher.EntityClasses.SalesOrderHeader> > FetchGraphAsync() { using (var ctx = new AWDataContext()) { return(await(from soh in ctx.SalesOrderHeaders where soh.SalesOrderId > 50000 && soh.SalesOrderId <= 51000 select soh) .Include(x => x.SalesOrderDetails) .Include(x => x.Customer) .ToListAsync()); } }
/// <summary> /// Fetches the complete graph using eager loading and returns this as an IEnumerable. /// </summary> /// <returns>the graph fetched</returns> public override IEnumerable <EFCore.Bencher.EntityClasses.SalesOrderHeader> FetchGraph() { using (var ctx = new AWDataContext(this.ConnectionStringToUse)) { return((from soh in ctx.SalesOrderHeaders where soh.SalesOrderId > 50000 && soh.SalesOrderId <= 51000 select soh) .Include(x => x.SalesOrderDetails) .Include(x => x.Customer) .ToList()); } }