如何在 Microsoft Azure Function 中创建一个类? [英] How to create a class inside Microsoft Azure Function?
问题描述
可能这是一个错误的问题,但我需要创建一个模型/类并在 azure 函数中访问它.我无法找到如何创建课程.
May be it's a wrong question, but I need to create a Model/class and access same in azure function. I could not able to find how can I create a class.
推荐答案
类可以内联创建,因为它通常会在常规 C# 项目中定义一个类.这是一个例子 定义类的函数.
Classes may be created inline as it would typically define a class in a regular C# project. Here's an example of a function that defines a class.
您还可以在单独的文件中定义类,并使用 这里.
You can also define classes in separate files and reference those files using the #load
directive as documented here.
另一种选择是引用定义类的程序集,如 在此处记录.
Another option is to reference an assembly where your classes are defined, as documented here.
而且,另一种方法和另一种选择是使用新发布的 适用于 Azure Functions 的 Visual Studio 2017 工具
And, a different approach, and yet another option, is to use the newly announced Visual Studio 2017 Tools for Azure Functions
这篇关于如何在 Microsoft Azure Function 中创建一个类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!