Beispiel #1
0
        void SetDefaultAccess()
        {
            var resolvedAccess = MemberAccessResolver.Resolve(member);

            if (resolvedAccess == Mapping.Access.Property || resolvedAccess == Mapping.Access.Unset)
                return; // property is the default so we don't need to specify it

            attributes.Set("Access", Layer.Defaults, resolvedAccess.ToString());
        }
        void ParentReference(Member property, Action <ParentPropertyPart> customMapping)
        {
            var parentMapping = new ParentMapping
            {
                ContainingEntityType = entity
            };

            parentMapping.Set(x => x.Name, Layer.Defaults, property.Name);

            var access = MemberAccessResolver.Resolve(property);

            if (access != Access.Property && access != Access.Unset)
            {
                parentMapping.Set(x => x.Access, Layer.Defaults, access.ToString());
            }

            customMapping?.Invoke(new ParentPropertyPart(parentMapping));

            attributes.Set("Parent", Layer.Defaults, parentMapping);
        }
Beispiel #3
0
        TBuilder ParentReference(Member property, Action <ParentPropertyPart> customMapping)
        {
            var parentMapping = new ParentMapping
            {
                ContainingEntityType = typeof(TEntity)
            };

            parentMapping.Set(x => x.Name, Layer.Defaults, property.Name);

            var defaultAccess = MemberAccessResolver.Resolve(property);

            if (defaultAccess != Mapping.Access.Property && defaultAccess != Mapping.Access.Unset)
            {
                parentMapping.Set(x => x.Access, Layer.Defaults, defaultAccess.ToString());
            }

            customMapping?.Invoke(new ParentPropertyPart(parentMapping));

            attributes.Set("Parent", Layer.Defaults, parentMapping);

            return((TBuilder)this);
        }