This project is used to generate the artifact classes for the C# Deblazer ORM used by Digitec Galaxus
Roslyn is used to generate the artifact classes from a DBML File generate by the SqlMetal.exe
Download the latest release from
- Download SQL Metal
- Generate DBML File:
sqlmetal.exe /conn:"Data Source=MySQlServer;Initial Catalog=MyDatabase;Integrated Security=True;" /timeout:0 /dbml:"DataClasses.dbml" /namespace:devinite.Meta.DbLayer /language:csharp /pluralize- Generate Artifacts
deblazer.artifacts.exe -dbml <Path to DBML File> -o <OutputPath>- Add the files to a .csproj
- Add References for
System.ComponentModel.DataAnnotationsandSystem.Data.Linq - Create a "Db" Class for accessing your artifacts
using Dg.Deblazer.Write;
namespace Deblazer.WideWorldImporter.DbLayer
{
public class Db : WriteDb
{
public Db(string connectionString) : base(connectionString, allowLoadingBinaryData: true)
{}
}
}- Create a query
var topTenPeople = db.Application_Peoples()
.TakeDb(takeCount)
.ToList();The tooling uses f# as primary Language targeting the .NET 4.6.1 Framework. .NET core is not yet possible because of the usuage of an XML Type-Provider.