Esempio n. 1
0
        public ActionResult Select(int interestId, int contactId)
        {
            var contactModel = new ContactInterestData();
            var contact      = new ContactDetail();

            contact.ContactId = contactId;
            var svc = CreateInterestService();

            contactModel.InterestId = interestId;
            svc.AddInterest();
            return(View(contactModel));
        }
Esempio n. 2
0
        public bool AddInterest()
        {
            //TODO: persist item from Interest
            var model  = new ContactInterestData();
            var entity =
                new ContactInterest()
            {
                ContactId  = model.Id,
                InterestId = model.InterestId,
                //Item = item.ToString()
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.ContactInterests.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }