Versions of XData
XData delivered as two specific versions: .Net 4.0 package to use with full featured Windows .Net framework version 4.0 or later, and cross platformed .Net Standard 2.0 package.
The versions has similar API but some different implementations of certain features:
1) Different initialization of XData:
Net 4.0:
using (var dataEngine = XDataManager.InitXData(x =>
x.UseConfiguration(ConfigurationManager
.OpenExeConfiguration(ConfigurationUserLevel.None))))
{
using (var dataScope = dataEngine.NewDataScope())
{
foreach(var data in dataScope.GetRepository<SomeObject>())
Console.WriteLine(string.Format("{0}, {1}", data.SomeId, data.Name));
}
}
NetStandard 2.0:
//Set configuration file
var builder = new ConfigurationBuilder();
builder.AddXmlFile("MyConsoleApp.config");
var configFile = builder.Build();
//Set services
using(var serviceProvider = new ServiceCollection()
.AddLogging()
// Localization only for ASP.NET Core
.AddSingleton(typeof(IStringLocalizerFactory), x => null)
.AddSingleton(typeof(IConfigurationRoot), x => configFile)
.AddXData()
.BuildServiceProvider())
{
//Configure logging
serviceProvider.GetRequiredService<ILoggerFactory>()
.AddConsole(LogLevel.Warning).AddDebug();
var dataEngine = serviceProvider.GetRequiredService<IDataEngine>();
using (var dataScope = dataEngine.NewDataScope())
{
foreach(var data in dataScope.GetRepository<SomeObject>())
Console.WriteLine($"{data.SomeId}, {data.Name}");
}
}
2) Logging in .Net 4.0 version is realized with log plugins implements ILogWriter interface. Logging in .Net Standard 2.0 version is realized using Microsoft.Extensions.Logging service.
3) Configuration of .Net 4.0 version is limited by using app.config/web.config files. Configuration in .Net Standard 2.0 version is realized using Microsoft.Extensions.Configuration service. Configuration structure for both versions described here.
4) Localization of .Net 4.0 version use satellite localization assemblies. Localization in .Net Standard 2.0 version is realized using Microsoft.Extensions.Localization service. Localization procedures for both versions described here.
5) Some database adapters not implemented for .Net Standard 2.0 version because no applicable implementation of .Net data providers for .Net Standard 2.0 found now. We are hope they will be implemented in short time future, and XData can be use that databases too.
6) Three tier architecture is not implemented for .Net Standard 2.0 version for now. Some limitations of current .Net Core realization makes not possible to implement this feature on same technologies now. And no specific requests to implement it quick as possible.
7) Three tier client plugin required full .Net 4.0 framework only (base functionality is available on .Net 4.0 Client version). Life time limited cache (for IDataScope and WorkSet) is required full .Net 4.0 framework. Same caching functionality is implemented in .Net Standard 2.0 version.