示例#1
0
        public void Descriptions()
        {
            IDictionary <TestEnum, string> enums = EnumHelper.Descriptions <TestEnum>();

            Assert.AreEqual(3, enums.Count);
            Assert.AreEqual("A", enums[TestEnum.A]);
            Assert.AreEqual("B", enums[TestEnum.B]);
            Assert.AreEqual("C", enums[TestEnum.C]);
        }
示例#2
0
        public IActionResult GetEnums()
        {
            var enums = new
            {
                Cartidges = EnumHelper.Descriptions <Cartridge>(),
                Types     = EnumHelper.Descriptions <FirearmType>()
            };

            return(Ok(enums));
        }
示例#3
0
        public IActionResult GetEnums()
        {
            var enums = new
            {
                BrassManufacturers  = EnumHelper.Descriptions <BrassManufacturer>(),
                BulletConstuction   = EnumHelper.Descriptions <BulletConstruction>(),
                BulletTypes         = EnumHelper.Descriptions <BulletType>(),
                BulletBaseTypes     = EnumHelper.Descriptions <BulletBaseType>(),
                BulletManufacturers = EnumHelper.Descriptions <BulletManufacturer>(),
                Calibers            = EnumHelper.Descriptions <Caliber>(),
                Cartidges           = EnumHelper.Descriptions <Cartridge>(),
                PrimerTypes         = EnumHelper.Descriptions <PrimerType>(),
                PrimerManufacturers = EnumHelper.Descriptions <PrimerManufacturer>(),
                Powders             = EnumHelper.Descriptions <GunPowder>(),
                FirearmTypes        = EnumHelper.Descriptions <FirearmType>()
            };

            return(Ok(enums));
        }