Beispiel #1
0
        public void RepositorioCustomer()
        {
            Random rdm   = new Random();
            Users  _user = new Users("Latino", $"latino{rdm.Next(0, 10000)}@gmail.com", "123456");


            Customer _customer = new Customer($"{rdm.Next(100, 999)}56811892", DateTime.Now, "30526425", true, _user);
            Address  _address  = new Address("Rua testeAddress", 25, "TesteTesteAddress", "TesteTesteAddress", "TesteTestAddress", "TesteTesteAddress", "78005-210", _customer.ID);

            // _customer.Rel_AdressList.Add(_address);

            _repositoryUsers.AddEntity(_user);
            //((DbContextEF)_context).SaveChanges();
            _repositoryCustomer.AddEntity(_customer);
            //((DbContextEF)_context).SaveChanges();
            _repositoryAddress.AddEntity(_address);
            //((DbContextEF)_context).SaveChanges();
            // _repositoryCustomer.AddEntity(_customer);

            var customerQuery       = _repositoryCustomer.GetCustomer(_customer.ID);
            var customerCPF         = _repositoryCustomer.GetCustomerCPF(_customer.Document);
            var customerWithAddress = _repositoryCustomer.GetCustomerWithAddress(customerCPF.CustomerId);
            //Guid.Parse("7E03E3AA-9BB9-4BF6-9C4C-5BD584E8B514")
        }
Beispiel #2
0
 public ObjectRequest GetCustomerWithAddress(Guid Id) => new ObjectRequest()
 .CreateObjectRequest(_repCustomer.GetCustomerWithAddress(Id), true);