Exemple #1
0
        public async Task VerifyMetadataPropertyType()
        {
            var api = new PrimitivesApi();
            var edmModel = await api.GetModelAsync();

            var entityType = (IEdmEntityType)
                edmModel.FindDeclaredType(@"Microsoft.Restier.EntityFramework.Tests.Models.Primitives.DateItem");
            Assert.NotNull(entityType);

            Assert.True(entityType.FindProperty("DTProperty").Type.IsDateTimeOffset());
            Assert.True(entityType.FindProperty("DateProperty").Type.IsDate());
            Assert.True(entityType.FindProperty("TODProperty").Type.IsTimeOfDay());
            Assert.True(entityType.FindProperty("TSProperty").Type.IsDuration());
        }
Exemple #2
0
        public async Task VerifyMetadataPropertyType()
        {
            var api      = new PrimitivesApi();
            var edmModel = await api.GetModelAsync();

            var entityType = (IEdmEntityType)
                             edmModel.FindDeclaredType(@"Microsoft.Restier.EntityFramework.Tests.Models.Primitives.DateItem");

            Assert.NotNull(entityType);

            Assert.True(entityType.FindProperty("DTProperty").Type.IsDateTimeOffset());
            Assert.True(entityType.FindProperty("DateProperty").Type.IsDate());
            Assert.True(entityType.FindProperty("TODProperty").Type.IsTimeOfDay());
            Assert.True(entityType.FindProperty("TSProperty").Type.IsDuration());
        }
Exemple #3
0
        public async Task VerifyMetadataPropertyType()
        {
            ApiConfiguration.AddPublisherServices<PrimitivesApi>(services =>
            {
                services.AddODataServices<PrimitivesApi>();
            });
            var api = new PrimitivesApi();
            var edmModel = await api.GetModelAsync();

            var entityType = (IEdmEntityType)
                edmModel.FindDeclaredType(@"Microsoft.Restier.Providers.EntityFramework7.Tests.Models.Primitives.DateItem");
            Assert.NotNull(entityType);

            Assert.True(entityType.FindProperty("DTProperty").Type.IsDateTimeOffset());
            Assert.True(entityType.FindProperty("DateProperty").Type.IsDate());
            Assert.True(entityType.FindProperty("TODProperty").Type.IsTimeOfDay());
            Assert.True(entityType.FindProperty("TSProperty").Type.IsDuration());
        }
Exemple #4
0
        public async Task VerifyMetadataPropertyType()
        {
            ApiConfiguration.AddPublisherServices <PrimitivesApi>(services =>
            {
                services.AddODataServices <PrimitivesApi>();
            });
            var api      = new PrimitivesApi();
            var edmModel = await api.GetModelAsync();

            var entityType = (IEdmEntityType)
                             edmModel.FindDeclaredType(@"Microsoft.Restier.Providers.EntityFramework7.Tests.Models.Primitives.DateItem");

            Assert.NotNull(entityType);

            Assert.True(entityType.FindProperty("DTProperty").Type.IsDateTimeOffset());
            Assert.True(entityType.FindProperty("DateProperty").Type.IsDate());
            Assert.True(entityType.FindProperty("TODProperty").Type.IsTimeOfDay());
            Assert.True(entityType.FindProperty("TSProperty").Type.IsDuration());
        }