Exemplo n.º 1
0
        public static void EnsureSeedDataForContext(this ContactsManagerContext context)
        {
            if (context.CompanyAddressTypes.Any())
            {
                return;
            }

            var companyAddresstypes = new List <string>
            {
                "Principal address",
                "Invoicing address",
                "Agency"
            };

            foreach (var addressType in companyAddresstypes)
            {
                context.CompanyAddressTypes.Add(new CompanyAddressType
                {
                    InternalDescription = addressType
                });
            }

            context.SaveChanges(true);
        }
Exemplo n.º 2
0
 public Repository(ContactsManagerContext context)
 {
     _context = context;
 }
 public ContactCompanyRelationshipRepository(ContactsManagerContext context)
 {
     _context = context;
 }