Esempio n. 1
0
        private async Task SeedAsync(GenericFactory factory, IPropertyAccessContext context)
        {
            var parent = await factory.CreateAsync <Parent>();

            await parent.SetAsync(Parent.Name, "Parent", context);

            await parent.SetAsync(Parent.Description, "Description of Parent", context);

            await parent.SetAsync(Parent.SomeValue, new ByYearAndMonth <int>(new[] {
                new ByYearAndMonth <int> .Entry(2018, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }),
                new ByYearAndMonth <int> .Entry(2019, new[] { 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }),
            }), context);

            var anotherParent = await factory.CreateAsync <Parent>();

            await anotherParent.SetAsync(Parent.Name, "Another Parent", context);

            await anotherParent.SetAsync(Parent.Description, "Description of Another Parent", context);

            await anotherParent.SetAsync(Parent.SomeValue, ByYearAndMonth <int> .Empty, context);
        }