Add record to database table in C#
if (model.Roles != null && model.Roles[0] == "Client Integration")
{
clientUser.ClientUserConsents.Add(new ClientUserConsent
{
ClientUserId = clientUser.ClientUserId,
ConsentDate = TimeService.Instance.now(),
VersionNumber = ConfigHelper.ClientConsentVersionNumber
});
}
clientViewClientUserService.UpdateAssignedViews(clientUser, model.SelectedViews);
clientUserRepository.saveChanges();