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()); } }
public CalibersController(ShootingContext context) { _context = context; }
public PrimersController(ShootingContext context) { _context = context; }
public ManufacturersController(ShootingContext context) { _context = context; }
public PowderShapesController(ShootingContext context) { _context = context; }
public CartridgesController(ShootingContext context) { _context = context; }
public GunTypesController(ShootingContext context) { _context = context; }
public BrassesController(ShootingContext context) { _context = context; }
public MaterialsController(ShootingContext context) { _context = context; }
public BulletsController(ShootingContext context) { _context = context; }
public ShootingSessionsController(ShootingContext context) { _context = context; }
public ShootingLocationsController(ShootingContext context) { _context = context; }
public UnitsController(ShootingContext context) { _context = context; }