public void StorePhoneContact(PhoneCallContact phoneCallContact, string userEmail) { const string subjectTxt = "Phone call"; var member = db.MemberRepository.FindMemberById(phoneCallContact.MemberId); // To assign user id to contact record property var user = db.AppUserRepository.FindUserByEmail(userEmail); var contact = new ContactRecord { CCGMember = member, Subject = subjectTxt, Comments = phoneCallContact.Comments, ContactDate = phoneCallContact.CallDateTime, Timestamp = DateTime.Now, Duration = phoneCallContact.CallDuration, PassAlong = phoneCallContact.PassAlong, ContactTypeId = phoneCallContact.ContactTypeId, AppUserId = user.Id }; db.ContactRecordRepository.Add(contact); }