public ShootingManagerBaseController() { this.brasses = cartridgeService.GetBrasses().OfType <Brass>().OrderBy(b => b.Name); this.brassViews = cartridgeService.GetBrassViews().OrderBy(b => b.BrassName); this.brassQuantities = brassService.GetAllQuantities().OfType <BrassQuantity>(); this.bullets = cartridgeLoadService.GetBullets().OfType <Bullet>().OrderBy(b => b.Name); this.bulletTypes = bulletService.GetBulletTypes().OfType <BulletType>().OrderBy(b => b.Abbreviation); this.bulletViews = bulletService.GetBulletViews().OrderBy(b => b.BulletName); this.bulletQuantities = bulletService.GetAllQuantities().OfType <BulletQuantity>(); this.calibers = cartridgeLoadService.GetCalibers().OfType <Caliber>().OrderBy(c => c.SortOrder); this.caliberViews = cartridgeLoadService.GetCaliberViews().OrderBy(c => c.SortOrder); this.cartridges = cartridgeService.GetAll().OfType <Cartridge>().OrderBy(c => c.CartridgeLoad.Caliber.SortOrder).ThenBy(c => c.Name); this.cartridgeQuantities = cartridgeService.GetAllQuantities().OfType <CartridgeQuantity>(); this.cartridgeLoads = cartridgeLoadService.GetAll().OfType <CartridgeLoad>().OrderBy(c => c.Caliber.SortOrder).ThenBy(c => c.Name); this.cartridgeViews = cartridgeService.GetCartridgeViews().OrderBy(c => c.CartridgeLoadViewCaliberViewSortOrder).ThenBy(c => c.Name); this.cartridgeLoadViews = cartridgeLoadService.GetCartridgeLoadViews().OrderBy(c => c.CaliberViewSortOrder).ThenBy(c => c.Name); this.guns = gunService.GetAll().OfType <Gun>().OrderBy(g => g.Name); this.gunTypes = gunService.GetGunTypes().OfType <GunType>().OrderBy(g => g.Name); this.gunViews = gunService.GetGunViews().OrderBy(g => g.Name); this.inventoryTypes = brassService.GetInventoryTypes().OfType <InventoryType>().OrderBy(i => i.Description); this.lengthUnits = cartridgeLoadService.GetLengthUnits().OfType <Unit>().OrderBy(l => l.Name); this.manufacturers = cartridgeService.GetManufacturers().OfType <Manufacturer>().OrderBy(m => m.Name); this.massUnits = cartridgeLoadService.GetMassUnits().OfType <Unit>().OrderBy(m => m.Name); this.materials = bulletService.GetMaterials().OfType <Material>().OrderBy(m => m.Name); this.powders = cartridgeLoadService.GetPowders().OfType <Powder>().OrderBy(p => p.Name); this.powderShapes = powderService.GetPowderShapes().OfType <PowderShape>().OrderBy(p => p.Name); this.powderTypes = powderService.GetPowderTypes().OfType <PowderType>().OrderBy(p => p.Name); this.powderViews = powderService.GetPowderViews().OrderBy(p => p.Name); this.powderQuantities = powderService.GetAllQuantities().OfType <PowderQuantity>(); this.pressureUnits = cartridgeLoadService.GetPressureUnits().OfType <Unit>().OrderBy(p => p.Name); this.primers = cartridgeService.GetPrimers().OfType <Primer>().OrderBy(p => p.Name); this.primerTypes = primerService.GetPrimerTypes().OrderBy(p => p.Name); this.primerViews = primerService.GetPrimerViews().OrderBy(p => p.PrimerName); this.primerQuantities = primerService.GetAllQuantities().OfType <PrimerQuantity>(); this.quantityUnits = brassService.GetQuantityUnits().OfType <Unit>().OrderBy(q => q.Name); this.shootingLocations = shootingSessionService.GetShootingLocations().OfType <ShootingLocation>().OrderBy(s => s.Name); this.shootingLocationViews = shootingSessionService.GetShootingLocationViews().OrderBy(s => s.ShootingLocationName); this.shootingSessions = shootingSessionService.GetAll().OfType <ShootingSession>().OrderBy(s => s.Date); this.shootingSessionViews = shootingSessionService.GetShootingSessionViews().OrderBy(s => s.Date); this.unitTypes = unitTypeService.GetAll().OfType <UnitType>().OrderBy(u => u.Name); this.velocityUnits = cartridgeLoadService.GetVelocityUnits().OfType <Unit>().OrderBy(v => v.Name); }
// GET: api/Gun/5 public GunView GetGun(int id) { var gunService = new GunService(); return(gunService.GetGunViews().Where(g => g.Id == id).First()); }
// GET: api/Gun public IEnumerable <GunView> GetGuns() { var gunService = new GunService(); return(gunService.GetGunViews()); }