ServiceStack ORMLite 是否可用于 .NET Core
Is ServiceStack ORMLite available for .NET Core
我看到了一些针对 .NET Core 的 ServiceStakck ORMLite 的提交 this
我们可以立即尝试还是只是 nuget 规范更新?我希望为 .Net 核心项目 (ServiceStack.OrmLite.PostgreSQL.Core) 集成 ServiceStack ORMLite。
正如 NuGet 包的 details page 中所述,您可以将它与至少具有 .NETStandard 1.3 的 .Net Core 一起使用。
但是如果你查看最新的 release note。他们说:
Just like the other .NET Core libraries .NET Core builds of
ServiceStack.Redis is released with a *.Core suffix until development
of .NET Core has stabilized.
所有 OrmLite's supported packages 都包含 .NET Framework v4.5 和 .NET Standard 2.0 版本,可以使用在 .NET Framework 和 .NET Core 项目中可以正常使用:
public class Person
{
[AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
}
public class Program
{
public static string PostgreSqlDb = "{Connection String}";
public static void Main(string[] args)
{
var dbFactory = new OrmLiteConnectionFactory(
PostgreSqlDb, PostgreSqlDialect.Provider);
using (var db = dbFactory.Open())
{
db.DropAndCreateTable<Person>();
5.Times(i => db.Insert(new Person { Name = "Name {i}" }));
var results = db.Select<Person>();
results.PrintDump();
}
Console.ReadLine();
}
}
我看到了一些针对 .NET Core 的 ServiceStakck ORMLite 的提交 this
我们可以立即尝试还是只是 nuget 规范更新?我希望为 .Net 核心项目 (ServiceStack.OrmLite.PostgreSQL.Core) 集成 ServiceStack ORMLite。
正如 NuGet 包的 details page 中所述,您可以将它与至少具有 .NETStandard 1.3 的 .Net Core 一起使用。
但是如果你查看最新的 release note。他们说:
Just like the other .NET Core libraries .NET Core builds of ServiceStack.Redis is released with a *.Core suffix until development of .NET Core has stabilized.
所有 OrmLite's supported packages 都包含 .NET Framework v4.5 和 .NET Standard 2.0 版本,可以使用在 .NET Framework 和 .NET Core 项目中可以正常使用:
public class Person
{
[AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
}
public class Program
{
public static string PostgreSqlDb = "{Connection String}";
public static void Main(string[] args)
{
var dbFactory = new OrmLiteConnectionFactory(
PostgreSqlDb, PostgreSqlDialect.Provider);
using (var db = dbFactory.Open())
{
db.DropAndCreateTable<Person>();
5.Times(i => db.Insert(new Person { Name = "Name {i}" }));
var results = db.Select<Person>();
results.PrintDump();
}
Console.ReadLine();
}
}