public async Task AssertCustomerExists() { var context = new CompanyContext(); var numberOfCustomers = await context.Customers.CountAsync(); Assert.IsTrue(numberOfCustomers > 0); }
public void DetecteLesEditionsConcurrentes() { var contexteDeJohn = new CompanyContext(); var clientDeJohn = contexteDeJohn.Customers.First(); var contexteDeSarah = new CompanyContext(); var clientDeSarah = contexteDeSarah.Customers.First(); clientDeJohn.AccountBalance += 1000; contexteDeJohn.SaveChanges(); clientDeSarah.AccountBalance += 2000; contexteDeSarah.SaveChanges(); }
private Employee GetEmployee(ApplicationUser user) { using (var context = new CompanyContext()) { var employees = from employee in context.Employees where employee.EmployeeId == user.Id select employee; foreach (var e in employees) { return e; } } return null; }
private ApplicationUser LoggedInUser() { var userId = User.Identity.GetUserId(); using (var context = new CompanyContext()) { var users = from u in context.Users where u.Id == userId select u; foreach (var u in users) { return u; } } return null; }
public ActionResult Completed(string id) { var user = LoggedInUser(); using (var context = new CompanyContext()) { var tasks = from task in context.Tasks where task.EmployeeId == user.Id && task.TaskId == id select task; foreach (var t in tasks) { t.EndDate = DateTime.Now; t.Status = "COMPLETED"; } context.SaveChanges(); } return View(); }
public async Task InsertionFonctionnelle() { Database.SetInitializer(new DropCreateDatabaseAlways<CompanyContext>()); CompanyContext context = new CompanyContext(); Customer customer = new Customer() { Name = "Albert Dupont", AddressLine1 = "Rue des cerisiers, 16", City = "Arlon", Country = "Belgique", EMail = "*****@*****.**", Id = 3, Remark = "Ne pas avoir peur des chiens pour aller chez ce client", PostCode = "6700" }; context.Customers.Add(customer); context.SaveChanges(); await AssertCustomerExists(); }
static MyConfiguration() { _context = new CompanyContext();//CompanyContext.GetContext(); unitOfWork = new UnitOfWork(_context); mapper = MappingConfiguration.ConfigurationMapper().CreateMapper(); }
public EmployeeController() { db = new CompanyContext(); }
public SupplierProcessNpracticeController(CompanyContext context) { _CompanyContext = context; }
public EmpRepo(CompanyContext temp) : base(temp) { cc = temp; }
public ProgressEmployeesController(CompanyContext context) { _context = context; }
public EmployeeService(CompanyContext context) : base(context) { }
public CategoryController() { _context = new CompanyContext(); }
public ProjectRepository(CompanyContext context) { this.context = context; }
private ActionResult Tasks(bool completed) { var employee = LoggedInUser(); IEnumerable<Task> tasks; using (var context = new CompanyContext()) { tasks = from task in context.Tasks where task.EmployeeId == employee.Id && (completed ? task.Status == "COMPLETED" : task.Status == "OPENED") orderby task.Deadline select task; tasks = tasks.ToList(); } return View(tasks); }
public EmployeePlansController(CompanyContext context) { _context = context; }
public Repositry(CompanyContext company) { Company = company; }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { _context = new CompanyContext(@"Data Source=vm-sql.iesn.be\Stu3IG;User ID=IG3A8;Password=pwUserdb39"); _customer = _context.Customers.First(); Formulaire.DataContext = _customer; }
public TodoItemsController(CompanyContext context) { _context = context; }
public HourlyPaidEmployeeController(CompanyContext db) { _db = db; }
public ClientRepository(CompanyContext context) { this.context = context; }
public BaseRepo(CompanyContext dbContext) { _dbContext = dbContext; }
public PrivateLimitedModel(CompanyContext context) { _context = context; }
public CoinTypeService(CompanyContext context) { _repo = new CoinRepo(context); }
public EmployeeController(IEmployeeService employeeService, IService <IEmployee> service, IDepartmentService departmentService, IMapper mapper, CompanyContext context) { this.employeeService = employeeService; this.service = service; this.departmentService = departmentService; this.mapper = mapper; }
public ReviewLogic() { _reviewContext = new ReviewContext(); _companyContext = new CompanyContext(); }
public CompaniesController(CompanyContext db) { _db = db; }
public OrderController(CompanyContext context) { _context = context; }
/// <summary> /// Instance an new instance of the class <see cref="CompanyExampleTest"/>. /// </summary> public CompanyExampleTestRemoting() { companyExampleContext = new CompanyContext(ClientEnvironment.GetInstanceRemoting(ServiceConstants.SqlServiceName).QueryHandler); }
public EmployeeFactsController(CompanyContext context) { _context = context; }
public TaskService(CompanyContext context) : base(context) { }
public CompanyRepository(CompanyContext db) { _db = db; }
public CompanyService(CompanyContext companyContext, OrderContext orderContext) { _companyContext = companyContext; _orderContext = orderContext; }
public EmployeeServices(CompanyContext _context) { departmentRepo = new Repository <CompanyDepartment>(_context); employeeRepo = new Repository <CompanyEmployee>(_context); }
public static void EnsureSeedDataForContext(this CompanyContext context) { if (context.Companies.Any()) { return; } var companies = new List <Company>() { new Company() { Name = "Microsoft", Description = "Microsoft Corporation is an American multinational technology company with headquarters in Redmond, Washington.", Founded = new DateTime(1975, 4, 4), Technologies = new List <Technology>() { new Technology() { Name = "C#", Description = "a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.", Appeared = new DateTime(2000, 1, 1) }, new Technology() { Name = "Typescript", Description = "It is a strict syntactical superset of JavaScript, and adds optional static typing to the language. ", Appeared = new DateTime(2012, 1, 1) }, new Technology() { Name = "F#", Description = "a strongly typed, multi-paradigm programming language that encompasses functional, imperative, and object-oriented programming methods.", Appeared = new DateTime(2005, 1, 1) } } }, new Company() { Name = "Apple", Description = "Apple Inc. is an American multinational technology company headquartered in Cupertino, California that designs, develops, and sells consumer electronics, computer software, and online services.", Founded = new DateTime(1976, 4, 1), Technologies = new List <Technology>() { new Technology() { Name = "Objective-c", Description = "It was the main programming language used by Apple for the OS X and iOS operating systems, and their respective application programming interfaces (APIs) Cocoa and Cocoa Touch prior to the introduction of Swift.", Appeared = new DateTime(1984, 1, 1) }, new Technology() { Name = "Swift", Description = "Swift is designed to work with Apple\'s Cocoa and Cocoa Touch frameworks and the large body of existing Objective-C (ObjC) code written for Apple products.", Appeared = new DateTime(2014, 1, 1) } } } }; context.Companies.AddRange(companies); context.SaveChanges(); }
public CustomerController(CompanyContext context) { _context = context; }
public ProvidersController(CompanyContext context) { _context = context; }
public ManagerController(CompanyContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public EmployeesController(CompanyContext db) { _db = db; }
public DepartmentRepository(CompanyContext db) { this.db = db; }
public ExpenseRepository(CompanyContext context) { this.context = context; }
public IncomeRepository(CompanyContext context) { this.context = context; }