Пример #1
0
        public static void EnsureSeedDataForContext(this ChurchAppContext context)
        {
            if (context.DonationTypes.Any())
            {
                return;
            }

            var donationTypes = new List <DonationType>()
            {
                new DonationType()
                {
                    Type = "Tithe"
                },
                new DonationType()
                {
                    Type = "Offering"
                },
                new DonationType()
                {
                    Type = "Pledge"
                }
            };

            context.AddRange(donationTypes);
            context.SaveChanges();
        }
        public static void EnsureSeedDataForContext(this ChurchAppContext context)
        {
            if (context.DonationTypes.Any())
            {
                return;
            }

            var addressTypes = new List <AddressType>()
            {
                new AddressType()
                {
                    Name = "Home"
                },
                new AddressType()
                {
                    Name = "Work"
                }
            };

            context.AddRange(addressTypes);
            context.SaveChanges();
        }
 public void Create(ICollection <Donation> donations)
 {
     _churchAppContext.AddRange(donations);
 }