コード例 #1
0
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index {
                Conventions = new DocumentConvention()
            };

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                "docs.Technologies\r\n\t.Where(technology => !technology.Id.EndsWith(\"/published\"))\r\n\t.Select(technology => new {TechnologyId = technology.Id, DrugId = technology.Drug.Id})",
                indexDefinition.Map);
        }
コード例 #2
0
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index();

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                @"docs.Technologies.Where(technology => !Id(technology).EndsWith(""/published"")).Select(technology => new {
    TechnologyId = Id(technology),
    DrugId = technology.Drug.Id
})".Replace("\r\n", Environment.NewLine),
                indexDefinition.Maps.First());
        }
コード例 #3
0
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index {
                Conventions = new DocumentConvention
                {
                    PrettifyGeneratedLinqExpressions = false
                }
            };

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                @"docs.Technologies.Where(technology => !technology.__document_id.EndsWith(""/published"")).Select(technology => new {
    TechnologyId = technology.__document_id,
    DrugId = technology.Drug.Id
})",
                indexDefinition.Map);
        }
コード例 #4
0
ファイル: Andrew.cs プロジェクト: yitaom2/ravendb
        public void CanCompile()
        {
            var technologySummaryIndex = new TechnologySummary_Index
            {
                Conventions = new DocumentConventions
                {
#pragma warning disable CS0618 // Type or member is obsolete
                    PrettifyGeneratedLinqExpressions = false
#pragma warning restore CS0618 // Type or member is obsolete
                }
            };

            var indexDefinition = technologySummaryIndex.CreateIndexDefinition();

            Assert.Equal(
                @"docs.Technologies.Where(technology => !Id(technology).EndsWith(""/published"")).Select(technology => new {
    TechnologyId = Id(technology),
    DrugId = technology.Drug.Id
})".Replace("\r\n", Environment.NewLine),
                indexDefinition.Maps.First());
        }