Exemplo n.º 1
0
        public ChlorineLevelsController()
        {
            // TODO(crhodes)
            // Figure out how to register the dbContext.

            _repository = new ConnectedRepository <ChlorineLevel>(new CustomPoolAndSpa.LookupData.CustomPoolAndSpaLookupsDbContext());
        }
Exemplo n.º 2
0
        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}");
            }
        }
Exemplo n.º 3
0
 public void Update(TYPE entity)
 {
     using (var context = _contextCreator())
     {
         _repository = new ConnectedRepository <TYPE>(context);
         _repository.Update(entity);
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 6
0
        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);
     }
 }
Exemplo n.º 12
0
 public void Delete(int entityId)
 {
     using (var context = _contextCreator())
     {
         _repository = new ConnectedRepository <Customer>(context);
         _repository.Delete(entityId);
     }
 }
Exemplo n.º 13
0
 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));
     }
 }
Exemplo n.º 15
0
 public IEnumerable <Customer> All()
 {
     using (var context = _contextCreator())
     {
         _repository = new ConnectedRepository <Customer>(context);
         return(_repository.All());
     }
 }
Exemplo n.º 16
0
 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());
     }
 }
Exemplo n.º 18
0
 public async Task <List <Customer> > AllAsync()
 {
     using (var context = _contextCreator())
     {
         _repository = new ConnectedRepository <Customer>(context);
         return(await _repository.AllAsync());
     }
 }
Exemplo n.º 19
0
 public Customer FindById(int entityId)
 {
     using (var context = _contextCreator())
     {
         _repository = new ConnectedRepository <Customer>(context);
         return(_repository.FindById(entityId));
     }
 }
Exemplo n.º 20
0
 public async Task DeleteAsync(int entityId)
 {
     using (var context = _contextCreator())
     {
         _repository = new ConnectedRepository <Customer>(context);
         await _repository.DeleteAsync(entityId);
     }
 }
Exemplo n.º 21
0
 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));
     }
 }
Exemplo n.º 24
0
 public IEnumerable <Customer> FindBy(
     Expression <Func <Customer, bool> > predicate)
 {
     using (var context = _contextCreator())
     {
         _repository = new ConnectedRepository <Customer>(context);
         return(_repository.FindBy(predicate));
     }
 }
Exemplo n.º 25
0
 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));
     }
 }
Exemplo n.º 27
0
        public IApplicationState OnBegin(ConnectedRepository repo)
        {
            AnswerViewModel avm = new AnswerViewModel(
                this.CurrentTest.Id,
                this.Spellings,
                new SpeachService(),
                repo);

            return(avm);
        }
Exemplo n.º 28
0
 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));
     }
 }
Exemplo n.º 29
0
        public void ShouldSaveTestOccurance()
        {
            IConnectedRepository repo = new ConnectedRepository();
            var testOccurance         = new TestOccurance
            {
                SpellTestId   = 1,
                DateTestTaken = DateTime.Now
            };

            repo.SaveTestOccurance(testOccurance);
            Debug.Print(testOccurance.Id.ToString());
        }
Exemplo n.º 30
0
        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;
        }