using System.ServiceModel.Channels;
using System.Xml;

namespace BeWo.Multitenancy
{
    public class MultitenancyHeader : MessageHeader
    {
        public override bool MustUnderstand
        {
            get
            {
                return false;
            }
        }

        public override string Name
        {
            get
            {
                return "Multitenancy";
            }
        }

        public override string Namespace
        {
            get
            {
                return "http://beyondsoft.de/Multitenancy.xsd";
            }
        }

        public string Tenant { get; set; }

        protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
        {
            writer.WriteElementString("Tenant", this.Tenant);
        }
    }
}