尝试使用实体空间运行函数时出错... [英] Error Trying to run Function with Entity Spatial...

查看:94
本文介绍了尝试使用实体空间运行函数时出错...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有一个非常简单的函数,可以很好地编译,但是在尝试在Visual Studio中运行时实体框架存在问题.这是代码.这里发生了什么?预先感谢.

Have a very simple Function that compiles fine but has Problems with Entity Framework when it attempts to run in Visual Studio. Here is the code. What is going on here? Thanks in Advance. 

using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using System.Data;
using System.Data.Entity.Spatial;

namespace SpatialTestFunction
{
    public static class Function1
    {
        [FunctionName("Function1")]
        public static void Run([TimerTrigger("0 */1 * * * *")]TimerInfo myTimer, TraceWriter log)
        {

          // Create a GeometryPolygon.
           DbGeometry testPoly = System.Data.Entity.Spatial.DbGeometry.PolygonFromText("POLYGON((127.652 -26.244,127.652 -26.194,127.652 -26.244))", 4326);


          DbGeometry Centroid =   testPoly.Centroid ;
           
            log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
        }
    }
}

推荐答案

您正在运行哪个版本的Azure函数v1或v2?
Which version of Azure functions are you running v1 or v2?


这篇关于尝试使用实体空间运行函数时出错...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆