public override async Task <Inventory> FindAsync(params object[] id) { var inventory = await RepositoryDbSet.FindAsync(id); return(InventoryMapper.MapFromDomain(await RepositoryDbSet.Where(a => a.Id == inventory.Id) .Include(i => i.Description).ThenInclude(t => t.Translations) .Include(a => a.Products).ThenInclude(aa => aa.ProductName).ThenInclude(t => t.Translations) .Include(a => a.Products).ThenInclude(aa => aa.Length).ThenInclude(t => t.Translations) .Include(a => a.Products).ThenInclude(aa => aa.Weight).ThenInclude(t => t.Translations) .Include(a => a.Products).ThenInclude(aa => aa.ManuFacturerItemCode).ThenInclude(t => t.Translations) .Include(a => a.Products).ThenInclude(aa => aa.ShopCode).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopName).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopAddress).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopContact).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopContact2).ThenInclude(t => t.Translations) .FirstOrDefaultAsync())); }
public override async Task <Order> FindAsync(params object[] id) { var order = await RepositoryDbContext.Set <Domain.Order>().FindAsync(id); RepositoryDbContext.Entry(order).State = EntityState.Detached; return(OrderMapper.MapFromDomain(await RepositoryDbSet.Where(a => a.Id == order.Id) .Include(m => m.Description).ThenInclude(t => t.Translations) .Include(a => a.Shipper).ThenInclude(aa => aa.ShipperName).ThenInclude(t => t.Translations) .Include(a => a.Shipper).ThenInclude(aa => aa.ShipperAddress).ThenInclude(t => t.Translations) .Include(a => a.Shipper).ThenInclude(aa => aa.PhoneNumber).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopName).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopAddress).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopContact).ThenInclude(t => t.Translations) .Include(a => a.Shop).ThenInclude(aa => aa.ShopContact2).ThenInclude(t => t.Translations) .Include(a => a.ProductsInOrder).ThenInclude(a => a.Product).ThenInclude(aa => aa.ProductName).ThenInclude(t => t.Translations) .Include(a => a.ProductsInOrder).ThenInclude(a => a.Product).ThenInclude(aa => aa.Length).ThenInclude(t => t.Translations) .Include(a => a.ProductsInOrder).ThenInclude(a => a.Product).ThenInclude(aa => aa.Weight).ThenInclude(t => t.Translations) .Include(a => a.ProductsInOrder).ThenInclude(a => a.Product).ThenInclude(aa => aa.ManuFacturerItemCode).ThenInclude(t => t.Translations) .Include(a => a.ProductsInOrder).ThenInclude(a => a.Product).ThenInclude(aa => aa.ShopCode).ThenInclude(t => t.Translations) .FirstOrDefaultAsync())); }
/// <summary> /// Get all acitve orders /// </summary> /// <param name="userId">Useraccont id</param> /// <returns> list of orders</returns> public List <TruckInOrder> GetAllTruckInOrders(int userId) { return(RepositoryDbSet .Where(o => o.Order.UnloadingDateTime > DateTime.Now && o.Order.UserAccontId == userId || o.Truck.UserAccontId == userId).ToList()); }
public async Task <List <DAL.App.DTO.DomainLikeDTO.ProductWithDefect> > AllAsyncByDefectId(int defectId) { return(await RepositoryDbSet .Where(a => a.DefectId == defectId).Select(e => ProductWithDefectMapper.MapFromDomain(e)).ToListAsync()); }
public List <Ticket> AllForUser(string id) { return(RepositoryDbSet .Where(t => t.ApplicationUserId == id) .ToList()); }
public List <Car> FindByPersonId(int personId) { return(RepositoryDbSet.Where(e => e.PersonId == personId).ToList()); }
public override async Task <List <DAL.App.DTO.Event> > AllAsync() { return(await RepositoryDbSet .Where(item => DateTime.Compare(item.EventDate, DateTime.Now) != -1) .Select(e => EventMapper.MapFromDomain(e)).ToListAsync()); }
public async Task <int> CountProductsInShop(int?shopId) { return(await RepositoryDbSet .Where(p => p.ShopId == shopId).CountAsync()); }
public ForumTopic FindByAuthor(string author) { return(RepositoryDbSet .Where(p => p.Author.ToLower().Contains(author.ToLower())) .FirstOrDefault()); }
public void DeleteAllRelationsForPerson(int personId) { RepositoryDbSet.RemoveRange(RepositoryDbSet. Where(w => w.Person1Id == personId || w.PersonId == personId)); }
public async Task <List <DAL.App.DTO.Person> > AllForUserAsync(int userId) { return(await RepositoryDbSet.Where(p => p.AppUserId == userId).Select(e => PersonMapper.MapFromDomain(e)) .ToListAsync()); }
public async Task<List<ProductInCategory>> AllAsyncByCategoryId(int categoryId) { return await RepositoryDbSet .Where(a => a.CategoryId == categoryId).Select(e => ProductInCategoryMapper.MapFromDomain(e)).ToListAsync(); }
public async Task <int> CountProductsInSale(int id) { return(await RepositoryDbSet .Where(s => s.SaleId == id) .CountAsync()); }
public async Task <int> GetQuantity(int id) { return(await RepositoryDbSet .Where(p => p.Id == id) .Select(p => p.Quantity).FirstOrDefaultAsync()); }
public async Task <Project> GetSingle(int id) { return(await RepositoryDbSet .Where(i => i.ProjectId == id) .SingleOrDefaultAsync()); }
public ForumTopic FindTopicByTitle(string title) { return(RepositoryDbSet .Where(p => p.Title.ToLower().Contains(title.ToLower())) .FirstOrDefault()); }
public PerformancePerformer FindByBothIds(int performanceId, int performerId) { return(RepositoryDbSet .Where(pp => pp.PerformanceId == performanceId && pp.PerformerId == performerId) .SingleOrDefault()); }
public async Task <IList <Claim> > GetClaimsAsync(TKey roleId, CancellationToken cancellationToken = default(CancellationToken)) { return(await RepositoryDbSet.Where(predicate : rc => rc.IdentityRoleId.Equals(roleId)).Select(selector: c => new Claim(c.ClaimType, c.ClaimValue)).ToListAsync(cancellationToken: cancellationToken)); }
public async Task <int> FindIdByString(Relation relation) { return(await RepositoryDbSet .Where(w => w.Relation == relation) .Select(e => e.Id).FirstOrDefaultAsync()); }
private async Task <List <DiseaseSymptom> > GetByDiseaseIdAsync(int id) { return(await RepositoryDbSet.Where(d => d.DiseaseId == id).ToListAsync()); }
public async Task <IEnumerable <Picture> > FindPicturesByPathAsync(string path) { return(await RepositoryDbSet.Where(pic => pic.Path == path).AsNoTracking() .Select(p => PictureMapper.MapFromDomain(p)).ToListAsync()); }
public List <Car> FindByLicensePlate(string licensePlate) { return(RepositoryDbSet.Where(e => e.LicensePlate == licensePlate).ToList()); }
public List <Answer> FindAnswersbyAuthor(string answer) { return(RepositoryDbSet .Where(x => x.Author.ToLower().Contains(answer.ToLower())) .ToList()); }
public async Task <List <DTO.DomainLikeDTO.ProductReturned> > AllAsyncByReturnId(int returnId) { return(await RepositoryDbSet .Where(p => p.ReturnId == returnId).Select(e => ProductReturnedMapper.MapFromDomain(e)).ToListAsync()); }
public async Task <int> CountProductsInReturn(int returnId) { return(await RepositoryDbSet .Where(r => r.ReturnId == returnId).CountAsync()); }
public Ticket FindForUser(string id, int ticketId) { return(RepositoryDbSet .Where(t => t.ApplicationUserId == id && t.TicketId == ticketId) .SingleOrDefault()); }
public async Task <int> CountDefectItems(int defectId) { return(await RepositoryDbSet .Where(d => d.DefectId == defectId) .CountAsync()); }