public ClassesController(Models.AppContext context) { db = context; }
public UserVotesController(Models.AppContext context) { db = context; }
public UserRepository(Models.AppContext appContext) : base(appContext) { }
{ public BookingRepository(Models.AppContext appContext) : base(appContext) { }
public HomeModel(Models.AppContext app) { this._context = app; }
public FlightRepository(Models.AppContext appContext) : base(appContext) { }
public UserController() { _context = new Models.AppContext(); }
public BegrotingController(Models.AppContext context) { _context = context; }
public RepositoryBase(Models.AppContext appContext) { this.Context = appContext; }
public InkomstController(Models.AppContext context) { _context = context; }
public AfschrijvingController(Models.AppContext context) { _context = context; }
public MessagesController(Models.AppContext db, UserManager <User> userManager, SignInManager <User> signInManager) { _db = db; _userManager = userManager; _signInManager = signInManager; }
public AccountController(Models.AppContext context) { db = context; }
public VoteOptionsController(Models.AppContext context) { db = context; }
public TemplateUseModel(IOptions <Configuration.CloudStorage> cloudSettings, Models.AppContext app) { context = app; azureFileController = new AzureFileController(cloudSettings.Value.ConnectionString, cloudSettings.Value.ReadString); }
public TicketService(Models.AppContext context) { _context = context; }
public UsersController(Models.AppContext context) { _context = context; _context.Database.EnsureCreated(); }
public UserViewModel(Models.AppContext app) { context = app; this.Breadcrumb = new LinkedList <Tuple <string, string> >(); Breadcrumb.AddLast(Tuple.Create("Home", "/home")); }
public ContractController(Models.AppContext context) { _context = context; }
public UserRepository(Models.AppContext db) { _db = db; }
public UserEventsController(Models.AppContext context) { db = context; }
public StorageController(Models.AppContext context, ILogger <StorageController> logger) { _context = context; _logger = logger; }
public ProductsV1_0Controller(Models.AppContext context) { _context = context; _context.Database.EnsureCreated(); }
public ReserveringController(Models.AppContext context) { _context = context; }
public RekeningController(Models.AppContext context) { _context = context; }
public PicturesController(Models.AppContext context, RabbitMqPublisher rabbitMqPublisher) { _context = context; _rabbitMqPublisher = rabbitMqPublisher; }
/// <summary> /// Saves the shipment data to the Database. If it exists in DB, it is edited; else it's added. /// </summary> public void SaveShipmentToDB() { using (var db = new Models.AppContext()) { //create shipment entity and set props Entities.Shipment entShipment = new Shipment() { ShipmentId = Shipment.ShipmentID, Boxes = new List <ShipmentBox>(), ShipmentDate = Shipment.ShipmentDate }; //add each box one to entShipment entity foreach (var box in Shipment.Boxes) { ShipmentBox entBox = new ShipmentBox { BoxContentString = box.FBALabel(), BoxNumber = box.BoxNumber, BoxId = box.BoxID, Shipment = entShipment }; entShipment.Boxes.Add(entBox); }//end foreach loop //get amazon warehouse entity and set to ShipmentEntity AmazonWarehouse amz = db.AmazonWarehouses.Where(a => a.Id == Shipment.FullfillmentShipTo.Id).FirstOrDefault(); entShipment.ShipToCenter = amz; //get company address entity and set to shipmententity CompanyAddress comp = db.CompanyAddresses.Where(c => c.Id == Shipment.CompanyShipFrom.Id).FirstOrDefault(); entShipment.ShipFromCenter = comp; //check if shipment exists in the database if (db.Shipments.Any(s => s.ShipmentId == Shipment.ShipmentID)) { Shipment shipmentDel = db.Shipments.Find(Shipment.ShipmentID); var bx = db.Boxes.Where((b => b.Shipment.ShipmentId == shipmentDel.ShipmentId)).ToList(); for (int i = 0; i < bx.Count(); i++) { db.Boxes.Remove(bx[i]); } db.SaveChanges(); //then delete the shipment with shipmentID db.Shipments.Remove(shipmentDel); //finally add the shipment back into shipments table db.Shipments.Add(entShipment); } else { //add shipment to DB and save db.Shipments.Add(entShipment); } db.SaveChanges(); } }
public RepositoryWrapper(Models.AppContext appContext) { _appContext = appContext; }
public VerifyModel(Models.AppContext app) { _context = app; }
public NewsController(Models.AppContext context) { db = context; }