DapperExtensions.Mapper.PropertyMap.ReadOnly C# (CSharp) Method

ReadOnly() public method

Fluently sets the read-only status of the property.
public ReadOnly ( ) : PropertyMap
return PropertyMap
        public PropertyMap ReadOnly()
        {
            if (KeyType != KeyType.NotAKey)
            {
                throw new ArgumentException(string.Format("'{0}' is a key field and cannot be marked readonly.", Name));
            }

            IsReadOnly = true;
            return this;
        }