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)); }
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); } }