public ChlorineLevelsController() { // TODO(crhodes) // Figure out how to register the dbContext. _repository = new ConnectedRepository <ChlorineLevel>(new CustomPoolAndSpa.LookupData.CustomPoolAndSpaLookupsDbContext()); }
static void Main(string[] args) { //CustomerRepository repository = new CustomerRepository(); Customer customer1 = new Customer { CustomerId = 115, CustomerName = "Sagar", Address = "Faridabad", Contact = "1234567890" }; //Customer customer2 = new Customer { CustomerId = 111, CustomerName = "Hitesh", Address = "Delhi", Contact = "1234567890" }; ////repository.AddCustomer(customer1); ////repository.RemoveCustomer(104); //repository.UpdateCustomer(customer2); //repository.SaveChanges(); ConnectedRepository repository = new ConnectedRepository(); //repository.AddCustomer(customer1); // Console.WriteLine(repository.GetOrderAmount()); var customers = repository.GetCustomerByLocation("Delhi"); //Console.WriteLine("Customer List"); //var customers = repository.GetCustomers(); foreach (Customer customer in customers) { Console.WriteLine($"Id: {customer.CustomerId}, Name: {customer.CustomerName}, Address: {customer.Address}, Contact: {customer.Contact}"); } }
public void Update(TYPE entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <TYPE>(context); _repository.Update(entity); } }
public async Task InsertAsync(TYPE entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <TYPE>(context); await _repository.InsertAsync(entity); } }
public async Task UpdateAsync(ServiceCall entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceCall>(context); await _repository.UpdateAsync(entity); } }
public MainWindow() { InitializeComponent(); //@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=TextEditor.DAL.FileDbContext;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" m_repository = new ConnectedRepository(ReadConnectionString()); LoadTextFile(-1); }
public void Delete(int entityId) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceAddress>(context); _repository.Delete(entityId); } }
public async Task InsertAsync(ServiceAddress entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceAddress>(context); await _repository.InsertAsync(entity); } }
public async Task <List <ServiceAddress> > AllAsync() { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceAddress>(context); return(await _repository.AllAsync()); } }
// TODO(crhodes) // Decide if we need FindByKey #endregion Find #region Insert public void Insert(ServiceAddress entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceAddress>(context); _repository.Insert(entity); } }
public void Update(ServiceCall entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceCall>(context); _repository.Update(entity); } }
public void Delete(int entityId) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); _repository.Delete(entityId); } }
public async Task UpdateAsync(Customer entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); await _repository.UpdateAsync(entity); } }
public ServiceCall FindById(int entityId) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceCall>(context); return(_repository.FindById(entityId)); } }
public IEnumerable <Customer> All() { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); return(_repository.All()); } }
public void Update(Customer entity) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); _repository.Update(entity); } }
public IEnumerable <ServiceCall> All() { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceCall>(context); return(_repository.All()); } }
public async Task <List <Customer> > AllAsync() { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); return(await _repository.AllAsync()); } }
public Customer FindById(int entityId) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); return(_repository.FindById(entityId)); } }
public async Task DeleteAsync(int entityId) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); await _repository.DeleteAsync(entityId); } }
public async Task <Customer> FindByIdAsync(int entityId) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); return(await _repository.FindByIdAsync(entityId)); } }
public IEnumerable <ServiceCall> AllInclude( params Expression <Func <ServiceCall, object> >[] includeProperties) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceCall>(context); return(_repository.AllInclude(includeProperties)); } }
public async Task <IEnumerable <ServiceCall> > FindByAsync( Expression <Func <ServiceCall, bool> > predicate) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceCall>(context); return(await _repository.FindByAsync(predicate)); } }
public IEnumerable <Customer> FindBy( Expression <Func <Customer, bool> > predicate) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); return(_repository.FindBy(predicate)); } }
public async Task <IEnumerable <Customer> > AllIncludeAsync( params Expression <Func <Customer, object> >[] includeProperties) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); return(await _repository.AllIncludeAsync(includeProperties)); } }
public async Task <IEnumerable <ServiceCall> > FindByIncludeAsync( Expression <Func <ServiceCall, bool> > predicate, params Expression <Func <ServiceCall, object> >[] includeProperties) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <ServiceCall>(context); return(await _repository.FindByIncludeAsync(predicate, includeProperties)); } }
public IApplicationState OnBegin(ConnectedRepository repo) { AnswerViewModel avm = new AnswerViewModel( this.CurrentTest.Id, this.Spellings, new SpeachService(), repo); return(avm); }
public IEnumerable <Customer> FindByInclude( Expression <Func <Customer, bool> > predicate, params Expression <Func <Customer, object> >[] includeProperties) { using (var context = _contextCreator()) { _repository = new ConnectedRepository <Customer>(context); return(_repository.FindByInclude(predicate, includeProperties)); } }
public void ShouldSaveTestOccurance() { IConnectedRepository repo = new ConnectedRepository(); var testOccurance = new TestOccurance { SpellTestId = 1, DateTestTaken = DateTime.Now }; repo.SaveTestOccurance(testOccurance); Debug.Print(testOccurance.Id.ToString()); }
public LoadFileDialog(ConnectedRepository repository) { InitializeComponent(); m_repository = repository; var filesInfo = m_repository.AllFilesWithoutContent(); m_filesGrid.DataContext = filesInfo; if (!filesInfo.Any()) { m_createdClmn.Width = 100; m_filesGrid.Width = 100; } SelectedFileId = -1; }