コード例 #1
0
        public CatRepository()
        {
            var barry = new Cat()
            {
                Birth  = TimestampFactory.GetTimestamp(new DateTime(2017, 11, 5, 3, 45, 0)),
                Hungry = false,
                Mood   = Mood.Amber,
                Id     = Guid.NewGuid().ToString(),
                Name   = "Barry"
            };

            var doug = new Cat()
            {
                Birth  = TimestampFactory.GetTimestamp(new DateTime(2018, 5, 4, 13, 25, 13)),
                Hungry = true,
                Mood   = Mood.Red,
                Id     = Guid.NewGuid().ToString(),
                Name   = "Doug"
            };

            var fluffy = new Cat()
            {
                Birth  = TimestampFactory.GetTimestamp(new DateTime(2010, 2, 19, 4, 15, 25)),
                Hungry = false,
                Mood   = Mood.Green,
                Id     = Guid.NewGuid().ToString(),
                Name   = "Fluffy"
            };

            Cats.AddOrOverwrite(barry.Id, barry);
            Cats.AddOrOverwrite(doug.Id, doug);
            Cats.AddOrOverwrite(fluffy.Id, fluffy);
        }