Exemplo n.º 1
0
        static void Main(string[] args)
        {
            List <Owners> owners = new List <Owners>();
            List <Dogs>   dogs   = new List <Dogs>();

            using (var db = new DogDBContext())
            {
                // refresh entries
                dogs   = db.Dogs.ToList();
                owners = db.Owners.ToList();

                dogs.ForEach(d => Console.WriteLine($" Dog {d.DogsId} {d.DogName} is a  " +
                                                    $"{d.DogBreed} and is very {d.DogSize}. His owner is called {d.Owner.OwnerName}"));

                owners.ForEach(o => Console.WriteLine($"{o.OwnerId,-10}{o.OwnerName}"));
            }
        }
Exemplo n.º 2
0
 public DataController(DogDBContext context, IHostingEnvironment environment)
 {
     _context     = context;
     _environment = environment;
 }
Exemplo n.º 3
0
 public OwnersController(DogDBContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public DogsController(DogDBContext context)
 {
     _context = context;
 }