public virtual async Task <List <Shop> > GetShopByUserShopIdForDropDown(int?shopId) { return(await RepositoryDbSet .Include(a => a.ShopName).ThenInclude(t => t.Translations) .Include(a => a.ShopAddress).ThenInclude(t => t.Translations) .Include(a => a.ShopContact).ThenInclude(t => t.Translations) .Include(a => a.ShopContact2).ThenInclude(t => t.Translations) .Where(s => s.Id == shopId).Select(e => ShopMapper.MapFromDomain(e)).ToListAsync()); }
public async Task <ActionResult <PublicApi.v1.DTO.Shop> > GetShop(int id) { var shop = await _bll.Shops.GetShopByShopId(id); if (shop == null) { return(NotFound()); } return(ShopMapper.MapFromBLL(shop)); }
public async Task <IActionResult> PutShop(int id, PublicApi.v1.DTO.Shop shop) { if (!ModelState.IsValid || id != shop.Id) { return(BadRequest()); } _bll.Shops.Update(ShopMapper.MapFromExternal(shop)); await _bll.SaveChangesAsync(); return(NoContent()); }
public override async Task <Shop> FindAsync(params object[] id) { var shop = await RepositoryDbSet.FindAsync(id); return(ShopMapper.MapFromDomain(await RepositoryDbSet .Include(a => a.ShopName).ThenInclude(t => t.Translations) .Include(a => a.ShopAddress).ThenInclude(t => t.Translations) .Include(a => a.ShopContact).ThenInclude(t => t.Translations) .Include(a => a.ShopContact2).ThenInclude(t => t.Translations) .Where(a => a.Id == shop.Id) .FirstOrDefaultAsync())); }
public Mapper() { _accountMapper = new AccountMapper(); _bazaarItemMapper = new BazaarItemMapper(); _bCardMapper = new BCardMapper(); _boxItemMapper = new ItemInstanceMapper(); _cardMapper = new CardMapper(); _cellonOptionMapper = new CellonOptionMapper(); _characterMapper = new CharacterMapper(); _characterRelationMapper = new CharacterRelationMapper(); _characterSkillMapper = new CharacterSkillMapper(); _comboMapper = new ComboMapper(); _dropMapper = new DropMapper(); _familyCharacterMapper = new FamilyCharacterMapper(); _familyLogMapper = new FamilyLogMapper(); _familyMapper = new FamilyMapper(); _generalLogMapper = new GeneralLogMapper(); _itemInstanceMapper = new ItemInstanceMapper(); _itemMapper = new ItemMapper(); _mailMapper = new MailMapper(); _maintenanceLogMapper = new MaintenanceLogMapper(); _mapMapper = new MapMapper(); _mapMonsterMapper = new MapMonsterMapper(); _mapNPCMapper = new MapNPCMapper(); _mapTypeMapMapper = new MapTypeMapMapper(); _mapTypeMapper = new MapTypeMapper(); _mateMapper = new MateMapper(); _minilandObjectMapper = new MinilandObjectMapper(); _npcMonsterMapper = new NpcMonsterMapper(); _npcMonsterSkillMapper = new NpcMonsterSkillMapper(); _penaltyLogMapper = new PenaltyLogMapper(); _portalMapper = new PortalMapper(); _questMapper = new QuestMapper(); _questProgressMapper = new QuestProgressMapper(); _quicklistEntryMapper = new QuicklistEntryMapper(); _recipeItemMapper = new RecipeItemMapper(); _recipeListMapper = new RecipeListMapper(); _recipeMapper = new RecipeMapper(); _respawnMapper = new RespawnMapper(); _respawnMapTypeMapper = new RespawnMapTypeMapper(); _rollGeneratedItemMapper = new RollGeneratedItemMapper(); _scriptedInstanceMapper = new ScriptedInstanceMapper(); _shellEffectMapper = new ShellEffectMapper(); _shopItemMapper = new ShopItemMapper(); _shopMapper = new ShopMapper(); _shopSkillMapper = new ShopSkillMapper(); _skillMapper = new SkillMapper(); _staticBonusMapper = new StaticBonusMapper(); _staticBuffMapper = new StaticBuffMapper(); _teleporterMapper = new TeleporterMapper(); }
public async Task <ActionResult <PublicApi.v1.DTO.Shop> > GetSingle() { var user = await _bll.AppUsers.FindAsync(User.GetUserId()); if (user.ShopId == null) { return(NotFound()); } var shop = await _bll.Shops.GetShopByShopId(user.ShopId); if (shop == null) { return(NotFound()); } return(ShopMapper.MapFromBLL(shop)); }
public async Task <List <Shop> > AllAsync(string order, string searchFor, int?pageIndex, int?pageSize) { var query = RepositoryDbSet.Include(a => a.ShopName).ThenInclude(t => t.Translations) .Include(a => a.ShopAddress).ThenInclude(t => t.Translations) .Include(a => a.ShopContact).ThenInclude(t => t.Translations) .Include(a => a.ShopContact2).ThenInclude(t => t.Translations).AsQueryable(); query = Search(query, searchFor); query = Order(query, order); if (pageIndex != null && pageSize != null) { query = query.Skip((pageIndex.Value - 1) * pageSize.Value).Take(pageSize.Value); } var temp = await query.ToListAsync(); var res = temp.Select(e => ShopMapper.MapFromDomain(e)).ToList(); return(res); }
public virtual async Task <List <Shop> > GetShopByUserShopId(int?shopId) { return(await RepositoryDbSet .Include(a => a.ShopName).ThenInclude(t => t.Translations) .Include(a => a.ShopAddress).ThenInclude(t => t.Translations) .Include(a => a.ShopContact).ThenInclude(t => t.Translations) .Include(a => a.ShopContact2).ThenInclude(t => t.Translations) .Include(s => s.Inventories).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations) .Include(s => s.Orders).ThenInclude(m => m.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(s => s.Returns).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations) .Include(d => d.Defects).ThenInclude(aa => aa.Description).ThenInclude(t => t.Translations) .Include(s => s.AppUsers) .Where(s => s.Id == shopId).Select(e => ShopMapper.MapFromDomain(e)).ToListAsync()); }
static void Main(string[] args) { //logger configuration Log.Logger = new LoggerConfiguration() .MinimumLevel.Verbose() .WriteTo.File("../Logs.json") .CreateLogger(); /* * Log.Verbose("Verbose log message"); * Log.Debug("Debug log message"); * Log.Information("Information log message"); * Log.Warning("Warning log message"); * Log.Error("Error log message"); * Log.Fatal("Fatal log message"); */ //get the config file var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json") .Build(); //set up db connection string connectionString = configuration.GetConnectionString("P0DB-REAL"); DbContextOptions <P0Context> options = new DbContextOptionsBuilder <P0Context>() .UseSqlServer(connectionString) .Options; //using statement using var context = new P0Context(options); IMapper shopMapper = new ShopMapper(); IMenu menu = new MainMenu(new CustomerBL(new CustomerRepoDB(context, shopMapper)), new ProductBL(new ProductRepoDB(context, shopMapper)), new LocationBL(new LocationRepoDB(context, shopMapper)), new InventoryBL(new InventoryRepoDB(context, shopMapper)), new OrderBL(new OrderRepoDB(context, shopMapper)), new CartBL(new CartRepoDB(context, shopMapper)), new CartProductsBL(new CartProductsRepoDB(context, shopMapper)), new OrderItemsBL(new OrderItemRepoDB(context, shopMapper))); menu.Start(); }
public async Task <List <Shop> > AllAsync(string order, string searchFor, int?pageIndex, int?pageSize) { return((await Uow.Shops.AllAsync(order, searchFor, pageIndex, pageSize)).Select(e => ShopMapper.MapFromDAL(e)).ToList()); }
public async Task <List <ShopWithCounts> > GetAllWithCountsAsync() { return((await Uow.Shops.GetAllWithCountsAsync()).Select(e => ShopMapper.MapFromDAL(e)).ToList()); }
public async Task <ShopWithCounts> GetShopByShopId(int?shopId) { return(ShopMapper.MapFromDAL(await Uow.Shops.GetShopByShopId(shopId))); }
public async Task <List <Shop> > GetShopByUserShopId(int?shopId) { return((await Uow.Shops.GetShopByUserShopId(shopId)).Select(e => ShopMapper.MapFromDAL(e)).ToList()); }
public override async Task <Shop> FindAsync(params object[] id) { return(ShopMapper.MapFromDAL(await Uow.Shops.FindAsync(id))); }
public override async Task <List <Shop> > AllAsync() { return((await Uow.Shops.AllAsync()).Select(e => ShopMapper.MapFromDAL(e)).ToList()); }
public override async Task <List <Shop> > AllAsync() { return(await RepositoryDbSet.Include(a => a.ShopName).ThenInclude(t => t.Translations) .Include(a => a.ShopAddress).ThenInclude(t => t.Translations) .Include(a => a.ShopContact).ThenInclude(t => t.Translations) .Include(a => a.ShopContact2).ThenInclude(t => t.Translations).Select(e => ShopMapper.MapFromDomain(e)).ToListAsync()); }
public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.Shop> > > GetShops() { var shop = (await _bll.Shops.GetAllWithCountsAsync()).Select(e => ShopMapper.MapFromBLL(e)).ToList(); return(shop); }