CreateResponseHeader() public method

Creates a new ResponseHeader instance, to be persisted when SubmitChanges is called.
public CreateResponseHeader ( int userId ) : ResponseHeader
userId int The ID of the user creating the instance.
return ResponseHeader
Ejemplo n.º 1
0
        /// <summary>
        /// Creates the response header.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>The ID of the created <see cref="ResponseHeader"/></returns>
        private static int CreateResponseHeader(int userId)
        {
            var surveyRepository = new SurveyRepository();
            var header           = surveyRepository.CreateResponseHeader(userId);

            surveyRepository.SubmitChanges();

            return(header.ResponseHeaderId);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates the response header.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>The ID of the created <see cref="ResponseHeader"/></returns>
        private static int CreateResponseHeader(int userId)
        {
            var surveyRepository = new SurveyRepository();
            var header = surveyRepository.CreateResponseHeader(userId);
            surveyRepository.SubmitChanges();

            return header.ResponseHeaderId;
        }