示例#1
0
        static void Main(string[] args)
        {
            CarRentalServicesDBContext _context = new CarRentalServicesDBContext();



            //var car = new Car{
            //    Brand = "Tesla",
            //    Model = "X",
            //    Year = 2016,
            //    Regnumber = "test"
            //};
            //var addCar = carMethods.AddCar(car);
            //_context.SaveChanges();



            var cust = new Customer {
                FirstName = "Ramin", LastName = "Runesson", Phone = "0703454545", Email = "*****@*****.**"
            };

            methods.ChangeCustomer(cust);
            List <Customer> customers = methods.GetAllCustomers();

            foreach (Customer c in customers)
            {
                Write(c.FirstName);
            }
            ReadKey();
        }
示例#2
0
        public string GetAllCustomer()
        {
            List <Customer> customers = customerMethods.GetAllCustomers();
            var             json      = JsonConvert.SerializeObject(customers);

            return(json);
        }
示例#3
0
 public List <Customer> GetAllCustomers()
 {
     return(customerMethods.GetAllCustomers());
 }