Silk.Data.Modelling 0.4.0.5

dotnet add package Silk.Data.Modelling --version 0.4.0.5
                    
NuGet\Install-Package Silk.Data.Modelling -Version 0.4.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Silk.Data.Modelling" Version="0.4.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Silk.Data.Modelling" Version="0.4.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Silk.Data.Modelling" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Silk.Data.Modelling --version 0.4.0.5
                    
#r "nuget: Silk.Data.Modelling, 0.4.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Silk.Data.Modelling@0.4.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Silk.Data.Modelling&version=0.4.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Silk.Data.Modelling&version=0.4.0.5
                    
Install as a Cake Tool

Silk.Data.Modelling

Silk.Data.Modelling is a .NET library for working with data structures and meta data.

Installing

Silk.Data.Modelling is available as a NuGet package: https://www.nuget.org/packages/Silk.Data.Modelling

You can install it from the NuGet package manager in Visual Studio or from command line with dotnet core:

dotnet add package Silk.Data.Modelling

Platform Requirements

Silk.Data.Modelling is built for netstandard2.0.

License

Silk.Data.Modelling is licensed under the MIT license.

Usage

  • Map objects with ObjectMapper.
  • Examine the model of a .NET CLR type with TypeModel.
  • Examine how two models intersect with TypeToTypeIntersectionAnalyzer.
  • Generate a mapping with TypeToTypeMappingFactory.
  • Read and write to an object graph with ObjectGraphReaderWriter.

Map objects with ObjectMapper

ObjectMapper is the standard implementation for mapping data from one type to another.

Use is pretty straightforward:

var mapper = new ObjectMapper();
var typeBObj = mapper.Map<TypeA, TypeB>(typeAObj);

The ObjectMapper will accept custom configurations for analyzing, mapping building, type instance factory and graph reader/writer factory, allowing the developer greater control of how mappings work in different scenarios.

Examine the model of a .NET CLR type with TypeModel

TypeModel is the structure used to examine metadata of a CLR type. To retrieve the TypeModel of a type simply:

TypeModel<TypeA> typeAModel = TypeModel.GetModelOf<TypeA>();

Once you have the TypeModel you can examine it's metadata or you can pass it into more interesting APIs like...

Examine how two models intersect with TypeToTypeIntersectionAnalyzer

TypeToTypeIntersectionAnalyzer is the type used to analyze two models and determine what they have in common.

An intersection analysis consists of two main stages (and behavior of both is completely customizable):

  • Analyze the two models and find candidate fields that could possibly intersect
    • This is goverened by IIntersectCandidateSource implementations the developer can provide
  • Filter the candidate fields against a set of rules of what's interesting
    • These are IIntersectionRule implementations the developer can provide

Once you have the intersection you could use it directly (for, say, determining how an entity type relates to it's database storage schema) or you can...

Generate a mapping with TypeToTypeMappingFactory

TypeToTypeMappingFactory uses similar rules to TypeToTypeIntersectionAnalyzer to generate a mapping between two types. Like other APIs in Silk.Data.Modelling you can provide a custom set of binding rules (IBindingFactory implementations) to govern how models are bound.

Read and write to an object graph with ObjectGraphReaderWriter

ObjectGraphReaderWriter is an abstraction API for reading and writing values to a graph of type instances.

Extending

Silk.Data.Modelling is built so that all of the above can be extended. Developers can develop their own data models, analyzers, mappings and graph read/write APIs that will work with the analysis rules that come with the library out of the box.

Custom Models

Model and field symbols are strongly typed throughout the Silk.Data.Modelling APIs while, largely, being completely agnostic to the type of model or field being used.

A custom model and field structure can be designed by simply implementing IModel and IField and populating objects with the data your model needs.

For an example of this you can look at Silk.Data.SQL.ORM which comes with it's own custom model for modelling how entities are stored in a database and mapping between entity types and the database.

Graph Readers + Writers

The graph reading and writing APIs implement how to store and retrieve information in your data graph. The standard implementation is ObjectGraphReaderWriter which will store data in instances of CLR types. However, none of the standard bindings actually create instance factories or the like, instead focusing purely on the mapping and storage of values - the graph reader/writer API decides how to create instances of the require types.

To implement your own graph reader and writer you need to implement IGraphReader and IGraphWriter.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Silk.Data.Modelling:

Package Downloads
Silk.Data.SQL.ORM

Silk.Data.SQL.ORM provides data orientated APIs for working with SQL data in .NET. Part of the SilkStack project.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0.5 804 3/28/2019
0.4.0.4 825 3/25/2019
0.4.0.3 656 3/11/2019
0.4.0.2 1,206 2/25/2019
0.4.0.1 719 2/16/2019
0.4.0 724 2/11/2019