Ejemplo n.º 1
0
 public void AddAmmunition(string ammunitionName, float coefficient, float grain, float diameter)
 {
     using (var db = new BallisticContext())
     {
         db.Add(new Ammunition {
             AmmunitionName = ammunitionName, Coefficient = coefficient, Grain = grain, Diameter = diameter
         });
         db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void AddFirearmType(string typeName)
 {
     using (var db = new BallisticContext())
     {
         db.Add(new FirearmType {
             TypeName = typeName
         });
         db.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public void AddFirearm(string firearmName, int muzzleVelocity, int typeID, int ammunitionID)
 {
     using (var db = new BallisticContext())
     {
         db.Add(new Firearm {
             FirearmName = firearmName, MuzzleVelocity = muzzleVelocity, FirearmTypeID = typeID, AmmunitionID = ammunitionID
         });
         db.SaveChanges();
     }
 }