Пример #1
0
        /// <summary>
        /// Reads properties of a <see cref="GuidDataKey"/> from a data reader.
        /// </summary>
        public static void Read(this GuidDataKey entity, SqlDataReader reader)
        {
            // Validate.
            if (entity is null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            // Read entity.
            entity.Id = reader.Get <Guid>("Id");
        }
Пример #2
0
        /// <summary>
        /// Sets data command parameter values for a <see cref="GuidDataKey"/>.
        /// </summary>
        public static void Set(this GuidDataKey entity, SqlParameterCollection parameters)
        {
            // Validate.
            if (entity is null)
            {
                throw new ArgumentNullException(nameof(entity));
            }
            if (parameters is null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            // Set parameters.
            parameters["@id"].Value = entity.Id;
        }
Пример #3
0
 /// <summary>
 /// Sets data command parameter values for a <see cref="GuidDataKey"/>.
 /// </summary>
 public static void Set(this GuidDataKey entity, SqlParameterCollection parameters)
 {
     parameters["@id"].Value = entity.Id;
 }
Пример #4
0
 /// <summary>
 /// Reads properties of a <see cref="GuidDataKey"/> from a data reader.
 /// </summary>
 public static void Read(this GuidDataKey entity, SqlDataReader reader)
 {
     entity.Id = reader.Get <Guid>("Id");
 }