Пример #1
0
        private Login AddNewLoginForCustomer(DefaultContainer context, Customer customer, string loginKeyValue)
        {
            var newLogin = new Login { Username = loginKeyValue, };

            context.AddToLogin(newLogin);
            context.SetLink(newLogin, "Customer", customer);
            context.AddLink(customer, "Logins", newLogin);
            context.SaveChanges();

            return newLogin;
        }
Пример #2
0
        private Login AddNewLoginForCustomer(DefaultContainer context, Customer customer, string loginKeyValue)
        {
            var newLogin = new Login {
                Username = loginKeyValue,
            };

            context.AddToLogin(newLogin);
            context.SetLink(newLogin, "Customer", customer);
            context.AddLink(customer, "Logins", newLogin);
            context.SaveChanges();

            return(newLogin);
        }