Example #1
0
        public DocumentMapping(Type documentType, StoreOptions storeOptions)
        {
            if (documentType == null)
            {
                throw new ArgumentNullException(nameof(documentType));
            }
            if (storeOptions == null)
            {
                throw new ArgumentNullException(nameof(storeOptions));
            }

            _schemaObjects = new DocumentSchemaObjects(this);

            _storeOptions = storeOptions;

            DocumentType = documentType;
            Alias        = defaultDocumentAliasName(documentType);

            IdMember = FindIdMember(documentType);

            if (IdMember != null)
            {
                _fields[IdMember.Name] = new IdField(IdMember);
                IdStrategy             = defineIdStrategy(documentType, storeOptions);
            }

            applyAnyMartenAttributes(documentType);
        }
Example #2
0
        public DocumentMapping(Type documentType, StoreOptions storeOptions) : base("d.data", documentType, storeOptions)
        {
            if (documentType == null)
            {
                throw new ArgumentNullException(nameof(documentType));
            }
            if (storeOptions == null)
            {
                throw new ArgumentNullException(nameof(storeOptions));
            }

            _schemaObjects = new DocumentSchemaObjects(this);

            _storeOptions = storeOptions;

            DocumentType = documentType;
            Alias        = defaultDocumentAliasName(documentType);

            IdMember = FindIdMember(documentType);

            applyAnyMartenAttributes(documentType);
        }