Inheritance: ClassMappingBase
        protected XmlDocument WriteComponent(string element, ComponentMappingBase mapping)
        {
            var doc = new XmlDocument();
            var componentElement = doc.AddElement(element);

            if (mapping.HasValue(x => x.Name))
                componentElement.WithAtt("name", mapping.Name);

            if (mapping.HasValue(x => x.Insert))
                componentElement.WithAtt("insert", mapping.Insert);

            if (mapping.HasValue(x => x.Update))
                componentElement.WithAtt("update", mapping.Update);

            if (mapping.HasValue(x => x.Access))
                componentElement.WithAtt("access", mapping.Access);

            if (mapping.HasValue(x => x.Lazy))
                componentElement.WithAtt("lazy", mapping.Lazy);

            if (mapping.HasValue(x => x.OptimisticLock))
                componentElement.WithAtt("optimistic-lock", mapping.OptimisticLock);

            return doc;
        }
 public bool Equals(ComponentMappingBase other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return base.Equals(other) &&
         Equals(other.attributes, attributes) &&
         Equals(other.ContainingEntityType, ContainingEntityType) &&
         Equals(other.Member, Member);
 }
        public override void ProcessComponent(ComponentMappingBase componentMapping)
        {
            if (!componentMapping.Attributes.IsSpecified(x => x.PropertyName))
            {
                if (componentMapping.PropertyInfo == null)
                    throw new ConventionException("Cannot apply the naming convention. No member specified.", componentMapping);

                componentMapping.PropertyName = DetermineNameFromMember(componentMapping.PropertyInfo);
            }
        }
Exemplo n.º 4
0
 public bool Equals(ComponentMappingBase other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) &&
            Equals(other.attributes, attributes) &&
            Equals(other.ContainingEntityType, ContainingEntityType) &&
            Equals(other.Member, Member));
 }
 public virtual void ProcessComponent(ComponentMappingBase componentMapping)
 {
 }
 public virtual void Visit(ComponentMappingBase componentMapping)
 {
 }
 public override void Visit(ComponentMappingBase componentMapping)
 {
     componentMapping.AcceptVisitor(this);
 }
 public void AddComponent(ComponentMappingBase componentMapping)
 {
     components.Add(componentMapping);
 }
 public void AddComponent(ComponentMappingBase componentMapping)
 {
     mappedMembers.AddComponent(componentMapping);
 }