コード例 #1
0
        public async Task <int> AddCaliber(Caliber caliber, ShootingContext context)
        {
            using (var transaction = context.Database.BeginTransaction())
            {
                var higherCalibers = from c in context.Caliber
                                     where c.SortOrder >= caliber.SortOrder
                                     orderby c.SortOrder
                                     select c;

                if (higherCalibers.Any())
                {
                    var startOrder = caliber.SortOrder + 1;
                    foreach (var cal in higherCalibers)
                    {
                    }
                }
                context.Caliber.Add(caliber);
                return(await context.SaveChangesAsync());
            }
        }
コード例 #2
0
 public CalibersController(ShootingContext context)
 {
     _context = context;
 }
コード例 #3
0
 public PrimersController(ShootingContext context)
 {
     _context = context;
 }
コード例 #4
0
 public ManufacturersController(ShootingContext context)
 {
     _context = context;
 }
コード例 #5
0
 public PowderShapesController(ShootingContext context)
 {
     _context = context;
 }
コード例 #6
0
 public CartridgesController(ShootingContext context)
 {
     _context = context;
 }
コード例 #7
0
 public GunTypesController(ShootingContext context)
 {
     _context = context;
 }
コード例 #8
0
 public BrassesController(ShootingContext context)
 {
     _context = context;
 }
コード例 #9
0
 public MaterialsController(ShootingContext context)
 {
     _context = context;
 }
コード例 #10
0
 public BulletsController(ShootingContext context)
 {
     _context = context;
 }
コード例 #11
0
 public ShootingSessionsController(ShootingContext context)
 {
     _context = context;
 }
コード例 #12
0
 public ShootingLocationsController(ShootingContext context)
 {
     _context = context;
 }
コード例 #13
0
 public UnitsController(ShootingContext context)
 {
     _context = context;
 }