示例#1
0
        static void AddNotBuyingFor(SecretSantaWebContext context, string buyerFirstName, string buyerFamilyName, string receiverFirstName, string receiverFamilyName)
        {
            var buyer    = context.People.SingleOrDefault(p => p.Name == buyerFirstName && p.Family.FamilyName == buyerFamilyName);
            var receiver = context.People.SingleOrDefault(p => p.Name == receiverFirstName && p.Family.FamilyName == receiverFamilyName);

            buyer.NotBuyingFor   = receiver;
            buyer.NotBuyingForID = receiver.PersonID;
        }