public async Task <IActionResult> AddUserBookmarkedContent([FromBody] AddUserBookMarks userBookmarks) { try { ProfileDataAccess _profileAccess = new ProfileDataAccess(_iconfiguration); DatabaseResponse response = await _profileAccess.AddUserBookmarkedContent(userBookmarks); if (response.ResponseCode == (int)DbReturnValue.CreateSuccess) { return(Ok(new OperationResponse { HasSucceeded = true, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.CreateSuccess), ReturnedObject = response.Results })); } else if (response.ResponseCode == (int)DbReturnValue.CreationFailed) { Log.Warning(EnumExtensions.GetDescription(DbReturnValue.CreationFailed)); return(Ok(new OperationResponse { HasSucceeded = false, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.CreationFailed), ReturnedObject = response.Results })); } else if (response.ResponseCode == (int)DbReturnValue.RecordExists) { Log.Warning(EnumExtensions.GetDescription(DbReturnValue.RecordExists)); return(Ok(new OperationResponse { HasSucceeded = false, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.RecordExists), ReturnedObject = response.Results })); } else { Log.Warning(EnumExtensions.GetDescription(DbReturnValue.NotExists)); return(Ok(new OperationResponse { HasSucceeded = false, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.NotExists), ReturnedObject = response.Results })); } } catch (Exception ex) { Log.Error(new ExceptionHelper().GetLogString(ex, ErrorLevel.Critical)); return(Ok(new OperationResponse { HasSucceeded = false, Message = StatusMessages.ServerError, StatusCode = ((int)ResponseStatus.ServerError).ToString(), IsDomainValidationErrors = false })); } }