Business Logic Toolkit for .NET
www.bltoolkit.net
|  Home   |  Download   |  Documentation   |  Discussions   |  License   |

  Source.Mapping.NullableAttribute.cs

 
using System;

namespace BLToolkit.Mapping
{
    [AttributeUsage(
        AttributeTargets.Property | AttributeTargets.Field |
        AttributeTargets.Class | AttributeTargets.Interface)]
    public class NullableAttribute : Attribute
    {
        public NullableAttribute()
        {
            _isNullable = true;
        }

        public NullableAttribute(bool isNullable)
        {
            _isNullable = isNullable;
        }

        public NullableAttribute(Type type)
        {
            _type       = type;
            _isNullable = true;
        }

        public NullableAttribute(Type type, bool isNullable)
        {
            _type       = type;
            _isNullable = isNullable;
        }

        private bool _isNullable;
        public  bool  IsNullable
        {
            get { return _isNullable;  }
            set { _isNullable = value; }
        }

        private readonly Type _type;
        public           Type  Type
        {
            get { return _type; }
        }
    }
}
 
© 2010 www.bltoolkit.net
support@bltoolkit.net