如何解决在C#.NET Core中使用Azure TableStorage-Nuget程序包WindowsAzure.Storage Alternative
我正在编写一个新应用程序以将日志存储在Azure的表存储中。
这是我的存储对象的外观:
public class ErrorLog : TableEntity
{
public static ErrorLog Create(DateTime dateTime,int httpStatusCode,string message)
=> new ErrorLog
{
PartitionKey = GetPartitionKey(dateTime),RowKey = GetRowKey(dateTime),HttpStatusCode = httpStatusCode,Message = message,};
public int HttpStatusCode { get; set; }
public string Message { get; set; }
public static string GetPartitionKey(DateTime dateTime)
=> dateTime.ToString("yyyy_MM_dd_HH");
public static string GetRowKey(DateTime dateTime)
=> dateTime.ToString("mm_ss");
}
但是,我试图找到新的NuGet软件包而不是“ WindowsAzure.Storage”(已弃用)以使用,无济于事。
解决方法
已弃用WindowsAzure.Storage。软件包Microsoft.Azure.CosmosDB.Table处于维护模式,将很快弃用。您应该使用Microsoft.Azure.Cosmos.Table库也可以用于访问Azure存储表。
,Microsoft.Azure.Cosmos.Table是一个用于Azure表的新程序包。 https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Table
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。