示例#1
0
        public ActionResult <IEnumerable <Pet> > Get()
        {
            var pets = new List <Pet>();
            var pet  = new Pet();

            pet.Id            = 0;
            pet.Name          = FakeDB.GenerateName(12);
            pet.Type          = FakeDB.GenerateType();
            pet.Color         = FakeDB.GenerateColor();
            pet.Birthdate     = FakeDB.GenerateDate(new DateTime(1990, 1, 1));
            pet.PreviousOwner = new Owner("Lars", "Madsen", "Kronprinsensgade 143, 6700, Esbjerg", "*****@*****.**", "40 37 27 63");
            pet.SoldDate      = FakeDB.GenerateDate(pet.Birthdate);
            pet.Price         = FakeDB.GeneratePrice(pet.Type);
            pets.Add(pet);
            return(pets);
        }