Пример #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();
        }
Пример #3
0
 public bool Save()
 {
     return(_churchAppContext.SaveChanges() >= 0);
 }
Пример #4
0
 public bool Save()
 {
     return(_context.SaveChanges() >= 0);
 }