diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b9901a --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# For use with Visual Studio + +syntax: glob +*.vs +*.suo +*.user +*.FileListAbsolute.txt +*bin/ +*obj/ +*/bin/* +*/obj/* +*.ncb +*.nlb +*.aps +*.clw +*.pdb +*.obj +*.exe +*.pch +*.vspscc +*.vsmdi +*_i.c +*_p.c +*.tlb +*.tlh +*.bak +*.cache +*.Cache +*.ilk +*.log +*.lib +*.sbr +*.scc +*.sig +_ReSharper*/* +TestResults/* +desktop.ini +publish +publish +packages diff --git a/Blink.Backoffice.Services.PcmDb/Blink.Backoffice.Services.PcmDb.csproj b/Blink.Backoffice.Services.PcmDb/Blink.Backoffice.Services.PcmDb.csproj new file mode 100644 index 0000000..7f1307a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Blink.Backoffice.Services.PcmDb.csproj @@ -0,0 +1,22 @@ + + + + net8.0 + enable + enable + 12 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/AkwizytorEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/AkwizytorEntityType.cs new file mode 100644 index 0000000..7873853 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/AkwizytorEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class AkwizytorEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Akwizytor", + typeof(Akwizytor), + baseEntityType); + + var akwId = runtimeEntityType.AddProperty( + "AkwId", + typeof(decimal), + propertyInfo: typeof(Akwizytor).GetProperty("AkwId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Akwizytor).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + akwId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + akwId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + akwId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var nazwisko = runtimeEntityType.AddProperty( + "Nazwisko", + typeof(string), + propertyInfo: typeof(Akwizytor).GetProperty("Nazwisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Akwizytor).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(Akwizytor).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Akwizytor).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prowizja = runtimeEntityType.AddProperty( + "Prowizja", + typeof(decimal), + propertyInfo: typeof(Akwizytor).GetProperty("Prowizja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Akwizytor).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + prowizja.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + prowizja.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + prowizja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { akwId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_AKWIZYTOR"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Akwizytor"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ArtykulEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ArtykulEntityType.cs new file mode 100644 index 0000000..5d43513 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ArtykulEntityType.cs @@ -0,0 +1,182 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ArtykulEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Artykul", + typeof(Artykul), + baseEntityType); + + var artId = runtimeEntityType.AddProperty( + "ArtId", + typeof(decimal), + propertyInfo: typeof(Artykul).GetProperty("ArtId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Artykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + artId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + artId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + artId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var artNazwa = runtimeEntityType.AddProperty( + "ArtNazwa", + typeof(string), + propertyInfo: typeof(Artykul).GetProperty("ArtNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Artykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + artNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + artNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrArtId = runtimeEntityType.AddProperty( + "CentrArtId", + typeof(decimal?), + propertyInfo: typeof(Artykul).GetProperty("CentrArtId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Artykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrArtId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrArtId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrArtId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var glownyTowId = runtimeEntityType.AddProperty( + "GlownyTowId", + typeof(decimal?), + propertyInfo: typeof(Artykul).GetProperty("GlownyTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Artykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + glownyTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + glownyTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + glownyTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { artId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ARTYKUL"); + + var index = runtimeEntityType.AddIndex( + new[] { glownyTowId }); + + var idx_CentrArtId = runtimeEntityType.AddIndex( + new[] { centrArtId }, + name: "idx_CentrArtId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("GlownyTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType); + + var glownyTow = declaringEntityType.AddNavigation("GlownyTow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Artykul).GetProperty("GlownyTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Artykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var artykul = principalEntityType.AddNavigation("Artykul", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Artykul", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ARTGLOWNYTOWID"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Artykul"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/AsortEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/AsortEntityType.cs new file mode 100644 index 0000000..a286e06 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/AsortEntityType.cs @@ -0,0 +1,431 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class AsortEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + typeof(Asort), + baseEntityType); + + var asId = runtimeEntityType.AddProperty( + "AsId", + typeof(decimal), + propertyInfo: typeof(Asort).GetProperty("AsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + asId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + asId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + asId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var autoryzacja = runtimeEntityType.AddProperty( + "Autoryzacja", + typeof(short?), + propertyInfo: typeof(Asort).GetProperty("Autoryzacja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + autoryzacja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + autoryzacja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bezAutoEtykiet = runtimeEntityType.AddProperty( + "BezAutoEtykiet", + typeof(short?), + propertyInfo: typeof(Asort).GetProperty("BezAutoEtykiet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + bezAutoEtykiet.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + bezAutoEtykiet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrAsId = runtimeEntityType.AddProperty( + "CentrAsId", + typeof(decimal?), + propertyInfo: typeof(Asort).GetProperty("CentrAsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrAsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrAsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrAsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var hurtRabat = runtimeEntityType.AddProperty( + "HurtRabat", + typeof(decimal), + propertyInfo: typeof(Asort).GetProperty("HurtRabat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + hurtRabat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + hurtRabat.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + hurtRabat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var marza = runtimeEntityType.AddProperty( + "Marza", + typeof(decimal), + propertyInfo: typeof(Asort).GetProperty("Marza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + marza.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + marza.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + marza.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Asort).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nocNarzut = runtimeEntityType.AddProperty( + "NocNarzut", + typeof(decimal), + propertyInfo: typeof(Asort).GetProperty("NocNarzut", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nocNarzut.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + nocNarzut.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + nocNarzut.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaMarzy = runtimeEntityType.AddProperty( + "OpcjaMarzy", + typeof(short), + propertyInfo: typeof(Asort).GetProperty("OpcjaMarzy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaMarzy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaMarzy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaNarzutu = runtimeEntityType.AddProperty( + "OpcjaNarzutu", + typeof(short), + propertyInfo: typeof(Asort).GetProperty("OpcjaNarzutu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaNarzutu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaNarzutu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaRabatu = runtimeEntityType.AddProperty( + "OpcjaRabatu", + typeof(short), + propertyInfo: typeof(Asort).GetProperty("OpcjaRabatu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaRabatu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaRabatu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(decimal?), + propertyInfo: typeof(Asort).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + param1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ukrytyNaBonowniku = runtimeEntityType.AddProperty( + "UkrytyNaBonowniku", + typeof(short?), + propertyInfo: typeof(Asort).GetProperty("UkrytyNaBonowniku", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ukrytyNaBonowniku.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + ukrytyNaBonowniku.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ukrytyNaPanelach = runtimeEntityType.AddProperty( + "UkrytyNaPanelach", + typeof(short?), + propertyInfo: typeof(Asort).GetProperty("UkrytyNaPanelach", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ukrytyNaPanelach.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + ukrytyNaPanelach.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { asId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ASORT"); + + var idx_CentrAsId = runtimeEntityType.AddIndex( + new[] { centrAsId }, + name: "idx_CentrAsId"); + + return runtimeEntityType; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Kasa", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("AsId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("AsId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Asort).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("As"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static RuntimeSkipNavigation CreateSkipNavigation2(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Sklep", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("AsId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("AsId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Asort).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("As"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Asort"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/BankEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/BankEntityType.cs new file mode 100644 index 0000000..28e1c63 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/BankEntityType.cs @@ -0,0 +1,247 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class BankEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Bank", + typeof(Bank), + baseEntityType); + + var bankId = runtimeEntityType.AddProperty( + "BankId", + typeof(decimal), + propertyInfo: typeof(Bank).GetProperty("BankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + bankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + bankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + bankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var adres = runtimeEntityType.AddProperty( + "Adres", + typeof(string), + propertyInfo: typeof(Bank).GetProperty("Adres", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + adres.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + adres.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Bank).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrBankId = runtimeEntityType.AddProperty( + "CentrBankId", + typeof(decimal?), + propertyInfo: typeof(Bank).GetProperty("CentrBankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrBankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrBankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrBankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Bank).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrRozliBank = runtimeEntityType.AddProperty( + "NrRozliBank", + typeof(string), + propertyInfo: typeof(Bank).GetProperty("NrRozliBank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 8, + unicode: false); + nrRozliBank.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(8)", + size: 8)); + nrRozliBank.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sWIFT = runtimeEntityType.AddProperty( + "SWIFT", + typeof(string), + propertyInfo: typeof(Bank).GetProperty("SWIFT", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 11, + unicode: false); + sWIFT.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(11)", + size: 11)); + sWIFT.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Bank).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { bankId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Bank"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/BlokadaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/BlokadaEntityType.cs new file mode 100644 index 0000000..8ea2ea5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/BlokadaEntityType.cs @@ -0,0 +1,208 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class BlokadaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Blokada", + typeof(Blokada), + baseEntityType); + + var sesjaId = runtimeEntityType.AddProperty( + "SesjaId", + typeof(decimal), + propertyInfo: typeof(Blokada).GetProperty("SesjaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Blokada).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sesjaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sesjaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sesjaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Blokada).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Blokada).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(Blokada).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Blokada).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal), + propertyInfo: typeof(Blokada).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Blokada).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sesjaId, towId, magId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_BLOKADA"); + + var idx_BlokTowMag = runtimeEntityType.AddIndex( + new[] { towId, magId }, + name: "idx_BlokTowMag"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SesjaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SesjaId") }), + principalEntityType, + required: true); + + var sesja = declaringEntityType.AddNavigation("Sesja", + runtimeForeignKey, + onDependent: true, + typeof(SesjaAktywna), + propertyInfo: typeof(Blokada).GetProperty("Sesja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Blokada).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var blokada = principalEntityType.AddNavigation("Blokada", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SesjaAktywna).GetProperty("Blokada", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SesjaAktywna).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_BLOKADA_REF_BLOKS_SESJAAKT"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId"), declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId"), principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + var istw = declaringEntityType.AddNavigation("Istw", + runtimeForeignKey, + onDependent: true, + typeof(Istw), + propertyInfo: typeof(Blokada).GetProperty("Istw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Blokada).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var blokada = principalEntityType.AddNavigation("Blokada", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Istw).GetProperty("Blokada", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_BLOKADA_REF_BLOKT_ISTW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Blokada"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/CentrStanZgodyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/CentrStanZgodyEntityType.cs new file mode 100644 index 0000000..aca9a58 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/CentrStanZgodyEntityType.cs @@ -0,0 +1,273 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class CentrStanZgodyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody", + typeof(CentrStanZgody), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(CentrStanZgody).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zgId = runtimeEntityType.AddProperty( + "ZgId", + typeof(decimal), + propertyInfo: typeof(CentrStanZgody).GetProperty("ZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDec = runtimeEntityType.AddProperty( + "DataDec", + typeof(DateTime?), + propertyInfo: typeof(CentrStanZgody).GetProperty("DataDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDec.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDec.AddAnnotation("Relational:ColumnType", "datetime"); + dataDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaDec = runtimeEntityType.AddProperty( + "FormaDec", + typeof(short?), + propertyInfo: typeof(CentrStanZgody).GetProperty("FormaDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + formaDec.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + formaDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(string), + propertyInfo: typeof(CentrStanZgody).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kiedy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(CentrStanZgody).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(CentrStanZgody).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, zgId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_CENTRSTANZGODY"); + + var idx_CESTZG_ZG = runtimeEntityType.AddIndex( + new[] { zgId }, + name: "idx_CESTZG_ZG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(CentrStanZgody).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var centrStanZgody = principalEntityType.AddNavigation("CentrStanZgody", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("CentrStanZgody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_CESTZG_KTH"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZgId") }), + principalEntityType, + required: true); + + var zg = declaringEntityType.AddNavigation("Zg", + runtimeForeignKey, + onDependent: true, + typeof(Zgoda), + propertyInfo: typeof(CentrStanZgody).GetProperty("Zg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CentrStanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var centrStanZgody = principalEntityType.AddNavigation("CentrStanZgody", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zgoda).GetProperty("CentrStanZgody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_CESTZG_ZG"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "CentrStanZgody"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/CzasEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/CzasEntityType.cs new file mode 100644 index 0000000..0ceb8ab --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/CzasEntityType.cs @@ -0,0 +1,332 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class CzasEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Czas", + typeof(Czas), + baseEntityType); + + var czasID = runtimeEntityType.AddProperty( + "CzasID", + typeof(decimal), + propertyInfo: typeof(Czas).GetProperty("CzasID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + czasID.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + czasID.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + czasID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime?), + propertyInfo: typeof(Czas).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dzien.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dzien.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzienMiesiaca = runtimeEntityType.AddProperty( + "DzienMiesiaca", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("DzienMiesiaca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dzienMiesiaca.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dzienMiesiaca.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dzienMiesiaca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzienTygodnia = runtimeEntityType.AddProperty( + "DzienTygodnia", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("DzienTygodnia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dzienTygodnia.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dzienTygodnia.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dzienTygodnia.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var miesiac = runtimeEntityType.AddProperty( + "Miesiac", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("Miesiac", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + miesiac.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + miesiac.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + miesiac.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var miesiacRoku = runtimeEntityType.AddProperty( + "MiesiacRoku", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("MiesiacRoku", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + miesiacRoku.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + miesiacRoku.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + miesiacRoku.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rok = runtimeEntityType.AddProperty( + "Rok", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("Rok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rok.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rok.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tydzien = runtimeEntityType.AddProperty( + "Tydzien", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("Tydzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tydzien.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tydzien.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tydzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tydzienRoku = runtimeEntityType.AddProperty( + "TydzienRoku", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("TydzienRoku", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tydzienRoku.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tydzienRoku.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tydzienRoku.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var weekend = runtimeEntityType.AddProperty( + "Weekend", + typeof(decimal?), + propertyInfo: typeof(Czas).GetProperty("Weekend", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Czas).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + weekend.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + weekend.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + weekend.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { czasID }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_CZAS"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Czas"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DefinicjaKoduEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DefinicjaKoduEntityType.cs new file mode 100644 index 0000000..d385365 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DefinicjaKoduEntityType.cs @@ -0,0 +1,242 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DefinicjaKoduEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DefinicjaKodu", + typeof(DefinicjaKodu), + baseEntityType); + + var dKId = runtimeEntityType.AddProperty( + "DKId", + typeof(decimal), + propertyInfo: typeof(DefinicjaKodu).GetProperty("DKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(DefinicjaKodu).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrDKId = runtimeEntityType.AddProperty( + "CentrDKId", + typeof(decimal?), + propertyInfo: typeof(DefinicjaKodu).GetProperty("CentrDKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrDKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrDKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrDKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDo = runtimeEntityType.AddProperty( + "DataDo", + typeof(DateTime?), + propertyInfo: typeof(DefinicjaKodu).GetProperty("DataDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDo.AddAnnotation("Relational:ColumnType", "datetime"); + dataDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataOd = runtimeEntityType.AddProperty( + "DataOd", + typeof(DateTime?), + propertyInfo: typeof(DefinicjaKodu).GetProperty("DataOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataOd.AddAnnotation("Relational:ColumnType", "datetime"); + dataOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(DefinicjaKodu).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(DefinicjaKodu).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(DefinicjaKodu).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dKId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DEFKODU"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DefinicjaKodu"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobBinEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobBinEntityType.cs new file mode 100644 index 0000000..ec55a8d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobBinEntityType.cs @@ -0,0 +1,145 @@ +// +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DlugiZasobBinEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobBin", + typeof(DlugiZasobBin), + baseEntityType); + + var zasobId = runtimeEntityType.AddProperty( + "ZasobId", + typeof(decimal), + propertyInfo: typeof(DlugiZasobBin).GetProperty("ZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobBin).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var porcja = runtimeEntityType.AddProperty( + "Porcja", + typeof(short), + propertyInfo: typeof(DlugiZasobBin).GetProperty("Porcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobBin).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + porcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + porcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dane = runtimeEntityType.AddProperty( + "Dane", + typeof(byte[]), + propertyInfo: typeof(DlugiZasobBin).GetProperty("Dane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobBin).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + dane.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Byte[] v1, Byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (Byte[] v) => v.GetHashCode(), + (Byte[] v) => v), + keyComparer: new ValueComparer( + (Byte[] v1, Byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (Byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (Byte[] source) => source.ToArray()), + providerValueComparer: new ValueComparer( + (Byte[] v1, Byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (Byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (Byte[] source) => source.ToArray()), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varbinary(max)"), + storeTypePostfix: StoreTypePostfix.None); + dane.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zasobId, porcja }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZasobId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZasobId") }), + principalEntityType, + required: true); + + var zasob = declaringEntityType.AddNavigation("Zasob", + runtimeForeignKey, + onDependent: true, + typeof(DlugiZasob), + propertyInfo: typeof(DlugiZasobBin).GetProperty("Zasob", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobBin).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dlugiZasobBin = principalEntityType.AddNavigation("DlugiZasobBin", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(DlugiZasob).GetProperty("DlugiZasobBin", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DlugiZasobBin_ZasobId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DlugiZasobBin"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobEntityType.cs new file mode 100644 index 0000000..bcaf7e1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobEntityType.cs @@ -0,0 +1,463 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DlugiZasobEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + typeof(DlugiZasob), + baseEntityType); + + var zasobId = runtimeEntityType.AddProperty( + "ZasobId", + typeof(decimal), + propertyInfo: typeof(DlugiZasob).GetProperty("ZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(DlugiZasob).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrWersja = runtimeEntityType.AddProperty( + "CentrWersja", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("CentrWersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + centrWersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + centrWersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrZasobId = runtimeEntityType.AddProperty( + "CentrZasobId", + typeof(decimal?), + propertyInfo: typeof(DlugiZasob).GetProperty("CentrZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrZasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrZasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrZasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var gUID = runtimeEntityType.AddProperty( + "GUID", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("GUID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + gUID.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + gUID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcje = runtimeEntityType.AddProperty( + "Opcje", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Opcje", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + opcje.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + opcje.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sciezka = runtimeEntityType.AddProperty( + "Sciezka", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Sciezka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + sciezka.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + sciezka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot1 = runtimeEntityType.AddProperty( + "Skrot1", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Skrot1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + skrot1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + skrot1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot2 = runtimeEntityType.AddProperty( + "Skrot2", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Skrot2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + skrot2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + skrot2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot3 = runtimeEntityType.AddProperty( + "Skrot3", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Skrot3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + skrot3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + skrot3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot4 = runtimeEntityType.AddProperty( + "Skrot4", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Skrot4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + skrot4.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + skrot4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typDanych = runtimeEntityType.AddProperty( + "TypDanych", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("TypDanych", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + typDanych.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + typDanych.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zastosowanie = runtimeEntityType.AddProperty( + "Zastosowanie", + typeof(string), + propertyInfo: typeof(DlugiZasob).GetProperty("Zastosowanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + zastosowanie.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + zastosowanie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(DlugiZasob).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zasobId }); + runtimeEntityType.SetPrimaryKey(key); + + var ixDlugiZasob_CentrZasobId = runtimeEntityType.AddIndex( + new[] { centrZasobId }, + name: "IxDlugiZasob_CentrZasobId"); + + var ixDlugiZasob_GUID = runtimeEntityType.AddIndex( + new[] { gUID }, + name: "IxDlugiZasob_GUID"); + + var ixDlugiZasob_Zmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "IxDlugiZasob_Zmiana"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DlugiZasob"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobTxtEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobTxtEntityType.cs new file mode 100644 index 0000000..b591bad --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DlugiZasobTxtEntityType.cs @@ -0,0 +1,144 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DlugiZasobTxtEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobTxt", + typeof(DlugiZasobTxt), + baseEntityType); + + var zasobId = runtimeEntityType.AddProperty( + "ZasobId", + typeof(decimal), + propertyInfo: typeof(DlugiZasobTxt).GetProperty("ZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var porcja = runtimeEntityType.AddProperty( + "Porcja", + typeof(short), + propertyInfo: typeof(DlugiZasobTxt).GetProperty("Porcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + porcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + porcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dane = runtimeEntityType.AddProperty( + "Dane", + typeof(string), + propertyInfo: typeof(DlugiZasobTxt).GetProperty("Dane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + unicode: false); + dane.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(max)"), + storeTypePostfix: StoreTypePostfix.None); + dane.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zasobId, porcja }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZasobId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZasobId") }), + principalEntityType, + required: true); + + var zasob = declaringEntityType.AddNavigation("Zasob", + runtimeForeignKey, + onDependent: true, + typeof(DlugiZasob), + propertyInfo: typeof(DlugiZasobTxt).GetProperty("Zasob", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasobTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dlugiZasobTxt = principalEntityType.AddNavigation("DlugiZasobTxt", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(DlugiZasob).GetProperty("DlugiZasobTxt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DlugiZasobTxt_ZasobId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DlugiZasobTxt"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokDodKthEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokDodKthEntityType.cs new file mode 100644 index 0000000..24367f5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokDodKthEntityType.cs @@ -0,0 +1,202 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokDodKthEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DokDodKth", + typeof(DokDodKth), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(DokDodKth).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(DokDodKth).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(DokDodKth).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal?), + propertyInfo: typeof(DokDodKth).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOKDODKTH"); + + var idx_DDKth = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "idx_DDKth"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(DokDodKth).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokDodKth = principalEntityType.AddNavigation("DokDodKth", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("DokDodKth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKDODKT_REF_DDK_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(DokDodKth).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokDodKth = principalEntityType.AddNavigation("DokDodKth", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("DokDodKth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKDODKT_REF_DKD_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokDodKth"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokEntityType.cs new file mode 100644 index 0000000..2a23295 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokEntityType.cs @@ -0,0 +1,1848 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + typeof(Dok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrDokId = runtimeEntityType.AddProperty( + "CentrDokId", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("CentrDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + centrDokId.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + centrDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenySpBrutto = runtimeEntityType.AddProperty( + "CenySpBrutto", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("CenySpBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + cenySpBrutto.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + cenySpBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenyZakBrutto = runtimeEntityType.AddProperty( + "CenyZakBrutto", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("CenyZakBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + cenyZakBrutto.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + cenyZakBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime), + propertyInfo: typeof(Dok).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDod = runtimeEntityType.AddProperty( + "DataDod", + typeof(DateTime), + propertyInfo: typeof(Dok).GetProperty("DataDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataDod.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDod.AddAnnotation("Relational:ColumnType", "datetime"); + dataDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataPom = runtimeEntityType.AddProperty( + "DataPom", + typeof(DateTime), + propertyInfo: typeof(Dok).GetProperty("DataPom", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataPom.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataPom.AddAnnotation("Relational:ColumnType", "datetime"); + dataPom.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var doZaplaty = runtimeEntityType.AddProperty( + "DoZaplaty", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("DoZaplaty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + doZaplaty.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + doZaplaty.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + doZaplaty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var eksportFK = runtimeEntityType.AddProperty( + "EksportFK", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("EksportFK", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + eksportFK.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + eksportFK.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaPlat = runtimeEntityType.AddProperty( + "FormaPlat", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("FormaPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + formaPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + formaPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnyWDniu = runtimeEntityType.AddProperty( + "KolejnyWDniu", + typeof(int), + propertyInfo: typeof(Dok).GetProperty("KolejnyWDniu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + kolejnyWDniu.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnyWDniu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota1 = runtimeEntityType.AddProperty( + "Kwota1", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota10 = runtimeEntityType.AddProperty( + "Kwota10", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota10", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota10.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota10.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota10.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota11 = runtimeEntityType.AddProperty( + "Kwota11", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("Kwota11", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota11.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota11.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota11.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota12 = runtimeEntityType.AddProperty( + "Kwota12", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("Kwota12", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota12.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota12.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota12.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota2 = runtimeEntityType.AddProperty( + "Kwota2", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota3 = runtimeEntityType.AddProperty( + "Kwota3", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota4 = runtimeEntityType.AddProperty( + "Kwota4", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota4.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota5 = runtimeEntityType.AddProperty( + "Kwota5", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota5.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota5.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota6 = runtimeEntityType.AddProperty( + "Kwota6", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota6.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota6.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota7 = runtimeEntityType.AddProperty( + "Kwota7", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota7", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota7.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota7.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota7.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota8 = runtimeEntityType.AddProperty( + "Kwota8", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota8", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota8.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota8.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota8.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota9 = runtimeEntityType.AddProperty( + "Kwota9", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Kwota9", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota9.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota9.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota9.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDet = runtimeEntityType.AddProperty( + "NettoDet", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("NettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDetUslugi = runtimeEntityType.AddProperty( + "NettoDetUslugi", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("NettoDetUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDetUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDetUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDetUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMag = runtimeEntityType.AddProperty( + "NettoMag", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("NettoMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMagUslugi = runtimeEntityType.AddProperty( + "NettoMagUslugi", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("NettoMagUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoMagUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMagUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMagUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoUslugi = runtimeEntityType.AddProperty( + "NettoUslugi", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("NettoUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDok = runtimeEntityType.AddProperty( + "NrDok", + typeof(string), + propertyInfo: typeof(Dok).GetProperty("NrDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nrDok.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrKolejny = runtimeEntityType.AddProperty( + "NrKolejny", + typeof(int?), + propertyInfo: typeof(Dok).GetProperty("NrKolejny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrKolejny.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + nrKolejny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrKolejnyMag = runtimeEntityType.AddProperty( + "NrKolejnyMag", + typeof(int?), + propertyInfo: typeof(Dok).GetProperty("NrKolejnyMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrKolejnyMag.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + nrKolejnyMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja1 = runtimeEntityType.AddProperty( + "Opcja1", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("Opcja1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja3 = runtimeEntityType.AddProperty( + "Opcja3", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("Opcja3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja3.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja4 = runtimeEntityType.AddProperty( + "Opcja4", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("Opcja4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja4.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja5 = runtimeEntityType.AddProperty( + "Opcja5", + typeof(short?), + propertyInfo: typeof(Dok).GetProperty("Opcja5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja5.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja6 = runtimeEntityType.AddProperty( + "Opcja6", + typeof(short?), + propertyInfo: typeof(Dok).GetProperty("Opcja6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja6.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja7 = runtimeEntityType.AddProperty( + "Opcja7", + typeof(short?), + propertyInfo: typeof(Dok).GetProperty("Opcja7", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja7.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja7.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja8 = runtimeEntityType.AddProperty( + "Opcja8", + typeof(short?), + propertyInfo: typeof(Dok).GetProperty("Opcja8", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja8.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja8.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int), + propertyInfo: typeof(Dok).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(int), + propertyInfo: typeof(Dok).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param2.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(int), + propertyInfo: typeof(Dok).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param3.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param4 = runtimeEntityType.AddProperty( + "Param4", + typeof(int), + propertyInfo: typeof(Dok).GetProperty("Param4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param4.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param5 = runtimeEntityType.AddProperty( + "Param5", + typeof(int?), + propertyInfo: typeof(Dok).GetProperty("Param5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param5.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param6 = runtimeEntityType.AddProperty( + "Param6", + typeof(int?), + propertyInfo: typeof(Dok).GetProperty("Param6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param6.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDet = runtimeEntityType.AddProperty( + "PodatekDet", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("PodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDetUslugi = runtimeEntityType.AddProperty( + "PodatekDetUslugi", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("PodatekDetUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDetUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDetUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDetUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMag = runtimeEntityType.AddProperty( + "PodatekMag", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("PodatekMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMagUslugi = runtimeEntityType.AddProperty( + "PodatekMagUslugi", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("PodatekMagUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekMagUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMagUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMagUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekUslugi = runtimeEntityType.AddProperty( + "PodatekUslugi", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("PodatekUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatProc = runtimeEntityType.AddProperty( + "RabatProc", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("RabatProc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatProc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatProc.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatProc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var razem = runtimeEntityType.AddProperty( + "Razem", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Razem", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + razem.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + razem.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + razem.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var terminPlat = runtimeEntityType.AddProperty( + "TerminPlat", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("TerminPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + terminPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + terminPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typDok = runtimeEntityType.AddProperty( + "TypDok", + typeof(short), + propertyInfo: typeof(Dok).GetProperty("TypDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typDok.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walIdPlatnosci = runtimeEntityType.AddProperty( + "WalIdPlatnosci", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("WalIdPlatnosci", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walIdPlatnosci.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walIdPlatnosci.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walIdPlatnosci.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zaplacono = runtimeEntityType.AddProperty( + "Zaplacono", + typeof(decimal), + propertyInfo: typeof(Dok).GetProperty("Zaplacono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + zaplacono.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + zaplacono.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + zaplacono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zaplaconoPodatek = runtimeEntityType.AddProperty( + "ZaplaconoPodatek", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("ZaplaconoPodatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zaplaconoPodatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + zaplaconoPodatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + zaplaconoPodatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zaplaconoWKasie = runtimeEntityType.AddProperty( + "ZaplaconoWKasie", + typeof(decimal?), + propertyInfo: typeof(Dok).GetProperty("ZaplaconoWKasie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zaplaconoWKasie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + zaplaconoWKasie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + zaplaconoWKasie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Dok).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaPkt = runtimeEntityType.AddProperty( + "ZmianaPkt", + typeof(DateTime?), + propertyInfo: typeof(Dok).GetProperty("ZmianaPkt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmianaPkt.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaPkt.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaPkt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOK"); + + var index = runtimeEntityType.AddIndex( + new[] { walIdPlatnosci }); + + var dokTypDok = runtimeEntityType.AddIndex( + new[] { typDok, data, kolejnyWDniu }, + name: "DokTypDok"); + + var idx_DokCentrDokId = runtimeEntityType.AddIndex( + new[] { centrDokId }, + name: "idx_DokCentrDokId"); + + var idx_DokDataKolejnyWDniu = runtimeEntityType.AddIndex( + new[] { data, kolejnyWDniu }, + name: "idx_DokDataKolejnyWDniu"); + + var idx_DokMagId = runtimeEntityType.AddIndex( + new[] { magId }, + name: "idx_DokMagId"); + + var idx_DokNrDok = runtimeEntityType.AddIndex( + new[] { nrDok }, + name: "idx_DokNrDok"); + + var idx_DokUzId = runtimeEntityType.AddIndex( + new[] { uzId }, + name: "idx_DokUzId"); + + var idx_DokWal = runtimeEntityType.AddIndex( + new[] { walId }, + name: "idx_DokWal"); + + var idx_DokZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_DokZmiana"); + + var idx_DokZmianaPkt = runtimeEntityType.AddIndex( + new[] { zmianaPkt }, + name: "idx_DokZmianaPkt"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(Dok).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dok = principalEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOK_REF_DOKMA_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType, + required: true); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(Dok).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dok = principalEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOK_REF_DOKUZ_UZYTKOWN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(Dok).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokWal = principalEntityType.AddNavigation("DokWal", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("DokWal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOK_REF_DOKWA_WALUTA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalIdPlatnosci") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType); + + var walIdPlatnosciNavigation = declaringEntityType.AddNavigation("WalIdPlatnosciNavigation", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(Dok).GetProperty("WalIdPlatnosciNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokWalIdPlatnosciNavigation = principalEntityType.AddNavigation("DokWalIdPlatnosciNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("DokWalIdPlatnosciNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_DokWalIdPlatnosci"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "KB", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("DokId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("DokId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("KB", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Dok"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Dok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKasaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKasaEntityType.cs new file mode 100644 index 0000000..975e8a2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKasaEntityType.cs @@ -0,0 +1,155 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokKasaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DokKasa", + typeof(DokKasa), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(DokKasa).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(DokKasa).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOKKASA"); + + var idx_DokKasaId = runtimeEntityType.AddIndex( + new[] { kasaId }, + name: "idx_DokKasaId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + unique: true, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(DokKasa).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokKasa = principalEntityType.AddNavigation("DokKasa", + runtimeForeignKey, + onDependent: false, + typeof(DokKasa), + propertyInfo: typeof(Dok).GetProperty("DokKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKASA_REF_DOKKA_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(DokKasa).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokKasa = principalEntityType.AddNavigation("DokKasa", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("DokKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKASA_REF_KASA_KASA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokKasa"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKontoBankoweEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKontoBankoweEntityType.cs new file mode 100644 index 0000000..3edb53e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKontoBankoweEntityType.cs @@ -0,0 +1,123 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokKontoBankoweEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "DokKontoBankowe", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kBId = runtimeEntityType.AddProperty( + "KBId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kBId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { kBId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKONTOBANK_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KBId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KBId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKONTOBANK_KONTOBANK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokKontoBankowe"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKontrEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKontrEntityType.cs new file mode 100644 index 0000000..bfdf1df --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKontrEntityType.cs @@ -0,0 +1,155 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokKontrEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DokKontr", + typeof(DokKontr), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(DokKontr).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(DokKontr).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOKKONTR"); + + var idx_DokKontrId = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "idx_DokKontrId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + unique: true, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(DokKontr).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokKontr = principalEntityType.AddNavigation("DokKontr", + runtimeForeignKey, + onDependent: false, + typeof(DokKontr), + propertyInfo: typeof(Dok).GetProperty("DokKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKONTR_REF_DOKKO_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(DokKontr).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokKontr = principalEntityType.AddNavigation("DokKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("DokKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKONTR_REF_KONTR_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokKontr"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKursEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKursEntityType.cs new file mode 100644 index 0000000..ec80e7d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokKursEntityType.cs @@ -0,0 +1,253 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokKursEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DokKurs", + typeof(DokKurs), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(DokKurs).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(DokKurs).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime?), + propertyInfo: typeof(DokKurs).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal?), + propertyInfo: typeof(DokKurs).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrTabeli = runtimeEntityType.AddProperty( + "NrTabeli", + typeof(string), + propertyInfo: typeof(DokKurs).GetProperty("NrTabeli", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrTabeli.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrTabeli.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(DokKurs).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOKKURS"); + + var idx_DokKursWal = runtimeEntityType.AddIndex( + new[] { walId }, + name: "idx_DokKursWal"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(DokKurs).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokKurs = principalEntityType.AddNavigation("DokKurs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("DokKurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKURS_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType, + required: true); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(DokKurs).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokKurs = principalEntityType.AddNavigation("DokKurs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("DokKurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKKURS_WAL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokKurs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokPunktyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokPunktyEntityType.cs new file mode 100644 index 0000000..e513eb8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokPunktyEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokPunktyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DokPunkty", + typeof(DokPunkty), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(DokPunkty).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(DokPunkty).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(DateTime), + propertyInfo: typeof(DokPunkty).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + kiedy.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + kiedy.AddAnnotation("Relational:ColumnType", "datetime"); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal), + propertyInfo: typeof(DokPunkty).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOKPUNKTY"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(DokPunkty).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokPunkty = principalEntityType.AddNavigation("DokPunkty", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("DokPunkty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKPUNKT_REF_DOKPK_DOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokPunkty"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokWBufPowiazanieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokWBufPowiazanieEntityType.cs new file mode 100644 index 0000000..662e928 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokWBufPowiazanieEntityType.cs @@ -0,0 +1,199 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokWBufPowiazanieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DokWBufPowiazanie", + typeof(DokWBufPowiazanie), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(DokWBufPowiazanie).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jakiePow = runtimeEntityType.AddProperty( + "JakiePow", + typeof(short), + propertyInfo: typeof(DokWBufPowiazanie).GetProperty("JakiePow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + jakiePow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + jakiePow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ktorePow = runtimeEntityType.AddProperty( + "KtorePow", + typeof(short), + propertyInfo: typeof(DokWBufPowiazanie).GetProperty("KtorePow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + ktorePow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + ktorePow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal?), + propertyInfo: typeof(DokWBufPowiazanie).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param = runtimeEntityType.AddProperty( + "Param", + typeof(string), + propertyInfo: typeof(DokWBufPowiazanie).GetProperty("Param", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + param.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, jakiePow, ktorePow }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOKWBUFPOWIAZANIE"); + + var idx_DokWBufId = runtimeEntityType.AddIndex( + new[] { id }, + name: "idx_DokWBufId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(DokWBufPowiazanie).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokWBufPowiazanie = principalEntityType.AddNavigation("DokWBufPowiazanie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("DokWBufPowiazanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DokWBufPow"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokWBufPowiazanie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokWalutaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokWalutaEntityType.cs new file mode 100644 index 0000000..fac55e4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DokWalutaEntityType.cs @@ -0,0 +1,337 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DokWalutaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DokWaluta", + typeof(DokWaluta), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(DokWaluta).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(DokWaluta).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dokKwota = runtimeEntityType.AddProperty( + "DokKwota", + typeof(decimal), + propertyInfo: typeof(DokWaluta).GetProperty("DokKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + dokKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + dokKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + dokKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal), + propertyInfo: typeof(DokWaluta).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walKwota = runtimeEntityType.AddProperty( + "WalKwota", + typeof(decimal), + propertyInfo: typeof(DokWaluta).GetProperty("WalKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walNetto = runtimeEntityType.AddProperty( + "WalNetto", + typeof(decimal?), + propertyInfo: typeof(DokWaluta).GetProperty("WalNetto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walNetto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walNetto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walNetto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walNettoDet = runtimeEntityType.AddProperty( + "WalNettoDet", + typeof(decimal?), + propertyInfo: typeof(DokWaluta).GetProperty("WalNettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walNettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walNettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walNettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walPodatek = runtimeEntityType.AddProperty( + "WalPodatek", + typeof(decimal?), + propertyInfo: typeof(DokWaluta).GetProperty("WalPodatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walPodatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walPodatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walPodatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walPodatekDet = runtimeEntityType.AddProperty( + "WalPodatekDet", + typeof(decimal?), + propertyInfo: typeof(DokWaluta).GetProperty("WalPodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walPodatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walPodatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walPodatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, walId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOKWALUTA"); + + var idx_WalDok = runtimeEntityType.AddIndex( + new[] { walId }, + name: "idx_WalDok"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(DokWaluta).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokWaluta = principalEntityType.AddNavigation("DokWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("DokWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKWALUT_REF_DOKWA_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType, + required: true); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(DokWaluta).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dokWaluta = principalEntityType.AddNavigation("DokWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("DokWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOKWALUT_REF_WALDO_WALUTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DokWaluta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DostProdEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DostProdEntityType.cs new file mode 100644 index 0000000..6b9cd93 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DostProdEntityType.cs @@ -0,0 +1,180 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DostProdEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DostProd", + typeof(DostProd), + baseEntityType); + + var dostId = runtimeEntityType.AddProperty( + "DostId", + typeof(decimal), + propertyInfo: typeof(DostProd).GetProperty("DostId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DostProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dostId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dostId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dostId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prodId = runtimeEntityType.AddProperty( + "ProdId", + typeof(decimal), + propertyInfo: typeof(DostProd).GetProperty("ProdId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DostProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + prodId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + prodId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + prodId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatProd = runtimeEntityType.AddProperty( + "RabatProd", + typeof(decimal), + propertyInfo: typeof(DostProd).GetProperty("RabatProd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DostProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatProd.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatProd.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatProd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dostId, prodId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOSTPROD"); + + var index = runtimeEntityType.AddIndex( + new[] { prodId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DostId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var dost = declaringEntityType.AddNavigation("Dost", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(DostProd).GetProperty("Dost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DostProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dostProdDost = principalEntityType.AddNavigation("DostProdDost", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("DostProdDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_DostPrKth"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ProdId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var prod = declaringEntityType.AddNavigation("Prod", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(DostProd).GetProperty("Prod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DostProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dostProdProd = principalEntityType.AddNavigation("DostProdProd", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("DostProdProd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_PrDostKth"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DostProd"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DostawcaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DostawcaEntityType.cs new file mode 100644 index 0000000..b493e11 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DostawcaEntityType.cs @@ -0,0 +1,280 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DostawcaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Dostawca", + typeof(Dostawca), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(Dostawca).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Dostawca).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZak = runtimeEntityType.AddProperty( + "CenaZak", + typeof(decimal), + propertyInfo: typeof(Dostawca).GetProperty("CenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWZgrzewce = runtimeEntityType.AddProperty( + "IleWZgrzewce", + typeof(decimal?), + propertyInfo: typeof(Dostawca).GetProperty("IleWZgrzewce", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileWZgrzewce.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWZgrzewce.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWZgrzewce.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(Dostawca).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 30, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(30)", + size: 30)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzucany = runtimeEntityType.AddProperty( + "Narzucany", + typeof(short?), + propertyInfo: typeof(Dostawca).GetProperty("Narzucany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzucany.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + narzucany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatOdWart = runtimeEntityType.AddProperty( + "RabatOdWart", + typeof(decimal), + propertyInfo: typeof(Dostawca).GetProperty("RabatOdWart", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatOdWart.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatOdWart.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatOdWart.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DOSTAWCA"); + + var idx_DostTowId = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_DostTowId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(Dostawca).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dostawcaNavigation = principalEntityType.AddNavigation("DostawcaNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("DostawcaNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOSTAWCA_REF_KTHDO_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Dostawca).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dostawca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dostawca = principalEntityType.AddNavigation("Dostawca", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Dostawca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_DOSTAWCA_REF_TOWDO_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Dostawca"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DzienRozlEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DzienRozlEntityType.cs new file mode 100644 index 0000000..c330fe8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DzienRozlEntityType.cs @@ -0,0 +1,122 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DzienRozlEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozl", + typeof(DzienRozl), + baseEntityType); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime), + propertyInfo: typeof(DzienRozl).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(DzienRozl).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(DzienRozl).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dzien }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DZIENROZL"); + + var idx_DzienZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_DzienZmiana"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DzienRozl"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/DzienRozlParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DzienRozlParamEntityType.cs new file mode 100644 index 0000000..ce45f8a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/DzienRozlParamEntityType.cs @@ -0,0 +1,145 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class DzienRozlParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozlParam", + typeof(DzienRozlParam), + baseEntityType); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime), + propertyInfo: typeof(DzienRozlParam).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(DzienRozlParam).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(string), + propertyInfo: typeof(DzienRozlParam).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + wartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dzien, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_DZIENROZLPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("Dzien") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("Dzien") }), + principalEntityType, + required: true); + + var dzienNavigation = declaringEntityType.AddNavigation("DzienNavigation", + runtimeForeignKey, + onDependent: true, + typeof(DzienRozl), + propertyInfo: typeof(DzienRozlParam).GetProperty("DzienNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var dzienRozlParam = principalEntityType.AddNavigation("DzienRozlParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(DzienRozl).GetProperty("DzienRozlParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_DzienRozlPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "DzienRozlParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/EmailEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/EmailEntityType.cs new file mode 100644 index 0000000..1952540 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/EmailEntityType.cs @@ -0,0 +1,644 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class EmailEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Email", + typeof(Email), + baseEntityType); + + var emId = runtimeEntityType.AddProperty( + "EmId", + typeof(decimal), + propertyInfo: typeof(Email).GetProperty("EmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + emId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + emId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + emId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Email).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var auth = runtimeEntityType.AddProperty( + "Auth", + typeof(short), + propertyInfo: typeof(Email).GetProperty("Auth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + auth.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + auth.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var haslo = runtimeEntityType.AddProperty( + "Haslo", + typeof(string), + propertyInfo: typeof(Email).GetProperty("Haslo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + haslo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + haslo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var host = runtimeEntityType.AddProperty( + "Host", + typeof(string), + propertyInfo: typeof(Email).GetProperty("Host", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + host.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + host.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kopia = runtimeEntityType.AddProperty( + "Kopia", + typeof(short), + propertyInfo: typeof(Email).GetProperty("Kopia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kopia.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kopia.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kopiaEmail = runtimeEntityType.AddProperty( + "KopiaEmail", + typeof(string), + propertyInfo: typeof(Email).GetProperty("KopiaEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + kopiaEmail.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + kopiaEmail.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var login = runtimeEntityType.AddProperty( + "Login", + typeof(string), + propertyInfo: typeof(Email).GetProperty("Login", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + login.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + login.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nadawca = runtimeEntityType.AddProperty( + "Nadawca", + typeof(string), + propertyInfo: typeof(Email).GetProperty("Nadawca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nadawca.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nadawca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Email).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var port = runtimeEntityType.AddProperty( + "Port", + typeof(string), + propertyInfo: typeof(Email).GetProperty("Port", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 5, + unicode: false); + port.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(5)", + size: 5)); + port.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tEDId = runtimeEntityType.AddProperty( + "TEDId", + typeof(decimal?), + propertyInfo: typeof(Email).GetProperty("TEDId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tEDId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tEDId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tEDId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tEHRId = runtimeEntityType.AddProperty( + "TEHRId", + typeof(decimal?), + propertyInfo: typeof(Email).GetProperty("TEHRId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tEHRId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tEHRId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tEHRId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tERId = runtimeEntityType.AddProperty( + "TERId", + typeof(decimal?), + propertyInfo: typeof(Email).GetProperty("TERId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tERId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tERId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tERId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tEWId = runtimeEntityType.AddProperty( + "TEWId", + typeof(decimal?), + propertyInfo: typeof(Email).GetProperty("TEWId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tEWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tEWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tEWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tEZIId = runtimeEntityType.AddProperty( + "TEZIId", + typeof(decimal?), + propertyInfo: typeof(Email).GetProperty("TEZIId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tEZIId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tEZIId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tEZIId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tLS = runtimeEntityType.AddProperty( + "TLS", + typeof(short), + propertyInfo: typeof(Email).GetProperty("TLS", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + tLS.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tLS.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tLSVer = runtimeEntityType.AddProperty( + "TLSVer", + typeof(short), + propertyInfo: typeof(Email).GetProperty("TLSVer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + tLSVer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tLSVer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal?), + propertyInfo: typeof(Email).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Email).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { emId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { tEDId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { tERId }); + + var index1 = runtimeEntityType.AddIndex( + new[] { tEWId }); + + var index2 = runtimeEntityType.AddIndex( + new[] { uzId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TEDId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TEId") }), + principalEntityType); + + var tED = declaringEntityType.AddNavigation("TED", + runtimeForeignKey, + onDependent: true, + typeof(TrescEmail), + propertyInfo: typeof(Email).GetProperty("TED", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var emailTED = principalEntityType.AddNavigation("EmailTED", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TrescEmail).GetProperty("EmailTED", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Email_TED"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TERId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TEId") }), + principalEntityType); + + var tER = declaringEntityType.AddNavigation("TER", + runtimeForeignKey, + onDependent: true, + typeof(TrescEmail), + propertyInfo: typeof(Email).GetProperty("TER", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var emailTER = principalEntityType.AddNavigation("EmailTER", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TrescEmail).GetProperty("EmailTER", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Email_TER"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TEWId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TEId") }), + principalEntityType); + + var tEW = declaringEntityType.AddNavigation("TEW", + runtimeForeignKey, + onDependent: true, + typeof(TrescEmail), + propertyInfo: typeof(Email).GetProperty("TEW", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var emailTEW = principalEntityType.AddNavigation("EmailTEW", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TrescEmail).GetProperty("EmailTEW", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Email_TEW"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(Email).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Email).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var email = principalEntityType.AddNavigation("Email", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("Email", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Email_Uz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Email"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormZgodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormZgodEntityType.cs new file mode 100644 index 0000000..3999cc8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormZgodEntityType.cs @@ -0,0 +1,197 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class FormZgodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.FormZgod", + typeof(FormZgod), + baseEntityType); + + var typOsId = runtimeEntityType.AddProperty( + "TypOsId", + typeof(decimal), + propertyInfo: typeof(FormZgod).GetProperty("TypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + typOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zgId = runtimeEntityType.AddProperty( + "ZgId", + typeof(decimal), + propertyInfo: typeof(FormZgod).GetProperty("ZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(FormZgod).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wymagana = runtimeEntityType.AddProperty( + "Wymagana", + typeof(short?), + propertyInfo: typeof(FormZgod).GetProperty("Wymagana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wymagana.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wymagana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { typOsId, zgId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_FORMZGOD"); + + var idx_FMZG_ZGODA = runtimeEntityType.AddIndex( + new[] { zgId }, + name: "idx_FMZG_ZGODA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TypOsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TypOsId") }), + principalEntityType, + required: true); + + var typOs = declaringEntityType.AddNavigation("TypOs", + runtimeForeignKey, + onDependent: true, + typeof(TypOs), + propertyInfo: typeof(FormZgod).GetProperty("TypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var formZgod = principalEntityType.AddNavigation("FormZgod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TypOs).GetProperty("FormZgod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_FMZG_TYPOS"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZgId") }), + principalEntityType, + required: true); + + var zg = declaringEntityType.AddNavigation("Zg", + runtimeForeignKey, + onDependent: true, + typeof(Zgoda), + propertyInfo: typeof(FormZgod).GetProperty("Zg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var formZgod = principalEntityType.AddNavigation("FormZgod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zgoda).GetProperty("FormZgod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_FMZG_ZGODA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "FormZgod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormaPlatnPos7EntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormaPlatnPos7EntityType.cs new file mode 100644 index 0000000..d3370b6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormaPlatnPos7EntityType.cs @@ -0,0 +1,285 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class FormaPlatnPos7EntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnPos7", + typeof(FormaPlatnPos7), + baseEntityType); + + var formaId = runtimeEntityType.AddProperty( + "FormaId", + typeof(decimal), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("FormaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + formaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + formaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + formaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var autoryzacja = runtimeEntityType.AddProperty( + "Autoryzacja", + typeof(short?), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("Autoryzacja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + autoryzacja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + autoryzacja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrFormaId = runtimeEntityType.AddProperty( + "CentrFormaId", + typeof(decimal?), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("CentrFormaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrFormaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrFormaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrFormaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(decimal?), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kolejnosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kolejnosc.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var reszta = runtimeEntityType.AddProperty( + "Reszta", + typeof(short), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("Reszta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + reszta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + reszta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var serwisPlatniczy = runtimeEntityType.AddProperty( + "SerwisPlatniczy", + typeof(string), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("SerwisPlatniczy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + serwisPlatniczy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + serwisPlatniczy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { formaId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "FormaPlatnPos7"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormaPlatnosciEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormaPlatnosciEntityType.cs new file mode 100644 index 0000000..33a173e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/FormaPlatnosciEntityType.cs @@ -0,0 +1,135 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class FormaPlatnosciEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnosci", + typeof(FormaPlatnosci), + baseEntityType); + + var formaPlat = runtimeEntityType.AddProperty( + "FormaPlat", + typeof(short), + propertyInfo: typeof(FormaPlatnosci).GetProperty("FormaPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnosci).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + formaPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + formaPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var maxTermPlat = runtimeEntityType.AddProperty( + "MaxTermPlat", + typeof(short), + propertyInfo: typeof(FormaPlatnosci).GetProperty("MaxTermPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnosci).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + maxTermPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + maxTermPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minTermPlat = runtimeEntityType.AddProperty( + "MinTermPlat", + typeof(short), + propertyInfo: typeof(FormaPlatnosci).GetProperty("MinTermPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnosci).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + minTermPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + minTermPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(FormaPlatnosci).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnosci).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { formaPlat }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_FORMAPLATNOSCI"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "FormaPlatnosci"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrWartoscEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrWartoscEntityType.cs new file mode 100644 index 0000000..46ffa18 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrWartoscEntityType.cs @@ -0,0 +1,176 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class GrWartoscEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.GrWartosc", + typeof(GrWartosc), + baseEntityType); + + var grId = runtimeEntityType.AddProperty( + "GrId", + typeof(decimal), + propertyInfo: typeof(GrWartosc).GetProperty("GrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + grId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(GrWartosc).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(int), + propertyInfo: typeof(GrWartosc).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + wartosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { grId, parId, wartosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_GRWARTOSC"); + + var index = runtimeEntityType.AddIndex( + new[] { parId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("GrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("GrId") }), + principalEntityType, + required: true); + + var gr = declaringEntityType.AddNavigation("Gr", + runtimeForeignKey, + onDependent: true, + typeof(GrupaTow), + propertyInfo: typeof(GrWartosc).GetProperty("Gr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var grWartosc = principalEntityType.AddNavigation("GrWartosc", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(GrupaTow).GetProperty("GrWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_GRWARTOS_REF_GRWAR_GRUPATOW"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Parametr), + propertyInfo: typeof(GrWartosc).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var grWartosc = principalEntityType.AddNavigation("GrWartosc", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Parametr).GetProperty("GrWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_GRWARTOS_REF_PARGR_PARAMETR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "GrWartosc"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaAkcyzowaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaAkcyzowaEntityType.cs new file mode 100644 index 0000000..69ee334 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaAkcyzowaEntityType.cs @@ -0,0 +1,329 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class GrupaAkcyzowaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa", + typeof(GrupaAkcyzowa), + baseEntityType); + + var grAkcId = runtimeEntityType.AddProperty( + "GrAkcId", + typeof(decimal), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("GrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + grAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var akcJM = runtimeEntityType.AddProperty( + "AkcJM", + typeof(string), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("AkcJM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + akcJM.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + akcJM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrGrAkcId = runtimeEntityType.AddProperty( + "CentrGrAkcId", + typeof(decimal?), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("CentrGrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrGrAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrGrAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrGrAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodJM = runtimeEntityType.AddProperty( + "DodJM", + typeof(string), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("DodJM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + dodJM.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + dodJM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileDodJMWAkcJM = runtimeEntityType.AddProperty( + "IleDodJMWAkcJM", + typeof(decimal?), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("IleDodJMWAkcJM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileDodJMWAkcJM.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileDodJMWAkcJM.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileDodJMWAkcJM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjeWzoru = runtimeEntityType.AddProperty( + "OpcjeWzoru", + typeof(string), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("OpcjeWzoru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + opcjeWzoru.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + opcjeWzoru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prefiksyCN = runtimeEntityType.AddProperty( + "PrefiksyCN", + typeof(string), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("PrefiksyCN", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + prefiksyCN.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + prefiksyCN.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { grAkcId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_GRUPAAKCYZOWA"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "GrupaAkcyzowa"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaPromocjiEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaPromocjiEntityType.cs new file mode 100644 index 0000000..a7548b1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaPromocjiEntityType.cs @@ -0,0 +1,216 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class GrupaPromocjiEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.GrupaPromocji", + typeof(GrupaPromocji), + baseEntityType); + + var grupaId = runtimeEntityType.AddProperty( + "GrupaId", + typeof(decimal), + propertyInfo: typeof(GrupaPromocji).GetProperty("GrupaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + grupaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grupaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grupaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywna = runtimeEntityType.AddProperty( + "Aktywna", + typeof(short), + propertyInfo: typeof(GrupaPromocji).GetProperty("Aktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrGrupaId = runtimeEntityType.AddProperty( + "CentrGrupaId", + typeof(decimal?), + propertyInfo: typeof(GrupaPromocji).GetProperty("CentrGrupaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrGrupaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrGrupaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrGrupaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(GrupaPromocji).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(GrupaPromocji).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(GrupaPromocji).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(GrupaPromocji).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { grupaId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "GrupaPromocji"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaTowEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaTowEntityType.cs new file mode 100644 index 0000000..b0ad1d2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaTowEntityType.cs @@ -0,0 +1,124 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class GrupaTowEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.GrupaTow", + typeof(GrupaTow), + baseEntityType); + + var grId = runtimeEntityType.AddProperty( + "GrId", + typeof(decimal), + propertyInfo: typeof(GrupaTow).GetProperty("GrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + grId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(GrupaTow).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(GrupaTow).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { grId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_GRUPATOW"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "GrupaTow"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaUzEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaUzEntityType.cs new file mode 100644 index 0000000..ed94ef4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/GrupaUzEntityType.cs @@ -0,0 +1,155 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class GrupaUzEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.GrupaUz", + typeof(GrupaUz), + baseEntityType); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal), + propertyInfo: typeof(GrupaUz).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rolaId = runtimeEntityType.AddProperty( + "RolaId", + typeof(decimal), + propertyInfo: typeof(GrupaUz).GetProperty("RolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rolaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rolaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { uzId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_GRUPAUZ"); + + var idx_Rola = runtimeEntityType.AddIndex( + new[] { rolaId }, + name: "idx_Rola"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RolaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType, + required: true); + + var rola = declaringEntityType.AddNavigation("Rola", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(GrupaUz).GetProperty("Rola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var grupaUzRola = principalEntityType.AddNavigation("GrupaUzRola", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("GrupaUzRola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_GRUPAUZ_REF_GRROL_UZYTKOWN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType, + unique: true, + required: true); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(GrupaUz).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var grupaUzUz = principalEntityType.AddNavigation("GrupaUzUz", + runtimeForeignKey, + onDependent: false, + typeof(GrupaUz), + propertyInfo: typeof(Uzytkownik).GetProperty("GrupaUzUz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_GRUPAUZ_REF_GRUZ_UZYTKOWN"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "GrupaUz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmCenyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmCenyEntityType.cs new file mode 100644 index 0000000..debc5d5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmCenyEntityType.cs @@ -0,0 +1,457 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmCenyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmCeny", + typeof(HarmCeny), + baseEntityType); + + var harmId = runtimeEntityType.AddProperty( + "HarmId", + typeof(decimal), + propertyInfo: typeof(HarmCeny).GetProperty("HarmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + harmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + harmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + harmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(HarmCeny).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena5 = runtimeEntityType.AddProperty( + "Cena5", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("Cena5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena5.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena5.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena6 = runtimeEntityType.AddProperty( + "Cena6", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("Cena6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena6.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena6.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena7 = runtimeEntityType.AddProperty( + "Cena7", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("Cena7", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena7.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena7.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena7.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena8 = runtimeEntityType.AddProperty( + "Cena8", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("Cena8", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena8.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena8.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena8.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDet = runtimeEntityType.AddProperty( + "CenaDet", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("CenaDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDod = runtimeEntityType.AddProperty( + "CenaDod", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("CenaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaDod.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDod.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaHurt = runtimeEntityType.AddProperty( + "CenaHurt", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("CenaHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaHurt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaNoc = runtimeEntityType.AddProperty( + "CenaNoc", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("CenaNoc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaNoc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaNoc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaNoc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaOtwarta = runtimeEntityType.AddProperty( + "CenaOtwarta", + typeof(short?), + propertyInfo: typeof(HarmCeny).GetProperty("CenaOtwarta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaOtwarta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + cenaOtwarta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var inne = runtimeEntityType.AddProperty( + "Inne", + typeof(string), + propertyInfo: typeof(HarmCeny).GetProperty("Inne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + inne.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + inne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var progPromocji = runtimeEntityType.AddProperty( + "ProgPromocji", + typeof(decimal?), + propertyInfo: typeof(HarmCeny).GetProperty("ProgPromocji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + progPromocji.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + progPromocji.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + progPromocji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short?), + propertyInfo: typeof(HarmCeny).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { harmId, towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_HARMCENY"); + + var idx_HarmTow = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_HarmTow"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("HarmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("HarmId") }), + principalEntityType, + required: true); + + var harm = declaringEntityType.AddNavigation("Harm", + runtimeForeignKey, + onDependent: true, + typeof(HarmWpis), + propertyInfo: typeof(HarmCeny).GetProperty("Harm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmCeny = principalEntityType.AddNavigation("HarmCeny", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(HarmWpis).GetProperty("HarmCeny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HARMCENY_REF_HARMC_HARMWPIS"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(HarmCeny).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCeny).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmCeny = principalEntityType.AddNavigation("HarmCeny", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("HarmCeny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HARMCENY_REF_HARMT_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmCeny"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmCyklEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmCyklEntityType.cs new file mode 100644 index 0000000..8085567 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmCyklEntityType.cs @@ -0,0 +1,228 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmCyklEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmCykl", + typeof(HarmCykl), + baseEntityType); + + var harmId = runtimeEntityType.AddProperty( + "HarmId", + typeof(decimal), + propertyInfo: typeof(HarmCykl).GetProperty("HarmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + harmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + harmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + harmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odDnia = runtimeEntityType.AddProperty( + "OdDnia", + typeof(short), + propertyInfo: typeof(HarmCykl).GetProperty("OdDnia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + odDnia.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + odDnia.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odGodz = runtimeEntityType.AddProperty( + "OdGodz", + typeof(short), + propertyInfo: typeof(HarmCykl).GetProperty("OdGodz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + odGodz.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + odGodz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odMin = runtimeEntityType.AddProperty( + "OdMin", + typeof(short), + propertyInfo: typeof(HarmCykl).GetProperty("OdMin", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + odMin.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + odMin.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var doDnia = runtimeEntityType.AddProperty( + "DoDnia", + typeof(short?), + propertyInfo: typeof(HarmCykl).GetProperty("DoDnia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + doDnia.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + doDnia.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var doGodz = runtimeEntityType.AddProperty( + "DoGodz", + typeof(short?), + propertyInfo: typeof(HarmCykl).GetProperty("DoGodz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + doGodz.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + doGodz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var doMin = runtimeEntityType.AddProperty( + "DoMin", + typeof(short?), + propertyInfo: typeof(HarmCykl).GetProperty("DoMin", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + doMin.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + doMin.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { harmId, odDnia, odGodz, odMin }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_HARMCYKL"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("HarmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("HarmId") }), + principalEntityType, + required: true); + + var harm = declaringEntityType.AddNavigation("Harm", + runtimeForeignKey, + onDependent: true, + typeof(HarmWpis), + propertyInfo: typeof(HarmCykl).GetProperty("Harm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmCykl = principalEntityType.AddNavigation("HarmCykl", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(HarmWpis).GetProperty("HarmCykl", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HARMCYKL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmCykl"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmHarmEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmHarmEntityType.cs new file mode 100644 index 0000000..25ed04d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmHarmEntityType.cs @@ -0,0 +1,175 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmHarmEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmHarm", + typeof(HarmHarm), + baseEntityType); + + var harmId = runtimeEntityType.AddProperty( + "HarmId", + typeof(decimal), + propertyInfo: typeof(HarmHarm).GetProperty("HarmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmHarm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + harmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + harmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + harmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(HarmHarm).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmHarm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poprzHarmId = runtimeEntityType.AddProperty( + "PoprzHarmId", + typeof(decimal), + propertyInfo: typeof(HarmHarm).GetProperty("PoprzHarmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmHarm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + poprzHarmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + poprzHarmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + poprzHarmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { harmId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_HARMHARM"); + + var index = runtimeEntityType.AddIndex( + new[] { poprzHarmId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("HarmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("HarmId") }), + principalEntityType, + required: true); + + var harm = declaringEntityType.AddNavigation("Harm", + runtimeForeignKey, + onDependent: true, + typeof(HarmWpis), + propertyInfo: typeof(HarmHarm).GetProperty("Harm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmHarm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmHarmHarm = principalEntityType.AddNavigation("HarmHarmHarm", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(HarmWpis).GetProperty("HarmHarmHarm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HARMHARM"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PoprzHarmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("HarmId") }), + principalEntityType, + required: true); + + var poprzHarm = declaringEntityType.AddNavigation("PoprzHarm", + runtimeForeignKey, + onDependent: true, + typeof(HarmWpis), + propertyInfo: typeof(HarmHarm).GetProperty("PoprzHarm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmHarm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmHarmPoprzHarm = principalEntityType.AddNavigation("HarmHarmPoprzHarm", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(HarmWpis).GetProperty("HarmHarmPoprzHarm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HARMPOPRZHARM"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmHarm"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapCyklEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapCyklEntityType.cs new file mode 100644 index 0000000..f9fda1c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapCyklEntityType.cs @@ -0,0 +1,164 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmRapCyklEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapCykl", + typeof(HarmRapCykl), + baseEntityType); + + var hRId = runtimeEntityType.AddProperty( + "HRId", + typeof(decimal), + propertyInfo: typeof(HarmRapCykl).GetProperty("HRId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + hRId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + hRId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + hRId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(short), + propertyInfo: typeof(HarmRapCykl).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + dzien.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var godzina = runtimeEntityType.AddProperty( + "Godzina", + typeof(short), + propertyInfo: typeof(HarmRapCykl).GetProperty("Godzina", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + godzina.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + godzina.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minuta = runtimeEntityType.AddProperty( + "Minuta", + typeof(short), + propertyInfo: typeof(HarmRapCykl).GetProperty("Minuta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapCykl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + minuta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + minuta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { hRId, dzien, godzina, minuta }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("HRId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("HRId") }), + principalEntityType, + required: true); + + var hR = declaringEntityType.AddNavigation("HR", + runtimeForeignKey, + onDependent: true, + typeof(HarmRap), + propertyInfo: typeof(HarmRapCykl).GetProperty("HR", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapCykl).GetField("
k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmRapCykl = principalEntityType.AddNavigation("HarmRapCykl", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(HarmRap).GetProperty("HarmRapCykl", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HarmRapCykl_HRId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmRapCykl"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapEntityType.cs new file mode 100644 index 0000000..3fe8aee --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapEntityType.cs @@ -0,0 +1,278 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmRapEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmRap", + typeof(HarmRap), + baseEntityType); + + var hRId = runtimeEntityType.AddProperty( + "HRId", + typeof(decimal), + propertyInfo: typeof(HarmRap).GetProperty("HRId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + hRId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + hRId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + hRId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(HarmRap).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDo = runtimeEntityType.AddProperty( + "DataDo", + typeof(DateTime?), + propertyInfo: typeof(HarmRap).GetProperty("DataDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDo.AddAnnotation("Relational:ColumnType", "datetime"); + dataDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataOd = runtimeEntityType.AddProperty( + "DataOd", + typeof(DateTime), + propertyInfo: typeof(HarmRap).GetProperty("DataOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataOd.AddAnnotation("Relational:ColumnType", "datetime"); + dataOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(HarmRap).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzajCyklicznosci = runtimeEntityType.AddProperty( + "RodzajCyklicznosci", + typeof(short), + propertyInfo: typeof(HarmRap).GetProperty("RodzajCyklicznosci", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzajCyklicznosci.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzajCyklicznosci.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzajEksportu = runtimeEntityType.AddProperty( + "RodzajEksportu", + typeof(short?), + propertyInfo: typeof(HarmRap).GetProperty("RodzajEksportu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rodzajEksportu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rodzajEksportu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(HarmRap).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wysylajEmail = runtimeEntityType.AddProperty( + "WysylajEmail", + typeof(short?), + propertyInfo: typeof(HarmRap).GetProperty("WysylajEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wysylajEmail.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wysylajEmail.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(HarmRap).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { hRId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmRap"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapParamEntityType.cs new file mode 100644 index 0000000..2f951e6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapParamEntityType.cs @@ -0,0 +1,149 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmRapParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapParam", + typeof(HarmRapParam), + baseEntityType); + + var hRId = runtimeEntityType.AddProperty( + "HRId", + typeof(decimal), + propertyInfo: typeof(HarmRapParam).GetProperty("HRId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + hRId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + hRId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + hRId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(HarmRapParam).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parWartosc = runtimeEntityType.AddProperty( + "ParWartosc", + typeof(string), + propertyInfo: typeof(HarmRapParam).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + parWartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parWartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { hRId, parNazwa }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("HRId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("HRId") }), + principalEntityType, + required: true); + + var hR = declaringEntityType.AddNavigation("HR", + runtimeForeignKey, + onDependent: true, + typeof(HarmRap), + propertyInfo: typeof(HarmRapParam).GetProperty("HR", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapParam).GetField("
k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmRapParam = principalEntityType.AddNavigation("HarmRapParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(HarmRap).GetProperty("HarmRapParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HarmRapParam_HRId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmRapParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapZlecenieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapZlecenieEntityType.cs new file mode 100644 index 0000000..aa02e8d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmRapZlecenieEntityType.cs @@ -0,0 +1,200 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmRapZlecenieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapZlecenie", + typeof(HarmRapZlecenie), + baseEntityType); + + var hRId = runtimeEntityType.AddProperty( + "HRId", + typeof(decimal), + propertyInfo: typeof(HarmRapZlecenie).GetProperty("HRId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapZlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + hRId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + hRId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + hRId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzas = runtimeEntityType.AddProperty( + "DataCzas", + typeof(DateTime), + propertyInfo: typeof(HarmRapZlecenie).GetProperty("DataCzas", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapZlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataCzas.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzas.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzas.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var komentarz = runtimeEntityType.AddProperty( + "Komentarz", + typeof(string), + propertyInfo: typeof(HarmRapZlecenie).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapZlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + komentarz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + komentarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(HarmRapZlecenie).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapZlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(HarmRapZlecenie).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapZlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { hRId, dataCzas }); + runtimeEntityType.SetPrimaryKey(key); + + var idx_HarmRapZlecenieDataCzas = runtimeEntityType.AddIndex( + new[] { dataCzas }, + name: "idx_HarmRapZlecenieDataCzas"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("HRId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("HRId") }), + principalEntityType, + required: true); + + var hR = declaringEntityType.AddNavigation("HR", + runtimeForeignKey, + onDependent: true, + typeof(HarmRap), + propertyInfo: typeof(HarmRapZlecenie).GetProperty("HR", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRapZlecenie).GetField("
k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmRapZlecenie = principalEntityType.AddNavigation("HarmRapZlecenie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(HarmRap).GetProperty("HarmRapZlecenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmRap).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HarmRapZlecenie_HRId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmRapZlecenie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmWpisEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmWpisEntityType.cs new file mode 100644 index 0000000..140788a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/HarmWpisEntityType.cs @@ -0,0 +1,418 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class HarmWpisEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + typeof(HarmWpis), + baseEntityType); + + var harmId = runtimeEntityType.AddProperty( + "HarmId", + typeof(decimal), + propertyInfo: typeof(HarmWpis).GetProperty("HarmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + harmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + harmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + harmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(HarmWpis).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrHarmId = runtimeEntityType.AddProperty( + "CentrHarmId", + typeof(decimal?), + propertyInfo: typeof(HarmWpis).GetProperty("CentrHarmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrHarmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrHarmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrHarmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenyBrutto = runtimeEntityType.AddProperty( + "CenyBrutto", + typeof(short?), + propertyInfo: typeof(HarmWpis).GetProperty("CenyBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenyBrutto.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + cenyBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var harmTyp = runtimeEntityType.AddProperty( + "HarmTyp", + typeof(short), + propertyInfo: typeof(HarmWpis).GetProperty("HarmTyp", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + harmTyp.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + harmTyp.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var krajId = runtimeEntityType.AddProperty( + "KrajId", + typeof(decimal?), + propertyInfo: typeof(HarmWpis).GetProperty("KrajId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + krajId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + krajId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + krajId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(HarmWpis).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcje = runtimeEntityType.AddProperty( + "Opcje", + typeof(string), + propertyInfo: typeof(HarmWpis).GetProperty("Opcje", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + opcje.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opcje.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var polId = runtimeEntityType.AddProperty( + "PolId", + typeof(decimal?), + propertyInfo: typeof(HarmWpis).GetProperty("PolId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + polId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + polId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + polId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uwzgledniony = runtimeEntityType.AddProperty( + "Uwzgledniony", + typeof(short), + propertyInfo: typeof(HarmWpis).GetProperty("Uwzgledniony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + uwzgledniony.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + uwzgledniony.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waznyDo = runtimeEntityType.AddProperty( + "WaznyDo", + typeof(DateTime?), + propertyInfo: typeof(HarmWpis).GetProperty("WaznyDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waznyDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + waznyDo.AddAnnotation("Relational:ColumnType", "datetime"); + waznyDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waznyOd = runtimeEntityType.AddProperty( + "WaznyOd", + typeof(DateTime?), + propertyInfo: typeof(HarmWpis).GetProperty("WaznyOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waznyOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + waznyOd.AddAnnotation("Relational:ColumnType", "datetime"); + waznyOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(HarmWpis).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { harmId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_HARMWPIS"); + + var idx_HarmKraj = runtimeEntityType.AddIndex( + new[] { krajId, harmId }, + name: "idx_HarmKraj"); + + var idx_HarmPol = runtimeEntityType.AddIndex( + new[] { polId }, + name: "idx_HarmPol"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KrajId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KrajId") }), + principalEntityType); + + var kraj = declaringEntityType.AddNavigation("Kraj", + runtimeForeignKey, + onDependent: true, + typeof(Kraj), + propertyInfo: typeof(HarmWpis).GetProperty("Kraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmWpis = principalEntityType.AddNavigation("HarmWpis", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kraj).GetProperty("HarmWpis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_HarmKraj"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PolId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PolId") }), + principalEntityType); + + var pol = declaringEntityType.AddNavigation("Pol", + runtimeForeignKey, + onDependent: true, + typeof(Polityka), + propertyInfo: typeof(HarmWpis).GetProperty("Pol", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(HarmWpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var harmWpis = principalEntityType.AddNavigation("HarmWpis", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Polityka).GetProperty("HarmWpis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_HARMWPIS_REF_HARMP_POLITYKA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "HarmWpis"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/IstwEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/IstwEntityType.cs new file mode 100644 index 0000000..4b4ce52 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/IstwEntityType.cs @@ -0,0 +1,310 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class IstwEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Istw", + typeof(Istw), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Istw).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(Istw).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokadaMag = runtimeEntityType.AddProperty( + "BlokadaMag", + typeof(decimal), + propertyInfo: typeof(Istw).GetProperty("BlokadaMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + blokadaMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + blokadaMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + blokadaMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaMag = runtimeEntityType.AddProperty( + "CenaMag", + typeof(decimal), + propertyInfo: typeof(Istw).GetProperty("CenaMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwacjaMag = runtimeEntityType.AddProperty( + "RezerwacjaMag", + typeof(decimal?), + propertyInfo: typeof(Istw).GetProperty("RezerwacjaMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rezerwacjaMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rezerwacjaMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rezerwacjaMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanMag = runtimeEntityType.AddProperty( + "StanMag", + typeof(decimal), + propertyInfo: typeof(Istw).GetProperty("StanMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanMax = runtimeEntityType.AddProperty( + "StanMax", + typeof(decimal), + propertyInfo: typeof(Istw).GetProperty("StanMax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanMax.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanMax.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanMax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanMin = runtimeEntityType.AddProperty( + "StanMin", + typeof(decimal), + propertyInfo: typeof(Istw).GetProperty("StanMin", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanMin.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanMin.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanMin.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, magId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ISTW"); + + var index = runtimeEntityType.AddIndex( + new[] { magId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(Istw).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var istw = principalEntityType.AddNavigation("Istw", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("Istw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ISTW_REF_ISTWM_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Istw).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Istw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var istw = principalEntityType.AddNavigation("Istw", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Istw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ISTW_REF_TOWIS_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Istw"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/JMEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/JMEntityType.cs new file mode 100644 index 0000000..50987ee --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/JMEntityType.cs @@ -0,0 +1,149 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class JMEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.JM", + typeof(JM), + baseEntityType); + + var jMId = runtimeEntityType.AddProperty( + "JMId", + typeof(decimal), + propertyInfo: typeof(JM).GetProperty("JMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(JM).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + jMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + jMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + jMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrJMId = runtimeEntityType.AddProperty( + "CentrJMId", + typeof(decimal?), + propertyInfo: typeof(JM).GetProperty("CentrJMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(JM).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrJMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrJMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrJMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(JM).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(JM).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var precyzja = runtimeEntityType.AddProperty( + "Precyzja", + typeof(short), + propertyInfo: typeof(JM).GetProperty("Precyzja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(JM).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + precyzja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + precyzja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { jMId }); + runtimeEntityType.SetPrimaryKey(key); + + var idx_CentrJMId = runtimeEntityType.AddIndex( + new[] { centrJMId }, + name: "idx_CentrJMId"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "JM"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KartaLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KartaLojEntityType.cs new file mode 100644 index 0000000..75c8e62 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KartaLojEntityType.cs @@ -0,0 +1,389 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KartaLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + typeof(KartaLoj), + baseEntityType); + + var kartaId = runtimeEntityType.AddProperty( + "KartaId", + typeof(decimal), + propertyInfo: typeof(KartaLoj).GetProperty("KartaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kartaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kartaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kartaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrKartaId = runtimeEntityType.AddProperty( + "CentrKartaId", + typeof(decimal?), + propertyInfo: typeof(KartaLoj).GetProperty("CentrKartaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKartaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKartaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKartaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKarty = runtimeEntityType.AddProperty( + "KodKarty", + typeof(string), + propertyInfo: typeof(KartaLoj).GetProperty("KodKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + kodKarty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kodKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal), + propertyInfo: typeof(KartaLoj).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis1 = runtimeEntityType.AddProperty( + "Opis1", + typeof(string), + propertyInfo: typeof(KartaLoj).GetProperty("Opis1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + opis1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + opis1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis2 = runtimeEntityType.AddProperty( + "Opis2", + typeof(string), + propertyInfo: typeof(KartaLoj).GetProperty("Opis2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + opis2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + opis2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posiadacz = runtimeEntityType.AddProperty( + "Posiadacz", + typeof(string), + propertyInfo: typeof(KartaLoj).GetProperty("Posiadacz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + posiadacz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + posiadacz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKarty = runtimeEntityType.AddProperty( + "TypKarty", + typeof(short), + propertyInfo: typeof(KartaLoj).GetProperty("TypKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typKarty.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uniewazniono = runtimeEntityType.AddProperty( + "Uniewazniono", + typeof(DateTime?), + propertyInfo: typeof(KartaLoj).GetProperty("Uniewazniono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uniewazniono.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + uniewazniono.AddAnnotation("Relational:ColumnType", "datetime"); + uniewazniono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waznaDo = runtimeEntityType.AddProperty( + "WaznaDo", + typeof(DateTime?), + propertyInfo: typeof(KartaLoj).GetProperty("WaznaDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waznaDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + waznaDo.AddAnnotation("Relational:ColumnType", "datetime"); + waznaDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waznaOd = runtimeEntityType.AddProperty( + "WaznaOd", + typeof(DateTime?), + propertyInfo: typeof(KartaLoj).GetProperty("WaznaOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waznaOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + waznaOd.AddAnnotation("Relational:ColumnType", "datetime"); + waznaOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kartaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KARTALOJ"); + + var idx_CentrKartaId = runtimeEntityType.AddIndex( + new[] { centrKartaId }, + name: "idx_CentrKartaId"); + + var idx_KLoj_KodKarty = runtimeEntityType.AddIndex( + new[] { kodKarty }, + name: "idx_KLoj_KodKarty"); + + var idx_KLoj_Konto = runtimeEntityType.AddIndex( + new[] { kontoId }, + name: "idx_KLoj_Konto"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType, + required: true); + + var konto = declaringEntityType.AddNavigation("Konto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(KartaLoj).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kartaLoj = principalEntityType.AddNavigation("KartaLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("KartaLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_KartaKonto"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "NrRej", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KartaId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KartaId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(KartaLoj).GetProperty("NrRej", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Karta"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KartaLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasKodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasKodEntityType.cs new file mode 100644 index 0000000..937d75e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasKodEntityType.cs @@ -0,0 +1,558 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KasKodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KasKod", + typeof(KasKod), + baseEntityType); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(KasKod).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(KasKod).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(KasKod).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bylyZmianyCen = runtimeEntityType.AddProperty( + "BylyZmianyCen", + typeof(short), + propertyInfo: typeof(KasKod).GetProperty("BylyZmianyCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + bylyZmianyCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + bylyZmianyCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bylyZmianyInne = runtimeEntityType.AddProperty( + "BylyZmianyInne", + typeof(short), + propertyInfo: typeof(KasKod).GetProperty("BylyZmianyInne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + bylyZmianyInne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + bylyZmianyInne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodIndeks = runtimeEntityType.AddProperty( + "DodIndeks", + typeof(short?), + propertyInfo: typeof(KasKod).GetProperty("DodIndeks", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dodIndeks.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + dodIndeks.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWKodzie = runtimeEntityType.AddProperty( + "IleWKodzie", + typeof(decimal?), + propertyInfo: typeof(KasKod).GetProperty("IleWKodzie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileWKodzie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWKodzie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWKodzie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kasPrefPLU = runtimeEntityType.AddProperty( + "KasPrefPLU", + typeof(int?), + propertyInfo: typeof(KasKod).GetProperty("KasPrefPLU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kasPrefPLU.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + kasPrefPLU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(KasKod).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodOpak = runtimeEntityType.AddProperty( + "KodOpak", + typeof(string), + propertyInfo: typeof(KasKod).GetProperty("KodOpak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodOpak.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodOpak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pLU = runtimeEntityType.AddProperty( + "PLU", + typeof(int?), + propertyInfo: typeof(KasKod).GetProperty("PLU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + pLU.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + pLU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pLUOpak = runtimeEntityType.AddProperty( + "PLUOpak", + typeof(int?), + propertyInfo: typeof(KasKod).GetProperty("PLUOpak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + pLUOpak.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + pLUOpak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short?), + propertyInfo: typeof(KasKod).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa = runtimeEntityType.AddProperty( + "Rezerwa", + typeof(string), + propertyInfo: typeof(KasKod).GetProperty("Rezerwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + rezerwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + rezerwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(KasKod).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(KasKod).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short?), + propertyInfo: typeof(KasKod).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typTowaru = runtimeEntityType.AddProperty( + "TypTowaru", + typeof(short?), + propertyInfo: typeof(KasKod).GetProperty("TypTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typTowaru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianyCen = runtimeEntityType.AddProperty( + "ZmianyCen", + typeof(short), + propertyInfo: typeof(KasKod).GetProperty("ZmianyCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zmianyCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zmianyCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianyInne = runtimeEntityType.AddProperty( + "ZmianyInne", + typeof(short), + propertyInfo: typeof(KasKod).GetProperty("ZmianyInne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zmianyInne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zmianyInne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId, towId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KASKOD"); + + var idx_KasKodTow = runtimeEntityType.AddIndex( + new[] { towId, kolejnosc }, + name: "idx_KasKodTow"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(KasKod).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasKod = principalEntityType.AddNavigation("KasKod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("KasKod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASKOD_REF_KASKO_KASA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(KasKod).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasKod = principalEntityType.AddNavigation("KasKod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("KasKod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASKOD_REF_KASKO_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KasKod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasParEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasParEntityType.cs new file mode 100644 index 0000000..ea028a6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasParEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KasParEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KasPar", + typeof(KasPar), + baseEntityType); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(KasPar).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(KasPar).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 60, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parWartosc = runtimeEntityType.AddProperty( + "ParWartosc", + typeof(string), + propertyInfo: typeof(KasPar).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + parWartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parWartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId, parNazwa }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KASPAR"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(KasPar).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasPar = principalEntityType.AddNavigation("KasPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("KasPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASPAR_REF_KASPA_KASA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KasPar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasTowEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasTowEntityType.cs new file mode 100644 index 0000000..07b7d1b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasTowEntityType.cs @@ -0,0 +1,331 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KasTowEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KasTow", + typeof(KasTow), + baseEntityType); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(KasTow).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodWyslany = runtimeEntityType.AddProperty( + "KodWyslany", + typeof(string), + propertyInfo: typeof(KasTow).GetProperty("KodWyslany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 20, + unicode: false); + kodWyslany.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodWyslany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodIndeks = runtimeEntityType.AddProperty( + "DodIndeks", + typeof(short), + propertyInfo: typeof(KasTow).GetProperty("DodIndeks", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dodIndeks.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dodIndeks.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodatkowy = runtimeEntityType.AddProperty( + "Dodatkowy", + typeof(short), + propertyInfo: typeof(KasTow).GetProperty("Dodatkowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dodatkowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dodatkowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var flagaExp = runtimeEntityType.AddProperty( + "FlagaExp", + typeof(short), + propertyInfo: typeof(KasTow).GetProperty("FlagaExp", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + flagaExp.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + flagaExp.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var plu = runtimeEntityType.AddProperty( + "Plu", + typeof(int), + propertyInfo: typeof(KasTow).GetProperty("Plu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + plu.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + plu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(KasTow).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typTowaru = runtimeEntityType.AddProperty( + "TypTowaru", + typeof(short), + propertyInfo: typeof(KasTow).GetProperty("TypTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typTowaru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianyCen = runtimeEntityType.AddProperty( + "ZmianyCen", + typeof(short), + propertyInfo: typeof(KasTow).GetProperty("ZmianyCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zmianyCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zmianyCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianyInne = runtimeEntityType.AddProperty( + "ZmianyInne", + typeof(short), + propertyInfo: typeof(KasTow).GetProperty("ZmianyInne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zmianyInne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zmianyInne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId, kodWyslany }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KASTOW"); + + var idx_KasTowKasaPluDodIndeks = runtimeEntityType.AddIndex( + new[] { kasaId, plu, dodIndeks }, + name: "idx_KasTowKasaPluDodIndeks"); + + var idx_KasTowTowId = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_KasTowTowId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(KasTow).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasTow = principalEntityType.AddNavigation("KasTow", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("KasTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASTOW_REF_KASKO_KASA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(KasTow).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasTow).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasTow = principalEntityType.AddNavigation("KasTow", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("KasTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASTOW_REF_KASTO_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KasTow"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasaEntityType.cs new file mode 100644 index 0000000..11400a5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasaEntityType.cs @@ -0,0 +1,318 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KasaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + typeof(Kasa), + baseEntityType); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(Kasa).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Kasa).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(Kasa).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Kasa).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrUnikatowy = runtimeEntityType.AddProperty( + "NrUnikatowy", + typeof(string), + propertyInfo: typeof(Kasa).GetProperty("NrUnikatowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 30, + unicode: false); + nrUnikatowy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(30)", + size: 30)); + nrUnikatowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(short), + propertyInfo: typeof(Kasa).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + numer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(Kasa).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanowisko = runtimeEntityType.AddProperty( + "Stanowisko", + typeof(string), + propertyInfo: typeof(Kasa).GetProperty("Stanowisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + stanowisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + stanowisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(string), + propertyInfo: typeof(Kasa).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + typ.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KASA"); + + var index = runtimeEntityType.AddIndex( + new[] { magId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(Kasa).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasa = principalEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASA_REF_KASAM_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "As", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KasaId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KasaId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("As", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Kasa"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Kasa"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasaFormaPlatnEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasaFormaPlatnEntityType.cs new file mode 100644 index 0000000..93e18b4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KasaFormaPlatnEntityType.cs @@ -0,0 +1,174 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KasaFormaPlatnEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn", + typeof(KasaFormaPlatn), + baseEntityType); + + var formaId = runtimeEntityType.AddProperty( + "FormaId", + typeof(decimal), + propertyInfo: typeof(KasaFormaPlatn).GetProperty("FormaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + formaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + formaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + formaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(KasaFormaPlatn).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(KasaFormaPlatn).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { formaId, kasaId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { kasaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("FormaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("FormaId") }), + principalEntityType, + required: true); + + var forma = declaringEntityType.AddNavigation("Forma", + runtimeForeignKey, + onDependent: true, + typeof(FormaPlatnPos7), + propertyInfo: typeof(KasaFormaPlatn).GetProperty("Forma", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasaFormaPlatn = principalEntityType.AddNavigation("KasaFormaPlatn", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(FormaPlatnPos7).GetProperty("KasaFormaPlatn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(FormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASAFORMAPLATN_FPP7"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(KasaFormaPlatn).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kasaFormaPlatn = principalEntityType.AddNavigation("KasaFormaPlatn", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("KasaFormaPlatn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KASAFORMAPLATN_KASA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KasaFormaPlatn"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KatParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KatParamEntityType.cs new file mode 100644 index 0000000..10ac323 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KatParamEntityType.cs @@ -0,0 +1,201 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KatParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KatParam", + typeof(KatParam), + baseEntityType); + + var katId = runtimeEntityType.AddProperty( + "KatId", + typeof(decimal), + propertyInfo: typeof(KatParam).GetProperty("KatId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KatParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + katId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + katId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + katId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(KatParam).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KatParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(KatParam).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KatParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartDom = runtimeEntityType.AddProperty( + "WartDom", + typeof(int), + propertyInfo: typeof(KatParam).GetProperty("WartDom", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KatParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + wartDom.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wartDom.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { katId, parId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KATPARAM"); + + var idx_KatParKat = runtimeEntityType.AddIndex( + new[] { katId }, + name: "idx_KatParKat"); + + var idx_KatParPar = runtimeEntityType.AddIndex( + new[] { parId }, + name: "idx_KatParPar"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KatId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KatId") }), + principalEntityType, + required: true); + + var kat = declaringEntityType.AddNavigation("Kat", + runtimeForeignKey, + onDependent: true, + typeof(Kategoria), + propertyInfo: typeof(KatParam).GetProperty("Kat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KatParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var katParam = principalEntityType.AddNavigation("KatParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kategoria).GetProperty("KatParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kategoria).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KATPARAM_REF_KATPA_KATEGORI"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Parametr), + propertyInfo: typeof(KatParam).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KatParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var katParam = principalEntityType.AddNavigation("KatParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Parametr).GetProperty("KatParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KATPARAM_REF_PARKA_PARAMETR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KatParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KategoriaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KategoriaEntityType.cs new file mode 100644 index 0000000..7dfac08 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KategoriaEntityType.cs @@ -0,0 +1,129 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KategoriaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Kategoria", + typeof(Kategoria), + baseEntityType); + + var katId = runtimeEntityType.AddProperty( + "KatId", + typeof(decimal), + propertyInfo: typeof(Kategoria).GetProperty("KatId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kategoria).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + katId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + katId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + katId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrKatId = runtimeEntityType.AddProperty( + "CentrKatId", + typeof(decimal?), + propertyInfo: typeof(Kategoria).GetProperty("CentrKatId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kategoria).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKatId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKatId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKatId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Kategoria).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kategoria).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { katId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KATEGORIA"); + + var idx_CentrKatId = runtimeEntityType.AddIndex( + new[] { centrKatId }, + name: "idx_CentrKatId"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Kategoria"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KodDodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KodDodEntityType.cs new file mode 100644 index 0000000..d62cc50 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KodDodEntityType.cs @@ -0,0 +1,315 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KodDodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KodDod", + typeof(KodDod), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(KodDod).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(KodDod).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWKodzie = runtimeEntityType.AddProperty( + "IleWKodzie", + typeof(decimal?), + propertyInfo: typeof(KodDod).GetProperty("IleWKodzie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileWKodzie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWKodzie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWKodzie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(KodDod).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodCentralny = runtimeEntityType.AddProperty( + "KodCentralny", + typeof(short?), + propertyInfo: typeof(KodDod).GetProperty("KodCentralny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kodCentralny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + kodCentralny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short), + propertyInfo: typeof(KodDod).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prefPLU = runtimeEntityType.AddProperty( + "PrefPLU", + typeof(int), + propertyInfo: typeof(KodDod).GetProperty("PrefPLU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + prefPLU.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + prefPLU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(KodDod).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var subsysKoduDod = runtimeEntityType.AddProperty( + "SubsysKoduDod", + typeof(string), + propertyInfo: typeof(KodDod).GetProperty("SubsysKoduDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + subsysKoduDod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + subsysKoduDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKodu = runtimeEntityType.AddProperty( + "TypKodu", + typeof(short?), + propertyInfo: typeof(KodDod).GetProperty("TypKodu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typKodu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typKodu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KODDOD"); + + var idx_KodDodKod = runtimeEntityType.AddIndex( + new[] { kod }, + name: "idx_KodDodKod"); + + var idx_KodDodSkrot = runtimeEntityType.AddIndex( + new[] { skrot }, + name: "idx_KodDodSkrot"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(KodDod).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodDod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kodDod = principalEntityType.AddNavigation("KodDod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("KodDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KODDOD_REF_KODDO_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KodDod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KodWazonyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KodWazonyEntityType.cs new file mode 100644 index 0000000..907d4ae --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KodWazonyEntityType.cs @@ -0,0 +1,288 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KodWazonyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KodWazony", + typeof(KodWazony), + baseEntityType); + + var kWId = runtimeEntityType.AddProperty( + "KWId", + typeof(decimal), + propertyInfo: typeof(KodWazony).GetProperty("KWId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrKWId = runtimeEntityType.AddProperty( + "CentrKWId", + typeof(decimal?), + propertyInfo: typeof(KodWazony).GetProperty("CentrKWId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czescStala = runtimeEntityType.AddProperty( + "CzescStala", + typeof(short), + propertyInfo: typeof(KodWazony).GetProperty("CzescStala", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + czescStala.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + czescStala.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodKontrola = runtimeEntityType.AddProperty( + "DodKontrola", + typeof(short), + propertyInfo: typeof(KodWazony).GetProperty("DodKontrola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dodKontrola.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dodKontrola.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jMId = runtimeEntityType.AddProperty( + "JMId", + typeof(decimal?), + propertyInfo: typeof(KodWazony).GetProperty("JMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + jMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + jMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + jMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(KodWazony).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var precyzjaWKodzie = runtimeEntityType.AddProperty( + "PrecyzjaWKodzie", + typeof(short), + propertyInfo: typeof(KodWazony).GetProperty("PrecyzjaWKodzie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + precyzjaWKodzie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + precyzjaWKodzie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prefix = runtimeEntityType.AddProperty( + "Prefix", + typeof(short), + propertyInfo: typeof(KodWazony).GetProperty("Prefix", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + prefix.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + prefix.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartoscWKodzie = runtimeEntityType.AddProperty( + "WartoscWKodzie", + typeof(short), + propertyInfo: typeof(KodWazony).GetProperty("WartoscWKodzie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + wartoscWKodzie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + wartoscWKodzie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kWId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KODWAZONY"); + + var index = runtimeEntityType.AddIndex( + new[] { jMId }); + + var idx_CentrKWId = runtimeEntityType.AddIndex( + new[] { centrKWId }, + name: "idx_CentrKWId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("JMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("JMId") }), + principalEntityType); + + var jM = declaringEntityType.AddNavigation("JM", + runtimeForeignKey, + onDependent: true, + typeof(JM), + propertyInfo: typeof(KodWazony).GetProperty("JM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KodWazony).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kodWazony = principalEntityType.AddNavigation("KodWazony", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(JM).GetProperty("KodWazony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(JM).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_KodWazony"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KodWazony"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KomentarzEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KomentarzEntityType.cs new file mode 100644 index 0000000..63d18e1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KomentarzEntityType.cs @@ -0,0 +1,124 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KomentarzEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Komentarz", + typeof(Komentarz), + baseEntityType); + + var zmId = runtimeEntityType.AddProperty( + "ZmId", + typeof(decimal), + propertyInfo: typeof(Komentarz).GetProperty("ZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Komentarz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(Komentarz).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Komentarz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zmId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KOMENTARZ"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZmId") }), + principalEntityType, + unique: true, + required: true); + + var zm = declaringEntityType.AddNavigation("Zm", + runtimeForeignKey, + onDependent: true, + typeof(Zmiana), + propertyInfo: typeof(Komentarz).GetProperty("Zm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Komentarz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var komentarz = principalEntityType.AddNavigation("Komentarz", + runtimeForeignKey, + onDependent: false, + typeof(Komentarz), + propertyInfo: typeof(Zmiana).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KOMENTAR_REF_ZMKOM_ZMIANA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Komentarz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KonfigEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KonfigEntityType.cs new file mode 100644 index 0000000..5e5a17e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KonfigEntityType.cs @@ -0,0 +1,123 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KonfigEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Konfig", + typeof(Konfig), + baseEntityType); + + var parGrupa = runtimeEntityType.AddProperty( + "ParGrupa", + typeof(string), + propertyInfo: typeof(Konfig).GetProperty("ParGrupa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Konfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parGrupa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parGrupa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(Konfig).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Konfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parWartosc = runtimeEntityType.AddProperty( + "ParWartosc", + typeof(string), + propertyInfo: typeof(Konfig).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Konfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + parWartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parWartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parGrupa, parNazwa }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KONFIG"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Konfig"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoBankoweEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoBankoweEntityType.cs new file mode 100644 index 0000000..258e0eb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoBankoweEntityType.cs @@ -0,0 +1,501 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KontoBankoweEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + typeof(KontoBankowe), + baseEntityType); + + var kBId = runtimeEntityType.AddProperty( + "KBId", + typeof(decimal), + propertyInfo: typeof(KontoBankowe).GetProperty("KBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywne = runtimeEntityType.AddProperty( + "Aktywne", + typeof(short), + propertyInfo: typeof(KontoBankowe).GetProperty("Aktywne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bankId = runtimeEntityType.AddProperty( + "BankId", + typeof(decimal), + propertyInfo: typeof(KontoBankowe).GetProperty("BankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + bankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + bankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + bankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrKBId = runtimeEntityType.AddProperty( + "CentrKBId", + typeof(decimal?), + propertyInfo: typeof(KontoBankowe).GetProperty("CentrKBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslne = runtimeEntityType.AddProperty( + "Domyslne", + typeof(short), + propertyInfo: typeof(KontoBankowe).GetProperty("Domyslne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kBIdOplat = runtimeEntityType.AddProperty( + "KBIdOplat", + typeof(decimal?), + propertyInfo: typeof(KontoBankowe).GetProperty("KBIdOplat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kBIdOplat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kBIdOplat.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kBIdOplat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal?), + propertyInfo: typeof(KontoBankowe).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(KontoBankowe).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(string), + propertyInfo: typeof(KontoBankowe).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + numer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var powKBId = runtimeEntityType.AddProperty( + "PowKBId", + typeof(decimal?), + propertyInfo: typeof(KontoBankowe).GetProperty("PowKBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + powKBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powKBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powKBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sufix = runtimeEntityType.AddProperty( + "Sufix", + typeof(string), + propertyInfo: typeof(KontoBankowe).GetProperty("Sufix", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + sufix.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + sufix.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(KontoBankowe).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(KontoBankowe).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(KontoBankowe).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kBId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { bankId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { magId }); + + var index1 = runtimeEntityType.AddIndex( + new[] { walId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("BankId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("BankId") }), + principalEntityType, + required: true); + + var bank = declaringEntityType.AddNavigation("Bank", + runtimeForeignKey, + onDependent: true, + typeof(Bank), + propertyInfo: typeof(KontoBankowe).GetProperty("Bank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontoBankowe = principalEntityType.AddNavigation("KontoBankowe", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Bank).GetProperty("KontoBankowe", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTOBANK_BANK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(KontoBankowe).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontoBankowe = principalEntityType.AddNavigation("KontoBankowe", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("KontoBankowe", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTOBANK_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType, + required: true); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(KontoBankowe).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontoBankowe = principalEntityType.AddNavigation("KontoBankowe", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("KontoBankowe", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTOBANK_WALUTA"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Dok", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KBId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KBId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(KontoBankowe).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("KB"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KontoBankowe"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoBankoweKontrEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoBankoweKontrEntityType.cs new file mode 100644 index 0000000..06d8c46 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoBankoweKontrEntityType.cs @@ -0,0 +1,421 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KontoBankoweKontrEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + typeof(KontoBankoweKontr), + baseEntityType); + + var kBKId = runtimeEntityType.AddProperty( + "KBKId", + typeof(decimal), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("KBKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kBKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kBKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kBKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywne = runtimeEntityType.AddProperty( + "Aktywne", + typeof(short), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Aktywne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bankId = runtimeEntityType.AddProperty( + "BankId", + typeof(decimal?), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("BankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + bankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + bankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + bankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrKBKId = runtimeEntityType.AddProperty( + "CentrKBKId", + typeof(decimal?), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("CentrKBKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKBKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKBKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKBKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslne = runtimeEntityType.AddProperty( + "Domyslne", + typeof(short), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Domyslne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(string), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + numer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var powKBKId = runtimeEntityType.AddProperty( + "PowKBKId", + typeof(decimal?), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("PowKBKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + powKBKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powKBKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powKBKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wykazVat = runtimeEntityType.AddProperty( + "WykazVat", + typeof(short), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("WykazVat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + wykazVat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + wykazVat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kBKId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { bankId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { kontrId }); + + var index1 = runtimeEntityType.AddIndex( + new[] { walId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("BankId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("BankId") }), + principalEntityType); + + var bank = declaringEntityType.AddNavigation("Bank", + runtimeForeignKey, + onDependent: true, + typeof(Bank), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Bank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontoBankoweKontr = principalEntityType.AddNavigation("KontoBankoweKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Bank).GetProperty("KontoBankoweKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Bank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTOBANKKONTR_BANK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontoBankoweKontr = principalEntityType.AddNavigation("KontoBankoweKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("KontoBankoweKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTOBANKKONTR_KONTR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType, + required: true); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(KontoBankoweKontr).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontoBankoweKontr = principalEntityType.AddNavigation("KontoBankoweKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("KontoBankoweKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTOBANKKONTR_WALUTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KontoBankoweKontr"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoLojEntityType.cs new file mode 100644 index 0000000..138fd32 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontoLojEntityType.cs @@ -0,0 +1,338 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KontoLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + typeof(KontoLoj), + baseEntityType); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal), + propertyInfo: typeof(KontoLoj).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywne = runtimeEntityType.AddProperty( + "Aktywne", + typeof(short), + propertyInfo: typeof(KontoLoj).GetProperty("Aktywne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrKontoId = runtimeEntityType.AddProperty( + "CentrKontoId", + typeof(decimal?), + propertyInfo: typeof(KontoLoj).GetProperty("CentrKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(KontoLoj).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(KontoLoj).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stan = runtimeEntityType.AddProperty( + "Stan", + typeof(decimal), + propertyInfo: typeof(KontoLoj).GetProperty("Stan", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stan.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stan.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stan.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanPocz = runtimeEntityType.AddProperty( + "StanPocz", + typeof(decimal), + propertyInfo: typeof(KontoLoj).GetProperty("StanPocz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanPocz.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanPocz.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanPocz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKonta = runtimeEntityType.AddProperty( + "TypKonta", + typeof(short), + propertyInfo: typeof(KontoLoj).GetProperty("TypKonta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typKonta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typKonta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(KontoLoj).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaStanu = runtimeEntityType.AddProperty( + "ZmianaStanu", + typeof(DateTime), + propertyInfo: typeof(KontoLoj).GetProperty("ZmianaStanu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmianaStanu.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaStanu.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaStanu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontoId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KONTOLOJ"); + + var idx_CentrKontoId = runtimeEntityType.AddIndex( + new[] { centrKontoId }, + name: "idx_CentrKontoId"); + + var idx_KLoj_KontrId = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "idx_KLoj_KontrId"); + + var idx_KLoj_ZmStanu = runtimeEntityType.AddIndex( + new[] { zmianaStanu }, + name: "idx_KLoj_ZmStanu"); + + var idx_KLoj_Zmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_KLoj_Zmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(KontoLoj).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontoLoj = principalEntityType.AddNavigation("KontoLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("KontoLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_KontoKth"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KontoLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontrOpisEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontrOpisEntityType.cs new file mode 100644 index 0000000..e373c22 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontrOpisEntityType.cs @@ -0,0 +1,146 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KontrOpisEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KontrOpis", + typeof(KontrOpis), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(KontrOpis).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(KontrOpis).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(KontrOpis).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KONTROPIS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(KontrOpis).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontrOpis = principalEntityType.AddNavigation("KontrOpis", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("KontrOpis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTROPI_REF_KTHOP_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KontrOpis"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontrahentEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontrahentEntityType.cs new file mode 100644 index 0000000..76b432a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KontrahentEntityType.cs @@ -0,0 +1,1291 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KontrahentEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + typeof(Kontrahent), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(Kontrahent).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var akwId = runtimeEntityType.AddProperty( + "AkwId", + typeof(decimal?), + propertyInfo: typeof(Kontrahent).GetProperty("AkwId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + akwId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + akwId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + akwId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bank = runtimeEntityType.AddProperty( + "Bank", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Bank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + bank.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + bank.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrKontrId = runtimeEntityType.AddProperty( + "CentrKontrId", + typeof(decimal?), + propertyInfo: typeof(Kontrahent).GetProperty("CentrKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czasRealZam = runtimeEntityType.AddProperty( + "CzasRealZam", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("CzasRealZam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + czasRealZam.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + czasRealZam.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dostawca = runtimeEntityType.AddProperty( + "Dostawca", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("Dostawca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dostawca.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dostawca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var eMail = runtimeEntityType.AddProperty( + "EMail", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("EMail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + eMail.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + eMail.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var fax = runtimeEntityType.AddProperty( + "Fax", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Fax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + fax.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + fax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaPlatDost = runtimeEntityType.AddProperty( + "FormaPlatDost", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("FormaPlatDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + formaPlatDost.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + formaPlatDost.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaPlatOdb = runtimeEntityType.AddProperty( + "FormaPlatOdb", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("FormaPlatOdb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + formaPlatOdb.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + formaPlatOdb.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeksCentr = runtimeEntityType.AddProperty( + "IndeksCentr", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("IndeksCentr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + indeksCentr.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeksCentr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kartaAktywna = runtimeEntityType.AddProperty( + "KartaAktywna", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("KartaAktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kartaAktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kartaAktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKarty = runtimeEntityType.AddProperty( + "KodKarty", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("KodKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kodKarty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKontr = runtimeEntityType.AddProperty( + "KodKontr", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("KodKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kodKontr.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKontr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var konto = runtimeEntityType.AddProperty( + "Konto", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + konto.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + konto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrKrajId = runtimeEntityType.AddProperty( + "KontrKrajId", + typeof(decimal?), + propertyInfo: typeof(Kontrahent).GetProperty("KontrKrajId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontrKrajId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrKrajId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrKrajId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var maxKredyt = runtimeEntityType.AddProperty( + "MaxKredyt", + typeof(decimal), + propertyInfo: typeof(Kontrahent).GetProperty("MaxKredyt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + maxKredyt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + maxKredyt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + maxKredyt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var maxPoTermPlat = runtimeEntityType.AddProperty( + "MaxPoTermPlat", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("MaxPoTermPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + maxPoTermPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + maxPoTermPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var miasto = runtimeEntityType.AddProperty( + "Miasto", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Miasto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + miasto.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + miasto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nIP = runtimeEntityType.AddProperty( + "NIP", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("NIP", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nIP.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nIP.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var naPrzelewie1 = runtimeEntityType.AddProperty( + "NaPrzelewie1", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("NaPrzelewie1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + naPrzelewie1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + naPrzelewie1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var naPrzelewie2 = runtimeEntityType.AddProperty( + "NaPrzelewie2", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("NaPrzelewie2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + naPrzelewie2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + naPrzelewie2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrAnalityki = runtimeEntityType.AddProperty( + "NrAnalityki", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("NrAnalityki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + nrAnalityki.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + nrAnalityki.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDomu = runtimeEntityType.AddProperty( + "NrDomu", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("NrDomu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 9, + unicode: false); + nrDomu.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(9)", + size: 9)); + nrDomu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrLokalu = runtimeEntityType.AddProperty( + "NrLokalu", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("NrLokalu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 9, + unicode: false); + nrLokalu.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(9)", + size: 9)); + nrLokalu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odbiorca = runtimeEntityType.AddProperty( + "Odbiorca", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("Odbiorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + odbiorca.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + odbiorca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var osoba = runtimeEntityType.AddProperty( + "Osoba", + typeof(short?), + propertyInfo: typeof(Kontrahent).GetProperty("Osoba", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + osoba.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + osoba.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poczta = runtimeEntityType.AddProperty( + "Poczta", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Poczta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + poczta.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + poczta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomRabatu = runtimeEntityType.AddProperty( + "PoziomRabatu", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("PoziomRabatu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomRabatu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomRabatu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var producent = runtimeEntityType.AddProperty( + "Producent", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("Producent", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + producent.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + producent.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatDost = runtimeEntityType.AddProperty( + "RabatDost", + typeof(decimal), + propertyInfo: typeof(Kontrahent).GetProperty("RabatDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatDost.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatDost.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatDost.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatOdb = runtimeEntityType.AddProperty( + "RabatOdb", + typeof(decimal), + propertyInfo: typeof(Kontrahent).GetProperty("RabatOdb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatOdb.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatOdb.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatOdb.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa1 = runtimeEntityType.AddProperty( + "Rezerwa1", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Rezerwa1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 80, + unicode: false); + rezerwa1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(80)", + size: 80)); + rezerwa1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa2 = runtimeEntityType.AddProperty( + "Rezerwa2", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Rezerwa2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + rezerwa2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + rezerwa2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var staly = runtimeEntityType.AddProperty( + "Staly", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("Staly", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + staly.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + staly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var telefon = runtimeEntityType.AddProperty( + "Telefon", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Telefon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + telefon.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + telefon.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termPlatDost = runtimeEntityType.AddProperty( + "TermPlatDost", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("TermPlatDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + termPlatDost.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + termPlatDost.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termPlatOdb = runtimeEntityType.AddProperty( + "TermPlatOdb", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("TermPlatOdb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + termPlatOdb.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + termPlatOdb.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termWaznKarty = runtimeEntityType.AddProperty( + "TermWaznKarty", + typeof(DateTime), + propertyInfo: typeof(Kontrahent).GetProperty("TermWaznKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + termWaznKarty.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + termWaznKarty.AddAnnotation("Relational:ColumnType", "datetime"); + termWaznKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ulica = runtimeEntityType.AddProperty( + "Ulica", + typeof(string), + propertyInfo: typeof(Kontrahent).GetProperty("Ulica", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + ulica.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + ulica.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zakPracChron = runtimeEntityType.AddProperty( + "ZakPracChron", + typeof(short), + propertyInfo: typeof(Kontrahent).GetProperty("ZakPracChron", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zakPracChron.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zakPracChron.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Kontrahent).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KONTRAHENT"); + + var index = runtimeEntityType.AddIndex( + new[] { akwId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { kontrKrajId }); + + var idx_KontrIndCentr = runtimeEntityType.AddIndex( + new[] { indeksCentr }, + name: "idx_KontrIndCentr"); + + var idx_KontrNIP = runtimeEntityType.AddIndex( + new[] { nIP }, + name: "idx_KontrNIP"); + + var idx_KontrZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_KontrZmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("AkwId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("AkwId") }), + principalEntityType); + + var akw = declaringEntityType.AddNavigation("Akw", + runtimeForeignKey, + onDependent: true, + typeof(Akwizytor), + propertyInfo: typeof(Kontrahent).GetProperty("Akw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontrahent = principalEntityType.AddNavigation("Kontrahent", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Akwizytor).GetProperty("Kontrahent", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Akwizytor).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KONTRAHE_REF_KTHAK_AKWIZYTO"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrKrajId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KrajId") }), + principalEntityType); + + var kontrKraj = declaringEntityType.AddNavigation("KontrKraj", + runtimeForeignKey, + onDependent: true, + typeof(Kraj), + propertyInfo: typeof(Kontrahent).GetProperty("KontrKraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kontrahent = principalEntityType.AddNavigation("Kontrahent", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kraj).GetProperty("Kontrahent", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_KontrahentKraj"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "KPW", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KontrId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KontrId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("KPW", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Kontr"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static RuntimeSkipNavigation CreateSkipNavigation2(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "SklepFlagi", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KontrId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KontrId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("SklepFlagi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Kontr"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static RuntimeSkipNavigation CreateSkipNavigation3(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "TypOs", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KontrId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KontrId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("TypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Kontr"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Kontrahent"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KrajEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KrajEntityType.cs new file mode 100644 index 0000000..93c1bae --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KrajEntityType.cs @@ -0,0 +1,228 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KrajEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + typeof(Kraj), + baseEntityType); + + var krajId = runtimeEntityType.AddProperty( + "KrajId", + typeof(decimal), + propertyInfo: typeof(Kraj).GetProperty("KrajId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + krajId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + krajId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + krajId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Kraj).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("Relational:DefaultValue", (short)1); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(Kraj).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Kraj).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(Kraj).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zdjecieFlagi = runtimeEntityType.AddProperty( + "ZdjecieFlagi", + typeof(string), + propertyInfo: typeof(Kraj).GetProperty("ZdjecieFlagi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 100, + unicode: false); + zdjecieFlagi.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(100)", + size: 100)); + zdjecieFlagi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { krajId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KRAJ"); + + var index = runtimeEntityType.AddIndex( + new[] { walId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType, + required: true); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(Kraj).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kraj = principalEntityType.AddNavigation("Kraj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("Kraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_KrajWal"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Kraj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KrajStawkaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KrajStawkaEntityType.cs new file mode 100644 index 0000000..879751c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KrajStawkaEntityType.cs @@ -0,0 +1,142 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KrajStawkaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KrajStawka", + typeof(KrajStawka), + baseEntityType); + + var krajId = runtimeEntityType.AddProperty( + "KrajId", + typeof(decimal), + propertyInfo: typeof(KrajStawka).GetProperty("KrajId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KrajStawka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + krajId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + krajId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + krajId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(KrajStawka).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KrajStawka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podstawowa = runtimeEntityType.AddProperty( + "Podstawowa", + typeof(short?), + propertyInfo: typeof(KrajStawka).GetProperty("Podstawowa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KrajStawka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + podstawowa.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + podstawowa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { krajId, stawka }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KRAJSTAWKA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KrajId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KrajId") }), + principalEntityType, + required: true); + + var kraj = declaringEntityType.AddNavigation("Kraj", + runtimeForeignKey, + onDependent: true, + typeof(Kraj), + propertyInfo: typeof(KrajStawka).GetProperty("Kraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KrajStawka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var krajStawka = principalEntityType.AddNavigation("KrajStawka", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kraj).GetProperty("KrajStawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_KrajVat"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KrajStawka"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthParWartoscEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthParWartoscEntityType.cs new file mode 100644 index 0000000..5591d49 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthParWartoscEntityType.cs @@ -0,0 +1,252 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KthParWartoscEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", + typeof(KthParWartosc), + baseEntityType); + + var kPWId = runtimeEntityType.AddProperty( + "KPWId", + typeof(decimal), + propertyInfo: typeof(KthParWartosc).GetProperty("KPWId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kPWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kPWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kPWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrKPWId = runtimeEntityType.AddProperty( + "CentrKPWId", + typeof(decimal?), + propertyInfo: typeof(KthParWartosc).GetProperty("CentrKPWId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKPWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKPWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKPWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(KthParWartosc).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kthParId = runtimeEntityType.AddProperty( + "KthParId", + typeof(decimal), + propertyInfo: typeof(KthParWartosc).GetProperty("KthParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kthParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kthParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kthParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(KthParWartosc).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kPWId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KTHPARWARTOSC"); + + var idx_KPWPar = runtimeEntityType.AddIndex( + new[] { kthParId }, + name: "idx_KPWPar"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KthParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KthParId") }), + principalEntityType, + required: true); + + var kthPar = declaringEntityType.AddNavigation("KthPar", + runtimeForeignKey, + onDependent: true, + typeof(KthParam), + propertyInfo: typeof(KthParWartosc).GetProperty("KthPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kthParWartosc = principalEntityType.AddNavigation("KthParWartosc", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KthParam).GetProperty("KthParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KTHPARWA_REF_KPWAR_KTHPARAM"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Kontr", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KPWId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KPWId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(KthParWartosc).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("KPW"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static RuntimeSkipNavigation CreateSkipNavigation2(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Sklep", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KPWId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KPWId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(KthParWartosc).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("KPW"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KthParWartosc"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthParamEntityType.cs new file mode 100644 index 0000000..2d9afad --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthParamEntityType.cs @@ -0,0 +1,221 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KthParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KthParam", + typeof(KthParam), + baseEntityType); + + var kthParId = runtimeEntityType.AddProperty( + "KthParId", + typeof(decimal), + propertyInfo: typeof(KthParam).GetProperty("KthParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kthParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kthParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kthParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrKthParId = runtimeEntityType.AddProperty( + "CentrKthParId", + typeof(decimal?), + propertyInfo: typeof(KthParam).GetProperty("CentrKthParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKthParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKthParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKthParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kPWDomyslnaId = runtimeEntityType.AddProperty( + "KPWDomyslnaId", + typeof(decimal?), + propertyInfo: typeof(KthParam).GetProperty("KPWDomyslnaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kPWDomyslnaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kPWDomyslnaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kPWDomyslnaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(KthParam).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(KthParam).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wymagany = runtimeEntityType.AddProperty( + "Wymagany", + typeof(short), + propertyInfo: typeof(KthParam).GetProperty("Wymagany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + wymagany.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + wymagany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kthParId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KTHPARAM"); + + var index = runtimeEntityType.AddIndex( + new[] { kPWDomyslnaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KPWDomyslnaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KPWId") }), + principalEntityType); + + var kPWDomyslna = declaringEntityType.AddNavigation("KPWDomyslna", + runtimeForeignKey, + onDependent: true, + typeof(KthParWartosc), + propertyInfo: typeof(KthParam).GetProperty("KPWDomyslna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kthParam = principalEntityType.AddNavigation("KthParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KthParWartosc).GetProperty("KthParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KthParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KTHPARAM_REF_KPDOM_KTHPARWA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KthParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthTypOsEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthTypOsEntityType.cs new file mode 100644 index 0000000..1801697 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthTypOsEntityType.cs @@ -0,0 +1,125 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KthTypOsEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "KthTypOs", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typOsId = runtimeEntityType.AddProperty( + "TypOsId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + typOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, typOsId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KTHTYPOS"); + + var idx_KTHTYPOS_TYPOS = runtimeEntityType.AddIndex( + new[] { typOsId }, + name: "idx_KTHTYPOS_TYPOS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KTHTYPOS_KTH"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TypOsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TypOsId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KTHTYPOS_TYPOS"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KthTypOs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthWartoscEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthWartoscEntityType.cs new file mode 100644 index 0000000..cfc3403 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KthWartoscEntityType.cs @@ -0,0 +1,125 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KthWartoscEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "KthWartosc", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kPWId = runtimeEntityType.AddProperty( + "KPWId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kPWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kPWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kPWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, kPWId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KTHWARTOSC"); + + var idx_KWart = runtimeEntityType.AddIndex( + new[] { kPWId }, + name: "idx_KWart"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KPWId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KPWId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KTHWARTO_REF_KWPAR_KTHPARWA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KTHWARTO_REF_KTHWA_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KthWartosc"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/KursWalutyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KursWalutyEntityType.cs new file mode 100644 index 0000000..890e370 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/KursWalutyEntityType.cs @@ -0,0 +1,333 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class KursWalutyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.KursWaluty", + typeof(KursWaluty), + baseEntityType); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(KursWaluty).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime), + propertyInfo: typeof(KursWaluty).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal?), + propertyInfo: typeof(KursWaluty).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kursZak = runtimeEntityType.AddProperty( + "KursZak", + typeof(decimal?), + propertyInfo: typeof(KursWaluty).GetProperty("KursZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kursZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kursZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kursZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kursZakZr = runtimeEntityType.AddProperty( + "KursZakZr", + typeof(decimal?), + propertyInfo: typeof(KursWaluty).GetProperty("KursZakZr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kursZakZr.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kursZakZr.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kursZakZr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kursZr = runtimeEntityType.AddProperty( + "KursZr", + typeof(decimal?), + propertyInfo: typeof(KursWaluty).GetProperty("KursZr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kursZr.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kursZr.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kursZr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrTabeli = runtimeEntityType.AddProperty( + "NrTabeli", + typeof(string), + propertyInfo: typeof(KursWaluty).GetProperty("NrTabeli", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrTabeli.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrTabeli.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrTabeliZak = runtimeEntityType.AddProperty( + "NrTabeliZak", + typeof(string), + propertyInfo: typeof(KursWaluty).GetProperty("NrTabeliZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrTabeliZak.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrTabeliZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var spread = runtimeEntityType.AddProperty( + "Spread", + typeof(decimal?), + propertyInfo: typeof(KursWaluty).GetProperty("Spread", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + spread.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + spread.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + spread.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var spreadZak = runtimeEntityType.AddProperty( + "SpreadZak", + typeof(decimal?), + propertyInfo: typeof(KursWaluty).GetProperty("SpreadZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + spreadZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + spreadZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + spreadZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { walId, data }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_KURSWALUTY"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType, + required: true); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(KursWaluty).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KursWaluty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var kursWaluty = principalEntityType.AddNavigation("KursWaluty", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("KursWaluty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_KURSWAL_REFERENCE_WAL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "KursWaluty"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/LiniaLotniczaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LiniaLotniczaEntityType.cs new file mode 100644 index 0000000..4ee341b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LiniaLotniczaEntityType.cs @@ -0,0 +1,179 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class LiniaLotniczaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.LiniaLotnicza", + typeof(LiniaLotnicza), + baseEntityType); + + var liniaId = runtimeEntityType.AddProperty( + "LiniaId", + typeof(decimal), + propertyInfo: typeof(LiniaLotnicza).GetProperty("LiniaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LiniaLotnicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + liniaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + liniaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + liniaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(LiniaLotnicza).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LiniaLotnicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(LiniaLotnicza).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LiniaLotnicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 16, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(16)", + size: 16)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(LiniaLotnicza).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LiniaLotnicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(LiniaLotnicza).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LiniaLotnicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { liniaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_LINIALOTN"); + + var idx_LinLotKod = runtimeEntityType.AddIndex( + new[] { kod }, + name: "idx_LinLotKod"); + + var idx_LinLotZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_LinLotZmiana"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "LiniaLotnicza"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogOperationEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogOperationEntityType.cs new file mode 100644 index 0000000..c5ca290 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogOperationEntityType.cs @@ -0,0 +1,332 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class LogOperationEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.LogOperation", + typeof(LogOperation), + baseEntityType); + + var operationId = runtimeEntityType.AddProperty( + "OperationId", + typeof(decimal), + propertyInfo: typeof(LogOperation).GetProperty("OperationId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + operationId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + operationId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + operationId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var additionalDesc = runtimeEntityType.AddProperty( + "AdditionalDesc", + typeof(string), + propertyInfo: typeof(LogOperation).GetProperty("AdditionalDesc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + additionalDesc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + additionalDesc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var appTypeId = runtimeEntityType.AddProperty( + "AppTypeId", + typeof(decimal), + propertyInfo: typeof(LogOperation).GetProperty("AppTypeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + appTypeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + appTypeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + appTypeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var lastUpdate = runtimeEntityType.AddProperty( + "LastUpdate", + typeof(DateTime?), + propertyInfo: typeof(LogOperation).GetProperty("LastUpdate", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + lastUpdate.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + lastUpdate.AddAnnotation("Relational:ColumnType", "datetime"); + lastUpdate.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var modItemId = runtimeEntityType.AddProperty( + "ModItemId", + typeof(string), + propertyInfo: typeof(LogOperation).GetProperty("ModItemId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 30, + unicode: false); + modItemId.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(30)", + size: 30)); + modItemId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var modTableTypeId = runtimeEntityType.AddProperty( + "ModTableTypeId", + typeof(decimal?), + propertyInfo: typeof(LogOperation).GetProperty("ModTableTypeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + modTableTypeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + modTableTypeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + modTableTypeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var moduleTypeId = runtimeEntityType.AddProperty( + "ModuleTypeId", + typeof(decimal), + propertyInfo: typeof(LogOperation).GetProperty("ModuleTypeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + moduleTypeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + moduleTypeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + moduleTypeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var operationTime = runtimeEntityType.AddProperty( + "OperationTime", + typeof(DateTime), + propertyInfo: typeof(LogOperation).GetProperty("OperationTime", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + operationTime.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + operationTime.AddAnnotation("Relational:ColumnType", "datetime"); + operationTime.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var operationTypeId = runtimeEntityType.AddProperty( + "OperationTypeId", + typeof(decimal), + propertyInfo: typeof(LogOperation).GetProperty("OperationTypeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + operationTypeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + operationTypeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + operationTypeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var operatorId = runtimeEntityType.AddProperty( + "OperatorId", + typeof(decimal?), + propertyInfo: typeof(LogOperation).GetProperty("OperatorId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + operatorId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + operatorId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + operatorId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posId = runtimeEntityType.AddProperty( + "PosId", + typeof(decimal), + propertyInfo: typeof(LogOperation).GetProperty("PosId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + posId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + posId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + posId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { operationId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_LOGOPERATION"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "LogOperation"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogTypeDefEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogTypeDefEntityType.cs new file mode 100644 index 0000000..89aecac --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogTypeDefEntityType.cs @@ -0,0 +1,170 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class LogTypeDefEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.LogTypeDef", + typeof(LogTypeDef), + baseEntityType); + + var typeId = runtimeEntityType.AddProperty( + "TypeId", + typeof(decimal), + propertyInfo: typeof(LogTypeDef).GetProperty("TypeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogTypeDef).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + typeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var lastUpdate = runtimeEntityType.AddProperty( + "LastUpdate", + typeof(DateTime?), + propertyInfo: typeof(LogTypeDef).GetProperty("LastUpdate", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogTypeDef).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + lastUpdate.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + lastUpdate.AddAnnotation("Relational:ColumnType", "datetime"); + lastUpdate.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var type = runtimeEntityType.AddProperty( + "Type", + typeof(int), + propertyInfo: typeof(LogTypeDef).GetProperty("Type", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogTypeDef).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + type.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + type.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typeCategory = runtimeEntityType.AddProperty( + "TypeCategory", + typeof(string), + propertyInfo: typeof(LogTypeDef).GetProperty("TypeCategory", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogTypeDef).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 50, + unicode: false); + typeCategory.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(50)", + size: 50)); + typeCategory.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typeValue = runtimeEntityType.AddProperty( + "TypeValue", + typeof(string), + propertyInfo: typeof(LogTypeDef).GetProperty("TypeValue", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogTypeDef).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + typeValue.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + typeValue.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { typeId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_LOGTYPEDEF"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "LogTypeDef"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogValChangeNumEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogValChangeNumEntityType.cs new file mode 100644 index 0000000..c3a4635 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogValChangeNumEntityType.cs @@ -0,0 +1,232 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class LogValChangeNumEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeNum", + typeof(LogValChangeNum), + baseEntityType); + + var valChangeId = runtimeEntityType.AddProperty( + "ValChangeId", + typeof(decimal), + propertyInfo: typeof(LogValChangeNum).GetProperty("ValChangeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeNum).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + valChangeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + valChangeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + valChangeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var lastUpdate = runtimeEntityType.AddProperty( + "LastUpdate", + typeof(DateTime?), + propertyInfo: typeof(LogValChangeNum).GetProperty("LastUpdate", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeNum).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + lastUpdate.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + lastUpdate.AddAnnotation("Relational:ColumnType", "datetime"); + lastUpdate.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var operationId = runtimeEntityType.AddProperty( + "OperationId", + typeof(decimal), + propertyInfo: typeof(LogValChangeNum).GetProperty("OperationId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeNum).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + operationId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + operationId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + operationId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valChangeTypeId = runtimeEntityType.AddProperty( + "ValChangeTypeId", + typeof(decimal), + propertyInfo: typeof(LogValChangeNum).GetProperty("ValChangeTypeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeNum).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + valChangeTypeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + valChangeTypeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + valChangeTypeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valueAfter = runtimeEntityType.AddProperty( + "ValueAfter", + typeof(decimal), + propertyInfo: typeof(LogValChangeNum).GetProperty("ValueAfter", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeNum).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + valueAfter.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + valueAfter.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + valueAfter.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valueBefore = runtimeEntityType.AddProperty( + "ValueBefore", + typeof(decimal), + propertyInfo: typeof(LogValChangeNum).GetProperty("ValueBefore", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeNum).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + valueBefore.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + valueBefore.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + valueBefore.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { valChangeId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_LOGVALCHANGENUM"); + + var index = runtimeEntityType.AddIndex( + new[] { operationId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("OperationId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("OperationId") }), + principalEntityType, + required: true); + + var operation = declaringEntityType.AddNavigation("Operation", + runtimeForeignKey, + onDependent: true, + typeof(LogOperation), + propertyInfo: typeof(LogValChangeNum).GetProperty("Operation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeNum).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var logValChangeNum = principalEntityType.AddNavigation("LogValChangeNum", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(LogOperation).GetProperty("LogValChangeNum", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_LOGVALCH_REFERENCE_LOGOPERB"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "LogValChangeNum"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogValChangeTxtEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogValChangeTxtEntityType.cs new file mode 100644 index 0000000..c5c8ac9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LogValChangeTxtEntityType.cs @@ -0,0 +1,230 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class LogValChangeTxtEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeTxt", + typeof(LogValChangeTxt), + baseEntityType); + + var valChangeId = runtimeEntityType.AddProperty( + "ValChangeId", + typeof(decimal), + propertyInfo: typeof(LogValChangeTxt).GetProperty("ValChangeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + valChangeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + valChangeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + valChangeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var lastUpdate = runtimeEntityType.AddProperty( + "LastUpdate", + typeof(DateTime?), + propertyInfo: typeof(LogValChangeTxt).GetProperty("LastUpdate", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + lastUpdate.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + lastUpdate.AddAnnotation("Relational:ColumnType", "datetime"); + lastUpdate.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var operationId = runtimeEntityType.AddProperty( + "OperationId", + typeof(decimal), + propertyInfo: typeof(LogValChangeTxt).GetProperty("OperationId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + operationId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + operationId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + operationId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valChangeTypeId = runtimeEntityType.AddProperty( + "ValChangeTypeId", + typeof(decimal), + propertyInfo: typeof(LogValChangeTxt).GetProperty("ValChangeTypeId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + valChangeTypeId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + valChangeTypeId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + valChangeTypeId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valueAfter = runtimeEntityType.AddProperty( + "ValueAfter", + typeof(string), + propertyInfo: typeof(LogValChangeTxt).GetProperty("ValueAfter", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + valueAfter.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + valueAfter.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valueBefore = runtimeEntityType.AddProperty( + "ValueBefore", + typeof(string), + propertyInfo: typeof(LogValChangeTxt).GetProperty("ValueBefore", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + valueBefore.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + valueBefore.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { valChangeId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_LOGVALCHANGETXT"); + + var index = runtimeEntityType.AddIndex( + new[] { operationId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("OperationId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("OperationId") }), + principalEntityType, + required: true); + + var operation = declaringEntityType.AddNavigation("Operation", + runtimeForeignKey, + onDependent: true, + typeof(LogOperation), + propertyInfo: typeof(LogValChangeTxt).GetProperty("Operation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogValChangeTxt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var logValChangeTxt = principalEntityType.AddNavigation("LogValChangeTxt", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(LogOperation).GetProperty("LogValChangeTxt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(LogOperation).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_LOGVALCH_REFERENCE_LOGOPERA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "LogValChangeTxt"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/LotniskoEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LotniskoEntityType.cs new file mode 100644 index 0000000..eda61d8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/LotniskoEntityType.cs @@ -0,0 +1,226 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class LotniskoEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Lotnisko", + typeof(Lotnisko), + baseEntityType); + + var lotnId = runtimeEntityType.AddProperty( + "LotnId", + typeof(decimal), + propertyInfo: typeof(Lotnisko).GetProperty("LotnId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Lotnisko).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + lotnId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + lotnId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + lotnId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Lotnisko).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Lotnisko).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dutyFree = runtimeEntityType.AddProperty( + "DutyFree", + typeof(short), + propertyInfo: typeof(Lotnisko).GetProperty("DutyFree", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Lotnisko).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dutyFree.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dutyFree.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(Lotnisko).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Lotnisko).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 16, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(16)", + size: 16)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kraj = runtimeEntityType.AddProperty( + "Kraj", + typeof(string), + propertyInfo: typeof(Lotnisko).GetProperty("Kraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Lotnisko).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + kraj.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + kraj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Lotnisko).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Lotnisko).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Lotnisko).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Lotnisko).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { lotnId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_LOTNISKO"); + + var idx_LotnKod = runtimeEntityType.AddIndex( + new[] { kod }, + name: "idx_LotnKod"); + + var idx_LotnZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_LotnZmiana"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Lotnisko"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/MagazynEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MagazynEntityType.cs new file mode 100644 index 0000000..66a2191 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MagazynEntityType.cs @@ -0,0 +1,146 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class MagazynEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + typeof(Magazyn), + baseEntityType); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(Magazyn).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Magazyn).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(short?), + propertyInfo: typeof(Magazyn).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + numer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { magId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_MAGAZYN"); + + return runtimeEntityType; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Pol", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("MagId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("MagId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("Pol", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Mag"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Magazyn"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/MarZakresEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MarZakresEntityType.cs new file mode 100644 index 0000000..d6db381 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MarZakresEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class MarZakresEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.MarZakres", + typeof(MarZakres), + baseEntityType); + + var marId = runtimeEntityType.AddProperty( + "MarId", + typeof(decimal), + propertyInfo: typeof(MarZakres).GetProperty("MarId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(MarZakres).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + marId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + marId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + marId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odCeny = runtimeEntityType.AddProperty( + "OdCeny", + typeof(decimal), + propertyInfo: typeof(MarZakres).GetProperty("OdCeny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(MarZakres).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + odCeny.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + odCeny.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + odCeny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var koncowki = runtimeEntityType.AddProperty( + "Koncowki", + typeof(string), + propertyInfo: typeof(MarZakres).GetProperty("Koncowki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(MarZakres).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + koncowki.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + koncowki.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zaokraglanie = runtimeEntityType.AddProperty( + "Zaokraglanie", + typeof(short), + propertyInfo: typeof(MarZakres).GetProperty("Zaokraglanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(MarZakres).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zaokraglanie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zaokraglanie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { marId, odCeny }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_MARZAKRES"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MarId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MarId") }), + principalEntityType, + required: true); + + var mar = declaringEntityType.AddNavigation("Mar", + runtimeForeignKey, + onDependent: true, + typeof(Marzownik), + propertyInfo: typeof(MarZakres).GetProperty("Mar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(MarZakres).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var marZakres = principalEntityType.AddNavigation("MarZakres", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Marzownik).GetProperty("MarZakres", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_MARZAKRE_REF_MARZA_MARZOWNI"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "MarZakres"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/MarzownikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MarzownikEntityType.cs new file mode 100644 index 0000000..531395b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MarzownikEntityType.cs @@ -0,0 +1,424 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class MarzownikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + typeof(Marzownik), + baseEntityType); + + var marId = runtimeEntityType.AddProperty( + "MarId", + typeof(decimal), + propertyInfo: typeof(Marzownik).GetProperty("MarId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + marId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + marId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + marId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var asId = runtimeEntityType.AddProperty( + "AsId", + typeof(decimal?), + propertyInfo: typeof(Marzownik).GetProperty("AsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + asId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + asId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + asId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal?), + propertyInfo: typeof(Marzownik).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minMarzaJest = runtimeEntityType.AddProperty( + "MinMarzaJest", + typeof(short?), + propertyInfo: typeof(Marzownik).GetProperty("MinMarzaJest", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + minMarzaJest.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + minMarzaJest.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minMarzaOd100 = runtimeEntityType.AddProperty( + "MinMarzaOd100", + typeof(decimal?), + propertyInfo: typeof(Marzownik).GetProperty("MinMarzaOd100", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + minMarzaOd100.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + minMarzaOd100.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + minMarzaOd100.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minMarzaW100 = runtimeEntityType.AddProperty( + "MinMarzaW100", + typeof(decimal?), + propertyInfo: typeof(Marzownik).GetProperty("MinMarzaW100", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + minMarzaW100.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + minMarzaW100.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + minMarzaW100.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var modOd100 = runtimeEntityType.AddProperty( + "ModOd100", + typeof(decimal?), + propertyInfo: typeof(Marzownik).GetProperty("ModOd100", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + modOd100.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + modOd100.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + modOd100.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var modW100 = runtimeEntityType.AddProperty( + "ModW100", + typeof(decimal?), + propertyInfo: typeof(Marzownik).GetProperty("ModW100", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + modW100.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + modW100.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + modW100.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var modZnaczenie = runtimeEntityType.AddProperty( + "ModZnaczenie", + typeof(short?), + propertyInfo: typeof(Marzownik).GetProperty("ModZnaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + modZnaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + modZnaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short), + propertyInfo: typeof(Marzownik).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal?), + propertyInfo: typeof(Marzownik).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zakresy = runtimeEntityType.AddProperty( + "Zakresy", + typeof(short), + propertyInfo: typeof(Marzownik).GetProperty("Zakresy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zakresy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zakresy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { marId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_MARZOWNIK"); + + var idxMarAs = runtimeEntityType.AddIndex( + new[] { asId }, + name: "idxMarAs"); + + var idxMarMag = runtimeEntityType.AddIndex( + new[] { magId }, + name: "idxMarMag"); + + var idxMarTow = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idxMarTow"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("AsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("AsId") }), + principalEntityType); + + var @as = declaringEntityType.AddNavigation("As", + runtimeForeignKey, + onDependent: true, + typeof(Asort), + propertyInfo: typeof(Marzownik).GetProperty("As", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var marzownik = principalEntityType.AddNavigation("Marzownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Asort).GetProperty("Marzownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_MARZOWNI_REF_MARAS_ASORT"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(Marzownik).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var marzownik = principalEntityType.AddNavigation("Marzownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("Marzownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_MARZOWNI_REF_MARMA_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Marzownik).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Marzownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var marzownik = principalEntityType.AddNavigation("Marzownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Marzownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_MARZOWNI_REF_MARTO_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Marzownik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/MiastoEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MiastoEntityType.cs new file mode 100644 index 0000000..8e593f3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/MiastoEntityType.cs @@ -0,0 +1,165 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class MiastoEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Miasto", + typeof(Miasto), + baseEntityType); + + var mId = runtimeEntityType.AddProperty( + "MId", + typeof(decimal), + propertyInfo: typeof(Miasto).GetProperty("MId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Miasto).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + mId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + mId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + mId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Miasto).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Miasto).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslne = runtimeEntityType.AddProperty( + "Domyslne", + typeof(short), + propertyInfo: typeof(Miasto).GetProperty("Domyslne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Miasto).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Miasto).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Miasto).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Miasto).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Miasto).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { mId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Miasto"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/NotatkiEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NotatkiEntityType.cs new file mode 100644 index 0000000..d3c6acf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NotatkiEntityType.cs @@ -0,0 +1,171 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class NotatkiEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Notatki", + typeof(Notatki), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Notatki).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Notatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(Notatki).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Notatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var koniecLinii = runtimeEntityType.AddProperty( + "KoniecLinii", + typeof(short), + propertyInfo: typeof(Notatki).GetProperty("KoniecLinii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Notatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + koniecLinii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + koniecLinii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(Notatki).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Notatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_NOTATKI"); + + var swwDoNotatek = runtimeEntityType.AddTrigger( + "SwwDoNotatek"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Notatki).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Notatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var notatki = principalEntityType.AddNavigation("Notatki", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Notatki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_NOTATKI_REF_TOWNO_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Notatki"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + runtimeEntityType.AddAnnotation("SqlServer:UseSqlOutputClause", false); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/NrRejEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NrRejEntityType.cs new file mode 100644 index 0000000..1bd4bea --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NrRejEntityType.cs @@ -0,0 +1,200 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class NrRejEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.NrRej", + typeof(NrRej), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(NrRej).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrFormat = runtimeEntityType.AddProperty( + "NrFormat", + typeof(string), + propertyInfo: typeof(NrRej).GetProperty("NrFormat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 60, + unicode: false); + nrFormat.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrFormat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrWpisany = runtimeEntityType.AddProperty( + "NrWpisany", + typeof(string), + propertyInfo: typeof(NrRej).GetProperty("NrWpisany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nrWpisany.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrWpisany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wyborKart = runtimeEntityType.AddProperty( + "WyborKart", + typeof(short), + propertyInfo: typeof(NrRej).GetProperty("WyborKart", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + wyborKart.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + wyborKart.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, nrFormat }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_NRREJ"); + + var idx_NumerRej = runtimeEntityType.AddIndex( + new[] { nrFormat, kontrId }, + name: "idx_NumerRej"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(NrRej).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var nrRej = principalEntityType.AddNavigation("NrRej", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("NrRej", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_NrRejKth"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Karta", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("KontrId"), joinEntityType.FindProperty("NrFormat") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("KontrId"), declaringEntityType.FindProperty("NrFormat") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(NrRej).GetProperty("Karta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("NrRej"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "NrRej"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/NrRejKartaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NrRejKartaEntityType.cs new file mode 100644 index 0000000..704dd02 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NrRejKartaEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class NrRejKartaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "NrRejKarta", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrFormat = runtimeEntityType.AddProperty( + "NrFormat", + typeof(string), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 60, + unicode: false); + nrFormat.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrFormat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kartaId = runtimeEntityType.AddProperty( + "KartaId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kartaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kartaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kartaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, nrFormat, kartaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_NRREJKARTA"); + + var idx_NrRejKartaId = runtimeEntityType.AddIndex( + new[] { kartaId, kontrId, nrFormat }, + name: "idx_NrRejKartaId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KartaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KartaId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_KartaNrRej"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId"), declaringEntityType.FindProperty("NrFormat") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId"), principalEntityType.FindProperty("NrFormat") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_NrRejKarta"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "NrRejKarta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/NumDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NumDokEntityType.cs new file mode 100644 index 0000000..a02b805 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NumDokEntityType.cs @@ -0,0 +1,114 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class NumDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.NumDok", + typeof(NumDok), + baseEntityType); + + var typNumeru = runtimeEntityType.AddProperty( + "TypNumeru", + typeof(short), + propertyInfo: typeof(NumDok).GetProperty("TypNumeru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typNumeru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typNumeru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var format = runtimeEntityType.AddProperty( + "Format", + typeof(string), + propertyInfo: typeof(NumDok).GetProperty("Format", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + format.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + format.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var licznik = runtimeEntityType.AddProperty( + "Licznik", + typeof(int), + propertyInfo: typeof(NumDok).GetProperty("Licznik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + licznik.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + licznik.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { typNumeru }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_NUMDOK"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "NumDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/NumMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NumMagEntityType.cs new file mode 100644 index 0000000..4f232a7 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/NumMagEntityType.cs @@ -0,0 +1,195 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class NumMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.NumMag", + typeof(NumMag), + baseEntityType); + + var typNumeru = runtimeEntityType.AddProperty( + "TypNumeru", + typeof(short), + propertyInfo: typeof(NumMag).GetProperty("TypNumeru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typNumeru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typNumeru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(NumMag).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var format = runtimeEntityType.AddProperty( + "Format", + typeof(string), + propertyInfo: typeof(NumMag).GetProperty("Format", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + format.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + format.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var licznik = runtimeEntityType.AddProperty( + "Licznik", + typeof(int), + propertyInfo: typeof(NumMag).GetProperty("Licznik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + licznik.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + licznik.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { typNumeru, magId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_NUMMAG"); + + var index = runtimeEntityType.AddIndex( + new[] { magId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(NumMag).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var numMag = principalEntityType.AddNavigation("NumMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("NumMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_NUMMAG_REF_NUMMA_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TypNumeru") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TypNumeru") }), + principalEntityType, + required: true); + + var typNumeruNavigation = declaringEntityType.AddNavigation("TypNumeruNavigation", + runtimeForeignKey, + onDependent: true, + typeof(NumDok), + propertyInfo: typeof(NumMag).GetProperty("TypNumeruNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var numMag = principalEntityType.AddNavigation("NumMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(NumDok).GetProperty("NumMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(NumDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_NUMMAG_REF_NUMMA_NUMDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "NumMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OdbProdEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OdbProdEntityType.cs new file mode 100644 index 0000000..64985e2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OdbProdEntityType.cs @@ -0,0 +1,180 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OdbProdEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.OdbProd", + typeof(OdbProd), + baseEntityType); + + var odbId = runtimeEntityType.AddProperty( + "OdbId", + typeof(decimal), + propertyInfo: typeof(OdbProd).GetProperty("OdbId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OdbProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + odbId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + odbId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + odbId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prodId = runtimeEntityType.AddProperty( + "ProdId", + typeof(decimal), + propertyInfo: typeof(OdbProd).GetProperty("ProdId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OdbProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + prodId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + prodId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + prodId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatProd = runtimeEntityType.AddProperty( + "RabatProd", + typeof(decimal), + propertyInfo: typeof(OdbProd).GetProperty("RabatProd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OdbProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatProd.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatProd.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatProd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { odbId, prodId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ODBPROD"); + + var index = runtimeEntityType.AddIndex( + new[] { prodId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("OdbId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var odb = declaringEntityType.AddNavigation("Odb", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(OdbProd).GetProperty("Odb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OdbProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var odbProdOdb = principalEntityType.AddNavigation("OdbProdOdb", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("OdbProdOdb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ODBPROD_REF_ODBPR_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ProdId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var prod = declaringEntityType.AddNavigation("Prod", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(OdbProd).GetProperty("Prod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OdbProd).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var odbProdProd = principalEntityType.AddNavigation("OdbProdProd", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("OdbProdProd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ODBPROD_REF_PRODO_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "OdbProd"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OdbiorcaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OdbiorcaEntityType.cs new file mode 100644 index 0000000..7386b1b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OdbiorcaEntityType.cs @@ -0,0 +1,306 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OdbiorcaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Odbiorca", + typeof(Odbiorca), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(Odbiorca).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Odbiorca).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks = runtimeEntityType.AddProperty( + "Indeks", + typeof(string), + propertyInfo: typeof(Odbiorca).GetProperty("Indeks", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + indeks.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + indeks.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var naWylacznosc = runtimeEntityType.AddProperty( + "NaWylacznosc", + typeof(short?), + propertyInfo: typeof(Odbiorca).GetProperty("NaWylacznosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + naWylacznosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + naWylacznosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Odbiorca).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatTow = runtimeEntityType.AddProperty( + "RabatTow", + typeof(decimal?), + propertyInfo: typeof(Odbiorca).GetProperty("RabatTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rabatTow.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatTow.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatTow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stalaCena = runtimeEntityType.AddProperty( + "StalaCena", + typeof(decimal?), + propertyInfo: typeof(Odbiorca).GetProperty("StalaCena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stalaCena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stalaCena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stalaCena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zamowil = runtimeEntityType.AddProperty( + "Zamowil", + typeof(decimal), + propertyInfo: typeof(Odbiorca).GetProperty("Zamowil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + zamowil.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + zamowil.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + zamowil.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ODBIORCA"); + + var idx_OdbTowId = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_OdbTowId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(Odbiorca).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var odbiorcaNavigation = principalEntityType.AddNavigation("OdbiorcaNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("OdbiorcaNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ODBIORCA_REF_KTHOD_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Odbiorca).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Odbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var odbiorca = principalEntityType.AddNavigation("Odbiorca", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Odbiorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ODBIORCA_REF_TOWOD_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Odbiorca"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfKodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfKodEntityType.cs new file mode 100644 index 0000000..929212f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfKodEntityType.cs @@ -0,0 +1,198 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OfKodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.OfKod", + typeof(OfKod), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(OfKod).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ofId = runtimeEntityType.AddProperty( + "OfId", + typeof(decimal), + propertyInfo: typeof(OfKod).GetProperty("OfId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + ofId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + ofId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + ofId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(OfKod).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(OfKod).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKodu = runtimeEntityType.AddProperty( + "TypKodu", + typeof(short), + propertyInfo: typeof(OfKod).GetProperty("TypKodu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typKodu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typKodu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, ofId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_OFKOD"); + + var idx_OfKthKod = runtimeEntityType.AddIndex( + new[] { kontrId, kod }, + name: "idx_OfKthKod"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId"), declaringEntityType.FindProperty("OfId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId"), principalEntityType.FindProperty("OfId") }), + principalEntityType, + required: true); + + var oferta = declaringEntityType.AddNavigation("Oferta", + runtimeForeignKey, + onDependent: true, + typeof(Oferta), + propertyInfo: typeof(OfKod).GetProperty("Oferta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var ofKod = principalEntityType.AddNavigation("OfKod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Oferta).GetProperty("OfKod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_OFKOD_REF_OFKOD_OFERTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "OfKod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfSlownikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfSlownikEntityType.cs new file mode 100644 index 0000000..01fcb8c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfSlownikEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OfSlownikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.OfSlownik", + typeof(OfSlownik), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(OfSlownik).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfSlownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(OfSlownik).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfSlownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(OfSlownik).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfSlownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal?), + propertyInfo: typeof(OfSlownik).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfSlownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, typ, opis }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_OFSLOWNIK"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(OfSlownik).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OfSlownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var ofSlownik = principalEntityType.AddNavigation("OfSlownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("OfSlownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_OFSLOWNI_REF_OFSLO_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "OfSlownik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfertaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfertaEntityType.cs new file mode 100644 index 0000000..f3bf1fa --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OfertaEntityType.cs @@ -0,0 +1,586 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OfertaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Oferta", + typeof(Oferta), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(Oferta).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ofId = runtimeEntityType.AddProperty( + "OfId", + typeof(decimal), + propertyInfo: typeof(Oferta).GetProperty("OfId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + ofId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + ofId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + ofId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var asortyment = runtimeEntityType.AddProperty( + "Asortyment", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Asortyment", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + asortyment.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + asortyment.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cKU = runtimeEntityType.AddProperty( + "CKU", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("CKU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + cKU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + cKU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal?), + propertyInfo: typeof(Oferta).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks1 = runtimeEntityType.AddProperty( + "Indeks1", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Indeks1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + indeks1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks2 = runtimeEntityType.AddProperty( + "Indeks2", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Indeks2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + indeks2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jM = runtimeEntityType.AddProperty( + "JM", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("JM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + jM.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + jM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kategoria = runtimeEntityType.AddProperty( + "Kategoria", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Kategoria", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + kategoria.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kategoria.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis1 = runtimeEntityType.AddProperty( + "Opis1", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Opis1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis2 = runtimeEntityType.AddProperty( + "Opis2", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Opis2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis3 = runtimeEntityType.AddProperty( + "Opis3", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Opis3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis4 = runtimeEntityType.AddProperty( + "Opis4", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Opis4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis4.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przelicznik = runtimeEntityType.AddProperty( + "Przelicznik", + typeof(decimal?), + propertyInfo: typeof(Oferta).GetProperty("Przelicznik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + przelicznik.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + przelicznik.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + przelicznik.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(Oferta).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short?), + propertyInfo: typeof(Oferta).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termWazn = runtimeEntityType.AddProperty( + "TermWazn", + typeof(short?), + propertyInfo: typeof(Oferta).GetProperty("TermWazn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + termWazn.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + termWazn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal?), + propertyInfo: typeof(Oferta).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, ofId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_OFERTA"); + + var idx_OfTow = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_OfTow"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(Oferta).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var oferta = principalEntityType.AddNavigation("Oferta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("Oferta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_OFERTA_REF_OFKON_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Oferta).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oferta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var oferta = principalEntityType.AddNavigation("Oferta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Oferta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_OFERTA_REF_OFTOW_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Oferta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OpisZdarzLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OpisZdarzLojEntityType.cs new file mode 100644 index 0000000..05bc72c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OpisZdarzLojEntityType.cs @@ -0,0 +1,263 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OpisZdarzLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.OpisZdarzLoj", + typeof(OpisZdarzLoj), + baseEntityType); + + var zdarzLojId = runtimeEntityType.AddProperty( + "ZdarzLojId", + typeof(decimal), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("ZdarzLojId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zdarzLojId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zdarzLojId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zdarzLojId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paramI1 = runtimeEntityType.AddProperty( + "ParamI1", + typeof(int?), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("ParamI1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + paramI1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + paramI1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paramI2 = runtimeEntityType.AddProperty( + "ParamI2", + typeof(int?), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("ParamI2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + paramI2.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + paramI2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paramN1 = runtimeEntityType.AddProperty( + "ParamN1", + typeof(decimal?), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("ParamN1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + paramN1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + paramN1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + paramN1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paramN2 = runtimeEntityType.AddProperty( + "ParamN2", + typeof(decimal?), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("ParamN2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + paramN2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + paramN2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + paramN2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paramS1 = runtimeEntityType.AddProperty( + "ParamS1", + typeof(string), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("ParamS1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + paramS1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + paramS1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zdarzLojId, znaczenie, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_OPISZDARZLOJ"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZdarzLojId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZdarzLojId") }), + principalEntityType, + required: true); + + var zdarzLoj = declaringEntityType.AddNavigation("ZdarzLoj", + runtimeForeignKey, + onDependent: true, + typeof(ZdarzLoj), + propertyInfo: typeof(OpisZdarzLoj).GetProperty("ZdarzLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(OpisZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var opisZdarzLoj = principalEntityType.AddNavigation("OpisZdarzLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(ZdarzLoj).GetProperty("OpisZdarzLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_OpisZdarzLojZdarzLoj"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "OpisZdarzLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OplataEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OplataEntityType.cs new file mode 100644 index 0000000..9385b7e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OplataEntityType.cs @@ -0,0 +1,402 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OplataEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Oplata", + typeof(Oplata), + baseEntityType); + + var oplataId = runtimeEntityType.AddProperty( + "OplataId", + typeof(decimal), + propertyInfo: typeof(Oplata).GetProperty("OplataId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + oplataId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + oplataId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + oplataId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Oplata).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrOplataId = runtimeEntityType.AddProperty( + "CentrOplataId", + typeof(decimal?), + propertyInfo: typeof(Oplata).GetProperty("CentrOplataId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrOplataId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrOplataId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrOplataId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDo = runtimeEntityType.AddProperty( + "DataDo", + typeof(DateTime?), + propertyInfo: typeof(Oplata).GetProperty("DataDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDo.AddAnnotation("Relational:ColumnType", "datetime"); + dataDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataOd = runtimeEntityType.AddProperty( + "DataOd", + typeof(DateTime?), + propertyInfo: typeof(Oplata).GetProperty("DataOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataOd.AddAnnotation("Relational:ColumnType", "datetime"); + dataOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kBId = runtimeEntityType.AddProperty( + "KBId", + typeof(decimal?), + propertyInfo: typeof(Oplata).GetProperty("KBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var komentarz = runtimeEntityType.AddProperty( + "Komentarz", + typeof(string), + propertyInfo: typeof(Oplata).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + komentarz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + komentarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal?), + propertyInfo: typeof(Oplata).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Oplata).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(Oplata).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawkaProc = runtimeEntityType.AddProperty( + "StawkaProc", + typeof(decimal?), + propertyInfo: typeof(Oplata).GetProperty("StawkaProc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawkaProc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stawkaProc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stawkaProc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(Oplata).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Oplata).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { oplataId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { kBId }); + + var ixOplata_DataOd = runtimeEntityType.AddIndex( + new[] { dataOd, dataDo }, + name: "IxOplata_DataOd"); + + var ixOplata_Zmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "IxOplata_Zmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KBId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KBId") }), + principalEntityType); + + var kB = declaringEntityType.AddNavigation("KB", + runtimeForeignKey, + onDependent: true, + typeof(KontoBankowe), + propertyInfo: typeof(Oplata).GetProperty("KB", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Oplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var oplata = principalEntityType.AddNavigation("Oplata", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoBankowe).GetProperty("Oplata", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Oplata_KontoBank"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Oplata"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/OsobaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OsobaEntityType.cs new file mode 100644 index 0000000..86e8440 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/OsobaEntityType.cs @@ -0,0 +1,125 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class OsobaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Osoba", + typeof(Osoba), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(Osoba).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Osoba).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwisko = runtimeEntityType.AddProperty( + "Nazwisko", + typeof(string), + propertyInfo: typeof(Osoba).GetProperty("Nazwisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Osoba).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 60, + unicode: false); + nazwisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, nazwisko }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_OSOBA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(Osoba).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Osoba).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var osobaNavigation = principalEntityType.AddNavigation("OsobaNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("OsobaNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_OSOBA_REF_OSOBA_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Osoba"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHDaneEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHDaneEntityType.cs new file mode 100644 index 0000000..dca6f31 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHDaneEntityType.cs @@ -0,0 +1,146 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PHDaneEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PHDane", + typeof(PHDane), + baseEntityType); + + var pHId = runtimeEntityType.AddProperty( + "PHId", + typeof(decimal), + propertyInfo: typeof(PHDane).GetProperty("PHId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pHId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pHId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pHId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(PHDane).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(PHDane).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pHId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PHDANE"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PHId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PHId") }), + principalEntityType, + required: true); + + var pH = declaringEntityType.AddNavigation("PH", + runtimeForeignKey, + onDependent: true, + typeof(PH), + propertyInfo: typeof(PHDane).GetProperty("PH", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pHDane = principalEntityType.AddNavigation("PHDane", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PH).GetProperty("PHDane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PHDANE_REF_PHDAN_PH"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PHDane"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHEntityType.cs new file mode 100644 index 0000000..4a0b85a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHEntityType.cs @@ -0,0 +1,199 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PHEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PH", + typeof(PH), + baseEntityType); + + var pHId = runtimeEntityType.AddProperty( + "PHId", + typeof(decimal), + propertyInfo: typeof(PH).GetProperty("PHId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pHId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pHId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pHId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(PH).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal?), + propertyInfo: typeof(PH).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(PH).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(PH).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pHId }); + runtimeEntityType.SetPrimaryKey(key); + + var idx_PHKth = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "idx_PHKth"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(PH).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pH = principalEntityType.AddNavigation("PH", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("PH", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PH_REF_PHKON_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PH"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHOdbDaneEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHOdbDaneEntityType.cs new file mode 100644 index 0000000..ec5b182 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHOdbDaneEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PHOdbDaneEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbDane", + typeof(PHOdbDane), + baseEntityType); + + var pHId = runtimeEntityType.AddProperty( + "PHId", + typeof(decimal), + propertyInfo: typeof(PHOdbDane).GetProperty("PHId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pHId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pHId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pHId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(PHOdbDane).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(PHOdbDane).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(PHOdbDane).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pHId, kontrId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PHODBDANE"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PHId"), declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PHId"), principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var pHOdbiorca = declaringEntityType.AddNavigation("PHOdbiorca", + runtimeForeignKey, + onDependent: true, + typeof(PHOdbiorca), + propertyInfo: typeof(PHOdbDane).GetProperty("PHOdbiorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pHOdbDane = principalEntityType.AddNavigation("PHOdbDane", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PHOdbiorca).GetProperty("PHOdbDane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PHODBDAN_REF_PHODB_PHODBIOR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PHOdbDane"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHOdbiorcaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHOdbiorcaEntityType.cs new file mode 100644 index 0000000..9fa8a66 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHOdbiorcaEntityType.cs @@ -0,0 +1,155 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PHOdbiorcaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", + typeof(PHOdbiorca), + baseEntityType); + + var pHId = runtimeEntityType.AddProperty( + "PHId", + typeof(decimal), + propertyInfo: typeof(PHOdbiorca).GetProperty("PHId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pHId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pHId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pHId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(PHOdbiorca).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pHId, kontrId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PHODBIORCA"); + + var idx_PHOdbKth = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "idx_PHOdbKth"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(PHOdbiorca).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pHOdbiorca = principalEntityType.AddNavigation("PHOdbiorca", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("PHOdbiorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PHODBIOR_REF_PHODB_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PHId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PHId") }), + principalEntityType, + required: true); + + var pH = declaringEntityType.AddNavigation("PH", + runtimeForeignKey, + onDependent: true, + typeof(PH), + propertyInfo: typeof(PHOdbiorca).GetProperty("PH", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHOdbiorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pHOdbiorca = principalEntityType.AddNavigation("PHOdbiorca", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PH).GetProperty("PHOdbiorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PHODBIOR_REF_PHODB_PH"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PHOdbiorca"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHRozliczenieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHRozliczenieEntityType.cs new file mode 100644 index 0000000..4119655 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PHRozliczenieEntityType.cs @@ -0,0 +1,206 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PHRozliczenieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie", + typeof(PHRozliczenie), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(PHRozliczenie).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHRozliczenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pHId = runtimeEntityType.AddProperty( + "PHId", + typeof(decimal), + propertyInfo: typeof(PHRozliczenie).GetProperty("PHId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHRozliczenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pHId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pHId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pHId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal), + propertyInfo: typeof(PHRozliczenie).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHRozliczenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczono = runtimeEntityType.AddProperty( + "Rozliczono", + typeof(DateTime?), + propertyInfo: typeof(PHRozliczenie).GetProperty("Rozliczono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHRozliczenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rozliczono.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + rozliczono.AddAnnotation("Relational:ColumnType", "datetime"); + rozliczono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, pHId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PHROZLICZENIE"); + + var idx_PHRozPH = runtimeEntityType.AddIndex( + new[] { pHId }, + name: "idx_PHRozPH"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(PHRozliczenie).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHRozliczenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pHRozliczenie = principalEntityType.AddNavigation("PHRozliczenie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("PHRozliczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PHROZLIC_REF_PHDOK_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PHId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PHId") }), + principalEntityType, + required: true); + + var pH = declaringEntityType.AddNavigation("PH", + runtimeForeignKey, + onDependent: true, + typeof(PH), + propertyInfo: typeof(PHRozliczenie).GetProperty("PH", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PHRozliczenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pHRozliczenie = principalEntityType.AddNavigation("PHRozliczenie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PH).GetProperty("PHRozliczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PH).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PHROZLIC_REF_PHROZ_PH"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PHRozliczenie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PanelEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PanelEntityType.cs new file mode 100644 index 0000000..909867f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PanelEntityType.cs @@ -0,0 +1,427 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PanelEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + typeof(Panel), + baseEntityType); + + var panelId = runtimeEntityType.AddProperty( + "PanelId", + typeof(decimal), + propertyInfo: typeof(Panel).GetProperty("PanelId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + panelId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + panelId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + panelId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Panel).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrPanelId = runtimeEntityType.AddProperty( + "CentrPanelId", + typeof(decimal?), + propertyInfo: typeof(Panel).GetProperty("CentrPanelId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrPanelId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrPanelId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrPanelId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var h = runtimeEntityType.AddProperty( + "H", + typeof(short?), + propertyInfo: typeof(Panel).GetProperty("H", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + h.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + h.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var l = runtimeEntityType.AddProperty( + "L", + typeof(short?), + propertyInfo: typeof(Panel).GetProperty("L", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + l.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + l.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Panel).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int?), + propertyInfo: typeof(Panel).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(Panel).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var t = runtimeEntityType.AddProperty( + "T", + typeof(short?), + propertyInfo: typeof(Panel).GetProperty("T", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + t.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + t.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typAplikacji = runtimeEntityType.AddProperty( + "TypAplikacji", + typeof(short), + propertyInfo: typeof(Panel).GetProperty("TypAplikacji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + sentinel: (short)0); + typAplikacji.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typAplikacji.AddAnnotation("Relational:DefaultValue", (short)3); + typAplikacji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal?), + propertyInfo: typeof(Panel).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzNSId = runtimeEntityType.AddProperty( + "UzNSId", + typeof(decimal?), + propertyInfo: typeof(Panel).GetProperty("UzNSId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uzNSId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzNSId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzNSId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var w = runtimeEntityType.AddProperty( + "W", + typeof(short?), + propertyInfo: typeof(Panel).GetProperty("W", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + w.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + w.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Panel).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { panelId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PANEL"); + + var index = runtimeEntityType.AddIndex( + new[] { uzId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { uzNSId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(Panel).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var panel = principalEntityType.AddNavigation("Panel", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("Panel", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PANEL_REFERENCE_UZYTKOWNIK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzNSId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzNSId") }), + principalEntityType); + + var uzNS = declaringEntityType.AddNavigation("UzNS", + runtimeForeignKey, + onDependent: true, + typeof(UzNaSklep), + propertyInfo: typeof(Panel).GetProperty("UzNS", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var panel = principalEntityType.AddNavigation("Panel", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(UzNaSklep).GetProperty("Panel", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PANEL_REFERENCE_UZNASKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Panel"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PanelParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PanelParamEntityType.cs new file mode 100644 index 0000000..53af89e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PanelParamEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PanelParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PanelParam", + typeof(PanelParam), + baseEntityType); + + var panelId = runtimeEntityType.AddProperty( + "PanelId", + typeof(decimal), + propertyInfo: typeof(PanelParam).GetProperty("PanelId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + panelId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + panelId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + panelId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(PanelParam).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parWartosc = runtimeEntityType.AddProperty( + "ParWartosc", + typeof(string), + propertyInfo: typeof(PanelParam).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + parWartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parWartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { panelId, parNazwa }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PANELPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PanelId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PanelId") }), + principalEntityType, + required: true); + + var panel = declaringEntityType.AddNavigation("Panel", + runtimeForeignKey, + onDependent: true, + typeof(Panel), + propertyInfo: typeof(PanelParam).GetProperty("Panel", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var panelParam = principalEntityType.AddNavigation("PanelParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Panel).GetProperty("PanelParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PANELPARAM_REFERENCE_PANEL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PanelParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParBonEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParBonEntityType.cs new file mode 100644 index 0000000..6d3def6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParBonEntityType.cs @@ -0,0 +1,197 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ParBonEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ParBon", + typeof(ParBon), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(ParBon).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(ParBon).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal), + propertyInfo: typeof(ParBon).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(string), + propertyInfo: typeof(ParBon).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + numer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(string), + propertyInfo: typeof(ParBon).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + typ.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PARBON"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Paragon), + propertyInfo: typeof(ParBon).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var parBon = principalEntityType.AddNavigation("ParBon", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Paragon).GetProperty("ParBon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARBON_REF_PARBO_PARAGON"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ParBon"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParPunktyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParPunktyEntityType.cs new file mode 100644 index 0000000..0a81e6d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParPunktyEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ParPunktyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ParPunkty", + typeof(ParPunkty), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(ParPunkty).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(ParPunkty).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(DateTime), + propertyInfo: typeof(ParPunkty).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + kiedy.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + kiedy.AddAnnotation("Relational:ColumnType", "datetime"); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal), + propertyInfo: typeof(ParPunkty).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PARPUNKTY"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Paragon), + propertyInfo: typeof(ParPunkty).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var parPunkty = principalEntityType.AddNavigation("ParPunkty", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Paragon).GetProperty("ParPunkty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARPUNKT_REF_PARPK_PARAGON"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ParPunkty"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWalutaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWalutaEntityType.cs new file mode 100644 index 0000000..9ac2bbf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWalutaEntityType.cs @@ -0,0 +1,233 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ParWalutaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ParWaluta", + typeof(ParWaluta), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(ParWaluta).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(ParWaluta).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal), + propertyInfo: typeof(ParWaluta).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parKwota = runtimeEntityType.AddProperty( + "ParKwota", + typeof(decimal), + propertyInfo: typeof(ParWaluta).GetProperty("ParKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + parKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + parKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + parKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walKwota = runtimeEntityType.AddProperty( + "WalKwota", + typeof(decimal), + propertyInfo: typeof(ParWaluta).GetProperty("WalKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, walId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PARWALUTA"); + + var idx_WalPar = runtimeEntityType.AddIndex( + new[] { walId }, + name: "idx_WalPar"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Paragon), + propertyInfo: typeof(ParWaluta).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var parWaluta = principalEntityType.AddNavigation("ParWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Paragon).GetProperty("ParWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARWALUT_REF_PARWA_PARAGON"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType, + required: true); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(ParWaluta).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var parWaluta = principalEntityType.AddNavigation("ParWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("ParWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARWALUT_REF_WALPA_WALUTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ParWaluta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWartoscEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWartoscEntityType.cs new file mode 100644 index 0000000..f8c4e01 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWartoscEntityType.cs @@ -0,0 +1,167 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ParWartoscEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ParWartosc", + typeof(ParWartosc), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(ParWartosc).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(int), + propertyInfo: typeof(ParWartosc).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + wartosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnoscListy = runtimeEntityType.AddProperty( + "KolejnoscListy", + typeof(int), + propertyInfo: typeof(ParWartosc).GetProperty("KolejnoscListy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + kolejnoscListy.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnoscListy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(ParWartosc).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, wartosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PARWARTOSC"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Parametr), + propertyInfo: typeof(ParWartosc).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var parWartosc = principalEntityType.AddNavigation("ParWartosc", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Parametr).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARWARTO_REF_PARWA_PARAMETR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ParWartosc"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWiseBaseEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWiseBaseEntityType.cs new file mode 100644 index 0000000..fed9d58 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParWiseBaseEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ParWiseBaseEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase", + typeof(ParWiseBase), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(ParWiseBase).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var kodGrupy = runtimeEntityType.AddProperty( + "KodGrupy", + typeof(string), + propertyInfo: typeof(ParWiseBase).GetProperty("KodGrupy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + kodGrupy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + kodGrupy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolWGrupie = runtimeEntityType.AddProperty( + "KolWGrupie", + typeof(short?), + propertyInfo: typeof(ParWiseBase).GetProperty("KolWGrupie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kolWGrupie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + kolWGrupie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(ParWiseBase).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcje = runtimeEntityType.AddProperty( + "Opcje", + typeof(string), + propertyInfo: typeof(ParWiseBase).GetProperty("Opcje", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + opcje.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opcje.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId }); + runtimeEntityType.SetPrimaryKey(key); + + var idx_ParWB_GrupaINazwa = runtimeEntityType.AddIndex( + new[] { kodGrupy, nazwa }, + name: "idx_ParWB_GrupaINazwa"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ParWiseBase"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParagonEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParagonEntityType.cs new file mode 100644 index 0000000..708c24f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParagonEntityType.cs @@ -0,0 +1,844 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ParagonEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + typeof(Paragon), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Paragon).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bony = runtimeEntityType.AddProperty( + "Bony", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("Bony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + bony.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + bony.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + bony.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var brutto = runtimeEntityType.AddProperty( + "Brutto", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("Brutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + brutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + brutto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + brutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cechyPar = runtimeEntityType.AddProperty( + "CechyPar", + typeof(string), + propertyInfo: typeof(Paragon).GetProperty("CechyPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + cechyPar.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + cechyPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czek = runtimeEntityType.AddProperty( + "Czek", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("Czek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + czek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + czek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + czek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzas = runtimeEntityType.AddProperty( + "DataCzas", + typeof(DateTime), + propertyInfo: typeof(Paragon).GetProperty("DataCzas", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataCzas.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzas.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzas.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodFPlat = runtimeEntityType.AddProperty( + "DodFPlat", + typeof(decimal?), + propertyInfo: typeof(Paragon).GetProperty("DodFPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dodFPlat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + dodFPlat.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + dodFPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var eksportFK = runtimeEntityType.AddProperty( + "EksportFK", + typeof(short?), + propertyInfo: typeof(Paragon).GetProperty("EksportFK", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + eksportFK.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + eksportFK.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var gotowka = runtimeEntityType.AddProperty( + "Gotowka", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("Gotowka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + gotowka.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + gotowka.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + gotowka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupyGTU = runtimeEntityType.AddProperty( + "GrupyGTU", + typeof(string), + propertyInfo: typeof(Paragon).GetProperty("GrupyGTU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + grupyGTU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + grupyGTU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscPoz = runtimeEntityType.AddProperty( + "IloscPoz", + typeof(int), + propertyInfo: typeof(Paragon).GetProperty("IloscPoz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + iloscPoz.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + iloscPoz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var inneFPlat = runtimeEntityType.AddProperty( + "InneFPlat", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("InneFPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + inneFPlat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + inneFPlat.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + inneFPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var karta = runtimeEntityType.AddProperty( + "Karta", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("Karta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + karta.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + karta.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + karta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kasjer = runtimeEntityType.AddProperty( + "Kasjer", + typeof(string), + propertyInfo: typeof(Paragon).GetProperty("Kasjer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + kasjer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kasjer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKarty = runtimeEntityType.AddProperty( + "KodKarty", + typeof(string), + propertyInfo: typeof(Paragon).GetProperty("KodKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kodKarty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal?), + propertyInfo: typeof(Paragon).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nIP = runtimeEntityType.AddProperty( + "NIP", + typeof(string), + propertyInfo: typeof(Paragon).GetProperty("NIP", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + nIP.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nIP.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opakWyd = runtimeEntityType.AddProperty( + "OpakWyd", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("OpakWyd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + opakWyd.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + opakWyd.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + opakWyd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opakZwr = runtimeEntityType.AddProperty( + "OpakZwr", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("OpakZwr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + opakZwr.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + opakZwr.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + opakZwr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podmiotPowiazany = runtimeEntityType.AddProperty( + "PodmiotPowiazany", + typeof(short?), + propertyInfo: typeof(Paragon).GetProperty("PodmiotPowiazany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + podmiotPowiazany.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + podmiotPowiazany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przelew = runtimeEntityType.AddProperty( + "Przelew", + typeof(decimal?), + propertyInfo: typeof(Paragon).GetProperty("Przelew", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + przelew.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + przelew.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + przelew.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabat = runtimeEntityType.AddProperty( + "Rabat", + typeof(decimal), + propertyInfo: typeof(Paragon).GetProperty("Rabat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rabat.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rabat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPar = runtimeEntityType.AddProperty( + "TypPar", + typeof(short), + propertyInfo: typeof(Paragon).GetProperty("TypPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPar.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal?), + propertyInfo: typeof(Paragon).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waluty = runtimeEntityType.AddProperty( + "Waluty", + typeof(decimal?), + propertyInfo: typeof(Paragon).GetProperty("Waluty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waluty.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + waluty.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + waluty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Paragon).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaPkt = runtimeEntityType.AddProperty( + "ZmianaPkt", + typeof(DateTime?), + propertyInfo: typeof(Paragon).GetProperty("ZmianaPkt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmianaPkt.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaPkt.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaPkt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PARAGON"); + + var index = runtimeEntityType.AddIndex( + new[] { kasaId }); + + var idx_ParDataCzas = runtimeEntityType.AddIndex( + new[] { dataCzas }, + name: "idx_ParDataCzas"); + + var idx_ParKasjer = runtimeEntityType.AddIndex( + new[] { kasjer }, + name: "idx_ParKasjer"); + + var idx_ParWal = runtimeEntityType.AddIndex( + new[] { walId }, + name: "idx_ParWal"); + + var idx_ParZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_ParZmiana"); + + var idx_ParZmianaPkt = runtimeEntityType.AddIndex( + new[] { zmianaPkt }, + name: "idx_ParZmianaPkt"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(Paragon).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var paragon = principalEntityType.AddNavigation("Paragon", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("Paragon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARAGON_REF_PARKA_KASA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(Paragon).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var paragon = principalEntityType.AddNavigation("Paragon", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("Paragon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARAGON_REF_PARWA_WALUTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Paragon"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParametrEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParametrEntityType.cs new file mode 100644 index 0000000..2b8efb7 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ParametrEntityType.cs @@ -0,0 +1,192 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ParametrEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Parametr", + typeof(Parametr), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(Parametr).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrParId = runtimeEntityType.AddProperty( + "CentrParId", + typeof(decimal?), + propertyInfo: typeof(Parametr).GetProperty("CentrParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Parametr).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPar = runtimeEntityType.AddProperty( + "TypPar", + typeof(short), + propertyInfo: typeof(Parametr).GetProperty("TypPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPar.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartMax = runtimeEntityType.AddProperty( + "WartMax", + typeof(int), + propertyInfo: typeof(Parametr).GetProperty("WartMax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + wartMax.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wartMax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartMin = runtimeEntityType.AddProperty( + "WartMin", + typeof(int), + propertyInfo: typeof(Parametr).GetProperty("WartMin", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + wartMin.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wartMin.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PARAMETR"); + + var idx_CentrParId = runtimeEntityType.AddIndex( + new[] { centrParId }, + name: "idx_CentrParId"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Parametr"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PartiaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PartiaEntityType.cs new file mode 100644 index 0000000..9105ce8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PartiaEntityType.cs @@ -0,0 +1,304 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PartiaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Partia", + typeof(Partia), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(Partia).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(Partia).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cecha1 = runtimeEntityType.AddProperty( + "Cecha1", + typeof(string), + propertyInfo: typeof(Partia).GetProperty("Cecha1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + cecha1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + cecha1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cecha2 = runtimeEntityType.AddProperty( + "Cecha2", + typeof(string), + propertyInfo: typeof(Partia).GetProperty("Cecha2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + cecha2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + cecha2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataWazn = runtimeEntityType.AddProperty( + "DataWazn", + typeof(DateTime?), + propertyInfo: typeof(Partia).GetProperty("DataWazn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataWazn.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataWazn.AddAnnotation("Relational:ColumnType", "datetime"); + dataWazn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pozostalo = runtimeEntityType.AddProperty( + "Pozostalo", + typeof(decimal), + propertyInfo: typeof(Partia).GetProperty("Pozostalo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + pozostalo.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + pozostalo.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + pozostalo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Partia).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPartii = runtimeEntityType.AddProperty( + "TypPartii", + typeof(short), + propertyInfo: typeof(Partia).GetProperty("TypPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPartii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PARTIA"); + + var index = runtimeEntityType.AddIndex( + new[] { towId }); + + var idx_PrtTypTowIle = runtimeEntityType.AddIndex( + new[] { typPartii, towId, pozostalo }, + name: "idx_PrtTypTowIle"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Partia).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var partia = principalEntityType.AddNavigation("Partia", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Partia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARTIA_REF_PRTTO_TOWAR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + unique: true, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(Partia).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var partia = principalEntityType.AddNavigation("Partia", + runtimeForeignKey, + onDependent: false, + typeof(Partia), + propertyInfo: typeof(PozDok).GetProperty("Partia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PARTIA_REF_PRTPO_POZDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Partia"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcfUserEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcfUserEntityType.cs new file mode 100644 index 0000000..19e8537 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcfUserEntityType.cs @@ -0,0 +1,501 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcfUserEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + typeof(PcfUser), + baseEntityType); + + var pcfUserId = runtimeEntityType.AddProperty( + "PcfUserId", + typeof(int), + propertyInfo: typeof(PcfUser).GetProperty("PcfUserId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + pcfUserId.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + pcfUserId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var accessProfile = runtimeEntityType.AddProperty( + "AccessProfile", + typeof(int), + propertyInfo: typeof(PcfUser).GetProperty("AccessProfile", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + accessProfile.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + accessProfile.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var active = runtimeEntityType.AddProperty( + "Active", + typeof(short), + propertyInfo: typeof(PcfUser).GetProperty("Active", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + active.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + active.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blocked = runtimeEntityType.AddProperty( + "Blocked", + typeof(short), + propertyInfo: typeof(PcfUser).GetProperty("Blocked", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blocked.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blocked.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var eMail = runtimeEntityType.AddProperty( + "EMail", + typeof(string), + propertyInfo: typeof(PcfUser).GetProperty("EMail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + eMail.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + eMail.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var firstName = runtimeEntityType.AddProperty( + "FirstName", + typeof(string), + propertyInfo: typeof(PcfUser).GetProperty("FirstName", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 32, + unicode: false); + firstName.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + firstName.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var flags = runtimeEntityType.AddProperty( + "Flags", + typeof(string), + propertyInfo: typeof(PcfUser).GetProperty("Flags", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + flags.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + flags.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ident = runtimeEntityType.AddProperty( + "Ident", + typeof(string), + propertyInfo: typeof(PcfUser).GetProperty("Ident", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 32, + unicode: false); + ident.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + ident.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var lastName = runtimeEntityType.AddProperty( + "LastName", + typeof(string), + propertyInfo: typeof(PcfUser).GetProperty("LastName", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + lastName.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + lastName.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var passwordHash = runtimeEntityType.AddProperty( + "PasswordHash", + typeof(string), + propertyInfo: typeof(PcfUser).GetProperty("PasswordHash", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 32, + unicode: false); + passwordHash.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + passwordHash.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcfCustomerId = runtimeEntityType.AddProperty( + "PcfCustomerId", + typeof(decimal?), + propertyInfo: typeof(PcfUser).GetProperty("PcfCustomerId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + pcfCustomerId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcfCustomerId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcfCustomerId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcfLoyaltyCustomerId = runtimeEntityType.AddProperty( + "PcfLoyaltyCustomerId", + typeof(decimal?), + propertyInfo: typeof(PcfUser).GetProperty("PcfLoyaltyCustomerId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + pcfLoyaltyCustomerId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcfLoyaltyCustomerId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcfLoyaltyCustomerId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcfPStationId = runtimeEntityType.AddProperty( + "PcfPStationId", + typeof(decimal?), + propertyInfo: typeof(PcfUser).GetProperty("PcfPStationId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + pcfPStationId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcfPStationId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcfPStationId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var validFrom = runtimeEntityType.AddProperty( + "ValidFrom", + typeof(DateTime?), + propertyInfo: typeof(PcfUser).GetProperty("ValidFrom", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + validFrom.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + validFrom.AddAnnotation("Relational:ColumnType", "datetime"); + validFrom.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var validTo = runtimeEntityType.AddProperty( + "ValidTo", + typeof(DateTime?), + propertyInfo: typeof(PcfUser).GetProperty("ValidTo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + validTo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + validTo.AddAnnotation("Relational:ColumnType", "datetime"); + validTo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcfUserId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PCFUSER"); + + var index = runtimeEntityType.AddIndex( + new[] { pcfCustomerId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { pcfLoyaltyCustomerId }); + + var index1 = runtimeEntityType.AddIndex( + new[] { pcfPStationId }); + + var ixIdent = runtimeEntityType.AddIndex( + new[] { ident }, + name: "IxIdent"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcfCustomerId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType); + + var pcfCustomer = declaringEntityType.AddNavigation("PcfCustomer", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(PcfUser).GetProperty("PcfCustomer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcfUserPcfCustomer = principalEntityType.AddNavigation("PcfUserPcfCustomer", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("PcfUserPcfCustomer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PCFUSER_REFERENCE_KONTRC"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcfLoyaltyCustomerId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType); + + var pcfLoyaltyCustomer = declaringEntityType.AddNavigation("PcfLoyaltyCustomer", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(PcfUser).GetProperty("PcfLoyaltyCustomer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcfUserPcfLoyaltyCustomer = principalEntityType.AddNavigation("PcfUserPcfLoyaltyCustomer", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("PcfUserPcfLoyaltyCustomer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PCFUSER_REFERENCE_KONTRL"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcfPStationId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType); + + var pcfPStation = declaringEntityType.AddNavigation("PcfPStation", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(PcfUser).GetProperty("PcfPStation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcfUserPcfPStation = principalEntityType.AddNavigation("PcfUserPcfPStation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("PcfUserPcfPStation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PCFUSER_REFERENCE_KONTRS"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcfUser"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcfUserSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcfUserSklepEntityType.cs new file mode 100644 index 0000000..9319c66 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcfUserSklepEntityType.cs @@ -0,0 +1,197 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcfUserSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep", + typeof(PcfUserSklep), + baseEntityType); + + var pcfUserId = runtimeEntityType.AddProperty( + "PcfUserId", + typeof(int), + propertyInfo: typeof(PcfUserSklep).GetProperty("PcfUserId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUserSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + pcfUserId.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + pcfUserId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(PcfUserSklep).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUserSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(PcfUserSklep).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUserSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parametr = runtimeEntityType.AddProperty( + "Parametr", + typeof(string), + propertyInfo: typeof(PcfUserSklep).GetProperty("Parametr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUserSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + parametr.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parametr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcfUserId, sklepId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PcfUserSklepZnaczenie"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcfUserId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PcfUserId") }), + principalEntityType, + required: true); + + var pcfUser = declaringEntityType.AddNavigation("PcfUser", + runtimeForeignKey, + onDependent: true, + typeof(PcfUser), + propertyInfo: typeof(PcfUserSklep).GetProperty("PcfUser", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUserSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcfUserSklep = principalEntityType.AddNavigation("PcfUserSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PcfUser).GetProperty("PcfUserSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PcfUser"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(PcfUserSklep).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUserSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcfUserSklep = principalEntityType.AddNavigation("PcfUserSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("PcfUserSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Sklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcfUserSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcmDbContextModel.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcmDbContextModel.cs new file mode 100644 index 0000000..6aeef18 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcmDbContextModel.cs @@ -0,0 +1,47 @@ +// +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + [DbContext(typeof(PcmDbContext))] + public partial class PcmDbContextModel : RuntimeModel + { + private static readonly bool _useOldBehavior31751 = + System.AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue31751", out var enabled31751) && enabled31751; + + static PcmDbContextModel() + { + var model = new PcmDbContextModel(); + + if (_useOldBehavior31751) + { + model.Initialize(); + } + else + { + var thread = new System.Threading.Thread(RunInitialization, 10 * 1024 * 1024); + thread.Start(); + thread.Join(); + + void RunInitialization() + { + model.Initialize(); + } + } + + model.Customize(); + _instance = model; + } + + private static PcmDbContextModel _instance; + public static IModel Instance => _instance; + + partial void Initialize(); + + partial void Customize(); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcmDbContextModelBuilder.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcmDbContextModelBuilder.cs new file mode 100644 index 0000000..f947dac --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcmDbContextModelBuilder.cs @@ -0,0 +1,40242 @@ +// +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Metadata.Internal; +using Microsoft.EntityFrameworkCore.Migrations; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + public partial class PcmDbContextModel + { + partial void Initialize() + { + var akwizytor = AkwizytorEntityType.Create(this); + var artykul = ArtykulEntityType.Create(this); + var asort = AsortEntityType.Create(this); + var bank = BankEntityType.Create(this); + var blokada = BlokadaEntityType.Create(this); + var centrStanZgody = CentrStanZgodyEntityType.Create(this); + var czas = CzasEntityType.Create(this); + var definicjaKodu = DefinicjaKoduEntityType.Create(this); + var dlugiZasob = DlugiZasobEntityType.Create(this); + var dlugiZasobBin = DlugiZasobBinEntityType.Create(this); + var dlugiZasobTxt = DlugiZasobTxtEntityType.Create(this); + var dok = DokEntityType.Create(this); + var dokDodKth = DokDodKthEntityType.Create(this); + var dokKasa = DokKasaEntityType.Create(this); + var dokKontr = DokKontrEntityType.Create(this); + var dokKurs = DokKursEntityType.Create(this); + var dokPunkty = DokPunktyEntityType.Create(this); + var dokWBufPowiazanie = DokWBufPowiazanieEntityType.Create(this); + var dokWaluta = DokWalutaEntityType.Create(this); + var dostProd = DostProdEntityType.Create(this); + var dostawca = DostawcaEntityType.Create(this); + var dzienRozl = DzienRozlEntityType.Create(this); + var dzienRozlParam = DzienRozlParamEntityType.Create(this); + var email = EmailEntityType.Create(this); + var formZgod = FormZgodEntityType.Create(this); + var formaPlatnPos7 = FormaPlatnPos7EntityType.Create(this); + var formaPlatnosci = FormaPlatnosciEntityType.Create(this); + var grWartosc = GrWartoscEntityType.Create(this); + var grupaAkcyzowa = GrupaAkcyzowaEntityType.Create(this); + var grupaPromocji = GrupaPromocjiEntityType.Create(this); + var grupaTow = GrupaTowEntityType.Create(this); + var grupaUz = GrupaUzEntityType.Create(this); + var harmCeny = HarmCenyEntityType.Create(this); + var harmCykl = HarmCyklEntityType.Create(this); + var harmHarm = HarmHarmEntityType.Create(this); + var harmRap = HarmRapEntityType.Create(this); + var harmRapCykl = HarmRapCyklEntityType.Create(this); + var harmRapParam = HarmRapParamEntityType.Create(this); + var harmRapZlecenie = HarmRapZlecenieEntityType.Create(this); + var harmWpis = HarmWpisEntityType.Create(this); + var istw = IstwEntityType.Create(this); + var jM = JMEntityType.Create(this); + var kartaLoj = KartaLojEntityType.Create(this); + var kasKod = KasKodEntityType.Create(this); + var kasPar = KasParEntityType.Create(this); + var kasTow = KasTowEntityType.Create(this); + var kasa = KasaEntityType.Create(this); + var kasaFormaPlatn = KasaFormaPlatnEntityType.Create(this); + var katParam = KatParamEntityType.Create(this); + var kategoria = KategoriaEntityType.Create(this); + var kodDod = KodDodEntityType.Create(this); + var kodWazony = KodWazonyEntityType.Create(this); + var komentarz = KomentarzEntityType.Create(this); + var konfig = KonfigEntityType.Create(this); + var kontoBankowe = KontoBankoweEntityType.Create(this); + var kontoBankoweKontr = KontoBankoweKontrEntityType.Create(this); + var kontoLoj = KontoLojEntityType.Create(this); + var kontrOpis = KontrOpisEntityType.Create(this); + var kontrahent = KontrahentEntityType.Create(this); + var kraj = KrajEntityType.Create(this); + var krajStawka = KrajStawkaEntityType.Create(this); + var kthParWartosc = KthParWartoscEntityType.Create(this); + var kthParam = KthParamEntityType.Create(this); + var kursWaluty = KursWalutyEntityType.Create(this); + var liniaLotnicza = LiniaLotniczaEntityType.Create(this); + var logOperation = LogOperationEntityType.Create(this); + var logTypeDef = LogTypeDefEntityType.Create(this); + var logValChangeNum = LogValChangeNumEntityType.Create(this); + var logValChangeTxt = LogValChangeTxtEntityType.Create(this); + var lotnisko = LotniskoEntityType.Create(this); + var magazyn = MagazynEntityType.Create(this); + var marZakres = MarZakresEntityType.Create(this); + var marzownik = MarzownikEntityType.Create(this); + var miasto = MiastoEntityType.Create(this); + var notatki = NotatkiEntityType.Create(this); + var nrRej = NrRejEntityType.Create(this); + var numDok = NumDokEntityType.Create(this); + var numMag = NumMagEntityType.Create(this); + var odbProd = OdbProdEntityType.Create(this); + var odbiorca = OdbiorcaEntityType.Create(this); + var ofKod = OfKodEntityType.Create(this); + var ofSlownik = OfSlownikEntityType.Create(this); + var oferta = OfertaEntityType.Create(this); + var opisZdarzLoj = OpisZdarzLojEntityType.Create(this); + var oplata = OplataEntityType.Create(this); + var osoba = OsobaEntityType.Create(this); + var pH = PHEntityType.Create(this); + var pHDane = PHDaneEntityType.Create(this); + var pHOdbDane = PHOdbDaneEntityType.Create(this); + var pHOdbiorca = PHOdbiorcaEntityType.Create(this); + var pHRozliczenie = PHRozliczenieEntityType.Create(this); + var panel = PanelEntityType.Create(this); + var panelParam = PanelParamEntityType.Create(this); + var parBon = ParBonEntityType.Create(this); + var parPunkty = ParPunktyEntityType.Create(this); + var parWaluta = ParWalutaEntityType.Create(this); + var parWartosc = ParWartoscEntityType.Create(this); + var parWiseBase = ParWiseBaseEntityType.Create(this); + var paragon = ParagonEntityType.Create(this); + var parametr = ParametrEntityType.Create(this); + var partia = PartiaEntityType.Create(this); + var pcfUser = PcfUserEntityType.Create(this); + var pcfUserSklep = PcfUserSklepEntityType.Create(this); + var pcpPos = PcpPosEntityType.Create(this); + var pcpReceipt = PcpReceiptEntityType.Create(this); + var pcpReceiptItem = PcpReceiptItemEntityType.Create(this); + var pcpReceiptPayment = PcpReceiptPaymentEntityType.Create(this); + var pcpReceiptVat = PcpReceiptVatEntityType.Create(this); + var pcpShop = PcpShopEntityType.Create(this); + var polParam = PolParamEntityType.Create(this); + var polityka = PolitykaEntityType.Create(this); + var powKontLoj = PowKontLojEntityType.Create(this); + var powiadomienie = PowiadomienieEntityType.Create(this); + var powiadomienieParam = PowiadomienieParamEntityType.Create(this); + var powiazanie = PowiazanieEntityType.Create(this); + var powiazanieProm = PowiazaniePromEntityType.Create(this); + var powiazanieSklep = PowiazanieSklepEntityType.Create(this); + var powiazanieUz = PowiazanieUzEntityType.Create(this); + var powiazanieUzNaSklep = PowiazanieUzNaSklepEntityType.Create(this); + var pozAkcyza = PozAkcyzaEntityType.Create(this); + var pozCennikDok = PozCennikDokEntityType.Create(this); + var pozDok = PozDokEntityType.Create(this); + var pozDokWBufPowiazanie = PozDokWBufPowiazanieEntityType.Create(this); + var pozPar = PozParEntityType.Create(this); + var pozParSzczeg = PozParSzczegEntityType.Create(this); + var pozWz = PozWzEntityType.Create(this); + var profil = ProfilEntityType.Create(this); + var profilKasa = ProfilKasaEntityType.Create(this); + var profilKonfig = ProfilKonfigEntityType.Create(this); + var prtMag = PrtMagEntityType.Create(this); + var rapWartPocz = RapWartPoczEntityType.Create(this); + var rapWartPoczDane = RapWartPoczDaneEntityType.Create(this); + var regula = RegulaEntityType.Create(this); + var regulaAsort = RegulaAsortEntityType.Create(this); + var regulaDok = RegulaDokEntityType.Create(this); + var regulaDokSzczeg = RegulaDokSzczegEntityType.Create(this); + var regulaKod = RegulaKodEntityType.Create(this); + var regulaPar = RegulaParEntityType.Create(this); + var regulaParSzczeg = RegulaParSzczegEntityType.Create(this); + var regulaParam = RegulaParamEntityType.Create(this); + var regulaPozDok = RegulaPozDokEntityType.Create(this); + var regulaPozDokSzczeg = RegulaPozDokSzczegEntityType.Create(this); + var regulaPozPar = RegulaPozParEntityType.Create(this); + var regulaPozParSzczeg = RegulaPozParSzczegEntityType.Create(this); + var regulaProg = RegulaProgEntityType.Create(this); + var regulaSklep = RegulaSklepEntityType.Create(this); + var regulaSklepAuth = RegulaSklepAuthEntityType.Create(this); + var regulaTekst = RegulaTekstEntityType.Create(this); + var regulaTowar = RegulaTowarEntityType.Create(this); + var rola = RolaEntityType.Create(this); + var rolaUprawnienie = RolaUprawnienieEntityType.Create(this); + var rozPrtMag = RozPrtMagEntityType.Create(this); + var rozbicieDodDok = RozbicieDodDokEntityType.Create(this); + var rozbicieDok = RozbicieDokEntityType.Create(this); + var rozlicza = RozliczaEntityType.Create(this); + var rozliczeniePartii = RozliczeniePartiiEntityType.Create(this); + var sesja = SesjaEntityType.Create(this); + var sesjaAktywna = SesjaAktywnaEntityType.Create(this); + var skladnikDefinicjiKodu = SkladnikDefinicjiKoduEntityType.Create(this); + var skladnikWzorca = SkladnikWzorcaEntityType.Create(this); + var sklep = SklepEntityType.Create(this); + var sklepArtykul = SklepArtykulEntityType.Create(this); + var sklepBank = SklepBankEntityType.Create(this); + var sklepDefinicjaKodu = SklepDefinicjaKoduEntityType.Create(this); + var sklepDlugiZasob = SklepDlugiZasobEntityType.Create(this); + var sklepDok = SklepDokEntityType.Create(this); + var sklepDokDodKth = SklepDokDodKthEntityType.Create(this); + var sklepDokKurs = SklepDokKursEntityType.Create(this); + var sklepDokPunkty = SklepDokPunktyEntityType.Create(this); + var sklepDokWaluta = SklepDokWalutaEntityType.Create(this); + var sklepDost = SklepDostEntityType.Create(this); + var sklepDzienRozl = SklepDzienRozlEntityType.Create(this); + var sklepDzienRozlParam = SklepDzienRozlParamEntityType.Create(this); + var sklepEmail = SklepEmailEntityType.Create(this); + var sklepFlagi = SklepFlagiEntityType.Create(this); + var sklepFormZgod = SklepFormZgodEntityType.Create(this); + var sklepFormaPlatnPos7 = SklepFormaPlatnPos7EntityType.Create(this); + var sklepGrupaAkcyzowa = SklepGrupaAkcyzowaEntityType.Create(this); + var sklepGrupaPromocji = SklepGrupaPromocjiEntityType.Create(this); + var sklepGrupaUz = SklepGrupaUzEntityType.Create(this); + var sklepIstw = SklepIstwEntityType.Create(this); + var sklepKartaLoj = SklepKartaLojEntityType.Create(this); + var sklepKasa = SklepKasaEntityType.Create(this); + var sklepKasaFormaPlatn = SklepKasaFormaPlatnEntityType.Create(this); + var sklepKontoBankowe = SklepKontoBankoweEntityType.Create(this); + var sklepKontoBankoweKontr = SklepKontoBankoweKontrEntityType.Create(this); + var sklepKontoLoj = SklepKontoLojEntityType.Create(this); + var sklepKontr = SklepKontrEntityType.Create(this); + var sklepKontrOpis = SklepKontrOpisEntityType.Create(this); + var sklepKontrSklep = SklepKontrSklepEntityType.Create(this); + var sklepKthTypOs = SklepKthTypOsEntityType.Create(this); + var sklepMagazyn = SklepMagazynEntityType.Create(this); + var sklepNotatki = SklepNotatkiEntityType.Create(this); + var sklepNrRej = SklepNrRejEntityType.Create(this); + var sklepNrRejKarta = SklepNrRejKartaEntityType.Create(this); + var sklepOplata = SklepOplataEntityType.Create(this); + var sklepPanel = SklepPanelEntityType.Create(this); + var sklepPanelParam = SklepPanelParamEntityType.Create(this); + var sklepParBon = SklepParBonEntityType.Create(this); + var sklepParPunkty = SklepParPunktyEntityType.Create(this); + var sklepParWaluta = SklepParWalutaEntityType.Create(this); + var sklepParagon = SklepParagonEntityType.Create(this); + var sklepPartia = SklepPartiaEntityType.Create(this); + var sklepPowKontLoj = SklepPowKontLojEntityType.Create(this); + var sklepPowiazanieProm = SklepPowiazaniePromEntityType.Create(this); + var sklepPowiazanieUz = SklepPowiazanieUzEntityType.Create(this); + var sklepPozAkcyza = SklepPozAkcyzaEntityType.Create(this); + var sklepPozDok = SklepPozDokEntityType.Create(this); + var sklepPozPar = SklepPozParEntityType.Create(this); + var sklepPozParSzczeg = SklepPozParSzczegEntityType.Create(this); + var sklepProfil = SklepProfilEntityType.Create(this); + var sklepProfilKonfig = SklepProfilKonfigEntityType.Create(this); + var sklepPrtMag = SklepPrtMagEntityType.Create(this); + var sklepRapWartPocz = SklepRapWartPoczEntityType.Create(this); + var sklepRapWartPoczDane = SklepRapWartPoczDaneEntityType.Create(this); + var sklepRegula = SklepRegulaEntityType.Create(this); + var sklepRegulaAsort = SklepRegulaAsortEntityType.Create(this); + var sklepRegulaDok = SklepRegulaDokEntityType.Create(this); + var sklepRegulaDokSzczeg = SklepRegulaDokSzczegEntityType.Create(this); + var sklepRegulaKod = SklepRegulaKodEntityType.Create(this); + var sklepRegulaPar = SklepRegulaParEntityType.Create(this); + var sklepRegulaParSzczeg = SklepRegulaParSzczegEntityType.Create(this); + var sklepRegulaParam = SklepRegulaParamEntityType.Create(this); + var sklepRegulaPozDok = SklepRegulaPozDokEntityType.Create(this); + var sklepRegulaPozDokSzczeg = SklepRegulaPozDokSzczegEntityType.Create(this); + var sklepRegulaPozPar = SklepRegulaPozParEntityType.Create(this); + var sklepRegulaPozParSzczeg = SklepRegulaPozParSzczegEntityType.Create(this); + var sklepRegulaTekst = SklepRegulaTekstEntityType.Create(this); + var sklepRegulaTowar = SklepRegulaTowarEntityType.Create(this); + var sklepRola = SklepRolaEntityType.Create(this); + var sklepRolaUprawnienie = SklepRolaUprawnienieEntityType.Create(this); + var sklepRozPrtMag = SklepRozPrtMagEntityType.Create(this); + var sklepRozbicieDodDok = SklepRozbicieDodDokEntityType.Create(this); + var sklepRozbicieDok = SklepRozbicieDokEntityType.Create(this); + var sklepRozlPartii = SklepRozlPartiiEntityType.Create(this); + var sklepRozlicza = SklepRozliczaEntityType.Create(this); + var sklepSkladnikDefinicjiKodu = SklepSkladnikDefinicjiKoduEntityType.Create(this); + var sklepSkladnikWzorca = SklepSkladnikWzorcaEntityType.Create(this); + var sklepStanPrtMag = SklepStanPrtMagEntityType.Create(this); + var sklepSzczegPrtMag = SklepSzczegPrtMagEntityType.Create(this); + var sklepTekstDok = SklepTekstDokEntityType.Create(this); + var sklepTekstPoz = SklepTekstPozEntityType.Create(this); + var sklepTekstZgody = SklepTekstZgodyEntityType.Create(this); + var sklepTowAkcyza = SklepTowAkcyzaEntityType.Create(this); + var sklepTowDodatek = SklepTowDodatekEntityType.Create(this); + var sklepTowIntParam = SklepTowIntParamEntityType.Create(this); + var sklepTowKod = SklepTowKodEntityType.Create(this); + var sklepTowParWiseBase = SklepTowParWiseBaseEntityType.Create(this); + var sklepTowPowiazanie = SklepTowPowiazanieEntityType.Create(this); + var sklepTowStraty = SklepTowStratyEntityType.Create(this); + var sklepTowZamiennik = SklepTowZamiennikEntityType.Create(this); + var sklepTowZdjecia = SklepTowZdjeciaEntityType.Create(this); + var sklepTowar = SklepTowarEntityType.Create(this); + var sklepTowarSkladnika = SklepTowarSkladnikaEntityType.Create(this); + var sklepTrescEmail = SklepTrescEmailEntityType.Create(this); + var sklepTrescEmailTekst = SklepTrescEmailTekstEntityType.Create(this); + var sklepTypOs = SklepTypOsEntityType.Create(this); + var sklepUprawnienie = SklepUprawnienieEntityType.Create(this); + var sklepUzytkownik = SklepUzytkownikEntityType.Create(this); + var sklepWaluta = SklepWalutaEntityType.Create(this); + var sklepZaleznosc = SklepZaleznoscEntityType.Create(this); + var sklepZamiennik = SklepZamiennikEntityType.Create(this); + var sklepZasob = SklepZasobEntityType.Create(this); + var sklepZdarzOs = SklepZdarzOsEntityType.Create(this); + var sklepZdarzOsOpis = SklepZdarzOsOpisEntityType.Create(this); + var sklepZgoda = SklepZgodaEntityType.Create(this); + var sprzedaz = SprzedazEntityType.Create(this); + var stanPrtMag = StanPrtMagEntityType.Create(this); + var stanZgody = StanZgodyEntityType.Create(this); + var struktura_7_3 = Struktura_7_3EntityType.Create(this); + var subsys = SubsysEntityType.Create(this); + var szczegPrtMag = SzczegPrtMagEntityType.Create(this); + var tabelaAkcyzowa = TabelaAkcyzowaEntityType.Create(this); + var tekstDok = TekstDokEntityType.Create(this); + var tekstPoz = TekstPozEntityType.Create(this); + var tekstZgody = TekstZgodyEntityType.Create(this); + var towAkcyza = TowAkcyzaEntityType.Create(this); + var towDodatek = TowDodatekEntityType.Create(this); + var towIntParam = TowIntParamEntityType.Create(this); + var towKraj = TowKrajEntityType.Create(this); + var towParWiseBase = TowParWiseBaseEntityType.Create(this); + var towPowiazanie = TowPowiazanieEntityType.Create(this); + var towStraty = TowStratyEntityType.Create(this); + var towStratyDlaSklepu = TowStratyDlaSklepuEntityType.Create(this); + var towWartosc = TowWartoscEntityType.Create(this); + var towZamiennik = TowZamiennikEntityType.Create(this); + var towZdjecia = TowZdjeciaEntityType.Create(this); + var towar = TowarEntityType.Create(this); + var towarSkladnika = TowarSkladnikaEntityType.Create(this); + var trescEmail = TrescEmailEntityType.Create(this); + var trescEmailTekst = TrescEmailTekstEntityType.Create(this); + var typOs = TypOsEntityType.Create(this); + var ulica = UlicaEntityType.Create(this); + var uprawnienie = UprawnienieEntityType.Create(this); + var uprawnienieNaSklep = UprawnienieNaSklepEntityType.Create(this); + var uzNaSklep = UzNaSklepEntityType.Create(this); + var uzytkownik = UzytkownikEntityType.Create(this); + var vat = VatEntityType.Create(this); + var waluta = WalutaEntityType.Create(this); + var wersja_7_2 = Wersja_7_2EntityType.Create(this); + var wzorzec = WzorzecEntityType.Create(this); + var zaleznosc = ZaleznoscEntityType.Create(this); + var zamiennik = ZamiennikEntityType.Create(this); + var zasob = ZasobEntityType.Create(this); + var zdarzLoj = ZdarzLojEntityType.Create(this); + var zdarzOs = ZdarzOsEntityType.Create(this); + var zdarzOsOpis = ZdarzOsOpisEntityType.Create(this); + var zgoda = ZgodaEntityType.Create(this); + var zlecKomunikat = ZlecKomunikatEntityType.Create(this); + var zlecParam = ZlecParamEntityType.Create(this); + var zlecenie = ZlecenieEntityType.Create(this); + var zmiana = ZmianaEntityType.Create(this); + var zmianaTabeli = ZmianaTabeliEntityType.Create(this); + var dokKontoBankowe = DokKontoBankoweEntityType.Create(this); + var kthTypOs = KthTypOsEntityType.Create(this); + var kthWartosc = KthWartoscEntityType.Create(this); + var nrRejKarta = NrRejKartaEntityType.Create(this); + var polMag = PolMagEntityType.Create(this); + var przydzial = PrzydzialEntityType.Create(this); + var sklepKthPrzydzial = SklepKthPrzydzialEntityType.Create(this); + var sklepNarzDost = SklepNarzDostEntityType.Create(this); + var sklepPrzydzial = SklepPrzydzialEntityType.Create(this); + var sklepSklep = SklepSklepEntityType.Create(this); + + ArtykulEntityType.CreateForeignKey1(artykul, towar); + BlokadaEntityType.CreateForeignKey1(blokada, sesjaAktywna); + BlokadaEntityType.CreateForeignKey2(blokada, istw); + CentrStanZgodyEntityType.CreateForeignKey1(centrStanZgody, kontrahent); + CentrStanZgodyEntityType.CreateForeignKey2(centrStanZgody, zgoda); + DlugiZasobBinEntityType.CreateForeignKey1(dlugiZasobBin, dlugiZasob); + DlugiZasobTxtEntityType.CreateForeignKey1(dlugiZasobTxt, dlugiZasob); + DokEntityType.CreateForeignKey1(dok, magazyn); + DokEntityType.CreateForeignKey2(dok, uzytkownik); + DokEntityType.CreateForeignKey3(dok, waluta); + DokEntityType.CreateForeignKey4(dok, waluta); + DokDodKthEntityType.CreateForeignKey1(dokDodKth, dok); + DokDodKthEntityType.CreateForeignKey2(dokDodKth, kontrahent); + DokKasaEntityType.CreateForeignKey1(dokKasa, dok); + DokKasaEntityType.CreateForeignKey2(dokKasa, kasa); + DokKontrEntityType.CreateForeignKey1(dokKontr, dok); + DokKontrEntityType.CreateForeignKey2(dokKontr, kontrahent); + DokKursEntityType.CreateForeignKey1(dokKurs, dok); + DokKursEntityType.CreateForeignKey2(dokKurs, waluta); + DokPunktyEntityType.CreateForeignKey1(dokPunkty, dok); + DokWBufPowiazanieEntityType.CreateForeignKey1(dokWBufPowiazanie, dok); + DokWalutaEntityType.CreateForeignKey1(dokWaluta, dok); + DokWalutaEntityType.CreateForeignKey2(dokWaluta, waluta); + DostProdEntityType.CreateForeignKey1(dostProd, kontrahent); + DostProdEntityType.CreateForeignKey2(dostProd, kontrahent); + DostawcaEntityType.CreateForeignKey1(dostawca, kontrahent); + DostawcaEntityType.CreateForeignKey2(dostawca, towar); + DzienRozlParamEntityType.CreateForeignKey1(dzienRozlParam, dzienRozl); + EmailEntityType.CreateForeignKey1(email, trescEmail); + EmailEntityType.CreateForeignKey2(email, trescEmail); + EmailEntityType.CreateForeignKey3(email, trescEmail); + EmailEntityType.CreateForeignKey4(email, uzytkownik); + FormZgodEntityType.CreateForeignKey1(formZgod, typOs); + FormZgodEntityType.CreateForeignKey2(formZgod, zgoda); + GrWartoscEntityType.CreateForeignKey1(grWartosc, grupaTow); + GrWartoscEntityType.CreateForeignKey2(grWartosc, parametr); + GrupaUzEntityType.CreateForeignKey1(grupaUz, uzytkownik); + GrupaUzEntityType.CreateForeignKey2(grupaUz, uzytkownik); + HarmCenyEntityType.CreateForeignKey1(harmCeny, harmWpis); + HarmCenyEntityType.CreateForeignKey2(harmCeny, towar); + HarmCyklEntityType.CreateForeignKey1(harmCykl, harmWpis); + HarmHarmEntityType.CreateForeignKey1(harmHarm, harmWpis); + HarmHarmEntityType.CreateForeignKey2(harmHarm, harmWpis); + HarmRapCyklEntityType.CreateForeignKey1(harmRapCykl, harmRap); + HarmRapParamEntityType.CreateForeignKey1(harmRapParam, harmRap); + HarmRapZlecenieEntityType.CreateForeignKey1(harmRapZlecenie, harmRap); + HarmWpisEntityType.CreateForeignKey1(harmWpis, kraj); + HarmWpisEntityType.CreateForeignKey2(harmWpis, polityka); + IstwEntityType.CreateForeignKey1(istw, magazyn); + IstwEntityType.CreateForeignKey2(istw, towar); + KartaLojEntityType.CreateForeignKey1(kartaLoj, kontoLoj); + KasKodEntityType.CreateForeignKey1(kasKod, kasa); + KasKodEntityType.CreateForeignKey2(kasKod, towar); + KasParEntityType.CreateForeignKey1(kasPar, kasa); + KasTowEntityType.CreateForeignKey1(kasTow, kasa); + KasTowEntityType.CreateForeignKey2(kasTow, towar); + KasaEntityType.CreateForeignKey1(kasa, magazyn); + KasaFormaPlatnEntityType.CreateForeignKey1(kasaFormaPlatn, formaPlatnPos7); + KasaFormaPlatnEntityType.CreateForeignKey2(kasaFormaPlatn, kasa); + KatParamEntityType.CreateForeignKey1(katParam, kategoria); + KatParamEntityType.CreateForeignKey2(katParam, parametr); + KodDodEntityType.CreateForeignKey1(kodDod, towar); + KodWazonyEntityType.CreateForeignKey1(kodWazony, jM); + KomentarzEntityType.CreateForeignKey1(komentarz, zmiana); + KontoBankoweEntityType.CreateForeignKey1(kontoBankowe, bank); + KontoBankoweEntityType.CreateForeignKey2(kontoBankowe, magazyn); + KontoBankoweEntityType.CreateForeignKey3(kontoBankowe, waluta); + KontoBankoweKontrEntityType.CreateForeignKey1(kontoBankoweKontr, bank); + KontoBankoweKontrEntityType.CreateForeignKey2(kontoBankoweKontr, kontrahent); + KontoBankoweKontrEntityType.CreateForeignKey3(kontoBankoweKontr, waluta); + KontoLojEntityType.CreateForeignKey1(kontoLoj, kontrahent); + KontrOpisEntityType.CreateForeignKey1(kontrOpis, kontrahent); + KontrahentEntityType.CreateForeignKey1(kontrahent, akwizytor); + KontrahentEntityType.CreateForeignKey2(kontrahent, kraj); + KrajEntityType.CreateForeignKey1(kraj, waluta); + KrajStawkaEntityType.CreateForeignKey1(krajStawka, kraj); + KthParWartoscEntityType.CreateForeignKey1(kthParWartosc, kthParam); + KthParamEntityType.CreateForeignKey1(kthParam, kthParWartosc); + KursWalutyEntityType.CreateForeignKey1(kursWaluty, waluta); + LogValChangeNumEntityType.CreateForeignKey1(logValChangeNum, logOperation); + LogValChangeTxtEntityType.CreateForeignKey1(logValChangeTxt, logOperation); + MarZakresEntityType.CreateForeignKey1(marZakres, marzownik); + MarzownikEntityType.CreateForeignKey1(marzownik, asort); + MarzownikEntityType.CreateForeignKey2(marzownik, magazyn); + MarzownikEntityType.CreateForeignKey3(marzownik, towar); + NotatkiEntityType.CreateForeignKey1(notatki, towar); + NrRejEntityType.CreateForeignKey1(nrRej, kontrahent); + NumMagEntityType.CreateForeignKey1(numMag, magazyn); + NumMagEntityType.CreateForeignKey2(numMag, numDok); + OdbProdEntityType.CreateForeignKey1(odbProd, kontrahent); + OdbProdEntityType.CreateForeignKey2(odbProd, kontrahent); + OdbiorcaEntityType.CreateForeignKey1(odbiorca, kontrahent); + OdbiorcaEntityType.CreateForeignKey2(odbiorca, towar); + OfKodEntityType.CreateForeignKey1(ofKod, oferta); + OfSlownikEntityType.CreateForeignKey1(ofSlownik, kontrahent); + OfertaEntityType.CreateForeignKey1(oferta, kontrahent); + OfertaEntityType.CreateForeignKey2(oferta, towar); + OpisZdarzLojEntityType.CreateForeignKey1(opisZdarzLoj, zdarzLoj); + OplataEntityType.CreateForeignKey1(oplata, kontoBankowe); + OsobaEntityType.CreateForeignKey1(osoba, kontrahent); + PHEntityType.CreateForeignKey1(pH, kontrahent); + PHDaneEntityType.CreateForeignKey1(pHDane, pH); + PHOdbDaneEntityType.CreateForeignKey1(pHOdbDane, pHOdbiorca); + PHOdbiorcaEntityType.CreateForeignKey1(pHOdbiorca, kontrahent); + PHOdbiorcaEntityType.CreateForeignKey2(pHOdbiorca, pH); + PHRozliczenieEntityType.CreateForeignKey1(pHRozliczenie, dok); + PHRozliczenieEntityType.CreateForeignKey2(pHRozliczenie, pH); + PanelEntityType.CreateForeignKey1(panel, uzytkownik); + PanelEntityType.CreateForeignKey2(panel, uzNaSklep); + PanelParamEntityType.CreateForeignKey1(panelParam, panel); + ParBonEntityType.CreateForeignKey1(parBon, paragon); + ParPunktyEntityType.CreateForeignKey1(parPunkty, paragon); + ParWalutaEntityType.CreateForeignKey1(parWaluta, paragon); + ParWalutaEntityType.CreateForeignKey2(parWaluta, waluta); + ParWartoscEntityType.CreateForeignKey1(parWartosc, parametr); + ParagonEntityType.CreateForeignKey1(paragon, kasa); + ParagonEntityType.CreateForeignKey2(paragon, waluta); + PartiaEntityType.CreateForeignKey1(partia, towar); + PartiaEntityType.CreateForeignKey2(partia, pozDok); + PcfUserEntityType.CreateForeignKey1(pcfUser, kontrahent); + PcfUserEntityType.CreateForeignKey2(pcfUser, kontrahent); + PcfUserEntityType.CreateForeignKey3(pcfUser, kontrahent); + PcfUserSklepEntityType.CreateForeignKey1(pcfUserSklep, pcfUser); + PcfUserSklepEntityType.CreateForeignKey2(pcfUserSklep, sklep); + PcpPosEntityType.CreateForeignKey1(pcpPos, pcpShop); + PcpReceiptEntityType.CreateForeignKey1(pcpReceipt, kontrahent); + PcpReceiptEntityType.CreateForeignKey2(pcpReceipt, pcpPos); + PcpReceiptItemEntityType.CreateForeignKey1(pcpReceiptItem, pcpReceipt); + PcpReceiptPaymentEntityType.CreateForeignKey1(pcpReceiptPayment, pcpReceipt); + PcpReceiptVatEntityType.CreateForeignKey1(pcpReceiptVat, pcpReceipt); + PolParamEntityType.CreateForeignKey1(polParam, polityka); + PowKontLojEntityType.CreateForeignKey1(powKontLoj, kontoLoj); + PowKontLojEntityType.CreateForeignKey2(powKontLoj, kontoLoj); + PowiadomienieParamEntityType.CreateForeignKey1(powiadomienieParam, powiadomienie); + PowiazanieEntityType.CreateForeignKey1(powiazanie, towar); + PowiazanieEntityType.CreateForeignKey2(powiazanie, towar); + PowiazaniePromEntityType.CreateForeignKey1(powiazanieProm, grupaPromocji); + PowiazanieSklepEntityType.CreateForeignKey1(powiazanieSklep, sklep); + PowiazanieUzEntityType.CreateForeignKey1(powiazanieUz, uzytkownik); + PowiazanieUzNaSklepEntityType.CreateForeignKey1(powiazanieUzNaSklep, uzNaSklep); + PozAkcyzaEntityType.CreateForeignKey1(pozAkcyza, grupaAkcyzowa); + PozAkcyzaEntityType.CreateForeignKey2(pozAkcyza, pozDok); + PozCennikDokEntityType.CreateForeignKey1(pozCennikDok, sklep); + PozDokEntityType.CreateForeignKey1(pozDok, dok); + PozDokEntityType.CreateForeignKey2(pozDok, towar); + PozDokWBufPowiazanieEntityType.CreateForeignKey1(pozDokWBufPowiazanie, pozDok); + PozParEntityType.CreateForeignKey1(pozPar, paragon); + PozParEntityType.CreateForeignKey2(pozPar, towar); + PozParSzczegEntityType.CreateForeignKey1(pozParSzczeg, pozPar); + PozWzEntityType.CreateForeignKey1(pozWz, towar); + PozWzEntityType.CreateForeignKey2(pozWz, wzorzec); + ProfilKasaEntityType.CreateForeignKey1(profilKasa, kasa); + ProfilKasaEntityType.CreateForeignKey2(profilKasa, profil); + ProfilKonfigEntityType.CreateForeignKey1(profilKonfig, profil); + PrtMagEntityType.CreateForeignKey1(prtMag, magazyn); + PrtMagEntityType.CreateForeignKey2(prtMag, towar); + RapWartPoczDaneEntityType.CreateForeignKey1(rapWartPoczDane, magazyn); + RapWartPoczDaneEntityType.CreateForeignKey2(rapWartPoczDane, rapWartPocz); + RegulaAsortEntityType.CreateForeignKey1(regulaAsort, asort); + RegulaAsortEntityType.CreateForeignKey2(regulaAsort, regula); + RegulaDokEntityType.CreateForeignKey1(regulaDok, dok); + RegulaDokEntityType.CreateForeignKey2(regulaDok, kontoLoj); + RegulaDokEntityType.CreateForeignKey3(regulaDok, regula); + RegulaDokSzczegEntityType.CreateForeignKey1(regulaDokSzczeg, regulaDok); + RegulaKodEntityType.CreateForeignKey1(regulaKod, regula); + RegulaParEntityType.CreateForeignKey1(regulaPar, kontoLoj); + RegulaParEntityType.CreateForeignKey2(regulaPar, paragon); + RegulaParEntityType.CreateForeignKey3(regulaPar, regula); + RegulaParSzczegEntityType.CreateForeignKey1(regulaParSzczeg, regulaPar); + RegulaParamEntityType.CreateForeignKey1(regulaParam, regula); + RegulaPozDokEntityType.CreateForeignKey1(regulaPozDok, regula); + RegulaPozDokEntityType.CreateForeignKey2(regulaPozDok, pozDok); + RegulaPozDokSzczegEntityType.CreateForeignKey1(regulaPozDokSzczeg, regula); + RegulaPozDokSzczegEntityType.CreateForeignKey2(regulaPozDokSzczeg, pozDok); + RegulaPozParEntityType.CreateForeignKey1(regulaPozPar, regula); + RegulaPozParEntityType.CreateForeignKey2(regulaPozPar, pozPar); + RegulaPozParSzczegEntityType.CreateForeignKey1(regulaPozParSzczeg, regula); + RegulaPozParSzczegEntityType.CreateForeignKey2(regulaPozParSzczeg, pozPar); + RegulaProgEntityType.CreateForeignKey1(regulaProg, regula); + RegulaSklepEntityType.CreateForeignKey1(regulaSklep, regula); + RegulaSklepEntityType.CreateForeignKey2(regulaSklep, sklep); + RegulaSklepAuthEntityType.CreateForeignKey1(regulaSklepAuth, pcfUser); + RegulaSklepAuthEntityType.CreateForeignKey2(regulaSklepAuth, regula); + RegulaSklepAuthEntityType.CreateForeignKey3(regulaSklepAuth, sklep); + RegulaTekstEntityType.CreateForeignKey1(regulaTekst, regula); + RegulaTowarEntityType.CreateForeignKey1(regulaTowar, regula); + RegulaTowarEntityType.CreateForeignKey2(regulaTowar, towar); + RolaUprawnienieEntityType.CreateForeignKey1(rolaUprawnienie, rola); + RozPrtMagEntityType.CreateForeignKey1(rozPrtMag, pozDok); + RozPrtMagEntityType.CreateForeignKey2(rozPrtMag, prtMag); + RozbicieDodDokEntityType.CreateForeignKey1(rozbicieDodDok, dok); + RozbicieDokEntityType.CreateForeignKey1(rozbicieDok, dok); + RozliczaEntityType.CreateForeignKey1(rozlicza, dok); + RozliczaEntityType.CreateForeignKey2(rozlicza, dok); + RozliczeniePartiiEntityType.CreateForeignKey1(rozliczeniePartii, partia); + RozliczeniePartiiEntityType.CreateForeignKey2(rozliczeniePartii, pozDok); + SesjaEntityType.CreateForeignKey1(sesja, uzytkownik); + SesjaAktywnaEntityType.CreateForeignKey1(sesjaAktywna, sesja); + SkladnikDefinicjiKoduEntityType.CreateForeignKey1(skladnikDefinicjiKodu, definicjaKodu); + SkladnikWzorcaEntityType.CreateForeignKey1(skladnikWzorca, towar); + SklepEntityType.CreateForeignKey1(sklep, kraj); + SklepEntityType.CreateForeignKey2(sklep, magazyn); + SklepEntityType.CreateForeignKey3(sklep, kontrahent); + SklepArtykulEntityType.CreateForeignKey1(sklepArtykul, sklep); + SklepArtykulEntityType.CreateForeignKey2(sklepArtykul, sklepTowar); + SklepDefinicjaKoduEntityType.CreateForeignKey1(sklepDefinicjaKodu, sklep); + SklepDlugiZasobEntityType.CreateForeignKey1(sklepDlugiZasob, dlugiZasob); + SklepDokEntityType.CreateForeignKey1(sklepDok, dok); + SklepDokEntityType.CreateForeignKey2(sklepDok, sklep); + SklepDokEntityType.CreateForeignKey3(sklepDok, sklepKasa); + SklepDokEntityType.CreateForeignKey4(sklepDok, sklepKontr); + SklepDokEntityType.CreateForeignKey5(sklepDok, sklepMagazyn); + SklepDokEntityType.CreateForeignKey6(sklepDok, sklepKontr); + SklepDokEntityType.CreateForeignKey7(sklepDok, sklepUzytkownik); + SklepDokEntityType.CreateForeignKey8(sklepDok, sklepWaluta); + SklepDokDodKthEntityType.CreateForeignKey1(sklepDokDodKth, sklepDok); + SklepDokDodKthEntityType.CreateForeignKey2(sklepDokDodKth, sklepKontr); + SklepDokKursEntityType.CreateForeignKey1(sklepDokKurs, sklepDok); + SklepDokKursEntityType.CreateForeignKey2(sklepDokKurs, sklepWaluta); + SklepDokPunktyEntityType.CreateForeignKey1(sklepDokPunkty, sklepDok); + SklepDokWalutaEntityType.CreateForeignKey1(sklepDokWaluta, sklepDok); + SklepDokWalutaEntityType.CreateForeignKey2(sklepDokWaluta, sklepWaluta); + SklepDostEntityType.CreateForeignKey1(sklepDost, sklepKontr); + SklepDostEntityType.CreateForeignKey2(sklepDost, sklepTowar); + SklepDzienRozlEntityType.CreateForeignKey1(sklepDzienRozl, sklep); + SklepDzienRozlParamEntityType.CreateForeignKey1(sklepDzienRozlParam, sklepDzienRozl); + SklepEmailEntityType.CreateForeignKey1(sklepEmail, sklepTrescEmail); + SklepEmailEntityType.CreateForeignKey2(sklepEmail, sklepTrescEmail); + SklepEmailEntityType.CreateForeignKey3(sklepEmail, sklepTrescEmail); + SklepEmailEntityType.CreateForeignKey4(sklepEmail, sklepUzytkownik); + SklepFlagiEntityType.CreateForeignKey1(sklepFlagi, sklep); + SklepFlagiEntityType.CreateForeignKey2(sklepFlagi, towar); + SklepFormZgodEntityType.CreateForeignKey1(sklepFormZgod, sklepTypOs); + SklepFormZgodEntityType.CreateForeignKey2(sklepFormZgod, sklepZgoda); + SklepFormaPlatnPos7EntityType.CreateForeignKey1(sklepFormaPlatnPos7, sklep); + SklepGrupaAkcyzowaEntityType.CreateForeignKey1(sklepGrupaAkcyzowa, sklep); + SklepGrupaUzEntityType.CreateForeignKey1(sklepGrupaUz, sklepUzytkownik); + SklepGrupaUzEntityType.CreateForeignKey2(sklepGrupaUz, sklepUzytkownik); + SklepIstwEntityType.CreateForeignKey1(sklepIstw, sklepMagazyn); + SklepIstwEntityType.CreateForeignKey2(sklepIstw, sklepTowar); + SklepKartaLojEntityType.CreateForeignKey1(sklepKartaLoj, sklep); + SklepKartaLojEntityType.CreateForeignKey2(sklepKartaLoj, sklepKontoLoj); + SklepKasaEntityType.CreateForeignKey1(sklepKasa, sklep); + SklepKasaEntityType.CreateForeignKey2(sklepKasa, sklepMagazyn); + SklepKasaFormaPlatnEntityType.CreateForeignKey1(sklepKasaFormaPlatn, sklepFormaPlatnPos7); + SklepKasaFormaPlatnEntityType.CreateForeignKey2(sklepKasaFormaPlatn, sklepKasa); + SklepKontoBankoweEntityType.CreateForeignKey1(sklepKontoBankowe, sklepBank); + SklepKontoBankoweEntityType.CreateForeignKey2(sklepKontoBankowe, sklepWaluta); + SklepKontoBankoweKontrEntityType.CreateForeignKey1(sklepKontoBankoweKontr, sklepBank); + SklepKontoBankoweKontrEntityType.CreateForeignKey2(sklepKontoBankoweKontr, sklepKontr); + SklepKontoBankoweKontrEntityType.CreateForeignKey3(sklepKontoBankoweKontr, sklepWaluta); + SklepKontoLojEntityType.CreateForeignKey1(sklepKontoLoj, kontoLoj); + SklepKontoLojEntityType.CreateForeignKey2(sklepKontoLoj, sklep); + SklepKontoLojEntityType.CreateForeignKey3(sklepKontoLoj, sklepKontr); + SklepKontrEntityType.CreateForeignKey1(sklepKontr, kontrahent); + SklepKontrEntityType.CreateForeignKey2(sklepKontr, sklep); + SklepKontrOpisEntityType.CreateForeignKey1(sklepKontrOpis, sklepKontr); + SklepKontrSklepEntityType.CreateForeignKey1(sklepKontrSklep, kontrahent); + SklepKthTypOsEntityType.CreateForeignKey1(sklepKthTypOs, sklepKontr); + SklepKthTypOsEntityType.CreateForeignKey2(sklepKthTypOs, sklepTypOs); + SklepMagazynEntityType.CreateForeignKey1(sklepMagazyn, sklep); + SklepNotatkiEntityType.CreateForeignKey1(sklepNotatki, sklepTowar); + SklepNrRejEntityType.CreateForeignKey1(sklepNrRej, sklepKontr); + SklepNrRejKartaEntityType.CreateForeignKey1(sklepNrRejKarta, sklepKartaLoj); + SklepNrRejKartaEntityType.CreateForeignKey2(sklepNrRejKarta, sklepNrRej); + SklepOplataEntityType.CreateForeignKey1(sklepOplata, sklep); + SklepPanelEntityType.CreateForeignKey1(sklepPanel, panel); + SklepPanelEntityType.CreateForeignKey2(sklepPanel, sklepUzytkownik); + SklepPanelParamEntityType.CreateForeignKey1(sklepPanelParam, sklepPanel); + SklepParBonEntityType.CreateForeignKey1(sklepParBon, sklepParagon); + SklepParPunktyEntityType.CreateForeignKey1(sklepParPunkty, sklepParagon); + SklepParWalutaEntityType.CreateForeignKey1(sklepParWaluta, sklepParagon); + SklepParWalutaEntityType.CreateForeignKey2(sklepParWaluta, sklepWaluta); + SklepParagonEntityType.CreateForeignKey1(sklepParagon, sklep); + SklepParagonEntityType.CreateForeignKey2(sklepParagon, sklepKasa); + SklepParagonEntityType.CreateForeignKey3(sklepParagon, sklepWaluta); + SklepPartiaEntityType.CreateForeignKey1(sklepPartia, sklepTowar); + SklepPartiaEntityType.CreateForeignKey2(sklepPartia, sklepPozDok); + SklepPowKontLojEntityType.CreateForeignKey1(sklepPowKontLoj, sklepKontoLoj); + SklepPowKontLojEntityType.CreateForeignKey2(sklepPowKontLoj, sklepKontoLoj); + SklepPowiazaniePromEntityType.CreateForeignKey1(sklepPowiazanieProm, sklepGrupaPromocji); + SklepPowiazanieUzEntityType.CreateForeignKey1(sklepPowiazanieUz, sklepUzytkownik); + SklepPozAkcyzaEntityType.CreateForeignKey1(sklepPozAkcyza, sklepGrupaAkcyzowa); + SklepPozAkcyzaEntityType.CreateForeignKey2(sklepPozAkcyza, sklepPozDok); + SklepPozDokEntityType.CreateForeignKey1(sklepPozDok, sklepDok); + SklepPozDokEntityType.CreateForeignKey2(sklepPozDok, sklepTowar); + SklepPozParEntityType.CreateForeignKey1(sklepPozPar, sklepParagon); + SklepPozParEntityType.CreateForeignKey2(sklepPozPar, sklepTowar); + SklepPozParSzczegEntityType.CreateForeignKey1(sklepPozParSzczeg, sklepPozPar); + SklepProfilEntityType.CreateForeignKey1(sklepProfil, profil); + SklepProfilEntityType.CreateForeignKey2(sklepProfil, sklep); + SklepProfilKonfigEntityType.CreateForeignKey1(sklepProfilKonfig, sklepProfil); + SklepPrtMagEntityType.CreateForeignKey1(sklepPrtMag, sklepMagazyn); + SklepPrtMagEntityType.CreateForeignKey2(sklepPrtMag, sklepTowar); + SklepRapWartPoczEntityType.CreateForeignKey1(sklepRapWartPocz, sklep); + SklepRapWartPoczDaneEntityType.CreateForeignKey1(sklepRapWartPoczDane, sklepMagazyn); + SklepRapWartPoczDaneEntityType.CreateForeignKey2(sklepRapWartPoczDane, sklepRapWartPocz); + SklepRegulaEntityType.CreateForeignKey1(sklepRegula, sklep); + SklepRegulaAsortEntityType.CreateForeignKey1(sklepRegulaAsort, sklepRegula); + SklepRegulaDokEntityType.CreateForeignKey1(sklepRegulaDok, kontoLoj); + SklepRegulaDokEntityType.CreateForeignKey2(sklepRegulaDok, sklepDok); + SklepRegulaDokSzczegEntityType.CreateForeignKey1(sklepRegulaDokSzczeg, sklepRegulaDok); + SklepRegulaKodEntityType.CreateForeignKey1(sklepRegulaKod, sklepRegula); + SklepRegulaParEntityType.CreateForeignKey1(sklepRegulaPar, kontoLoj); + SklepRegulaParEntityType.CreateForeignKey2(sklepRegulaPar, sklepParagon); + SklepRegulaParSzczegEntityType.CreateForeignKey1(sklepRegulaParSzczeg, sklepRegulaPar); + SklepRegulaParamEntityType.CreateForeignKey1(sklepRegulaParam, sklep); + SklepRegulaParamEntityType.CreateForeignKey2(sklepRegulaParam, sklepRegula); + SklepRegulaPozDokEntityType.CreateForeignKey1(sklepRegulaPozDok, sklepPozDok); + SklepRegulaPozDokSzczegEntityType.CreateForeignKey1(sklepRegulaPozDokSzczeg, sklepPozDok); + SklepRegulaPozParEntityType.CreateForeignKey1(sklepRegulaPozPar, sklepPozPar); + SklepRegulaPozParSzczegEntityType.CreateForeignKey1(sklepRegulaPozParSzczeg, sklepPozPar); + SklepRegulaTekstEntityType.CreateForeignKey1(sklepRegulaTekst, sklepRegula); + SklepRegulaTowarEntityType.CreateForeignKey1(sklepRegulaTowar, sklepRegula); + SklepRegulaTowarEntityType.CreateForeignKey2(sklepRegulaTowar, sklepTowar); + SklepRolaEntityType.CreateForeignKey1(sklepRola, rola); + SklepRolaEntityType.CreateForeignKey2(sklepRola, sklep); + SklepRolaUprawnienieEntityType.CreateForeignKey1(sklepRolaUprawnienie, sklepRola); + SklepRozPrtMagEntityType.CreateForeignKey1(sklepRozPrtMag, sklepPozDok); + SklepRozPrtMagEntityType.CreateForeignKey2(sklepRozPrtMag, sklepPrtMag); + SklepRozbicieDodDokEntityType.CreateForeignKey1(sklepRozbicieDodDok, sklepDok); + SklepRozbicieDokEntityType.CreateForeignKey1(sklepRozbicieDok, sklepDok); + SklepRozlPartiiEntityType.CreateForeignKey1(sklepRozlPartii, sklepPartia); + SklepRozlPartiiEntityType.CreateForeignKey2(sklepRozlPartii, sklepPozDok); + SklepRozliczaEntityType.CreateForeignKey1(sklepRozlicza, sklepDok); + SklepRozliczaEntityType.CreateForeignKey2(sklepRozlicza, sklepDok); + SklepSkladnikDefinicjiKoduEntityType.CreateForeignKey1(sklepSkladnikDefinicjiKodu, sklepDefinicjaKodu); + SklepSkladnikWzorcaEntityType.CreateForeignKey1(sklepSkladnikWzorca, sklepTowar); + SklepStanPrtMagEntityType.CreateForeignKey1(sklepStanPrtMag, sklepDzienRozl); + SklepStanPrtMagEntityType.CreateForeignKey2(sklepStanPrtMag, sklepPrtMag); + SklepSzczegPrtMagEntityType.CreateForeignKey1(sklepSzczegPrtMag, sklepPrtMag); + SklepTekstDokEntityType.CreateForeignKey1(sklepTekstDok, sklepDok); + SklepTekstPozEntityType.CreateForeignKey1(sklepTekstPoz, sklepPozDok); + SklepTekstZgodyEntityType.CreateForeignKey1(sklepTekstZgody, sklepZgoda); + SklepTowAkcyzaEntityType.CreateForeignKey1(sklepTowAkcyza, sklepGrupaAkcyzowa); + SklepTowAkcyzaEntityType.CreateForeignKey2(sklepTowAkcyza, sklepTowar); + SklepTowDodatekEntityType.CreateForeignKey1(sklepTowDodatek, sklepTowar); + SklepTowDodatekEntityType.CreateForeignKey2(sklepTowDodatek, sklepTowar); + SklepTowIntParamEntityType.CreateForeignKey1(sklepTowIntParam, sklepTowar); + SklepTowKodEntityType.CreateForeignKey1(sklepTowKod, sklepTowar); + SklepTowParWiseBaseEntityType.CreateForeignKey1(sklepTowParWiseBase, parWiseBase); + SklepTowParWiseBaseEntityType.CreateForeignKey2(sklepTowParWiseBase, sklepTowar); + SklepTowPowiazanieEntityType.CreateForeignKey1(sklepTowPowiazanie, sklepTowar); + SklepTowPowiazanieEntityType.CreateForeignKey2(sklepTowPowiazanie, sklepTowar); + SklepTowStratyEntityType.CreateForeignKey1(sklepTowStraty, sklepTowar); + SklepTowZamiennikEntityType.CreateForeignKey1(sklepTowZamiennik, sklepTowar); + SklepTowZamiennikEntityType.CreateForeignKey2(sklepTowZamiennik, sklepZamiennik); + SklepTowZdjeciaEntityType.CreateForeignKey1(sklepTowZdjecia, sklepTowar); + SklepTowarEntityType.CreateForeignKey1(sklepTowar, sklep); + SklepTowarEntityType.CreateForeignKey2(sklepTowar, towar); + SklepTowarEntityType.CreateForeignKey3(sklepTowar, sklepArtykul); + SklepTowarEntityType.CreateForeignKey4(sklepTowar, sklepKontr); + SklepTowarSkladnikaEntityType.CreateForeignKey1(sklepTowarSkladnika, sklepSkladnikWzorca); + SklepTowarSkladnikaEntityType.CreateForeignKey2(sklepTowarSkladnika, sklepTowar); + SklepTrescEmailEntityType.CreateForeignKey1(sklepTrescEmail, sklepUzytkownik); + SklepTrescEmailTekstEntityType.CreateForeignKey1(sklepTrescEmailTekst, sklepTrescEmail); + SklepTypOsEntityType.CreateForeignKey1(sklepTypOs, sklep); + SklepTypOsEntityType.CreateForeignKey2(sklepTypOs, typOs); + SklepUprawnienieEntityType.CreateForeignKey1(sklepUprawnienie, sklepUzytkownik); + SklepUzytkownikEntityType.CreateForeignKey1(sklepUzytkownik, sklep); + SklepUzytkownikEntityType.CreateForeignKey2(sklepUzytkownik, uzytkownik); + SklepUzytkownikEntityType.CreateForeignKey3(sklepUzytkownik, sklepProfil); + SklepWalutaEntityType.CreateForeignKey1(sklepWaluta, sklep); + SklepWalutaEntityType.CreateForeignKey2(sklepWaluta, waluta); + SklepZaleznoscEntityType.CreateForeignKey1(sklepZaleznosc, sklepDok); + SklepZaleznoscEntityType.CreateForeignKey2(sklepZaleznosc, sklepDok); + SklepZasobEntityType.CreateForeignKey1(sklepZasob, sklep); + SklepZdarzOsEntityType.CreateForeignKey1(sklepZdarzOs, sklepKontr); + SklepZdarzOsEntityType.CreateForeignKey2(sklepZdarzOs, sklepTypOs); + SklepZdarzOsEntityType.CreateForeignKey3(sklepZdarzOs, sklepUzytkownik); + SklepZdarzOsEntityType.CreateForeignKey4(sklepZdarzOs, sklepZgoda); + SklepZdarzOsOpisEntityType.CreateForeignKey1(sklepZdarzOsOpis, sklepZdarzOs); + SklepZgodaEntityType.CreateForeignKey1(sklepZgoda, sklep); + SklepZgodaEntityType.CreateForeignKey2(sklepZgoda, zgoda); + StanPrtMagEntityType.CreateForeignKey1(stanPrtMag, dzienRozl); + StanPrtMagEntityType.CreateForeignKey2(stanPrtMag, prtMag); + StanZgodyEntityType.CreateForeignKey1(stanZgody, kontrahent); + StanZgodyEntityType.CreateForeignKey2(stanZgody, zgoda); + SubsysEntityType.CreateForeignKey1(subsys, towar); + SzczegPrtMagEntityType.CreateForeignKey1(szczegPrtMag, prtMag); + TabelaAkcyzowaEntityType.CreateForeignKey1(tabelaAkcyzowa, grupaAkcyzowa); + TekstDokEntityType.CreateForeignKey1(tekstDok, dok); + TekstPozEntityType.CreateForeignKey1(tekstPoz, pozDok); + TekstZgodyEntityType.CreateForeignKey1(tekstZgody, zgoda); + TowAkcyzaEntityType.CreateForeignKey1(towAkcyza, grupaAkcyzowa); + TowAkcyzaEntityType.CreateForeignKey2(towAkcyza, towar); + TowDodatekEntityType.CreateForeignKey1(towDodatek, towar); + TowDodatekEntityType.CreateForeignKey2(towDodatek, towar); + TowIntParamEntityType.CreateForeignKey1(towIntParam, towar); + TowKrajEntityType.CreateForeignKey1(towKraj, kraj); + TowKrajEntityType.CreateForeignKey2(towKraj, towar); + TowParWiseBaseEntityType.CreateForeignKey1(towParWiseBase, parWiseBase); + TowParWiseBaseEntityType.CreateForeignKey2(towParWiseBase, towar); + TowPowiazanieEntityType.CreateForeignKey1(towPowiazanie, towar); + TowPowiazanieEntityType.CreateForeignKey2(towPowiazanie, towar); + TowStratyEntityType.CreateForeignKey1(towStraty, towar); + TowStratyDlaSklepuEntityType.CreateForeignKey1(towStratyDlaSklepu, sklep); + TowStratyDlaSklepuEntityType.CreateForeignKey2(towStratyDlaSklepu, towStraty); + TowWartoscEntityType.CreateForeignKey1(towWartosc, parametr); + TowWartoscEntityType.CreateForeignKey2(towWartosc, towar); + TowZamiennikEntityType.CreateForeignKey1(towZamiennik, towar); + TowZamiennikEntityType.CreateForeignKey2(towZamiennik, zamiennik); + TowZdjeciaEntityType.CreateForeignKey1(towZdjecia, towar); + TowarEntityType.CreateForeignKey1(towar, artykul); + TowarEntityType.CreateForeignKey2(towar, asort); + TowarEntityType.CreateForeignKey3(towar, jM); + TowarEntityType.CreateForeignKey4(towar, kategoria); + TowarEntityType.CreateForeignKey5(towar, kraj); + TowarEntityType.CreateForeignKey6(towar, kontrahent); + TowarSkladnikaEntityType.CreateForeignKey1(towarSkladnika, skladnikWzorca); + TowarSkladnikaEntityType.CreateForeignKey2(towarSkladnika, towar); + TrescEmailEntityType.CreateForeignKey1(trescEmail, uzytkownik); + TrescEmailTekstEntityType.CreateForeignKey1(trescEmailTekst, trescEmail); + UlicaEntityType.CreateForeignKey1(ulica, miasto); + UprawnienieEntityType.CreateForeignKey1(uprawnienie, uzytkownik); + UprawnienieNaSklepEntityType.CreateForeignKey1(uprawnienieNaSklep, uzNaSklep); + UzNaSklepEntityType.CreateForeignKey1(uzNaSklep, sklep); + UzNaSklepEntityType.CreateForeignKey2(uzNaSklep, sklepUzytkownik); + UzytkownikEntityType.CreateForeignKey1(uzytkownik, profil); + ZaleznoscEntityType.CreateForeignKey1(zaleznosc, dok); + ZaleznoscEntityType.CreateForeignKey2(zaleznosc, dok); + ZdarzLojEntityType.CreateForeignKey1(zdarzLoj, kartaLoj); + ZdarzLojEntityType.CreateForeignKey2(zdarzLoj, kontoLoj); + ZdarzOsEntityType.CreateForeignKey1(zdarzOs, kontrahent); + ZdarzOsEntityType.CreateForeignKey2(zdarzOs, typOs); + ZdarzOsEntityType.CreateForeignKey3(zdarzOs, uzytkownik); + ZdarzOsEntityType.CreateForeignKey4(zdarzOs, zgoda); + ZdarzOsOpisEntityType.CreateForeignKey1(zdarzOsOpis, zdarzOs); + ZlecKomunikatEntityType.CreateForeignKey1(zlecKomunikat, zlecenie); + ZlecParamEntityType.CreateForeignKey1(zlecParam, zlecenie); + ZlecenieEntityType.CreateForeignKey1(zlecenie, kasa); + ZmianaEntityType.CreateForeignKey1(zmiana, sesja); + ZmianaTabeliEntityType.CreateForeignKey1(zmianaTabeli, zmiana); + DokKontoBankoweEntityType.CreateForeignKey1(dokKontoBankowe, dok); + DokKontoBankoweEntityType.CreateForeignKey2(dokKontoBankowe, kontoBankowe); + KthTypOsEntityType.CreateForeignKey1(kthTypOs, kontrahent); + KthTypOsEntityType.CreateForeignKey2(kthTypOs, typOs); + KthWartoscEntityType.CreateForeignKey1(kthWartosc, kthParWartosc); + KthWartoscEntityType.CreateForeignKey2(kthWartosc, kontrahent); + NrRejKartaEntityType.CreateForeignKey1(nrRejKarta, kartaLoj); + NrRejKartaEntityType.CreateForeignKey2(nrRejKarta, nrRej); + PolMagEntityType.CreateForeignKey1(polMag, magazyn); + PolMagEntityType.CreateForeignKey2(polMag, polityka); + PrzydzialEntityType.CreateForeignKey1(przydzial, asort); + PrzydzialEntityType.CreateForeignKey2(przydzial, kasa); + SklepKthPrzydzialEntityType.CreateForeignKey1(sklepKthPrzydzial, kthParWartosc); + SklepKthPrzydzialEntityType.CreateForeignKey2(sklepKthPrzydzial, sklep); + SklepNarzDostEntityType.CreateForeignKey1(sklepNarzDost, kontrahent); + SklepNarzDostEntityType.CreateForeignKey2(sklepNarzDost, sklepFlagi); + SklepPrzydzialEntityType.CreateForeignKey1(sklepPrzydzial, asort); + SklepPrzydzialEntityType.CreateForeignKey2(sklepPrzydzial, sklep); + SklepSklepEntityType.CreateForeignKey1(sklepSklep, sklep); + SklepSklepEntityType.CreateForeignKey2(sklepSklep, sklep); + + AsortEntityType.CreateSkipNavigation1(asort, kasa, przydzial); + AsortEntityType.CreateSkipNavigation2(asort, sklep, sklepPrzydzial); + DokEntityType.CreateSkipNavigation1(dok, kontoBankowe, dokKontoBankowe); + KartaLojEntityType.CreateSkipNavigation1(kartaLoj, nrRej, nrRejKarta); + KasaEntityType.CreateSkipNavigation1(kasa, asort, przydzial); + KontoBankoweEntityType.CreateSkipNavigation1(kontoBankowe, dok, dokKontoBankowe); + KontrahentEntityType.CreateSkipNavigation1(kontrahent, kthParWartosc, kthWartosc); + KontrahentEntityType.CreateSkipNavigation2(kontrahent, sklepFlagi, sklepNarzDost); + KontrahentEntityType.CreateSkipNavigation3(kontrahent, typOs, kthTypOs); + KthParWartoscEntityType.CreateSkipNavigation1(kthParWartosc, kontrahent, kthWartosc); + KthParWartoscEntityType.CreateSkipNavigation2(kthParWartosc, sklep, sklepKthPrzydzial); + MagazynEntityType.CreateSkipNavigation1(magazyn, polityka, polMag); + NrRejEntityType.CreateSkipNavigation1(nrRej, kartaLoj, nrRejKarta); + PolitykaEntityType.CreateSkipNavigation1(polityka, magazyn, polMag); + SklepEntityType.CreateSkipNavigation1(sklep, asort, sklepPrzydzial); + SklepEntityType.CreateSkipNavigation2(sklep, sklep, sklepSklep); + SklepEntityType.CreateSkipNavigation3(sklep, kthParWartosc, sklepKthPrzydzial); + SklepEntityType.CreateSkipNavigation4(sklep, sklep, sklepSklep); + SklepFlagiEntityType.CreateSkipNavigation1(sklepFlagi, kontrahent, sklepNarzDost); + TypOsEntityType.CreateSkipNavigation1(typOs, kontrahent, kthTypOs); + + AkwizytorEntityType.CreateAnnotations(akwizytor); + ArtykulEntityType.CreateAnnotations(artykul); + AsortEntityType.CreateAnnotations(asort); + BankEntityType.CreateAnnotations(bank); + BlokadaEntityType.CreateAnnotations(blokada); + CentrStanZgodyEntityType.CreateAnnotations(centrStanZgody); + CzasEntityType.CreateAnnotations(czas); + DefinicjaKoduEntityType.CreateAnnotations(definicjaKodu); + DlugiZasobEntityType.CreateAnnotations(dlugiZasob); + DlugiZasobBinEntityType.CreateAnnotations(dlugiZasobBin); + DlugiZasobTxtEntityType.CreateAnnotations(dlugiZasobTxt); + DokEntityType.CreateAnnotations(dok); + DokDodKthEntityType.CreateAnnotations(dokDodKth); + DokKasaEntityType.CreateAnnotations(dokKasa); + DokKontrEntityType.CreateAnnotations(dokKontr); + DokKursEntityType.CreateAnnotations(dokKurs); + DokPunktyEntityType.CreateAnnotations(dokPunkty); + DokWBufPowiazanieEntityType.CreateAnnotations(dokWBufPowiazanie); + DokWalutaEntityType.CreateAnnotations(dokWaluta); + DostProdEntityType.CreateAnnotations(dostProd); + DostawcaEntityType.CreateAnnotations(dostawca); + DzienRozlEntityType.CreateAnnotations(dzienRozl); + DzienRozlParamEntityType.CreateAnnotations(dzienRozlParam); + EmailEntityType.CreateAnnotations(email); + FormZgodEntityType.CreateAnnotations(formZgod); + FormaPlatnPos7EntityType.CreateAnnotations(formaPlatnPos7); + FormaPlatnosciEntityType.CreateAnnotations(formaPlatnosci); + GrWartoscEntityType.CreateAnnotations(grWartosc); + GrupaAkcyzowaEntityType.CreateAnnotations(grupaAkcyzowa); + GrupaPromocjiEntityType.CreateAnnotations(grupaPromocji); + GrupaTowEntityType.CreateAnnotations(grupaTow); + GrupaUzEntityType.CreateAnnotations(grupaUz); + HarmCenyEntityType.CreateAnnotations(harmCeny); + HarmCyklEntityType.CreateAnnotations(harmCykl); + HarmHarmEntityType.CreateAnnotations(harmHarm); + HarmRapEntityType.CreateAnnotations(harmRap); + HarmRapCyklEntityType.CreateAnnotations(harmRapCykl); + HarmRapParamEntityType.CreateAnnotations(harmRapParam); + HarmRapZlecenieEntityType.CreateAnnotations(harmRapZlecenie); + HarmWpisEntityType.CreateAnnotations(harmWpis); + IstwEntityType.CreateAnnotations(istw); + JMEntityType.CreateAnnotations(jM); + KartaLojEntityType.CreateAnnotations(kartaLoj); + KasKodEntityType.CreateAnnotations(kasKod); + KasParEntityType.CreateAnnotations(kasPar); + KasTowEntityType.CreateAnnotations(kasTow); + KasaEntityType.CreateAnnotations(kasa); + KasaFormaPlatnEntityType.CreateAnnotations(kasaFormaPlatn); + KatParamEntityType.CreateAnnotations(katParam); + KategoriaEntityType.CreateAnnotations(kategoria); + KodDodEntityType.CreateAnnotations(kodDod); + KodWazonyEntityType.CreateAnnotations(kodWazony); + KomentarzEntityType.CreateAnnotations(komentarz); + KonfigEntityType.CreateAnnotations(konfig); + KontoBankoweEntityType.CreateAnnotations(kontoBankowe); + KontoBankoweKontrEntityType.CreateAnnotations(kontoBankoweKontr); + KontoLojEntityType.CreateAnnotations(kontoLoj); + KontrOpisEntityType.CreateAnnotations(kontrOpis); + KontrahentEntityType.CreateAnnotations(kontrahent); + KrajEntityType.CreateAnnotations(kraj); + KrajStawkaEntityType.CreateAnnotations(krajStawka); + KthParWartoscEntityType.CreateAnnotations(kthParWartosc); + KthParamEntityType.CreateAnnotations(kthParam); + KursWalutyEntityType.CreateAnnotations(kursWaluty); + LiniaLotniczaEntityType.CreateAnnotations(liniaLotnicza); + LogOperationEntityType.CreateAnnotations(logOperation); + LogTypeDefEntityType.CreateAnnotations(logTypeDef); + LogValChangeNumEntityType.CreateAnnotations(logValChangeNum); + LogValChangeTxtEntityType.CreateAnnotations(logValChangeTxt); + LotniskoEntityType.CreateAnnotations(lotnisko); + MagazynEntityType.CreateAnnotations(magazyn); + MarZakresEntityType.CreateAnnotations(marZakres); + MarzownikEntityType.CreateAnnotations(marzownik); + MiastoEntityType.CreateAnnotations(miasto); + NotatkiEntityType.CreateAnnotations(notatki); + NrRejEntityType.CreateAnnotations(nrRej); + NumDokEntityType.CreateAnnotations(numDok); + NumMagEntityType.CreateAnnotations(numMag); + OdbProdEntityType.CreateAnnotations(odbProd); + OdbiorcaEntityType.CreateAnnotations(odbiorca); + OfKodEntityType.CreateAnnotations(ofKod); + OfSlownikEntityType.CreateAnnotations(ofSlownik); + OfertaEntityType.CreateAnnotations(oferta); + OpisZdarzLojEntityType.CreateAnnotations(opisZdarzLoj); + OplataEntityType.CreateAnnotations(oplata); + OsobaEntityType.CreateAnnotations(osoba); + PHEntityType.CreateAnnotations(pH); + PHDaneEntityType.CreateAnnotations(pHDane); + PHOdbDaneEntityType.CreateAnnotations(pHOdbDane); + PHOdbiorcaEntityType.CreateAnnotations(pHOdbiorca); + PHRozliczenieEntityType.CreateAnnotations(pHRozliczenie); + PanelEntityType.CreateAnnotations(panel); + PanelParamEntityType.CreateAnnotations(panelParam); + ParBonEntityType.CreateAnnotations(parBon); + ParPunktyEntityType.CreateAnnotations(parPunkty); + ParWalutaEntityType.CreateAnnotations(parWaluta); + ParWartoscEntityType.CreateAnnotations(parWartosc); + ParWiseBaseEntityType.CreateAnnotations(parWiseBase); + ParagonEntityType.CreateAnnotations(paragon); + ParametrEntityType.CreateAnnotations(parametr); + PartiaEntityType.CreateAnnotations(partia); + PcfUserEntityType.CreateAnnotations(pcfUser); + PcfUserSklepEntityType.CreateAnnotations(pcfUserSklep); + PcpPosEntityType.CreateAnnotations(pcpPos); + PcpReceiptEntityType.CreateAnnotations(pcpReceipt); + PcpReceiptItemEntityType.CreateAnnotations(pcpReceiptItem); + PcpReceiptPaymentEntityType.CreateAnnotations(pcpReceiptPayment); + PcpReceiptVatEntityType.CreateAnnotations(pcpReceiptVat); + PcpShopEntityType.CreateAnnotations(pcpShop); + PolParamEntityType.CreateAnnotations(polParam); + PolitykaEntityType.CreateAnnotations(polityka); + PowKontLojEntityType.CreateAnnotations(powKontLoj); + PowiadomienieEntityType.CreateAnnotations(powiadomienie); + PowiadomienieParamEntityType.CreateAnnotations(powiadomienieParam); + PowiazanieEntityType.CreateAnnotations(powiazanie); + PowiazaniePromEntityType.CreateAnnotations(powiazanieProm); + PowiazanieSklepEntityType.CreateAnnotations(powiazanieSklep); + PowiazanieUzEntityType.CreateAnnotations(powiazanieUz); + PowiazanieUzNaSklepEntityType.CreateAnnotations(powiazanieUzNaSklep); + PozAkcyzaEntityType.CreateAnnotations(pozAkcyza); + PozCennikDokEntityType.CreateAnnotations(pozCennikDok); + PozDokEntityType.CreateAnnotations(pozDok); + PozDokWBufPowiazanieEntityType.CreateAnnotations(pozDokWBufPowiazanie); + PozParEntityType.CreateAnnotations(pozPar); + PozParSzczegEntityType.CreateAnnotations(pozParSzczeg); + PozWzEntityType.CreateAnnotations(pozWz); + ProfilEntityType.CreateAnnotations(profil); + ProfilKasaEntityType.CreateAnnotations(profilKasa); + ProfilKonfigEntityType.CreateAnnotations(profilKonfig); + PrtMagEntityType.CreateAnnotations(prtMag); + RapWartPoczEntityType.CreateAnnotations(rapWartPocz); + RapWartPoczDaneEntityType.CreateAnnotations(rapWartPoczDane); + RegulaEntityType.CreateAnnotations(regula); + RegulaAsortEntityType.CreateAnnotations(regulaAsort); + RegulaDokEntityType.CreateAnnotations(regulaDok); + RegulaDokSzczegEntityType.CreateAnnotations(regulaDokSzczeg); + RegulaKodEntityType.CreateAnnotations(regulaKod); + RegulaParEntityType.CreateAnnotations(regulaPar); + RegulaParSzczegEntityType.CreateAnnotations(regulaParSzczeg); + RegulaParamEntityType.CreateAnnotations(regulaParam); + RegulaPozDokEntityType.CreateAnnotations(regulaPozDok); + RegulaPozDokSzczegEntityType.CreateAnnotations(regulaPozDokSzczeg); + RegulaPozParEntityType.CreateAnnotations(regulaPozPar); + RegulaPozParSzczegEntityType.CreateAnnotations(regulaPozParSzczeg); + RegulaProgEntityType.CreateAnnotations(regulaProg); + RegulaSklepEntityType.CreateAnnotations(regulaSklep); + RegulaSklepAuthEntityType.CreateAnnotations(regulaSklepAuth); + RegulaTekstEntityType.CreateAnnotations(regulaTekst); + RegulaTowarEntityType.CreateAnnotations(regulaTowar); + RolaEntityType.CreateAnnotations(rola); + RolaUprawnienieEntityType.CreateAnnotations(rolaUprawnienie); + RozPrtMagEntityType.CreateAnnotations(rozPrtMag); + RozbicieDodDokEntityType.CreateAnnotations(rozbicieDodDok); + RozbicieDokEntityType.CreateAnnotations(rozbicieDok); + RozliczaEntityType.CreateAnnotations(rozlicza); + RozliczeniePartiiEntityType.CreateAnnotations(rozliczeniePartii); + SesjaEntityType.CreateAnnotations(sesja); + SesjaAktywnaEntityType.CreateAnnotations(sesjaAktywna); + SkladnikDefinicjiKoduEntityType.CreateAnnotations(skladnikDefinicjiKodu); + SkladnikWzorcaEntityType.CreateAnnotations(skladnikWzorca); + SklepEntityType.CreateAnnotations(sklep); + SklepArtykulEntityType.CreateAnnotations(sklepArtykul); + SklepBankEntityType.CreateAnnotations(sklepBank); + SklepDefinicjaKoduEntityType.CreateAnnotations(sklepDefinicjaKodu); + SklepDlugiZasobEntityType.CreateAnnotations(sklepDlugiZasob); + SklepDokEntityType.CreateAnnotations(sklepDok); + SklepDokDodKthEntityType.CreateAnnotations(sklepDokDodKth); + SklepDokKursEntityType.CreateAnnotations(sklepDokKurs); + SklepDokPunktyEntityType.CreateAnnotations(sklepDokPunkty); + SklepDokWalutaEntityType.CreateAnnotations(sklepDokWaluta); + SklepDostEntityType.CreateAnnotations(sklepDost); + SklepDzienRozlEntityType.CreateAnnotations(sklepDzienRozl); + SklepDzienRozlParamEntityType.CreateAnnotations(sklepDzienRozlParam); + SklepEmailEntityType.CreateAnnotations(sklepEmail); + SklepFlagiEntityType.CreateAnnotations(sklepFlagi); + SklepFormZgodEntityType.CreateAnnotations(sklepFormZgod); + SklepFormaPlatnPos7EntityType.CreateAnnotations(sklepFormaPlatnPos7); + SklepGrupaAkcyzowaEntityType.CreateAnnotations(sklepGrupaAkcyzowa); + SklepGrupaPromocjiEntityType.CreateAnnotations(sklepGrupaPromocji); + SklepGrupaUzEntityType.CreateAnnotations(sklepGrupaUz); + SklepIstwEntityType.CreateAnnotations(sklepIstw); + SklepKartaLojEntityType.CreateAnnotations(sklepKartaLoj); + SklepKasaEntityType.CreateAnnotations(sklepKasa); + SklepKasaFormaPlatnEntityType.CreateAnnotations(sklepKasaFormaPlatn); + SklepKontoBankoweEntityType.CreateAnnotations(sklepKontoBankowe); + SklepKontoBankoweKontrEntityType.CreateAnnotations(sklepKontoBankoweKontr); + SklepKontoLojEntityType.CreateAnnotations(sklepKontoLoj); + SklepKontrEntityType.CreateAnnotations(sklepKontr); + SklepKontrOpisEntityType.CreateAnnotations(sklepKontrOpis); + SklepKontrSklepEntityType.CreateAnnotations(sklepKontrSklep); + SklepKthTypOsEntityType.CreateAnnotations(sklepKthTypOs); + SklepMagazynEntityType.CreateAnnotations(sklepMagazyn); + SklepNotatkiEntityType.CreateAnnotations(sklepNotatki); + SklepNrRejEntityType.CreateAnnotations(sklepNrRej); + SklepNrRejKartaEntityType.CreateAnnotations(sklepNrRejKarta); + SklepOplataEntityType.CreateAnnotations(sklepOplata); + SklepPanelEntityType.CreateAnnotations(sklepPanel); + SklepPanelParamEntityType.CreateAnnotations(sklepPanelParam); + SklepParBonEntityType.CreateAnnotations(sklepParBon); + SklepParPunktyEntityType.CreateAnnotations(sklepParPunkty); + SklepParWalutaEntityType.CreateAnnotations(sklepParWaluta); + SklepParagonEntityType.CreateAnnotations(sklepParagon); + SklepPartiaEntityType.CreateAnnotations(sklepPartia); + SklepPowKontLojEntityType.CreateAnnotations(sklepPowKontLoj); + SklepPowiazaniePromEntityType.CreateAnnotations(sklepPowiazanieProm); + SklepPowiazanieUzEntityType.CreateAnnotations(sklepPowiazanieUz); + SklepPozAkcyzaEntityType.CreateAnnotations(sklepPozAkcyza); + SklepPozDokEntityType.CreateAnnotations(sklepPozDok); + SklepPozParEntityType.CreateAnnotations(sklepPozPar); + SklepPozParSzczegEntityType.CreateAnnotations(sklepPozParSzczeg); + SklepProfilEntityType.CreateAnnotations(sklepProfil); + SklepProfilKonfigEntityType.CreateAnnotations(sklepProfilKonfig); + SklepPrtMagEntityType.CreateAnnotations(sklepPrtMag); + SklepRapWartPoczEntityType.CreateAnnotations(sklepRapWartPocz); + SklepRapWartPoczDaneEntityType.CreateAnnotations(sklepRapWartPoczDane); + SklepRegulaEntityType.CreateAnnotations(sklepRegula); + SklepRegulaAsortEntityType.CreateAnnotations(sklepRegulaAsort); + SklepRegulaDokEntityType.CreateAnnotations(sklepRegulaDok); + SklepRegulaDokSzczegEntityType.CreateAnnotations(sklepRegulaDokSzczeg); + SklepRegulaKodEntityType.CreateAnnotations(sklepRegulaKod); + SklepRegulaParEntityType.CreateAnnotations(sklepRegulaPar); + SklepRegulaParSzczegEntityType.CreateAnnotations(sklepRegulaParSzczeg); + SklepRegulaParamEntityType.CreateAnnotations(sklepRegulaParam); + SklepRegulaPozDokEntityType.CreateAnnotations(sklepRegulaPozDok); + SklepRegulaPozDokSzczegEntityType.CreateAnnotations(sklepRegulaPozDokSzczeg); + SklepRegulaPozParEntityType.CreateAnnotations(sklepRegulaPozPar); + SklepRegulaPozParSzczegEntityType.CreateAnnotations(sklepRegulaPozParSzczeg); + SklepRegulaTekstEntityType.CreateAnnotations(sklepRegulaTekst); + SklepRegulaTowarEntityType.CreateAnnotations(sklepRegulaTowar); + SklepRolaEntityType.CreateAnnotations(sklepRola); + SklepRolaUprawnienieEntityType.CreateAnnotations(sklepRolaUprawnienie); + SklepRozPrtMagEntityType.CreateAnnotations(sklepRozPrtMag); + SklepRozbicieDodDokEntityType.CreateAnnotations(sklepRozbicieDodDok); + SklepRozbicieDokEntityType.CreateAnnotations(sklepRozbicieDok); + SklepRozlPartiiEntityType.CreateAnnotations(sklepRozlPartii); + SklepRozliczaEntityType.CreateAnnotations(sklepRozlicza); + SklepSkladnikDefinicjiKoduEntityType.CreateAnnotations(sklepSkladnikDefinicjiKodu); + SklepSkladnikWzorcaEntityType.CreateAnnotations(sklepSkladnikWzorca); + SklepStanPrtMagEntityType.CreateAnnotations(sklepStanPrtMag); + SklepSzczegPrtMagEntityType.CreateAnnotations(sklepSzczegPrtMag); + SklepTekstDokEntityType.CreateAnnotations(sklepTekstDok); + SklepTekstPozEntityType.CreateAnnotations(sklepTekstPoz); + SklepTekstZgodyEntityType.CreateAnnotations(sklepTekstZgody); + SklepTowAkcyzaEntityType.CreateAnnotations(sklepTowAkcyza); + SklepTowDodatekEntityType.CreateAnnotations(sklepTowDodatek); + SklepTowIntParamEntityType.CreateAnnotations(sklepTowIntParam); + SklepTowKodEntityType.CreateAnnotations(sklepTowKod); + SklepTowParWiseBaseEntityType.CreateAnnotations(sklepTowParWiseBase); + SklepTowPowiazanieEntityType.CreateAnnotations(sklepTowPowiazanie); + SklepTowStratyEntityType.CreateAnnotations(sklepTowStraty); + SklepTowZamiennikEntityType.CreateAnnotations(sklepTowZamiennik); + SklepTowZdjeciaEntityType.CreateAnnotations(sklepTowZdjecia); + SklepTowarEntityType.CreateAnnotations(sklepTowar); + SklepTowarSkladnikaEntityType.CreateAnnotations(sklepTowarSkladnika); + SklepTrescEmailEntityType.CreateAnnotations(sklepTrescEmail); + SklepTrescEmailTekstEntityType.CreateAnnotations(sklepTrescEmailTekst); + SklepTypOsEntityType.CreateAnnotations(sklepTypOs); + SklepUprawnienieEntityType.CreateAnnotations(sklepUprawnienie); + SklepUzytkownikEntityType.CreateAnnotations(sklepUzytkownik); + SklepWalutaEntityType.CreateAnnotations(sklepWaluta); + SklepZaleznoscEntityType.CreateAnnotations(sklepZaleznosc); + SklepZamiennikEntityType.CreateAnnotations(sklepZamiennik); + SklepZasobEntityType.CreateAnnotations(sklepZasob); + SklepZdarzOsEntityType.CreateAnnotations(sklepZdarzOs); + SklepZdarzOsOpisEntityType.CreateAnnotations(sklepZdarzOsOpis); + SklepZgodaEntityType.CreateAnnotations(sklepZgoda); + SprzedazEntityType.CreateAnnotations(sprzedaz); + StanPrtMagEntityType.CreateAnnotations(stanPrtMag); + StanZgodyEntityType.CreateAnnotations(stanZgody); + Struktura_7_3EntityType.CreateAnnotations(struktura_7_3); + SubsysEntityType.CreateAnnotations(subsys); + SzczegPrtMagEntityType.CreateAnnotations(szczegPrtMag); + TabelaAkcyzowaEntityType.CreateAnnotations(tabelaAkcyzowa); + TekstDokEntityType.CreateAnnotations(tekstDok); + TekstPozEntityType.CreateAnnotations(tekstPoz); + TekstZgodyEntityType.CreateAnnotations(tekstZgody); + TowAkcyzaEntityType.CreateAnnotations(towAkcyza); + TowDodatekEntityType.CreateAnnotations(towDodatek); + TowIntParamEntityType.CreateAnnotations(towIntParam); + TowKrajEntityType.CreateAnnotations(towKraj); + TowParWiseBaseEntityType.CreateAnnotations(towParWiseBase); + TowPowiazanieEntityType.CreateAnnotations(towPowiazanie); + TowStratyEntityType.CreateAnnotations(towStraty); + TowStratyDlaSklepuEntityType.CreateAnnotations(towStratyDlaSklepu); + TowWartoscEntityType.CreateAnnotations(towWartosc); + TowZamiennikEntityType.CreateAnnotations(towZamiennik); + TowZdjeciaEntityType.CreateAnnotations(towZdjecia); + TowarEntityType.CreateAnnotations(towar); + TowarSkladnikaEntityType.CreateAnnotations(towarSkladnika); + TrescEmailEntityType.CreateAnnotations(trescEmail); + TrescEmailTekstEntityType.CreateAnnotations(trescEmailTekst); + TypOsEntityType.CreateAnnotations(typOs); + UlicaEntityType.CreateAnnotations(ulica); + UprawnienieEntityType.CreateAnnotations(uprawnienie); + UprawnienieNaSklepEntityType.CreateAnnotations(uprawnienieNaSklep); + UzNaSklepEntityType.CreateAnnotations(uzNaSklep); + UzytkownikEntityType.CreateAnnotations(uzytkownik); + VatEntityType.CreateAnnotations(vat); + WalutaEntityType.CreateAnnotations(waluta); + Wersja_7_2EntityType.CreateAnnotations(wersja_7_2); + WzorzecEntityType.CreateAnnotations(wzorzec); + ZaleznoscEntityType.CreateAnnotations(zaleznosc); + ZamiennikEntityType.CreateAnnotations(zamiennik); + ZasobEntityType.CreateAnnotations(zasob); + ZdarzLojEntityType.CreateAnnotations(zdarzLoj); + ZdarzOsEntityType.CreateAnnotations(zdarzOs); + ZdarzOsOpisEntityType.CreateAnnotations(zdarzOsOpis); + ZgodaEntityType.CreateAnnotations(zgoda); + ZlecKomunikatEntityType.CreateAnnotations(zlecKomunikat); + ZlecParamEntityType.CreateAnnotations(zlecParam); + ZlecenieEntityType.CreateAnnotations(zlecenie); + ZmianaEntityType.CreateAnnotations(zmiana); + ZmianaTabeliEntityType.CreateAnnotations(zmianaTabeli); + DokKontoBankoweEntityType.CreateAnnotations(dokKontoBankowe); + KthTypOsEntityType.CreateAnnotations(kthTypOs); + KthWartoscEntityType.CreateAnnotations(kthWartosc); + NrRejKartaEntityType.CreateAnnotations(nrRejKarta); + PolMagEntityType.CreateAnnotations(polMag); + PrzydzialEntityType.CreateAnnotations(przydzial); + SklepKthPrzydzialEntityType.CreateAnnotations(sklepKthPrzydzial); + SklepNarzDostEntityType.CreateAnnotations(sklepNarzDost); + SklepPrzydzialEntityType.CreateAnnotations(sklepPrzydzial); + SklepSklepEntityType.CreateAnnotations(sklepSklep); + + AddAnnotation("ProductVersion", "8.0.2"); + AddAnnotation("Relational:MaxIdentifierLength", 128); + AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + AddRuntimeAnnotation("Relational:RelationalModel", CreateRelationalModel()); + } + + private IRelationalModel CreateRelationalModel() + { + var relationalModel = new RelationalModel(this); + + var akwizytor = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Akwizytor")!; + + var defaultTableMappings = new List>(); + akwizytor.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings); + var blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Akwizytor", null, relationalModel); + var akwIdColumnBase = new ColumnBase("AkwId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase); + blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase.Columns.Add("AkwId", akwIdColumnBase); + var nazwiskoColumnBase = new ColumnBase("Nazwisko", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase); + blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase.Columns.Add("Nazwisko", nazwiskoColumnBase); + var opisColumnBase = new ColumnBase("Opis", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase); + blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase.Columns.Add("Opis", opisColumnBase); + var prowizjaColumnBase = new ColumnBase("Prowizja", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase); + blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase.Columns.Add("Prowizja", prowizjaColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Akwizytor", blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase); + var blinkBackofficeServicesPcmDbEntitiesAkwizytorMappingBase = new TableMappingBase(akwizytor, blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase, true); + blinkBackofficeServicesPcmDbEntitiesAkwizytorTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesAkwizytorMappingBase, false); + defaultTableMappings.Add(blinkBackofficeServicesPcmDbEntitiesAkwizytorMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akwIdColumnBase, akwizytor.FindProperty("AkwId")!, blinkBackofficeServicesPcmDbEntitiesAkwizytorMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwiskoColumnBase, akwizytor.FindProperty("Nazwisko")!, blinkBackofficeServicesPcmDbEntitiesAkwizytorMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase, akwizytor.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesAkwizytorMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prowizjaColumnBase, akwizytor.FindProperty("Prowizja")!, blinkBackofficeServicesPcmDbEntitiesAkwizytorMappingBase); + + var tableMappings = new List(); + akwizytor.SetRuntimeAnnotation("Relational:TableMappings", tableMappings); + var akwizytorTable = new Table("Akwizytor", null, relationalModel); + var akwIdColumn = new Column("AkwId", "numeric(9,0)", akwizytorTable); + akwizytorTable.Columns.Add("AkwId", akwIdColumn); + var nazwiskoColumn = new Column("Nazwisko", "varchar(60)", akwizytorTable); + akwizytorTable.Columns.Add("Nazwisko", nazwiskoColumn); + var opisColumn = new Column("Opis", "varchar(255)", akwizytorTable); + akwizytorTable.Columns.Add("Opis", opisColumn); + var prowizjaColumn = new Column("Prowizja", "decimal(10,4)", akwizytorTable); + akwizytorTable.Columns.Add("Prowizja", prowizjaColumn); + var pK_AKWIZYTOR = new UniqueConstraint("PK_AKWIZYTOR", akwizytorTable, new[] { akwIdColumn }); + akwizytorTable.PrimaryKey = pK_AKWIZYTOR; + var pK_AKWIZYTORUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Akwizytor", + new[] { "AkwId" }); + pK_AKWIZYTOR.MappedKeys.Add(pK_AKWIZYTORUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_AKWIZYTORUc).Add(pK_AKWIZYTOR); + akwizytorTable.UniqueConstraints.Add("PK_AKWIZYTOR", pK_AKWIZYTOR); + relationalModel.Tables.Add(("Akwizytor", null), akwizytorTable); + var akwizytorTableMapping = new TableMapping(akwizytor, akwizytorTable, true); + akwizytorTable.AddTypeMapping(akwizytorTableMapping, false); + tableMappings.Add(akwizytorTableMapping); + RelationalModel.CreateColumnMapping(akwIdColumn, akwizytor.FindProperty("AkwId")!, akwizytorTableMapping); + RelationalModel.CreateColumnMapping(nazwiskoColumn, akwizytor.FindProperty("Nazwisko")!, akwizytorTableMapping); + RelationalModel.CreateColumnMapping(opisColumn, akwizytor.FindProperty("Opis")!, akwizytorTableMapping); + RelationalModel.CreateColumnMapping(prowizjaColumn, akwizytor.FindProperty("Prowizja")!, akwizytorTableMapping); + + var artykul = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Artykul")!; + + var defaultTableMappings0 = new List>(); + artykul.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings0); + var blinkBackofficeServicesPcmDbEntitiesArtykulTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Artykul", null, relationalModel); + var artIdColumnBase = new ColumnBase("ArtId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesArtykulTableBase); + blinkBackofficeServicesPcmDbEntitiesArtykulTableBase.Columns.Add("ArtId", artIdColumnBase); + var artNazwaColumnBase = new ColumnBase("ArtNazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesArtykulTableBase); + blinkBackofficeServicesPcmDbEntitiesArtykulTableBase.Columns.Add("ArtNazwa", artNazwaColumnBase); + var centrArtIdColumnBase = new ColumnBase("CentrArtId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesArtykulTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesArtykulTableBase.Columns.Add("CentrArtId", centrArtIdColumnBase); + var glownyTowIdColumnBase = new ColumnBase("GlownyTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesArtykulTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesArtykulTableBase.Columns.Add("GlownyTowId", glownyTowIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Artykul", blinkBackofficeServicesPcmDbEntitiesArtykulTableBase); + var blinkBackofficeServicesPcmDbEntitiesArtykulMappingBase = new TableMappingBase(artykul, blinkBackofficeServicesPcmDbEntitiesArtykulTableBase, true); + blinkBackofficeServicesPcmDbEntitiesArtykulTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesArtykulMappingBase, false); + defaultTableMappings0.Add(blinkBackofficeServicesPcmDbEntitiesArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)artIdColumnBase, artykul.FindProperty("ArtId")!, blinkBackofficeServicesPcmDbEntitiesArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)artNazwaColumnBase, artykul.FindProperty("ArtNazwa")!, blinkBackofficeServicesPcmDbEntitiesArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrArtIdColumnBase, artykul.FindProperty("CentrArtId")!, blinkBackofficeServicesPcmDbEntitiesArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)glownyTowIdColumnBase, artykul.FindProperty("GlownyTowId")!, blinkBackofficeServicesPcmDbEntitiesArtykulMappingBase); + + var tableMappings0 = new List(); + artykul.SetRuntimeAnnotation("Relational:TableMappings", tableMappings0); + var artykulTable = new Table("Artykul", null, relationalModel); + var artIdColumn = new Column("ArtId", "numeric(9,0)", artykulTable); + artykulTable.Columns.Add("ArtId", artIdColumn); + var artNazwaColumn = new Column("ArtNazwa", "varchar(120)", artykulTable); + artykulTable.Columns.Add("ArtNazwa", artNazwaColumn); + var centrArtIdColumn = new Column("CentrArtId", "numeric(9,0)", artykulTable) + { + IsNullable = true + }; + artykulTable.Columns.Add("CentrArtId", centrArtIdColumn); + var glownyTowIdColumn = new Column("GlownyTowId", "numeric(9,0)", artykulTable) + { + IsNullable = true + }; + artykulTable.Columns.Add("GlownyTowId", glownyTowIdColumn); + var pK_ARTYKUL = new UniqueConstraint("PK_ARTYKUL", artykulTable, new[] { artIdColumn }); + artykulTable.PrimaryKey = pK_ARTYKUL; + var pK_ARTYKULUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Artykul", + new[] { "ArtId" }); + pK_ARTYKUL.MappedKeys.Add(pK_ARTYKULUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ARTYKULUc).Add(pK_ARTYKUL); + artykulTable.UniqueConstraints.Add("PK_ARTYKUL", pK_ARTYKUL); + var idx_CentrArtId = new TableIndex( + "idx_CentrArtId", artykulTable, new[] { centrArtIdColumn }, false); + var idx_CentrArtIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Artykul", + "idx_CentrArtId"); + idx_CentrArtId.MappedIndexes.Add(idx_CentrArtIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrArtIdIx).Add(idx_CentrArtId); + artykulTable.Indexes.Add("idx_CentrArtId", idx_CentrArtId); + var iX_Artykul_GlownyTowId = new TableIndex( + "IX_Artykul_GlownyTowId", artykulTable, new[] { glownyTowIdColumn }, false); + var iX_Artykul_GlownyTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Artykul", + new[] { "GlownyTowId" }); + iX_Artykul_GlownyTowId.MappedIndexes.Add(iX_Artykul_GlownyTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Artykul_GlownyTowIdIx).Add(iX_Artykul_GlownyTowId); + artykulTable.Indexes.Add("IX_Artykul_GlownyTowId", iX_Artykul_GlownyTowId); + relationalModel.Tables.Add(("Artykul", null), artykulTable); + var artykulTableMapping = new TableMapping(artykul, artykulTable, true); + artykulTable.AddTypeMapping(artykulTableMapping, false); + tableMappings0.Add(artykulTableMapping); + RelationalModel.CreateColumnMapping(artIdColumn, artykul.FindProperty("ArtId")!, artykulTableMapping); + RelationalModel.CreateColumnMapping(artNazwaColumn, artykul.FindProperty("ArtNazwa")!, artykulTableMapping); + RelationalModel.CreateColumnMapping(centrArtIdColumn, artykul.FindProperty("CentrArtId")!, artykulTableMapping); + RelationalModel.CreateColumnMapping(glownyTowIdColumn, artykul.FindProperty("GlownyTowId")!, artykulTableMapping); + + var asort = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Asort")!; + + var defaultTableMappings1 = new List>(); + asort.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings1); + var blinkBackofficeServicesPcmDbEntitiesAsortTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Asort", null, relationalModel); + var asIdColumnBase = new ColumnBase("AsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("AsId", asIdColumnBase); + var autoryzacjaColumnBase = new ColumnBase("Autoryzacja", "smallint", blinkBackofficeServicesPcmDbEntitiesAsortTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("Autoryzacja", autoryzacjaColumnBase); + var bezAutoEtykietColumnBase = new ColumnBase("BezAutoEtykiet", "smallint", blinkBackofficeServicesPcmDbEntitiesAsortTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("BezAutoEtykiet", bezAutoEtykietColumnBase); + var centrAsIdColumnBase = new ColumnBase("CentrAsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesAsortTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("CentrAsId", centrAsIdColumnBase); + var hurtRabatColumnBase = new ColumnBase("HurtRabat", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("HurtRabat", hurtRabatColumnBase); + var marzaColumnBase = new ColumnBase("Marza", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("Marza", marzaColumnBase); + var nazwaColumnBase = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("Nazwa", nazwaColumnBase); + var nocNarzutColumnBase = new ColumnBase("NocNarzut", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("NocNarzut", nocNarzutColumnBase); + var opcjaMarzyColumnBase = new ColumnBase("OpcjaMarzy", "smallint", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("OpcjaMarzy", opcjaMarzyColumnBase); + var opcjaNarzutuColumnBase = new ColumnBase("OpcjaNarzutu", "smallint", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("OpcjaNarzutu", opcjaNarzutuColumnBase); + var opcjaRabatuColumnBase = new ColumnBase("OpcjaRabatu", "smallint", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("OpcjaRabatu", opcjaRabatuColumnBase); + var param1ColumnBase = new ColumnBase("Param1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesAsortTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("Param1", param1ColumnBase); + var ukrytyNaBonownikuColumnBase = new ColumnBase("UkrytyNaBonowniku", "smallint", blinkBackofficeServicesPcmDbEntitiesAsortTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("UkrytyNaBonowniku", ukrytyNaBonownikuColumnBase); + var ukrytyNaPanelachColumnBase = new ColumnBase("UkrytyNaPanelach", "smallint", blinkBackofficeServicesPcmDbEntitiesAsortTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.Columns.Add("UkrytyNaPanelach", ukrytyNaPanelachColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Asort", blinkBackofficeServicesPcmDbEntitiesAsortTableBase); + var blinkBackofficeServicesPcmDbEntitiesAsortMappingBase = new TableMappingBase(asort, blinkBackofficeServicesPcmDbEntitiesAsortTableBase, true); + blinkBackofficeServicesPcmDbEntitiesAsortTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesAsortMappingBase, false); + defaultTableMappings1.Add(blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asIdColumnBase, asort.FindProperty("AsId")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)autoryzacjaColumnBase, asort.FindProperty("Autoryzacja")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bezAutoEtykietColumnBase, asort.FindProperty("BezAutoEtykiet")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrAsIdColumnBase, asort.FindProperty("CentrAsId")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hurtRabatColumnBase, asort.FindProperty("HurtRabat")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)marzaColumnBase, asort.FindProperty("Marza")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase, asort.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nocNarzutColumnBase, asort.FindProperty("NocNarzut")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaMarzyColumnBase, asort.FindProperty("OpcjaMarzy")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaNarzutuColumnBase, asort.FindProperty("OpcjaNarzutu")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaRabatuColumnBase, asort.FindProperty("OpcjaRabatu")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase, asort.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ukrytyNaBonownikuColumnBase, asort.FindProperty("UkrytyNaBonowniku")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ukrytyNaPanelachColumnBase, asort.FindProperty("UkrytyNaPanelach")!, blinkBackofficeServicesPcmDbEntitiesAsortMappingBase); + + var tableMappings1 = new List(); + asort.SetRuntimeAnnotation("Relational:TableMappings", tableMappings1); + var asortTable = new Table("Asort", null, relationalModel); + var asIdColumn = new Column("AsId", "numeric(9,0)", asortTable); + asortTable.Columns.Add("AsId", asIdColumn); + var autoryzacjaColumn = new Column("Autoryzacja", "smallint", asortTable) + { + IsNullable = true + }; + asortTable.Columns.Add("Autoryzacja", autoryzacjaColumn); + var bezAutoEtykietColumn = new Column("BezAutoEtykiet", "smallint", asortTable) + { + IsNullable = true + }; + asortTable.Columns.Add("BezAutoEtykiet", bezAutoEtykietColumn); + var centrAsIdColumn = new Column("CentrAsId", "numeric(9,0)", asortTable) + { + IsNullable = true + }; + asortTable.Columns.Add("CentrAsId", centrAsIdColumn); + var hurtRabatColumn = new Column("HurtRabat", "decimal(10,4)", asortTable); + asortTable.Columns.Add("HurtRabat", hurtRabatColumn); + var marzaColumn = new Column("Marza", "decimal(10,4)", asortTable); + asortTable.Columns.Add("Marza", marzaColumn); + var nazwaColumn = new Column("Nazwa", "varchar(40)", asortTable); + asortTable.Columns.Add("Nazwa", nazwaColumn); + var nocNarzutColumn = new Column("NocNarzut", "decimal(10,4)", asortTable); + asortTable.Columns.Add("NocNarzut", nocNarzutColumn); + var opcjaMarzyColumn = new Column("OpcjaMarzy", "smallint", asortTable); + asortTable.Columns.Add("OpcjaMarzy", opcjaMarzyColumn); + var opcjaNarzutuColumn = new Column("OpcjaNarzutu", "smallint", asortTable); + asortTable.Columns.Add("OpcjaNarzutu", opcjaNarzutuColumn); + var opcjaRabatuColumn = new Column("OpcjaRabatu", "smallint", asortTable); + asortTable.Columns.Add("OpcjaRabatu", opcjaRabatuColumn); + var param1Column = new Column("Param1", "decimal(15,4)", asortTable) + { + IsNullable = true + }; + asortTable.Columns.Add("Param1", param1Column); + var ukrytyNaBonownikuColumn = new Column("UkrytyNaBonowniku", "smallint", asortTable) + { + IsNullable = true + }; + asortTable.Columns.Add("UkrytyNaBonowniku", ukrytyNaBonownikuColumn); + var ukrytyNaPanelachColumn = new Column("UkrytyNaPanelach", "smallint", asortTable) + { + IsNullable = true + }; + asortTable.Columns.Add("UkrytyNaPanelach", ukrytyNaPanelachColumn); + var pK_ASORT = new UniqueConstraint("PK_ASORT", asortTable, new[] { asIdColumn }); + asortTable.PrimaryKey = pK_ASORT; + var pK_ASORTUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + new[] { "AsId" }); + pK_ASORT.MappedKeys.Add(pK_ASORTUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ASORTUc).Add(pK_ASORT); + asortTable.UniqueConstraints.Add("PK_ASORT", pK_ASORT); + var idx_CentrAsId = new TableIndex( + "idx_CentrAsId", asortTable, new[] { centrAsIdColumn }, false); + var idx_CentrAsIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + "idx_CentrAsId"); + idx_CentrAsId.MappedIndexes.Add(idx_CentrAsIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrAsIdIx).Add(idx_CentrAsId); + asortTable.Indexes.Add("idx_CentrAsId", idx_CentrAsId); + relationalModel.Tables.Add(("Asort", null), asortTable); + var asortTableMapping = new TableMapping(asort, asortTable, true); + asortTable.AddTypeMapping(asortTableMapping, false); + tableMappings1.Add(asortTableMapping); + RelationalModel.CreateColumnMapping(asIdColumn, asort.FindProperty("AsId")!, asortTableMapping); + RelationalModel.CreateColumnMapping(autoryzacjaColumn, asort.FindProperty("Autoryzacja")!, asortTableMapping); + RelationalModel.CreateColumnMapping(bezAutoEtykietColumn, asort.FindProperty("BezAutoEtykiet")!, asortTableMapping); + RelationalModel.CreateColumnMapping(centrAsIdColumn, asort.FindProperty("CentrAsId")!, asortTableMapping); + RelationalModel.CreateColumnMapping(hurtRabatColumn, asort.FindProperty("HurtRabat")!, asortTableMapping); + RelationalModel.CreateColumnMapping(marzaColumn, asort.FindProperty("Marza")!, asortTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn, asort.FindProperty("Nazwa")!, asortTableMapping); + RelationalModel.CreateColumnMapping(nocNarzutColumn, asort.FindProperty("NocNarzut")!, asortTableMapping); + RelationalModel.CreateColumnMapping(opcjaMarzyColumn, asort.FindProperty("OpcjaMarzy")!, asortTableMapping); + RelationalModel.CreateColumnMapping(opcjaNarzutuColumn, asort.FindProperty("OpcjaNarzutu")!, asortTableMapping); + RelationalModel.CreateColumnMapping(opcjaRabatuColumn, asort.FindProperty("OpcjaRabatu")!, asortTableMapping); + RelationalModel.CreateColumnMapping(param1Column, asort.FindProperty("Param1")!, asortTableMapping); + RelationalModel.CreateColumnMapping(ukrytyNaBonownikuColumn, asort.FindProperty("UkrytyNaBonowniku")!, asortTableMapping); + RelationalModel.CreateColumnMapping(ukrytyNaPanelachColumn, asort.FindProperty("UkrytyNaPanelach")!, asortTableMapping); + + var bank = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Bank")!; + + var defaultTableMappings2 = new List>(); + bank.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings2); + var blinkBackofficeServicesPcmDbEntitiesBankTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Bank", null, relationalModel); + var adresColumnBase = new ColumnBase("Adres", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesBankTableBase); + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("Adres", adresColumnBase); + var aktywnyColumnBase = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesBankTableBase); + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("Aktywny", aktywnyColumnBase); + var bankIdColumnBase = new ColumnBase("BankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesBankTableBase); + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("BankId", bankIdColumnBase); + var centrBankIdColumnBase = new ColumnBase("CentrBankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesBankTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("CentrBankId", centrBankIdColumnBase); + var nazwaColumnBase0 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesBankTableBase); + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("Nazwa", nazwaColumnBase0); + var nrRozliBankColumnBase = new ColumnBase("NrRozliBank", "varchar(8)", blinkBackofficeServicesPcmDbEntitiesBankTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("NrRozliBank", nrRozliBankColumnBase); + var sWIFTColumnBase = new ColumnBase("SWIFT", "varchar(11)", blinkBackofficeServicesPcmDbEntitiesBankTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("SWIFT", sWIFTColumnBase); + var zmianaColumnBase = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesBankTableBase); + blinkBackofficeServicesPcmDbEntitiesBankTableBase.Columns.Add("Zmiana", zmianaColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Bank", blinkBackofficeServicesPcmDbEntitiesBankTableBase); + var blinkBackofficeServicesPcmDbEntitiesBankMappingBase = new TableMappingBase(bank, blinkBackofficeServicesPcmDbEntitiesBankTableBase, true); + blinkBackofficeServicesPcmDbEntitiesBankTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesBankMappingBase, false); + defaultTableMappings2.Add(blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bankIdColumnBase, bank.FindProperty("BankId")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)adresColumnBase, bank.FindProperty("Adres")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase, bank.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrBankIdColumnBase, bank.FindProperty("CentrBankId")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase0, bank.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrRozliBankColumnBase, bank.FindProperty("NrRozliBank")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sWIFTColumnBase, bank.FindProperty("SWIFT")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase, bank.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesBankMappingBase); + + var tableMappings2 = new List(); + bank.SetRuntimeAnnotation("Relational:TableMappings", tableMappings2); + var bankTable = new Table("Bank", null, relationalModel); + var bankIdColumn = new Column("BankId", "numeric(9,0)", bankTable); + bankTable.Columns.Add("BankId", bankIdColumn); + var adresColumn = new Column("Adres", "varchar(255)", bankTable); + bankTable.Columns.Add("Adres", adresColumn); + var aktywnyColumn = new Column("Aktywny", "smallint", bankTable); + bankTable.Columns.Add("Aktywny", aktywnyColumn); + var centrBankIdColumn = new Column("CentrBankId", "numeric(9,0)", bankTable) + { + IsNullable = true + }; + bankTable.Columns.Add("CentrBankId", centrBankIdColumn); + var nazwaColumn0 = new Column("Nazwa", "varchar(255)", bankTable); + bankTable.Columns.Add("Nazwa", nazwaColumn0); + var nrRozliBankColumn = new Column("NrRozliBank", "varchar(8)", bankTable) + { + IsNullable = true + }; + bankTable.Columns.Add("NrRozliBank", nrRozliBankColumn); + var sWIFTColumn = new Column("SWIFT", "varchar(11)", bankTable) + { + IsNullable = true + }; + bankTable.Columns.Add("SWIFT", sWIFTColumn); + var zmianaColumn = new Column("Zmiana", "datetime", bankTable); + bankTable.Columns.Add("Zmiana", zmianaColumn); + var pK_Bank = new UniqueConstraint("PK_Bank", bankTable, new[] { bankIdColumn }); + bankTable.PrimaryKey = pK_Bank; + var pK_BankUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Bank", + new[] { "BankId" }); + pK_Bank.MappedKeys.Add(pK_BankUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_BankUc).Add(pK_Bank); + bankTable.UniqueConstraints.Add("PK_Bank", pK_Bank); + relationalModel.Tables.Add(("Bank", null), bankTable); + var bankTableMapping = new TableMapping(bank, bankTable, true); + bankTable.AddTypeMapping(bankTableMapping, false); + tableMappings2.Add(bankTableMapping); + RelationalModel.CreateColumnMapping(bankIdColumn, bank.FindProperty("BankId")!, bankTableMapping); + RelationalModel.CreateColumnMapping(adresColumn, bank.FindProperty("Adres")!, bankTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn, bank.FindProperty("Aktywny")!, bankTableMapping); + RelationalModel.CreateColumnMapping(centrBankIdColumn, bank.FindProperty("CentrBankId")!, bankTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn0, bank.FindProperty("Nazwa")!, bankTableMapping); + RelationalModel.CreateColumnMapping(nrRozliBankColumn, bank.FindProperty("NrRozliBank")!, bankTableMapping); + RelationalModel.CreateColumnMapping(sWIFTColumn, bank.FindProperty("SWIFT")!, bankTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn, bank.FindProperty("Zmiana")!, bankTableMapping); + + var blokada = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Blokada")!; + + var defaultTableMappings3 = new List>(); + blokada.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings3); + var blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Blokada", null, relationalModel); + var iloscColumnBase = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase); + blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase.Columns.Add("Ilosc", iloscColumnBase); + var magIdColumnBase = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase); + blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase.Columns.Add("MagId", magIdColumnBase); + var sesjaIdColumnBase = new ColumnBase("SesjaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase); + blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase.Columns.Add("SesjaId", sesjaIdColumnBase); + var towIdColumnBase = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase); + blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase.Columns.Add("TowId", towIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Blokada", blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase); + var blinkBackofficeServicesPcmDbEntitiesBlokadaMappingBase = new TableMappingBase(blokada, blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesBlokadaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesBlokadaMappingBase, false); + defaultTableMappings3.Add(blinkBackofficeServicesPcmDbEntitiesBlokadaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase, blokada.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesBlokadaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sesjaIdColumnBase, blokada.FindProperty("SesjaId")!, blinkBackofficeServicesPcmDbEntitiesBlokadaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase, blokada.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesBlokadaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase, blokada.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesBlokadaMappingBase); + + var tableMappings3 = new List(); + blokada.SetRuntimeAnnotation("Relational:TableMappings", tableMappings3); + var blokadaTable = new Table("Blokada", null, relationalModel); + var sesjaIdColumn = new Column("SesjaId", "numeric(9,0)", blokadaTable); + blokadaTable.Columns.Add("SesjaId", sesjaIdColumn); + var towIdColumn = new Column("TowId", "numeric(9,0)", blokadaTable); + blokadaTable.Columns.Add("TowId", towIdColumn); + var magIdColumn = new Column("MagId", "numeric(9,0)", blokadaTable); + blokadaTable.Columns.Add("MagId", magIdColumn); + var iloscColumn = new Column("Ilosc", "decimal(15,4)", blokadaTable); + blokadaTable.Columns.Add("Ilosc", iloscColumn); + var pK_BLOKADA = new UniqueConstraint("PK_BLOKADA", blokadaTable, new[] { sesjaIdColumn, towIdColumn, magIdColumn }); + blokadaTable.PrimaryKey = pK_BLOKADA; + var pK_BLOKADAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Blokada", + new[] { "SesjaId", "TowId", "MagId" }); + pK_BLOKADA.MappedKeys.Add(pK_BLOKADAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_BLOKADAUc).Add(pK_BLOKADA); + blokadaTable.UniqueConstraints.Add("PK_BLOKADA", pK_BLOKADA); + var idx_BlokTowMag = new TableIndex( + "idx_BlokTowMag", blokadaTable, new[] { towIdColumn, magIdColumn }, false); + var idx_BlokTowMagIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Blokada", + "idx_BlokTowMag"); + idx_BlokTowMag.MappedIndexes.Add(idx_BlokTowMagIx); + RelationalModel.GetOrCreateTableIndexes(idx_BlokTowMagIx).Add(idx_BlokTowMag); + blokadaTable.Indexes.Add("idx_BlokTowMag", idx_BlokTowMag); + relationalModel.Tables.Add(("Blokada", null), blokadaTable); + var blokadaTableMapping = new TableMapping(blokada, blokadaTable, true); + blokadaTable.AddTypeMapping(blokadaTableMapping, false); + tableMappings3.Add(blokadaTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn, blokada.FindProperty("MagId")!, blokadaTableMapping); + RelationalModel.CreateColumnMapping(sesjaIdColumn, blokada.FindProperty("SesjaId")!, blokadaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn, blokada.FindProperty("TowId")!, blokadaTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn, blokada.FindProperty("Ilosc")!, blokadaTableMapping); + + var centrStanZgody = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody")!; + + var defaultTableMappings4 = new List>(); + centrStanZgody.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings4); + var blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody", null, relationalModel); + var dataDecColumnBase = new ColumnBase("DataDec", "datetime", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.Columns.Add("DataDec", dataDecColumnBase); + var formaDecColumnBase = new ColumnBase("FormaDec", "smallint", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.Columns.Add("FormaDec", formaDecColumnBase); + var kiedyColumnBase = new ColumnBase("Kiedy", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.Columns.Add("Kiedy", kiedyColumnBase); + var kontrIdColumnBase = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.Columns.Add("KontrId", kontrIdColumnBase); + var statusColumnBase = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.Columns.Add("Status", statusColumnBase); + var wersjaColumnBase = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.Columns.Add("Wersja", wersjaColumnBase); + var zgIdColumnBase = new ColumnBase("ZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.Columns.Add("ZgId", zgIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody", blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase); + var blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase = new TableMappingBase(centrStanZgody, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase, false); + defaultTableMappings4.Add(blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase, centrStanZgody.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zgIdColumnBase, centrStanZgody.FindProperty("ZgId")!, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDecColumnBase, centrStanZgody.FindProperty("DataDec")!, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaDecColumnBase, centrStanZgody.FindProperty("FormaDec")!, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase, centrStanZgody.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase, centrStanZgody.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase, centrStanZgody.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesCentrStanZgodyMappingBase); + + var tableMappings4 = new List(); + centrStanZgody.SetRuntimeAnnotation("Relational:TableMappings", tableMappings4); + var centrStanZgodyTable = new Table("CentrStanZgody", null, relationalModel); + var kontrIdColumn = new Column("KontrId", "numeric(9,0)", centrStanZgodyTable); + centrStanZgodyTable.Columns.Add("KontrId", kontrIdColumn); + var zgIdColumn = new Column("ZgId", "numeric(9,0)", centrStanZgodyTable); + centrStanZgodyTable.Columns.Add("ZgId", zgIdColumn); + var dataDecColumn = new Column("DataDec", "datetime", centrStanZgodyTable) + { + IsNullable = true + }; + centrStanZgodyTable.Columns.Add("DataDec", dataDecColumn); + var formaDecColumn = new Column("FormaDec", "smallint", centrStanZgodyTable) + { + IsNullable = true + }; + centrStanZgodyTable.Columns.Add("FormaDec", formaDecColumn); + var kiedyColumn = new Column("Kiedy", "varchar(20)", centrStanZgodyTable); + centrStanZgodyTable.Columns.Add("Kiedy", kiedyColumn); + var statusColumn = new Column("Status", "smallint", centrStanZgodyTable); + centrStanZgodyTable.Columns.Add("Status", statusColumn); + var wersjaColumn = new Column("Wersja", "varchar(20)", centrStanZgodyTable) + { + IsNullable = true + }; + centrStanZgodyTable.Columns.Add("Wersja", wersjaColumn); + var pK_CENTRSTANZGODY = new UniqueConstraint("PK_CENTRSTANZGODY", centrStanZgodyTable, new[] { kontrIdColumn, zgIdColumn }); + centrStanZgodyTable.PrimaryKey = pK_CENTRSTANZGODY; + var pK_CENTRSTANZGODYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody", + new[] { "KontrId", "ZgId" }); + pK_CENTRSTANZGODY.MappedKeys.Add(pK_CENTRSTANZGODYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_CENTRSTANZGODYUc).Add(pK_CENTRSTANZGODY); + centrStanZgodyTable.UniqueConstraints.Add("PK_CENTRSTANZGODY", pK_CENTRSTANZGODY); + var idx_CESTZG_ZG = new TableIndex( + "idx_CESTZG_ZG", centrStanZgodyTable, new[] { zgIdColumn }, false); + var idx_CESTZG_ZGIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody", + "idx_CESTZG_ZG"); + idx_CESTZG_ZG.MappedIndexes.Add(idx_CESTZG_ZGIx); + RelationalModel.GetOrCreateTableIndexes(idx_CESTZG_ZGIx).Add(idx_CESTZG_ZG); + centrStanZgodyTable.Indexes.Add("idx_CESTZG_ZG", idx_CESTZG_ZG); + relationalModel.Tables.Add(("CentrStanZgody", null), centrStanZgodyTable); + var centrStanZgodyTableMapping = new TableMapping(centrStanZgody, centrStanZgodyTable, true); + centrStanZgodyTable.AddTypeMapping(centrStanZgodyTableMapping, false); + tableMappings4.Add(centrStanZgodyTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn, centrStanZgody.FindProperty("KontrId")!, centrStanZgodyTableMapping); + RelationalModel.CreateColumnMapping(zgIdColumn, centrStanZgody.FindProperty("ZgId")!, centrStanZgodyTableMapping); + RelationalModel.CreateColumnMapping(dataDecColumn, centrStanZgody.FindProperty("DataDec")!, centrStanZgodyTableMapping); + RelationalModel.CreateColumnMapping(formaDecColumn, centrStanZgody.FindProperty("FormaDec")!, centrStanZgodyTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn, centrStanZgody.FindProperty("Kiedy")!, centrStanZgodyTableMapping); + RelationalModel.CreateColumnMapping(statusColumn, centrStanZgody.FindProperty("Status")!, centrStanZgodyTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn, centrStanZgody.FindProperty("Wersja")!, centrStanZgodyTableMapping); + + var czas = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Czas")!; + + var defaultTableMappings5 = new List>(); + czas.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings5); + var blinkBackofficeServicesPcmDbEntitiesCzasTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Czas", null, relationalModel); + var czasIDColumnBase = new ColumnBase("CzasID", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase); + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("CzasID", czasIDColumnBase); + var dataColumnBase = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("Data", dataColumnBase); + var dzienColumnBase = new ColumnBase("Dzien", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("Dzien", dzienColumnBase); + var dzienMiesiacaColumnBase = new ColumnBase("DzienMiesiaca", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("DzienMiesiaca", dzienMiesiacaColumnBase); + var dzienTygodniaColumnBase = new ColumnBase("DzienTygodnia", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("DzienTygodnia", dzienTygodniaColumnBase); + var miesiacColumnBase = new ColumnBase("Miesiac", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("Miesiac", miesiacColumnBase); + var miesiacRokuColumnBase = new ColumnBase("MiesiacRoku", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("MiesiacRoku", miesiacRokuColumnBase); + var rokColumnBase = new ColumnBase("Rok", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("Rok", rokColumnBase); + var tydzienColumnBase = new ColumnBase("Tydzien", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("Tydzien", tydzienColumnBase); + var tydzienRokuColumnBase = new ColumnBase("TydzienRoku", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("TydzienRoku", tydzienRokuColumnBase); + var weekendColumnBase = new ColumnBase("Weekend", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesCzasTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.Columns.Add("Weekend", weekendColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Czas", blinkBackofficeServicesPcmDbEntitiesCzasTableBase); + var blinkBackofficeServicesPcmDbEntitiesCzasMappingBase = new TableMappingBase(czas, blinkBackofficeServicesPcmDbEntitiesCzasTableBase, true); + blinkBackofficeServicesPcmDbEntitiesCzasTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesCzasMappingBase, false); + defaultTableMappings5.Add(blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czasIDColumnBase, czas.FindProperty("CzasID")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase, czas.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase, czas.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienMiesiacaColumnBase, czas.FindProperty("DzienMiesiaca")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienTygodniaColumnBase, czas.FindProperty("DzienTygodnia")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)miesiacColumnBase, czas.FindProperty("Miesiac")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)miesiacRokuColumnBase, czas.FindProperty("MiesiacRoku")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rokColumnBase, czas.FindProperty("Rok")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tydzienColumnBase, czas.FindProperty("Tydzien")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tydzienRokuColumnBase, czas.FindProperty("TydzienRoku")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)weekendColumnBase, czas.FindProperty("Weekend")!, blinkBackofficeServicesPcmDbEntitiesCzasMappingBase); + + var tableMappings5 = new List(); + czas.SetRuntimeAnnotation("Relational:TableMappings", tableMappings5); + var czasTable = new Table("Czas", null, relationalModel); + var czasIDColumn = new Column("CzasID", "numeric(9,0)", czasTable); + czasTable.Columns.Add("CzasID", czasIDColumn); + var dataColumn = new Column("Data", "datetime", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("Data", dataColumn); + var dzienColumn = new Column("Dzien", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("Dzien", dzienColumn); + var dzienMiesiacaColumn = new Column("DzienMiesiaca", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("DzienMiesiaca", dzienMiesiacaColumn); + var dzienTygodniaColumn = new Column("DzienTygodnia", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("DzienTygodnia", dzienTygodniaColumn); + var miesiacColumn = new Column("Miesiac", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("Miesiac", miesiacColumn); + var miesiacRokuColumn = new Column("MiesiacRoku", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("MiesiacRoku", miesiacRokuColumn); + var rokColumn = new Column("Rok", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("Rok", rokColumn); + var tydzienColumn = new Column("Tydzien", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("Tydzien", tydzienColumn); + var tydzienRokuColumn = new Column("TydzienRoku", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("TydzienRoku", tydzienRokuColumn); + var weekendColumn = new Column("Weekend", "numeric(9,0)", czasTable) + { + IsNullable = true + }; + czasTable.Columns.Add("Weekend", weekendColumn); + var pK_CZAS = new UniqueConstraint("PK_CZAS", czasTable, new[] { czasIDColumn }); + czasTable.PrimaryKey = pK_CZAS; + var pK_CZASUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Czas", + new[] { "CzasID" }); + pK_CZAS.MappedKeys.Add(pK_CZASUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_CZASUc).Add(pK_CZAS); + czasTable.UniqueConstraints.Add("PK_CZAS", pK_CZAS); + relationalModel.Tables.Add(("Czas", null), czasTable); + var czasTableMapping = new TableMapping(czas, czasTable, true); + czasTable.AddTypeMapping(czasTableMapping, false); + tableMappings5.Add(czasTableMapping); + RelationalModel.CreateColumnMapping(czasIDColumn, czas.FindProperty("CzasID")!, czasTableMapping); + RelationalModel.CreateColumnMapping(dataColumn, czas.FindProperty("Data")!, czasTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn, czas.FindProperty("Dzien")!, czasTableMapping); + RelationalModel.CreateColumnMapping(dzienMiesiacaColumn, czas.FindProperty("DzienMiesiaca")!, czasTableMapping); + RelationalModel.CreateColumnMapping(dzienTygodniaColumn, czas.FindProperty("DzienTygodnia")!, czasTableMapping); + RelationalModel.CreateColumnMapping(miesiacColumn, czas.FindProperty("Miesiac")!, czasTableMapping); + RelationalModel.CreateColumnMapping(miesiacRokuColumn, czas.FindProperty("MiesiacRoku")!, czasTableMapping); + RelationalModel.CreateColumnMapping(rokColumn, czas.FindProperty("Rok")!, czasTableMapping); + RelationalModel.CreateColumnMapping(tydzienColumn, czas.FindProperty("Tydzien")!, czasTableMapping); + RelationalModel.CreateColumnMapping(tydzienRokuColumn, czas.FindProperty("TydzienRoku")!, czasTableMapping); + RelationalModel.CreateColumnMapping(weekendColumn, czas.FindProperty("Weekend")!, czasTableMapping); + + var definicjaKodu = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DefinicjaKodu")!; + + var defaultTableMappings6 = new List>(); + definicjaKodu.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings6); + var blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DefinicjaKodu", null, relationalModel); + var aktywnyColumnBase0 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("Aktywny", aktywnyColumnBase0); + var centrDKIdColumnBase = new ColumnBase("CentrDKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("CentrDKId", centrDKIdColumnBase); + var dKIdColumnBase = new ColumnBase("DKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("DKId", dKIdColumnBase); + var dataDoColumnBase = new ColumnBase("DataDo", "datetime", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("DataDo", dataDoColumnBase); + var dataOdColumnBase = new ColumnBase("DataOd", "datetime", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("DataOd", dataOdColumnBase); + var nazwaColumnBase1 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("Nazwa", nazwaColumnBase1); + var typColumnBase = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("Typ", typColumnBase); + var zmianaColumnBase0 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.Columns.Add("Zmiana", zmianaColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DefinicjaKodu", blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase); + var blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase = new TableMappingBase(definicjaKodu, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase, false); + defaultTableMappings6.Add(blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dKIdColumnBase, definicjaKodu.FindProperty("DKId")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase0, definicjaKodu.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrDKIdColumnBase, definicjaKodu.FindProperty("CentrDKId")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDoColumnBase, definicjaKodu.FindProperty("DataDo")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataOdColumnBase, definicjaKodu.FindProperty("DataOd")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase1, definicjaKodu.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase, definicjaKodu.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase0, definicjaKodu.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesDefinicjaKoduMappingBase); + + var tableMappings6 = new List(); + definicjaKodu.SetRuntimeAnnotation("Relational:TableMappings", tableMappings6); + var definicjaKoduTable = new Table("DefinicjaKodu", null, relationalModel); + var dKIdColumn = new Column("DKId", "numeric(9,0)", definicjaKoduTable); + definicjaKoduTable.Columns.Add("DKId", dKIdColumn); + var aktywnyColumn0 = new Column("Aktywny", "smallint", definicjaKoduTable); + definicjaKoduTable.Columns.Add("Aktywny", aktywnyColumn0); + var centrDKIdColumn = new Column("CentrDKId", "numeric(9,0)", definicjaKoduTable) + { + IsNullable = true + }; + definicjaKoduTable.Columns.Add("CentrDKId", centrDKIdColumn); + var dataDoColumn = new Column("DataDo", "datetime", definicjaKoduTable) + { + IsNullable = true + }; + definicjaKoduTable.Columns.Add("DataDo", dataDoColumn); + var dataOdColumn = new Column("DataOd", "datetime", definicjaKoduTable) + { + IsNullable = true + }; + definicjaKoduTable.Columns.Add("DataOd", dataOdColumn); + var nazwaColumn1 = new Column("Nazwa", "varchar(120)", definicjaKoduTable); + definicjaKoduTable.Columns.Add("Nazwa", nazwaColumn1); + var typColumn = new Column("Typ", "smallint", definicjaKoduTable); + definicjaKoduTable.Columns.Add("Typ", typColumn); + var zmianaColumn0 = new Column("Zmiana", "datetime", definicjaKoduTable); + definicjaKoduTable.Columns.Add("Zmiana", zmianaColumn0); + var pK_DEFKODU = new UniqueConstraint("PK_DEFKODU", definicjaKoduTable, new[] { dKIdColumn }); + definicjaKoduTable.PrimaryKey = pK_DEFKODU; + var pK_DEFKODUUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DefinicjaKodu", + new[] { "DKId" }); + pK_DEFKODU.MappedKeys.Add(pK_DEFKODUUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DEFKODUUc).Add(pK_DEFKODU); + definicjaKoduTable.UniqueConstraints.Add("PK_DEFKODU", pK_DEFKODU); + relationalModel.Tables.Add(("DefinicjaKodu", null), definicjaKoduTable); + var definicjaKoduTableMapping = new TableMapping(definicjaKodu, definicjaKoduTable, true); + definicjaKoduTable.AddTypeMapping(definicjaKoduTableMapping, false); + tableMappings6.Add(definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(dKIdColumn, definicjaKodu.FindProperty("DKId")!, definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn0, definicjaKodu.FindProperty("Aktywny")!, definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(centrDKIdColumn, definicjaKodu.FindProperty("CentrDKId")!, definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(dataDoColumn, definicjaKodu.FindProperty("DataDo")!, definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(dataOdColumn, definicjaKodu.FindProperty("DataOd")!, definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn1, definicjaKodu.FindProperty("Nazwa")!, definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(typColumn, definicjaKodu.FindProperty("Typ")!, definicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn0, definicjaKodu.FindProperty("Zmiana")!, definicjaKoduTableMapping); + + var dlugiZasob = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob")!; + + var defaultTableMappings7 = new List>(); + dlugiZasob.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings7); + var blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", null, relationalModel); + var aktywnyColumnBase1 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Aktywny", aktywnyColumnBase1); + var centrWersjaColumnBase = new ColumnBase("CentrWersja", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("CentrWersja", centrWersjaColumnBase); + var centrZasobIdColumnBase = new ColumnBase("CentrZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("CentrZasobId", centrZasobIdColumnBase); + var gUIDColumnBase = new ColumnBase("GUID", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("GUID", gUIDColumnBase); + var nazwaColumnBase2 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Nazwa", nazwaColumnBase2); + var opcjeColumnBase = new ColumnBase("Opcje", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Opcje", opcjeColumnBase); + var sciezkaColumnBase = new ColumnBase("Sciezka", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Sciezka", sciezkaColumnBase); + var skrot1ColumnBase = new ColumnBase("Skrot1", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Skrot1", skrot1ColumnBase); + var skrot2ColumnBase = new ColumnBase("Skrot2", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Skrot2", skrot2ColumnBase); + var skrot3ColumnBase = new ColumnBase("Skrot3", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Skrot3", skrot3ColumnBase); + var skrot4ColumnBase = new ColumnBase("Skrot4", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Skrot4", skrot4ColumnBase); + var typDanychColumnBase = new ColumnBase("TypDanych", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("TypDanych", typDanychColumnBase); + var wersjaColumnBase0 = new ColumnBase("Wersja", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Wersja", wersjaColumnBase0); + var zasobIdColumnBase = new ColumnBase("ZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("ZasobId", zasobIdColumnBase); + var zastosowanieColumnBase = new ColumnBase("Zastosowanie", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Zastosowanie", zastosowanieColumnBase); + var zmianaColumnBase1 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.Columns.Add("Zmiana", zmianaColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase); + var blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase = new TableMappingBase(dlugiZasob, blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase, false); + defaultTableMappings7.Add(blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zasobIdColumnBase, dlugiZasob.FindProperty("ZasobId")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase1, dlugiZasob.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrWersjaColumnBase, dlugiZasob.FindProperty("CentrWersja")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrZasobIdColumnBase, dlugiZasob.FindProperty("CentrZasobId")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)gUIDColumnBase, dlugiZasob.FindProperty("GUID")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase2, dlugiZasob.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjeColumnBase, dlugiZasob.FindProperty("Opcje")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sciezkaColumnBase, dlugiZasob.FindProperty("Sciezka")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot1ColumnBase, dlugiZasob.FindProperty("Skrot1")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot2ColumnBase, dlugiZasob.FindProperty("Skrot2")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot3ColumnBase, dlugiZasob.FindProperty("Skrot3")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot4ColumnBase, dlugiZasob.FindProperty("Skrot4")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typDanychColumnBase, dlugiZasob.FindProperty("TypDanych")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase0, dlugiZasob.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zastosowanieColumnBase, dlugiZasob.FindProperty("Zastosowanie")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase1, dlugiZasob.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobMappingBase); + + var tableMappings7 = new List(); + dlugiZasob.SetRuntimeAnnotation("Relational:TableMappings", tableMappings7); + var dlugiZasobTable = new Table("DlugiZasob", null, relationalModel); + var zasobIdColumn = new Column("ZasobId", "numeric(9,0)", dlugiZasobTable); + dlugiZasobTable.Columns.Add("ZasobId", zasobIdColumn); + var aktywnyColumn1 = new Column("Aktywny", "smallint", dlugiZasobTable); + dlugiZasobTable.Columns.Add("Aktywny", aktywnyColumn1); + var centrWersjaColumn = new Column("CentrWersja", "varchar(40)", dlugiZasobTable) + { + IsNullable = true + }; + dlugiZasobTable.Columns.Add("CentrWersja", centrWersjaColumn); + var centrZasobIdColumn = new Column("CentrZasobId", "numeric(9,0)", dlugiZasobTable) + { + IsNullable = true + }; + dlugiZasobTable.Columns.Add("CentrZasobId", centrZasobIdColumn); + var gUIDColumn = new Column("GUID", "varchar(120)", dlugiZasobTable) + { + IsNullable = true + }; + dlugiZasobTable.Columns.Add("GUID", gUIDColumn); + var nazwaColumn2 = new Column("Nazwa", "varchar(255)", dlugiZasobTable); + dlugiZasobTable.Columns.Add("Nazwa", nazwaColumn2); + var opcjeColumn = new Column("Opcje", "varchar(40)", dlugiZasobTable); + dlugiZasobTable.Columns.Add("Opcje", opcjeColumn); + var sciezkaColumn = new Column("Sciezka", "varchar(255)", dlugiZasobTable); + dlugiZasobTable.Columns.Add("Sciezka", sciezkaColumn); + var skrot1Column = new Column("Skrot1", "varchar(255)", dlugiZasobTable) + { + IsNullable = true + }; + dlugiZasobTable.Columns.Add("Skrot1", skrot1Column); + var skrot2Column = new Column("Skrot2", "varchar(255)", dlugiZasobTable) + { + IsNullable = true + }; + dlugiZasobTable.Columns.Add("Skrot2", skrot2Column); + var skrot3Column = new Column("Skrot3", "varchar(255)", dlugiZasobTable) + { + IsNullable = true + }; + dlugiZasobTable.Columns.Add("Skrot3", skrot3Column); + var skrot4Column = new Column("Skrot4", "varchar(255)", dlugiZasobTable) + { + IsNullable = true + }; + dlugiZasobTable.Columns.Add("Skrot4", skrot4Column); + var typDanychColumn = new Column("TypDanych", "varchar(20)", dlugiZasobTable); + dlugiZasobTable.Columns.Add("TypDanych", typDanychColumn); + var wersjaColumn0 = new Column("Wersja", "varchar(40)", dlugiZasobTable); + dlugiZasobTable.Columns.Add("Wersja", wersjaColumn0); + var zastosowanieColumn = new Column("Zastosowanie", "varchar(40)", dlugiZasobTable); + dlugiZasobTable.Columns.Add("Zastosowanie", zastosowanieColumn); + var zmianaColumn1 = new Column("Zmiana", "datetime", dlugiZasobTable); + dlugiZasobTable.Columns.Add("Zmiana", zmianaColumn1); + var pK_DlugiZasob = new UniqueConstraint("PK_DlugiZasob", dlugiZasobTable, new[] { zasobIdColumn }); + dlugiZasobTable.PrimaryKey = pK_DlugiZasob; + var pK_DlugiZasobUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + new[] { "ZasobId" }); + pK_DlugiZasob.MappedKeys.Add(pK_DlugiZasobUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DlugiZasobUc).Add(pK_DlugiZasob); + dlugiZasobTable.UniqueConstraints.Add("PK_DlugiZasob", pK_DlugiZasob); + var ixDlugiZasob_CentrZasobId = new TableIndex( + "IxDlugiZasob_CentrZasobId", dlugiZasobTable, new[] { centrZasobIdColumn }, false); + var ixDlugiZasob_CentrZasobIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + "IxDlugiZasob_CentrZasobId"); + ixDlugiZasob_CentrZasobId.MappedIndexes.Add(ixDlugiZasob_CentrZasobIdIx); + RelationalModel.GetOrCreateTableIndexes(ixDlugiZasob_CentrZasobIdIx).Add(ixDlugiZasob_CentrZasobId); + dlugiZasobTable.Indexes.Add("IxDlugiZasob_CentrZasobId", ixDlugiZasob_CentrZasobId); + var ixDlugiZasob_GUID = new TableIndex( + "IxDlugiZasob_GUID", dlugiZasobTable, new[] { gUIDColumn }, false); + var ixDlugiZasob_GUIDIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + "IxDlugiZasob_GUID"); + ixDlugiZasob_GUID.MappedIndexes.Add(ixDlugiZasob_GUIDIx); + RelationalModel.GetOrCreateTableIndexes(ixDlugiZasob_GUIDIx).Add(ixDlugiZasob_GUID); + dlugiZasobTable.Indexes.Add("IxDlugiZasob_GUID", ixDlugiZasob_GUID); + var ixDlugiZasob_Zmiana = new TableIndex( + "IxDlugiZasob_Zmiana", dlugiZasobTable, new[] { zmianaColumn1 }, false); + var ixDlugiZasob_ZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + "IxDlugiZasob_Zmiana"); + ixDlugiZasob_Zmiana.MappedIndexes.Add(ixDlugiZasob_ZmianaIx); + RelationalModel.GetOrCreateTableIndexes(ixDlugiZasob_ZmianaIx).Add(ixDlugiZasob_Zmiana); + dlugiZasobTable.Indexes.Add("IxDlugiZasob_Zmiana", ixDlugiZasob_Zmiana); + relationalModel.Tables.Add(("DlugiZasob", null), dlugiZasobTable); + var dlugiZasobTableMapping = new TableMapping(dlugiZasob, dlugiZasobTable, true); + dlugiZasobTable.AddTypeMapping(dlugiZasobTableMapping, false); + tableMappings7.Add(dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(zasobIdColumn, dlugiZasob.FindProperty("ZasobId")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn1, dlugiZasob.FindProperty("Aktywny")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(centrWersjaColumn, dlugiZasob.FindProperty("CentrWersja")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(centrZasobIdColumn, dlugiZasob.FindProperty("CentrZasobId")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(gUIDColumn, dlugiZasob.FindProperty("GUID")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn2, dlugiZasob.FindProperty("Nazwa")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(opcjeColumn, dlugiZasob.FindProperty("Opcje")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(sciezkaColumn, dlugiZasob.FindProperty("Sciezka")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(skrot1Column, dlugiZasob.FindProperty("Skrot1")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(skrot2Column, dlugiZasob.FindProperty("Skrot2")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(skrot3Column, dlugiZasob.FindProperty("Skrot3")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(skrot4Column, dlugiZasob.FindProperty("Skrot4")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(typDanychColumn, dlugiZasob.FindProperty("TypDanych")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn0, dlugiZasob.FindProperty("Wersja")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(zastosowanieColumn, dlugiZasob.FindProperty("Zastosowanie")!, dlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn1, dlugiZasob.FindProperty("Zmiana")!, dlugiZasobTableMapping); + + var dlugiZasobBin = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobBin")!; + + var defaultTableMappings8 = new List>(); + dlugiZasobBin.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings8); + var blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobBin", null, relationalModel); + var daneColumnBase = new ColumnBase("Dane", "varbinary(max)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase.Columns.Add("Dane", daneColumnBase); + var porcjaColumnBase = new ColumnBase("Porcja", "smallint", blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase.Columns.Add("Porcja", porcjaColumnBase); + var zasobIdColumnBase0 = new ColumnBase("ZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase.Columns.Add("ZasobId", zasobIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobBin", blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase); + var blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinMappingBase = new TableMappingBase(dlugiZasobBin, blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinMappingBase, false); + defaultTableMappings8.Add(blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)porcjaColumnBase, dlugiZasobBin.FindProperty("Porcja")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zasobIdColumnBase0, dlugiZasobBin.FindProperty("ZasobId")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)daneColumnBase, dlugiZasobBin.FindProperty("Dane")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobBinMappingBase); + + var tableMappings8 = new List(); + dlugiZasobBin.SetRuntimeAnnotation("Relational:TableMappings", tableMappings8); + var dlugiZasobBinTable = new Table("DlugiZasobBin", null, relationalModel); + var zasobIdColumn0 = new Column("ZasobId", "numeric(9,0)", dlugiZasobBinTable); + dlugiZasobBinTable.Columns.Add("ZasobId", zasobIdColumn0); + var porcjaColumn = new Column("Porcja", "smallint", dlugiZasobBinTable); + dlugiZasobBinTable.Columns.Add("Porcja", porcjaColumn); + var daneColumn = new Column("Dane", "varbinary(max)", dlugiZasobBinTable); + dlugiZasobBinTable.Columns.Add("Dane", daneColumn); + var pK_DlugiZasobBin = new UniqueConstraint("PK_DlugiZasobBin", dlugiZasobBinTable, new[] { zasobIdColumn0, porcjaColumn }); + dlugiZasobBinTable.PrimaryKey = pK_DlugiZasobBin; + var pK_DlugiZasobBinUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobBin", + new[] { "ZasobId", "Porcja" }); + pK_DlugiZasobBin.MappedKeys.Add(pK_DlugiZasobBinUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DlugiZasobBinUc).Add(pK_DlugiZasobBin); + dlugiZasobBinTable.UniqueConstraints.Add("PK_DlugiZasobBin", pK_DlugiZasobBin); + relationalModel.Tables.Add(("DlugiZasobBin", null), dlugiZasobBinTable); + var dlugiZasobBinTableMapping = new TableMapping(dlugiZasobBin, dlugiZasobBinTable, true); + dlugiZasobBinTable.AddTypeMapping(dlugiZasobBinTableMapping, false); + tableMappings8.Add(dlugiZasobBinTableMapping); + RelationalModel.CreateColumnMapping(porcjaColumn, dlugiZasobBin.FindProperty("Porcja")!, dlugiZasobBinTableMapping); + RelationalModel.CreateColumnMapping(zasobIdColumn0, dlugiZasobBin.FindProperty("ZasobId")!, dlugiZasobBinTableMapping); + RelationalModel.CreateColumnMapping(daneColumn, dlugiZasobBin.FindProperty("Dane")!, dlugiZasobBinTableMapping); + + var dlugiZasobTxt = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobTxt")!; + + var defaultTableMappings9 = new List>(); + dlugiZasobTxt.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings9); + var blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobTxt", null, relationalModel); + var daneColumnBase0 = new ColumnBase("Dane", "varchar(max)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase.Columns.Add("Dane", daneColumnBase0); + var porcjaColumnBase0 = new ColumnBase("Porcja", "smallint", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase.Columns.Add("Porcja", porcjaColumnBase0); + var zasobIdColumnBase1 = new ColumnBase("ZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase.Columns.Add("ZasobId", zasobIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobTxt", blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase); + var blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtMappingBase = new TableMappingBase(dlugiZasobTxt, blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtMappingBase, false); + defaultTableMappings9.Add(blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)porcjaColumnBase0, dlugiZasobTxt.FindProperty("Porcja")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zasobIdColumnBase1, dlugiZasobTxt.FindProperty("ZasobId")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)daneColumnBase0, dlugiZasobTxt.FindProperty("Dane")!, blinkBackofficeServicesPcmDbEntitiesDlugiZasobTxtMappingBase); + + var tableMappings9 = new List(); + dlugiZasobTxt.SetRuntimeAnnotation("Relational:TableMappings", tableMappings9); + var dlugiZasobTxtTable = new Table("DlugiZasobTxt", null, relationalModel); + var zasobIdColumn1 = new Column("ZasobId", "numeric(9,0)", dlugiZasobTxtTable); + dlugiZasobTxtTable.Columns.Add("ZasobId", zasobIdColumn1); + var porcjaColumn0 = new Column("Porcja", "smallint", dlugiZasobTxtTable); + dlugiZasobTxtTable.Columns.Add("Porcja", porcjaColumn0); + var daneColumn0 = new Column("Dane", "varchar(max)", dlugiZasobTxtTable); + dlugiZasobTxtTable.Columns.Add("Dane", daneColumn0); + var pK_DlugiZasobTxt = new UniqueConstraint("PK_DlugiZasobTxt", dlugiZasobTxtTable, new[] { zasobIdColumn1, porcjaColumn0 }); + dlugiZasobTxtTable.PrimaryKey = pK_DlugiZasobTxt; + var pK_DlugiZasobTxtUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobTxt", + new[] { "ZasobId", "Porcja" }); + pK_DlugiZasobTxt.MappedKeys.Add(pK_DlugiZasobTxtUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DlugiZasobTxtUc).Add(pK_DlugiZasobTxt); + dlugiZasobTxtTable.UniqueConstraints.Add("PK_DlugiZasobTxt", pK_DlugiZasobTxt); + relationalModel.Tables.Add(("DlugiZasobTxt", null), dlugiZasobTxtTable); + var dlugiZasobTxtTableMapping = new TableMapping(dlugiZasobTxt, dlugiZasobTxtTable, true); + dlugiZasobTxtTable.AddTypeMapping(dlugiZasobTxtTableMapping, false); + tableMappings9.Add(dlugiZasobTxtTableMapping); + RelationalModel.CreateColumnMapping(porcjaColumn0, dlugiZasobTxt.FindProperty("Porcja")!, dlugiZasobTxtTableMapping); + RelationalModel.CreateColumnMapping(zasobIdColumn1, dlugiZasobTxt.FindProperty("ZasobId")!, dlugiZasobTxtTableMapping); + RelationalModel.CreateColumnMapping(daneColumn0, dlugiZasobTxt.FindProperty("Dane")!, dlugiZasobTxtTableMapping); + + var dok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Dok")!; + + var defaultTableMappings10 = new List>(); + dok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings10); + var blinkBackofficeServicesPcmDbEntitiesDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Dok", null, relationalModel); + var aktywnyColumnBase2 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Aktywny", aktywnyColumnBase2); + var centrDokIdColumnBase = new ColumnBase("CentrDokId", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("CentrDokId", centrDokIdColumnBase); + var cenySpBruttoColumnBase = new ColumnBase("CenySpBrutto", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("CenySpBrutto", cenySpBruttoColumnBase); + var cenyZakBruttoColumnBase = new ColumnBase("CenyZakBrutto", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("CenyZakBrutto", cenyZakBruttoColumnBase); + var dataColumnBase0 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Data", dataColumnBase0); + var dataDodColumnBase = new ColumnBase("DataDod", "datetime", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("DataDod", dataDodColumnBase); + var dataPomColumnBase = new ColumnBase("DataPom", "datetime", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("DataPom", dataPomColumnBase); + var doZaplatyColumnBase = new ColumnBase("DoZaplaty", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("DoZaplaty", doZaplatyColumnBase); + var dokIdColumnBase = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("DokId", dokIdColumnBase); + var eksportFKColumnBase = new ColumnBase("EksportFK", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("EksportFK", eksportFKColumnBase); + var formaPlatColumnBase = new ColumnBase("FormaPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("FormaPlat", formaPlatColumnBase); + var kolejnyWDniuColumnBase = new ColumnBase("KolejnyWDniu", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("KolejnyWDniu", kolejnyWDniuColumnBase); + var kursColumnBase = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kurs", kursColumnBase); + var kwota1ColumnBase = new ColumnBase("Kwota1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota1", kwota1ColumnBase); + var kwota10ColumnBase = new ColumnBase("Kwota10", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota10", kwota10ColumnBase); + var kwota11ColumnBase = new ColumnBase("Kwota11", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota11", kwota11ColumnBase); + var kwota12ColumnBase = new ColumnBase("Kwota12", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota12", kwota12ColumnBase); + var kwota2ColumnBase = new ColumnBase("Kwota2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota2", kwota2ColumnBase); + var kwota3ColumnBase = new ColumnBase("Kwota3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota3", kwota3ColumnBase); + var kwota4ColumnBase = new ColumnBase("Kwota4", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota4", kwota4ColumnBase); + var kwota5ColumnBase = new ColumnBase("Kwota5", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota5", kwota5ColumnBase); + var kwota6ColumnBase = new ColumnBase("Kwota6", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota6", kwota6ColumnBase); + var kwota7ColumnBase = new ColumnBase("Kwota7", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota7", kwota7ColumnBase); + var kwota8ColumnBase = new ColumnBase("Kwota8", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota8", kwota8ColumnBase); + var kwota9ColumnBase = new ColumnBase("Kwota9", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Kwota9", kwota9ColumnBase); + var magIdColumnBase0 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("MagId", magIdColumnBase0); + var nettoColumnBase = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Netto", nettoColumnBase); + var nettoDetColumnBase = new ColumnBase("NettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NettoDet", nettoDetColumnBase); + var nettoDetUslugiColumnBase = new ColumnBase("NettoDetUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NettoDetUslugi", nettoDetUslugiColumnBase); + var nettoMagColumnBase = new ColumnBase("NettoMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NettoMag", nettoMagColumnBase); + var nettoMagUslugiColumnBase = new ColumnBase("NettoMagUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NettoMagUslugi", nettoMagUslugiColumnBase); + var nettoUslugiColumnBase = new ColumnBase("NettoUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NettoUslugi", nettoUslugiColumnBase); + var nrDokColumnBase = new ColumnBase("NrDok", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NrDok", nrDokColumnBase); + var nrKolejnyColumnBase = new ColumnBase("NrKolejny", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NrKolejny", nrKolejnyColumnBase); + var nrKolejnyMagColumnBase = new ColumnBase("NrKolejnyMag", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("NrKolejnyMag", nrKolejnyMagColumnBase); + var opcja1ColumnBase = new ColumnBase("Opcja1", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja1", opcja1ColumnBase); + var opcja2ColumnBase = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja2", opcja2ColumnBase); + var opcja3ColumnBase = new ColumnBase("Opcja3", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja3", opcja3ColumnBase); + var opcja4ColumnBase = new ColumnBase("Opcja4", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja4", opcja4ColumnBase); + var opcja5ColumnBase = new ColumnBase("Opcja5", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja5", opcja5ColumnBase); + var opcja6ColumnBase = new ColumnBase("Opcja6", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja6", opcja6ColumnBase); + var opcja7ColumnBase = new ColumnBase("Opcja7", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja7", opcja7ColumnBase); + var opcja8ColumnBase = new ColumnBase("Opcja8", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Opcja8", opcja8ColumnBase); + var param1ColumnBase0 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Param1", param1ColumnBase0); + var param2ColumnBase = new ColumnBase("Param2", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Param2", param2ColumnBase); + var param3ColumnBase = new ColumnBase("Param3", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Param3", param3ColumnBase); + var param4ColumnBase = new ColumnBase("Param4", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Param4", param4ColumnBase); + var param5ColumnBase = new ColumnBase("Param5", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Param5", param5ColumnBase); + var param6ColumnBase = new ColumnBase("Param6", "int", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Param6", param6ColumnBase); + var podatekColumnBase = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Podatek", podatekColumnBase); + var podatekDetColumnBase = new ColumnBase("PodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("PodatekDet", podatekDetColumnBase); + var podatekDetUslugiColumnBase = new ColumnBase("PodatekDetUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("PodatekDetUslugi", podatekDetUslugiColumnBase); + var podatekMagColumnBase = new ColumnBase("PodatekMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("PodatekMag", podatekMagColumnBase); + var podatekMagUslugiColumnBase = new ColumnBase("PodatekMagUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("PodatekMagUslugi", podatekMagUslugiColumnBase); + var podatekUslugiColumnBase = new ColumnBase("PodatekUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("PodatekUslugi", podatekUslugiColumnBase); + var poziomCenColumnBase = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("PoziomCen", poziomCenColumnBase); + var rabatProcColumnBase = new ColumnBase("RabatProc", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("RabatProc", rabatProcColumnBase); + var razemColumnBase = new ColumnBase("Razem", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Razem", razemColumnBase); + var terminPlatColumnBase = new ColumnBase("TerminPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("TerminPlat", terminPlatColumnBase); + var typDokColumnBase = new ColumnBase("TypDok", "smallint", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("TypDok", typDokColumnBase); + var uzIdColumnBase = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("UzId", uzIdColumnBase); + var walIdColumnBase = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("WalId", walIdColumnBase); + var walIdPlatnosciColumnBase = new ColumnBase("WalIdPlatnosci", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("WalIdPlatnosci", walIdPlatnosciColumnBase); + var zaplaconoColumnBase = new ColumnBase("Zaplacono", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Zaplacono", zaplaconoColumnBase); + var zaplaconoPodatekColumnBase = new ColumnBase("ZaplaconoPodatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("ZaplaconoPodatek", zaplaconoPodatekColumnBase); + var zaplaconoWKasieColumnBase = new ColumnBase("ZaplaconoWKasie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("ZaplaconoWKasie", zaplaconoWKasieColumnBase); + var zmianaColumnBase2 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("Zmiana", zmianaColumnBase2); + var zmianaPktColumnBase = new ColumnBase("ZmianaPkt", "datetime", blinkBackofficeServicesPcmDbEntitiesDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokTableBase.Columns.Add("ZmianaPkt", zmianaPktColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Dok", blinkBackofficeServicesPcmDbEntitiesDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokMappingBase = new TableMappingBase(dok, blinkBackofficeServicesPcmDbEntitiesDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokMappingBase, false); + defaultTableMappings10.Add(blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase, dok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase2, dok.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrDokIdColumnBase, dok.FindProperty("CentrDokId")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenySpBruttoColumnBase, dok.FindProperty("CenySpBrutto")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenyZakBruttoColumnBase, dok.FindProperty("CenyZakBrutto")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase0, dok.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDodColumnBase, dok.FindProperty("DataDod")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataPomColumnBase, dok.FindProperty("DataPom")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)doZaplatyColumnBase, dok.FindProperty("DoZaplaty")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)eksportFKColumnBase, dok.FindProperty("EksportFK")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaPlatColumnBase, dok.FindProperty("FormaPlat")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyWDniuColumnBase, dok.FindProperty("KolejnyWDniu")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase, dok.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota1ColumnBase, dok.FindProperty("Kwota1")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota10ColumnBase, dok.FindProperty("Kwota10")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota11ColumnBase, dok.FindProperty("Kwota11")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota12ColumnBase, dok.FindProperty("Kwota12")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota2ColumnBase, dok.FindProperty("Kwota2")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota3ColumnBase, dok.FindProperty("Kwota3")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota4ColumnBase, dok.FindProperty("Kwota4")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota5ColumnBase, dok.FindProperty("Kwota5")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota6ColumnBase, dok.FindProperty("Kwota6")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota7ColumnBase, dok.FindProperty("Kwota7")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota8ColumnBase, dok.FindProperty("Kwota8")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota9ColumnBase, dok.FindProperty("Kwota9")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase0, dok.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase, dok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetColumnBase, dok.FindProperty("NettoDet")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetUslugiColumnBase, dok.FindProperty("NettoDetUslugi")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagColumnBase, dok.FindProperty("NettoMag")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagUslugiColumnBase, dok.FindProperty("NettoMagUslugi")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoUslugiColumnBase, dok.FindProperty("NettoUslugi")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDokColumnBase, dok.FindProperty("NrDok")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrKolejnyColumnBase, dok.FindProperty("NrKolejny")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrKolejnyMagColumnBase, dok.FindProperty("NrKolejnyMag")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja1ColumnBase, dok.FindProperty("Opcja1")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase, dok.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja3ColumnBase, dok.FindProperty("Opcja3")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja4ColumnBase, dok.FindProperty("Opcja4")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja5ColumnBase, dok.FindProperty("Opcja5")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja6ColumnBase, dok.FindProperty("Opcja6")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja7ColumnBase, dok.FindProperty("Opcja7")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja8ColumnBase, dok.FindProperty("Opcja8")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase0, dok.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase, dok.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase, dok.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param4ColumnBase, dok.FindProperty("Param4")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param5ColumnBase, dok.FindProperty("Param5")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param6ColumnBase, dok.FindProperty("Param6")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase, dok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetColumnBase, dok.FindProperty("PodatekDet")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetUslugiColumnBase, dok.FindProperty("PodatekDetUslugi")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagColumnBase, dok.FindProperty("PodatekMag")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagUslugiColumnBase, dok.FindProperty("PodatekMagUslugi")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekUslugiColumnBase, dok.FindProperty("PodatekUslugi")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase, dok.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatProcColumnBase, dok.FindProperty("RabatProc")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)razemColumnBase, dok.FindProperty("Razem")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)terminPlatColumnBase, dok.FindProperty("TerminPlat")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typDokColumnBase, dok.FindProperty("TypDok")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase, dok.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase, dok.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdPlatnosciColumnBase, dok.FindProperty("WalIdPlatnosci")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zaplaconoColumnBase, dok.FindProperty("Zaplacono")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zaplaconoPodatekColumnBase, dok.FindProperty("ZaplaconoPodatek")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zaplaconoWKasieColumnBase, dok.FindProperty("ZaplaconoWKasie")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase2, dok.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaPktColumnBase, dok.FindProperty("ZmianaPkt")!, blinkBackofficeServicesPcmDbEntitiesDokMappingBase); + + var tableMappings10 = new List(); + dok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings10); + var dokTable = new Table("Dok", null, relationalModel); + var dokIdColumn = new Column("DokId", "numeric(9,0)", dokTable); + dokTable.Columns.Add("DokId", dokIdColumn); + var aktywnyColumn2 = new Column("Aktywny", "smallint", dokTable); + dokTable.Columns.Add("Aktywny", aktywnyColumn2); + var centrDokIdColumn = new Column("CentrDokId", "decimal(15,4)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("CentrDokId", centrDokIdColumn); + var cenySpBruttoColumn = new Column("CenySpBrutto", "smallint", dokTable); + dokTable.Columns.Add("CenySpBrutto", cenySpBruttoColumn); + var cenyZakBruttoColumn = new Column("CenyZakBrutto", "smallint", dokTable); + dokTable.Columns.Add("CenyZakBrutto", cenyZakBruttoColumn); + var dataColumn0 = new Column("Data", "datetime", dokTable); + dokTable.Columns.Add("Data", dataColumn0); + var dataDodColumn = new Column("DataDod", "datetime", dokTable); + dokTable.Columns.Add("DataDod", dataDodColumn); + var dataPomColumn = new Column("DataPom", "datetime", dokTable); + dokTable.Columns.Add("DataPom", dataPomColumn); + var doZaplatyColumn = new Column("DoZaplaty", "decimal(15,4)", dokTable); + dokTable.Columns.Add("DoZaplaty", doZaplatyColumn); + var eksportFKColumn = new Column("EksportFK", "smallint", dokTable); + dokTable.Columns.Add("EksportFK", eksportFKColumn); + var formaPlatColumn = new Column("FormaPlat", "smallint", dokTable); + dokTable.Columns.Add("FormaPlat", formaPlatColumn); + var kolejnyWDniuColumn = new Column("KolejnyWDniu", "int", dokTable); + dokTable.Columns.Add("KolejnyWDniu", kolejnyWDniuColumn); + var kursColumn = new Column("Kurs", "decimal(15,4)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Kurs", kursColumn); + var kwota1Column = new Column("Kwota1", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota1", kwota1Column); + var kwota10Column = new Column("Kwota10", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota10", kwota10Column); + var kwota11Column = new Column("Kwota11", "decimal(15,4)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Kwota11", kwota11Column); + var kwota12Column = new Column("Kwota12", "decimal(15,4)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Kwota12", kwota12Column); + var kwota2Column = new Column("Kwota2", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota2", kwota2Column); + var kwota3Column = new Column("Kwota3", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota3", kwota3Column); + var kwota4Column = new Column("Kwota4", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota4", kwota4Column); + var kwota5Column = new Column("Kwota5", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota5", kwota5Column); + var kwota6Column = new Column("Kwota6", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota6", kwota6Column); + var kwota7Column = new Column("Kwota7", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota7", kwota7Column); + var kwota8Column = new Column("Kwota8", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota8", kwota8Column); + var kwota9Column = new Column("Kwota9", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Kwota9", kwota9Column); + var magIdColumn0 = new Column("MagId", "numeric(9,0)", dokTable); + dokTable.Columns.Add("MagId", magIdColumn0); + var nettoColumn = new Column("Netto", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Netto", nettoColumn); + var nettoDetColumn = new Column("NettoDet", "decimal(15,4)", dokTable); + dokTable.Columns.Add("NettoDet", nettoDetColumn); + var nettoDetUslugiColumn = new Column("NettoDetUslugi", "decimal(15,4)", dokTable); + dokTable.Columns.Add("NettoDetUslugi", nettoDetUslugiColumn); + var nettoMagColumn = new Column("NettoMag", "decimal(15,4)", dokTable); + dokTable.Columns.Add("NettoMag", nettoMagColumn); + var nettoMagUslugiColumn = new Column("NettoMagUslugi", "decimal(15,4)", dokTable); + dokTable.Columns.Add("NettoMagUslugi", nettoMagUslugiColumn); + var nettoUslugiColumn = new Column("NettoUslugi", "decimal(15,4)", dokTable); + dokTable.Columns.Add("NettoUslugi", nettoUslugiColumn); + var nrDokColumn = new Column("NrDok", "varchar(60)", dokTable); + dokTable.Columns.Add("NrDok", nrDokColumn); + var nrKolejnyColumn = new Column("NrKolejny", "int", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("NrKolejny", nrKolejnyColumn); + var nrKolejnyMagColumn = new Column("NrKolejnyMag", "int", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("NrKolejnyMag", nrKolejnyMagColumn); + var opcja1Column = new Column("Opcja1", "smallint", dokTable); + dokTable.Columns.Add("Opcja1", opcja1Column); + var opcja2Column = new Column("Opcja2", "smallint", dokTable); + dokTable.Columns.Add("Opcja2", opcja2Column); + var opcja3Column = new Column("Opcja3", "smallint", dokTable); + dokTable.Columns.Add("Opcja3", opcja3Column); + var opcja4Column = new Column("Opcja4", "smallint", dokTable); + dokTable.Columns.Add("Opcja4", opcja4Column); + var opcja5Column = new Column("Opcja5", "smallint", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Opcja5", opcja5Column); + var opcja6Column = new Column("Opcja6", "smallint", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Opcja6", opcja6Column); + var opcja7Column = new Column("Opcja7", "smallint", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Opcja7", opcja7Column); + var opcja8Column = new Column("Opcja8", "smallint", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Opcja8", opcja8Column); + var param1Column0 = new Column("Param1", "int", dokTable); + dokTable.Columns.Add("Param1", param1Column0); + var param2Column = new Column("Param2", "int", dokTable); + dokTable.Columns.Add("Param2", param2Column); + var param3Column = new Column("Param3", "int", dokTable); + dokTable.Columns.Add("Param3", param3Column); + var param4Column = new Column("Param4", "int", dokTable); + dokTable.Columns.Add("Param4", param4Column); + var param5Column = new Column("Param5", "int", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Param5", param5Column); + var param6Column = new Column("Param6", "int", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("Param6", param6Column); + var podatekColumn = new Column("Podatek", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Podatek", podatekColumn); + var podatekDetColumn = new Column("PodatekDet", "decimal(15,4)", dokTable); + dokTable.Columns.Add("PodatekDet", podatekDetColumn); + var podatekDetUslugiColumn = new Column("PodatekDetUslugi", "decimal(15,4)", dokTable); + dokTable.Columns.Add("PodatekDetUslugi", podatekDetUslugiColumn); + var podatekMagColumn = new Column("PodatekMag", "decimal(15,4)", dokTable); + dokTable.Columns.Add("PodatekMag", podatekMagColumn); + var podatekMagUslugiColumn = new Column("PodatekMagUslugi", "decimal(15,4)", dokTable); + dokTable.Columns.Add("PodatekMagUslugi", podatekMagUslugiColumn); + var podatekUslugiColumn = new Column("PodatekUslugi", "decimal(15,4)", dokTable); + dokTable.Columns.Add("PodatekUslugi", podatekUslugiColumn); + var poziomCenColumn = new Column("PoziomCen", "smallint", dokTable); + dokTable.Columns.Add("PoziomCen", poziomCenColumn); + var rabatProcColumn = new Column("RabatProc", "decimal(10,4)", dokTable); + dokTable.Columns.Add("RabatProc", rabatProcColumn); + var razemColumn = new Column("Razem", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Razem", razemColumn); + var terminPlatColumn = new Column("TerminPlat", "smallint", dokTable); + dokTable.Columns.Add("TerminPlat", terminPlatColumn); + var typDokColumn = new Column("TypDok", "smallint", dokTable); + dokTable.Columns.Add("TypDok", typDokColumn); + var uzIdColumn = new Column("UzId", "numeric(9,0)", dokTable); + dokTable.Columns.Add("UzId", uzIdColumn); + var walIdColumn = new Column("WalId", "numeric(9,0)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("WalId", walIdColumn); + var walIdPlatnosciColumn = new Column("WalIdPlatnosci", "numeric(9,0)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("WalIdPlatnosci", walIdPlatnosciColumn); + var zaplaconoColumn = new Column("Zaplacono", "decimal(15,4)", dokTable); + dokTable.Columns.Add("Zaplacono", zaplaconoColumn); + var zaplaconoPodatekColumn = new Column("ZaplaconoPodatek", "decimal(15,4)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("ZaplaconoPodatek", zaplaconoPodatekColumn); + var zaplaconoWKasieColumn = new Column("ZaplaconoWKasie", "decimal(15,4)", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("ZaplaconoWKasie", zaplaconoWKasieColumn); + var zmianaColumn2 = new Column("Zmiana", "datetime", dokTable); + dokTable.Columns.Add("Zmiana", zmianaColumn2); + var zmianaPktColumn = new Column("ZmianaPkt", "datetime", dokTable) + { + IsNullable = true + }; + dokTable.Columns.Add("ZmianaPkt", zmianaPktColumn); + var pK_DOK = new UniqueConstraint("PK_DOK", dokTable, new[] { dokIdColumn }); + dokTable.PrimaryKey = pK_DOK; + var pK_DOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + pK_DOK.MappedKeys.Add(pK_DOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKUc).Add(pK_DOK); + dokTable.UniqueConstraints.Add("PK_DOK", pK_DOK); + var dokTypDok = new TableIndex( + "DokTypDok", dokTable, new[] { typDokColumn, dataColumn0, kolejnyWDniuColumn }, false); + var dokTypDokIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "DokTypDok"); + dokTypDok.MappedIndexes.Add(dokTypDokIx); + RelationalModel.GetOrCreateTableIndexes(dokTypDokIx).Add(dokTypDok); + dokTable.Indexes.Add("DokTypDok", dokTypDok); + var idx_DokCentrDokId = new TableIndex( + "idx_DokCentrDokId", dokTable, new[] { centrDokIdColumn }, false); + var idx_DokCentrDokIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokCentrDokId"); + idx_DokCentrDokId.MappedIndexes.Add(idx_DokCentrDokIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokCentrDokIdIx).Add(idx_DokCentrDokId); + dokTable.Indexes.Add("idx_DokCentrDokId", idx_DokCentrDokId); + var idx_DokDataKolejnyWDniu = new TableIndex( + "idx_DokDataKolejnyWDniu", dokTable, new[] { dataColumn0, kolejnyWDniuColumn }, false); + var idx_DokDataKolejnyWDniuIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokDataKolejnyWDniu"); + idx_DokDataKolejnyWDniu.MappedIndexes.Add(idx_DokDataKolejnyWDniuIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokDataKolejnyWDniuIx).Add(idx_DokDataKolejnyWDniu); + dokTable.Indexes.Add("idx_DokDataKolejnyWDniu", idx_DokDataKolejnyWDniu); + var idx_DokMagId = new TableIndex( + "idx_DokMagId", dokTable, new[] { magIdColumn0 }, false); + var idx_DokMagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokMagId"); + idx_DokMagId.MappedIndexes.Add(idx_DokMagIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokMagIdIx).Add(idx_DokMagId); + dokTable.Indexes.Add("idx_DokMagId", idx_DokMagId); + var idx_DokNrDok = new TableIndex( + "idx_DokNrDok", dokTable, new[] { nrDokColumn }, false); + var idx_DokNrDokIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokNrDok"); + idx_DokNrDok.MappedIndexes.Add(idx_DokNrDokIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokNrDokIx).Add(idx_DokNrDok); + dokTable.Indexes.Add("idx_DokNrDok", idx_DokNrDok); + var idx_DokUzId = new TableIndex( + "idx_DokUzId", dokTable, new[] { uzIdColumn }, false); + var idx_DokUzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokUzId"); + idx_DokUzId.MappedIndexes.Add(idx_DokUzIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokUzIdIx).Add(idx_DokUzId); + dokTable.Indexes.Add("idx_DokUzId", idx_DokUzId); + var idx_DokWal = new TableIndex( + "idx_DokWal", dokTable, new[] { walIdColumn }, false); + var idx_DokWalIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokWal"); + idx_DokWal.MappedIndexes.Add(idx_DokWalIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokWalIx).Add(idx_DokWal); + dokTable.Indexes.Add("idx_DokWal", idx_DokWal); + var idx_DokZmiana = new TableIndex( + "idx_DokZmiana", dokTable, new[] { zmianaColumn2 }, false); + var idx_DokZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokZmiana"); + idx_DokZmiana.MappedIndexes.Add(idx_DokZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokZmianaIx).Add(idx_DokZmiana); + dokTable.Indexes.Add("idx_DokZmiana", idx_DokZmiana); + var idx_DokZmianaPkt = new TableIndex( + "idx_DokZmianaPkt", dokTable, new[] { zmianaPktColumn }, false); + var idx_DokZmianaPktIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + "idx_DokZmianaPkt"); + idx_DokZmianaPkt.MappedIndexes.Add(idx_DokZmianaPktIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokZmianaPktIx).Add(idx_DokZmianaPkt); + dokTable.Indexes.Add("idx_DokZmianaPkt", idx_DokZmianaPkt); + var iX_Dok_WalIdPlatnosci = new TableIndex( + "IX_Dok_WalIdPlatnosci", dokTable, new[] { walIdPlatnosciColumn }, false); + var iX_Dok_WalIdPlatnosciIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "WalIdPlatnosci" }); + iX_Dok_WalIdPlatnosci.MappedIndexes.Add(iX_Dok_WalIdPlatnosciIx); + RelationalModel.GetOrCreateTableIndexes(iX_Dok_WalIdPlatnosciIx).Add(iX_Dok_WalIdPlatnosci); + dokTable.Indexes.Add("IX_Dok_WalIdPlatnosci", iX_Dok_WalIdPlatnosci); + relationalModel.Tables.Add(("Dok", null), dokTable); + var dokTableMapping = new TableMapping(dok, dokTable, true); + dokTable.AddTypeMapping(dokTableMapping, false); + tableMappings10.Add(dokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn, dok.FindProperty("DokId")!, dokTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn2, dok.FindProperty("Aktywny")!, dokTableMapping); + RelationalModel.CreateColumnMapping(centrDokIdColumn, dok.FindProperty("CentrDokId")!, dokTableMapping); + RelationalModel.CreateColumnMapping(cenySpBruttoColumn, dok.FindProperty("CenySpBrutto")!, dokTableMapping); + RelationalModel.CreateColumnMapping(cenyZakBruttoColumn, dok.FindProperty("CenyZakBrutto")!, dokTableMapping); + RelationalModel.CreateColumnMapping(dataColumn0, dok.FindProperty("Data")!, dokTableMapping); + RelationalModel.CreateColumnMapping(dataDodColumn, dok.FindProperty("DataDod")!, dokTableMapping); + RelationalModel.CreateColumnMapping(dataPomColumn, dok.FindProperty("DataPom")!, dokTableMapping); + RelationalModel.CreateColumnMapping(doZaplatyColumn, dok.FindProperty("DoZaplaty")!, dokTableMapping); + RelationalModel.CreateColumnMapping(eksportFKColumn, dok.FindProperty("EksportFK")!, dokTableMapping); + RelationalModel.CreateColumnMapping(formaPlatColumn, dok.FindProperty("FormaPlat")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kolejnyWDniuColumn, dok.FindProperty("KolejnyWDniu")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kursColumn, dok.FindProperty("Kurs")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota1Column, dok.FindProperty("Kwota1")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota10Column, dok.FindProperty("Kwota10")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota11Column, dok.FindProperty("Kwota11")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota12Column, dok.FindProperty("Kwota12")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota2Column, dok.FindProperty("Kwota2")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota3Column, dok.FindProperty("Kwota3")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota4Column, dok.FindProperty("Kwota4")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota5Column, dok.FindProperty("Kwota5")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota6Column, dok.FindProperty("Kwota6")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota7Column, dok.FindProperty("Kwota7")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota8Column, dok.FindProperty("Kwota8")!, dokTableMapping); + RelationalModel.CreateColumnMapping(kwota9Column, dok.FindProperty("Kwota9")!, dokTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn0, dok.FindProperty("MagId")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn, dok.FindProperty("Netto")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetColumn, dok.FindProperty("NettoDet")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetUslugiColumn, dok.FindProperty("NettoDetUslugi")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagColumn, dok.FindProperty("NettoMag")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagUslugiColumn, dok.FindProperty("NettoMagUslugi")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nettoUslugiColumn, dok.FindProperty("NettoUslugi")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nrDokColumn, dok.FindProperty("NrDok")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nrKolejnyColumn, dok.FindProperty("NrKolejny")!, dokTableMapping); + RelationalModel.CreateColumnMapping(nrKolejnyMagColumn, dok.FindProperty("NrKolejnyMag")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja1Column, dok.FindProperty("Opcja1")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column, dok.FindProperty("Opcja2")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja3Column, dok.FindProperty("Opcja3")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja4Column, dok.FindProperty("Opcja4")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja5Column, dok.FindProperty("Opcja5")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja6Column, dok.FindProperty("Opcja6")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja7Column, dok.FindProperty("Opcja7")!, dokTableMapping); + RelationalModel.CreateColumnMapping(opcja8Column, dok.FindProperty("Opcja8")!, dokTableMapping); + RelationalModel.CreateColumnMapping(param1Column0, dok.FindProperty("Param1")!, dokTableMapping); + RelationalModel.CreateColumnMapping(param2Column, dok.FindProperty("Param2")!, dokTableMapping); + RelationalModel.CreateColumnMapping(param3Column, dok.FindProperty("Param3")!, dokTableMapping); + RelationalModel.CreateColumnMapping(param4Column, dok.FindProperty("Param4")!, dokTableMapping); + RelationalModel.CreateColumnMapping(param5Column, dok.FindProperty("Param5")!, dokTableMapping); + RelationalModel.CreateColumnMapping(param6Column, dok.FindProperty("Param6")!, dokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn, dok.FindProperty("Podatek")!, dokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetColumn, dok.FindProperty("PodatekDet")!, dokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetUslugiColumn, dok.FindProperty("PodatekDetUslugi")!, dokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagColumn, dok.FindProperty("PodatekMag")!, dokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagUslugiColumn, dok.FindProperty("PodatekMagUslugi")!, dokTableMapping); + RelationalModel.CreateColumnMapping(podatekUslugiColumn, dok.FindProperty("PodatekUslugi")!, dokTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn, dok.FindProperty("PoziomCen")!, dokTableMapping); + RelationalModel.CreateColumnMapping(rabatProcColumn, dok.FindProperty("RabatProc")!, dokTableMapping); + RelationalModel.CreateColumnMapping(razemColumn, dok.FindProperty("Razem")!, dokTableMapping); + RelationalModel.CreateColumnMapping(terminPlatColumn, dok.FindProperty("TerminPlat")!, dokTableMapping); + RelationalModel.CreateColumnMapping(typDokColumn, dok.FindProperty("TypDok")!, dokTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn, dok.FindProperty("UzId")!, dokTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn, dok.FindProperty("WalId")!, dokTableMapping); + RelationalModel.CreateColumnMapping(walIdPlatnosciColumn, dok.FindProperty("WalIdPlatnosci")!, dokTableMapping); + RelationalModel.CreateColumnMapping(zaplaconoColumn, dok.FindProperty("Zaplacono")!, dokTableMapping); + RelationalModel.CreateColumnMapping(zaplaconoPodatekColumn, dok.FindProperty("ZaplaconoPodatek")!, dokTableMapping); + RelationalModel.CreateColumnMapping(zaplaconoWKasieColumn, dok.FindProperty("ZaplaconoWKasie")!, dokTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn2, dok.FindProperty("Zmiana")!, dokTableMapping); + RelationalModel.CreateColumnMapping(zmianaPktColumn, dok.FindProperty("ZmianaPkt")!, dokTableMapping); + + var dokDodKth = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DokDodKth")!; + + var defaultTableMappings11 = new List>(); + dokDodKth.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings11); + var blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DokDodKth", null, relationalModel); + var dokIdColumnBase0 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase); + blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase.Columns.Add("DokId", dokIdColumnBase0); + var kontrIdColumnBase0 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase); + blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase.Columns.Add("KontrId", kontrIdColumnBase0); + var kwotaColumnBase = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase.Columns.Add("Kwota", kwotaColumnBase); + var znaczenieColumnBase = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase); + blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase.Columns.Add("Znaczenie", znaczenieColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DokDodKth", blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokDodKthMappingBase = new TableMappingBase(dokDodKth, blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokDodKthTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokDodKthMappingBase, false); + defaultTableMappings11.Add(blinkBackofficeServicesPcmDbEntitiesDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase0, dokDodKth.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase, dokDodKth.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase0, dokDodKth.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase, dokDodKth.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesDokDodKthMappingBase); + + var tableMappings11 = new List(); + dokDodKth.SetRuntimeAnnotation("Relational:TableMappings", tableMappings11); + var dokDodKthTable = new Table("DokDodKth", null, relationalModel); + var dokIdColumn0 = new Column("DokId", "numeric(9,0)", dokDodKthTable); + dokDodKthTable.Columns.Add("DokId", dokIdColumn0); + var znaczenieColumn = new Column("Znaczenie", "smallint", dokDodKthTable); + dokDodKthTable.Columns.Add("Znaczenie", znaczenieColumn); + var kontrIdColumn0 = new Column("KontrId", "numeric(9,0)", dokDodKthTable); + dokDodKthTable.Columns.Add("KontrId", kontrIdColumn0); + var kwotaColumn = new Column("Kwota", "decimal(15,4)", dokDodKthTable) + { + IsNullable = true + }; + dokDodKthTable.Columns.Add("Kwota", kwotaColumn); + var pK_DOKDODKTH = new UniqueConstraint("PK_DOKDODKTH", dokDodKthTable, new[] { dokIdColumn0, znaczenieColumn }); + dokDodKthTable.PrimaryKey = pK_DOKDODKTH; + var pK_DOKDODKTHUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokDodKth", + new[] { "DokId", "Znaczenie" }); + pK_DOKDODKTH.MappedKeys.Add(pK_DOKDODKTHUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKDODKTHUc).Add(pK_DOKDODKTH); + dokDodKthTable.UniqueConstraints.Add("PK_DOKDODKTH", pK_DOKDODKTH); + var idx_DDKth = new TableIndex( + "idx_DDKth", dokDodKthTable, new[] { kontrIdColumn0 }, false); + var idx_DDKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokDodKth", + "idx_DDKth"); + idx_DDKth.MappedIndexes.Add(idx_DDKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_DDKthIx).Add(idx_DDKth); + dokDodKthTable.Indexes.Add("idx_DDKth", idx_DDKth); + relationalModel.Tables.Add(("DokDodKth", null), dokDodKthTable); + var dokDodKthTableMapping = new TableMapping(dokDodKth, dokDodKthTable, true); + dokDodKthTable.AddTypeMapping(dokDodKthTableMapping, false); + tableMappings11.Add(dokDodKthTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn0, dokDodKth.FindProperty("DokId")!, dokDodKthTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn, dokDodKth.FindProperty("Znaczenie")!, dokDodKthTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn0, dokDodKth.FindProperty("KontrId")!, dokDodKthTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn, dokDodKth.FindProperty("Kwota")!, dokDodKthTableMapping); + + var dokKasa = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DokKasa")!; + + var defaultTableMappings12 = new List>(); + dokKasa.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings12); + var blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DokKasa", null, relationalModel); + var dokIdColumnBase1 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase.Columns.Add("DokId", dokIdColumnBase1); + var kasaIdColumnBase = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase.Columns.Add("KasaId", kasaIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DokKasa", blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokKasaMappingBase = new TableMappingBase(dokKasa, blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokKasaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokKasaMappingBase, false); + defaultTableMappings12.Add(blinkBackofficeServicesPcmDbEntitiesDokKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase1, dokKasa.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase, dokKasa.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesDokKasaMappingBase); + + var tableMappings12 = new List(); + dokKasa.SetRuntimeAnnotation("Relational:TableMappings", tableMappings12); + var dokKasaTable = new Table("DokKasa", null, relationalModel); + var dokIdColumn1 = new Column("DokId", "numeric(9,0)", dokKasaTable); + dokKasaTable.Columns.Add("DokId", dokIdColumn1); + var kasaIdColumn = new Column("KasaId", "numeric(9,0)", dokKasaTable); + dokKasaTable.Columns.Add("KasaId", kasaIdColumn); + var pK_DOKKASA = new UniqueConstraint("PK_DOKKASA", dokKasaTable, new[] { dokIdColumn1 }); + dokKasaTable.PrimaryKey = pK_DOKKASA; + var pK_DOKKASAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKasa", + new[] { "DokId" }); + pK_DOKKASA.MappedKeys.Add(pK_DOKKASAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKKASAUc).Add(pK_DOKKASA); + dokKasaTable.UniqueConstraints.Add("PK_DOKKASA", pK_DOKKASA); + var idx_DokKasaId = new TableIndex( + "idx_DokKasaId", dokKasaTable, new[] { kasaIdColumn }, false); + var idx_DokKasaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKasa", + "idx_DokKasaId"); + idx_DokKasaId.MappedIndexes.Add(idx_DokKasaIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokKasaIdIx).Add(idx_DokKasaId); + dokKasaTable.Indexes.Add("idx_DokKasaId", idx_DokKasaId); + relationalModel.Tables.Add(("DokKasa", null), dokKasaTable); + var dokKasaTableMapping = new TableMapping(dokKasa, dokKasaTable, true); + dokKasaTable.AddTypeMapping(dokKasaTableMapping, false); + tableMappings12.Add(dokKasaTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn1, dokKasa.FindProperty("DokId")!, dokKasaTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn, dokKasa.FindProperty("KasaId")!, dokKasaTableMapping); + + var dokKontr = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DokKontr")!; + + var defaultTableMappings13 = new List>(); + dokKontr.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings13); + var blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DokKontr", null, relationalModel); + var dokIdColumnBase2 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase.Columns.Add("DokId", dokIdColumnBase2); + var kontrIdColumnBase1 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase.Columns.Add("KontrId", kontrIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DokKontr", blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokKontrMappingBase = new TableMappingBase(dokKontr, blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokKontrTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokKontrMappingBase, false); + defaultTableMappings13.Add(blinkBackofficeServicesPcmDbEntitiesDokKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase2, dokKontr.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase1, dokKontr.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesDokKontrMappingBase); + + var tableMappings13 = new List(); + dokKontr.SetRuntimeAnnotation("Relational:TableMappings", tableMappings13); + var dokKontrTable = new Table("DokKontr", null, relationalModel); + var dokIdColumn2 = new Column("DokId", "numeric(9,0)", dokKontrTable); + dokKontrTable.Columns.Add("DokId", dokIdColumn2); + var kontrIdColumn1 = new Column("KontrId", "numeric(9,0)", dokKontrTable); + dokKontrTable.Columns.Add("KontrId", kontrIdColumn1); + var pK_DOKKONTR = new UniqueConstraint("PK_DOKKONTR", dokKontrTable, new[] { dokIdColumn2 }); + dokKontrTable.PrimaryKey = pK_DOKKONTR; + var pK_DOKKONTRUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKontr", + new[] { "DokId" }); + pK_DOKKONTR.MappedKeys.Add(pK_DOKKONTRUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKKONTRUc).Add(pK_DOKKONTR); + dokKontrTable.UniqueConstraints.Add("PK_DOKKONTR", pK_DOKKONTR); + var idx_DokKontrId = new TableIndex( + "idx_DokKontrId", dokKontrTable, new[] { kontrIdColumn1 }, false); + var idx_DokKontrIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKontr", + "idx_DokKontrId"); + idx_DokKontrId.MappedIndexes.Add(idx_DokKontrIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokKontrIdIx).Add(idx_DokKontrId); + dokKontrTable.Indexes.Add("idx_DokKontrId", idx_DokKontrId); + relationalModel.Tables.Add(("DokKontr", null), dokKontrTable); + var dokKontrTableMapping = new TableMapping(dokKontr, dokKontrTable, true); + dokKontrTable.AddTypeMapping(dokKontrTableMapping, false); + tableMappings13.Add(dokKontrTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn2, dokKontr.FindProperty("DokId")!, dokKontrTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn1, dokKontr.FindProperty("KontrId")!, dokKontrTableMapping); + + var dokKurs = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DokKurs")!; + + var defaultTableMappings14 = new List>(); + dokKurs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings14); + var blinkBackofficeServicesPcmDbEntitiesDokKursTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DokKurs", null, relationalModel); + var dataColumnBase1 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesDokKursTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokKursTableBase.Columns.Add("Data", dataColumnBase1); + var dokIdColumnBase3 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokKursTableBase); + blinkBackofficeServicesPcmDbEntitiesDokKursTableBase.Columns.Add("DokId", dokIdColumnBase3); + var kursColumnBase0 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokKursTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokKursTableBase.Columns.Add("Kurs", kursColumnBase0); + var nrTabeliColumnBase = new ColumnBase("NrTabeli", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesDokKursTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokKursTableBase.Columns.Add("NrTabeli", nrTabeliColumnBase); + var walIdColumnBase0 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokKursTableBase); + blinkBackofficeServicesPcmDbEntitiesDokKursTableBase.Columns.Add("WalId", walIdColumnBase0); + var znaczenieColumnBase0 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesDokKursTableBase); + blinkBackofficeServicesPcmDbEntitiesDokKursTableBase.Columns.Add("Znaczenie", znaczenieColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DokKurs", blinkBackofficeServicesPcmDbEntitiesDokKursTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase = new TableMappingBase(dokKurs, blinkBackofficeServicesPcmDbEntitiesDokKursTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokKursTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase, false); + defaultTableMappings14.Add(blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase3, dokKurs.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase0, dokKurs.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase1, dokKurs.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase0, dokKurs.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrTabeliColumnBase, dokKurs.FindProperty("NrTabeli")!, blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase0, dokKurs.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesDokKursMappingBase); + + var tableMappings14 = new List(); + dokKurs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings14); + var dokKursTable = new Table("DokKurs", null, relationalModel); + var dokIdColumn3 = new Column("DokId", "numeric(9,0)", dokKursTable); + dokKursTable.Columns.Add("DokId", dokIdColumn3); + var znaczenieColumn0 = new Column("Znaczenie", "smallint", dokKursTable); + dokKursTable.Columns.Add("Znaczenie", znaczenieColumn0); + var dataColumn1 = new Column("Data", "datetime", dokKursTable) + { + IsNullable = true + }; + dokKursTable.Columns.Add("Data", dataColumn1); + var kursColumn0 = new Column("Kurs", "decimal(15,4)", dokKursTable) + { + IsNullable = true + }; + dokKursTable.Columns.Add("Kurs", kursColumn0); + var nrTabeliColumn = new Column("NrTabeli", "varchar(60)", dokKursTable) + { + IsNullable = true + }; + dokKursTable.Columns.Add("NrTabeli", nrTabeliColumn); + var walIdColumn0 = new Column("WalId", "numeric(9,0)", dokKursTable); + dokKursTable.Columns.Add("WalId", walIdColumn0); + var pK_DOKKURS = new UniqueConstraint("PK_DOKKURS", dokKursTable, new[] { dokIdColumn3, znaczenieColumn0 }); + dokKursTable.PrimaryKey = pK_DOKKURS; + var pK_DOKKURSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKurs", + new[] { "DokId", "Znaczenie" }); + pK_DOKKURS.MappedKeys.Add(pK_DOKKURSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKKURSUc).Add(pK_DOKKURS); + dokKursTable.UniqueConstraints.Add("PK_DOKKURS", pK_DOKKURS); + var idx_DokKursWal = new TableIndex( + "idx_DokKursWal", dokKursTable, new[] { walIdColumn0 }, false); + var idx_DokKursWalIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKurs", + "idx_DokKursWal"); + idx_DokKursWal.MappedIndexes.Add(idx_DokKursWalIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokKursWalIx).Add(idx_DokKursWal); + dokKursTable.Indexes.Add("idx_DokKursWal", idx_DokKursWal); + relationalModel.Tables.Add(("DokKurs", null), dokKursTable); + var dokKursTableMapping = new TableMapping(dokKurs, dokKursTable, true); + dokKursTable.AddTypeMapping(dokKursTableMapping, false); + tableMappings14.Add(dokKursTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn3, dokKurs.FindProperty("DokId")!, dokKursTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn0, dokKurs.FindProperty("Znaczenie")!, dokKursTableMapping); + RelationalModel.CreateColumnMapping(dataColumn1, dokKurs.FindProperty("Data")!, dokKursTableMapping); + RelationalModel.CreateColumnMapping(kursColumn0, dokKurs.FindProperty("Kurs")!, dokKursTableMapping); + RelationalModel.CreateColumnMapping(nrTabeliColumn, dokKurs.FindProperty("NrTabeli")!, dokKursTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn0, dokKurs.FindProperty("WalId")!, dokKursTableMapping); + + var dokPunkty = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DokPunkty")!; + + var defaultTableMappings15 = new List>(); + dokPunkty.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings15); + var blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DokPunkty", null, relationalModel); + var dokIdColumnBase4 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase.Columns.Add("DokId", dokIdColumnBase4); + var kiedyColumnBase0 = new ColumnBase("Kiedy", "datetime", blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase.Columns.Add("Kiedy", kiedyColumnBase0); + var kwotaColumnBase0 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase.Columns.Add("Kwota", kwotaColumnBase0); + var typColumnBase0 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase.Columns.Add("Typ", typColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DokPunkty", blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokPunktyMappingBase = new TableMappingBase(dokPunkty, blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokPunktyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokPunktyMappingBase, false); + defaultTableMappings15.Add(blinkBackofficeServicesPcmDbEntitiesDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase4, dokPunkty.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase0, dokPunkty.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase0, dokPunkty.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase0, dokPunkty.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesDokPunktyMappingBase); + + var tableMappings15 = new List(); + dokPunkty.SetRuntimeAnnotation("Relational:TableMappings", tableMappings15); + var dokPunktyTable = new Table("DokPunkty", null, relationalModel); + var dokIdColumn4 = new Column("DokId", "numeric(9,0)", dokPunktyTable); + dokPunktyTable.Columns.Add("DokId", dokIdColumn4); + var typColumn0 = new Column("Typ", "smallint", dokPunktyTable); + dokPunktyTable.Columns.Add("Typ", typColumn0); + var kiedyColumn0 = new Column("Kiedy", "datetime", dokPunktyTable); + dokPunktyTable.Columns.Add("Kiedy", kiedyColumn0); + var kwotaColumn0 = new Column("Kwota", "decimal(15,4)", dokPunktyTable); + dokPunktyTable.Columns.Add("Kwota", kwotaColumn0); + var pK_DOKPUNKTY = new UniqueConstraint("PK_DOKPUNKTY", dokPunktyTable, new[] { dokIdColumn4, typColumn0 }); + dokPunktyTable.PrimaryKey = pK_DOKPUNKTY; + var pK_DOKPUNKTYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokPunkty", + new[] { "DokId", "Typ" }); + pK_DOKPUNKTY.MappedKeys.Add(pK_DOKPUNKTYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKPUNKTYUc).Add(pK_DOKPUNKTY); + dokPunktyTable.UniqueConstraints.Add("PK_DOKPUNKTY", pK_DOKPUNKTY); + relationalModel.Tables.Add(("DokPunkty", null), dokPunktyTable); + var dokPunktyTableMapping = new TableMapping(dokPunkty, dokPunktyTable, true); + dokPunktyTable.AddTypeMapping(dokPunktyTableMapping, false); + tableMappings15.Add(dokPunktyTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn4, dokPunkty.FindProperty("DokId")!, dokPunktyTableMapping); + RelationalModel.CreateColumnMapping(typColumn0, dokPunkty.FindProperty("Typ")!, dokPunktyTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn0, dokPunkty.FindProperty("Kiedy")!, dokPunktyTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn0, dokPunkty.FindProperty("Kwota")!, dokPunktyTableMapping); + + var dokWBufPowiazanie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DokWBufPowiazanie")!; + + var defaultTableMappings16 = new List>(); + dokWBufPowiazanie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings16); + var blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DokWBufPowiazanie", null, relationalModel); + var dokIdColumnBase5 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase.Columns.Add("DokId", dokIdColumnBase5); + var idColumnBase = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase.Columns.Add("Id", idColumnBase); + var jakiePowColumnBase = new ColumnBase("JakiePow", "smallint", blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase.Columns.Add("JakiePow", jakiePowColumnBase); + var ktorePowColumnBase = new ColumnBase("KtorePow", "smallint", blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase.Columns.Add("KtorePow", ktorePowColumnBase); + var paramColumnBase = new ColumnBase("Param", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase.Columns.Add("Param", paramColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DokWBufPowiazanie", blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase = new TableMappingBase(dokWBufPowiazanie, blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase, false); + defaultTableMappings16.Add(blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase5, dokWBufPowiazanie.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jakiePowColumnBase, dokWBufPowiazanie.FindProperty("JakiePow")!, blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ktorePowColumnBase, dokWBufPowiazanie.FindProperty("KtorePow")!, blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase, dokWBufPowiazanie.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramColumnBase, dokWBufPowiazanie.FindProperty("Param")!, blinkBackofficeServicesPcmDbEntitiesDokWBufPowiazanieMappingBase); + + var tableMappings16 = new List(); + dokWBufPowiazanie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings16); + var dokWBufPowiazanieTable = new Table("DokWBufPowiazanie", null, relationalModel); + var dokIdColumn5 = new Column("DokId", "numeric(9,0)", dokWBufPowiazanieTable); + dokWBufPowiazanieTable.Columns.Add("DokId", dokIdColumn5); + var jakiePowColumn = new Column("JakiePow", "smallint", dokWBufPowiazanieTable); + dokWBufPowiazanieTable.Columns.Add("JakiePow", jakiePowColumn); + var ktorePowColumn = new Column("KtorePow", "smallint", dokWBufPowiazanieTable); + dokWBufPowiazanieTable.Columns.Add("KtorePow", ktorePowColumn); + var idColumn = new Column("Id", "numeric(9,0)", dokWBufPowiazanieTable) + { + IsNullable = true + }; + dokWBufPowiazanieTable.Columns.Add("Id", idColumn); + var paramColumn = new Column("Param", "varchar(255)", dokWBufPowiazanieTable) + { + IsNullable = true + }; + dokWBufPowiazanieTable.Columns.Add("Param", paramColumn); + var pK_DOKWBUFPOWIAZANIE = new UniqueConstraint("PK_DOKWBUFPOWIAZANIE", dokWBufPowiazanieTable, new[] { dokIdColumn5, jakiePowColumn, ktorePowColumn }); + dokWBufPowiazanieTable.PrimaryKey = pK_DOKWBUFPOWIAZANIE; + var pK_DOKWBUFPOWIAZANIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokWBufPowiazanie", + new[] { "DokId", "JakiePow", "KtorePow" }); + pK_DOKWBUFPOWIAZANIE.MappedKeys.Add(pK_DOKWBUFPOWIAZANIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKWBUFPOWIAZANIEUc).Add(pK_DOKWBUFPOWIAZANIE); + dokWBufPowiazanieTable.UniqueConstraints.Add("PK_DOKWBUFPOWIAZANIE", pK_DOKWBUFPOWIAZANIE); + var idx_DokWBufId = new TableIndex( + "idx_DokWBufId", dokWBufPowiazanieTable, new[] { idColumn }, false); + var idx_DokWBufIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokWBufPowiazanie", + "idx_DokWBufId"); + idx_DokWBufId.MappedIndexes.Add(idx_DokWBufIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_DokWBufIdIx).Add(idx_DokWBufId); + dokWBufPowiazanieTable.Indexes.Add("idx_DokWBufId", idx_DokWBufId); + relationalModel.Tables.Add(("DokWBufPowiazanie", null), dokWBufPowiazanieTable); + var dokWBufPowiazanieTableMapping = new TableMapping(dokWBufPowiazanie, dokWBufPowiazanieTable, true); + dokWBufPowiazanieTable.AddTypeMapping(dokWBufPowiazanieTableMapping, false); + tableMappings16.Add(dokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn5, dokWBufPowiazanie.FindProperty("DokId")!, dokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(jakiePowColumn, dokWBufPowiazanie.FindProperty("JakiePow")!, dokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(ktorePowColumn, dokWBufPowiazanie.FindProperty("KtorePow")!, dokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(idColumn, dokWBufPowiazanie.FindProperty("Id")!, dokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(paramColumn, dokWBufPowiazanie.FindProperty("Param")!, dokWBufPowiazanieTableMapping); + + var dokWaluta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DokWaluta")!; + + var defaultTableMappings17 = new List>(); + dokWaluta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings17); + var blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DokWaluta", null, relationalModel); + var dokIdColumnBase6 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("DokId", dokIdColumnBase6); + var dokKwotaColumnBase = new ColumnBase("DokKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("DokKwota", dokKwotaColumnBase); + var kursColumnBase1 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("Kurs", kursColumnBase1); + var walIdColumnBase1 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("WalId", walIdColumnBase1); + var walKwotaColumnBase = new ColumnBase("WalKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("WalKwota", walKwotaColumnBase); + var walNettoColumnBase = new ColumnBase("WalNetto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("WalNetto", walNettoColumnBase); + var walNettoDetColumnBase = new ColumnBase("WalNettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("WalNettoDet", walNettoDetColumnBase); + var walPodatekColumnBase = new ColumnBase("WalPodatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("WalPodatek", walPodatekColumnBase); + var walPodatekDetColumnBase = new ColumnBase("WalPodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.Columns.Add("WalPodatekDet", walPodatekDetColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DokWaluta", blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase); + var blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase = new TableMappingBase(dokWaluta, blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDokWalutaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase, false); + defaultTableMappings17.Add(blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase6, dokWaluta.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase1, dokWaluta.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokKwotaColumnBase, dokWaluta.FindProperty("DokKwota")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase1, dokWaluta.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walKwotaColumnBase, dokWaluta.FindProperty("WalKwota")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walNettoColumnBase, dokWaluta.FindProperty("WalNetto")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walNettoDetColumnBase, dokWaluta.FindProperty("WalNettoDet")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walPodatekColumnBase, dokWaluta.FindProperty("WalPodatek")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walPodatekDetColumnBase, dokWaluta.FindProperty("WalPodatekDet")!, blinkBackofficeServicesPcmDbEntitiesDokWalutaMappingBase); + + var tableMappings17 = new List(); + dokWaluta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings17); + var dokWalutaTable = new Table("DokWaluta", null, relationalModel); + var dokIdColumn6 = new Column("DokId", "numeric(9,0)", dokWalutaTable); + dokWalutaTable.Columns.Add("DokId", dokIdColumn6); + var walIdColumn1 = new Column("WalId", "numeric(9,0)", dokWalutaTable); + dokWalutaTable.Columns.Add("WalId", walIdColumn1); + var dokKwotaColumn = new Column("DokKwota", "decimal(15,4)", dokWalutaTable); + dokWalutaTable.Columns.Add("DokKwota", dokKwotaColumn); + var kursColumn1 = new Column("Kurs", "decimal(15,4)", dokWalutaTable); + dokWalutaTable.Columns.Add("Kurs", kursColumn1); + var walKwotaColumn = new Column("WalKwota", "decimal(15,4)", dokWalutaTable); + dokWalutaTable.Columns.Add("WalKwota", walKwotaColumn); + var walNettoColumn = new Column("WalNetto", "decimal(15,4)", dokWalutaTable) + { + IsNullable = true + }; + dokWalutaTable.Columns.Add("WalNetto", walNettoColumn); + var walNettoDetColumn = new Column("WalNettoDet", "decimal(15,4)", dokWalutaTable) + { + IsNullable = true + }; + dokWalutaTable.Columns.Add("WalNettoDet", walNettoDetColumn); + var walPodatekColumn = new Column("WalPodatek", "decimal(15,4)", dokWalutaTable) + { + IsNullable = true + }; + dokWalutaTable.Columns.Add("WalPodatek", walPodatekColumn); + var walPodatekDetColumn = new Column("WalPodatekDet", "decimal(15,4)", dokWalutaTable) + { + IsNullable = true + }; + dokWalutaTable.Columns.Add("WalPodatekDet", walPodatekDetColumn); + var pK_DOKWALUTA = new UniqueConstraint("PK_DOKWALUTA", dokWalutaTable, new[] { dokIdColumn6, walIdColumn1 }); + dokWalutaTable.PrimaryKey = pK_DOKWALUTA; + var pK_DOKWALUTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokWaluta", + new[] { "DokId", "WalId" }); + pK_DOKWALUTA.MappedKeys.Add(pK_DOKWALUTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOKWALUTAUc).Add(pK_DOKWALUTA); + dokWalutaTable.UniqueConstraints.Add("PK_DOKWALUTA", pK_DOKWALUTA); + var idx_WalDok = new TableIndex( + "idx_WalDok", dokWalutaTable, new[] { walIdColumn1 }, false); + var idx_WalDokIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokWaluta", + "idx_WalDok"); + idx_WalDok.MappedIndexes.Add(idx_WalDokIx); + RelationalModel.GetOrCreateTableIndexes(idx_WalDokIx).Add(idx_WalDok); + dokWalutaTable.Indexes.Add("idx_WalDok", idx_WalDok); + relationalModel.Tables.Add(("DokWaluta", null), dokWalutaTable); + var dokWalutaTableMapping = new TableMapping(dokWaluta, dokWalutaTable, true); + dokWalutaTable.AddTypeMapping(dokWalutaTableMapping, false); + tableMappings17.Add(dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn6, dokWaluta.FindProperty("DokId")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn1, dokWaluta.FindProperty("WalId")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(dokKwotaColumn, dokWaluta.FindProperty("DokKwota")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(kursColumn1, dokWaluta.FindProperty("Kurs")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walKwotaColumn, dokWaluta.FindProperty("WalKwota")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walNettoColumn, dokWaluta.FindProperty("WalNetto")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walNettoDetColumn, dokWaluta.FindProperty("WalNettoDet")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walPodatekColumn, dokWaluta.FindProperty("WalPodatek")!, dokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walPodatekDetColumn, dokWaluta.FindProperty("WalPodatekDet")!, dokWalutaTableMapping); + + var dostProd = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DostProd")!; + + var defaultTableMappings18 = new List>(); + dostProd.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings18); + var blinkBackofficeServicesPcmDbEntitiesDostProdTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DostProd", null, relationalModel); + var dostIdColumnBase = new ColumnBase("DostId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDostProdTableBase); + blinkBackofficeServicesPcmDbEntitiesDostProdTableBase.Columns.Add("DostId", dostIdColumnBase); + var prodIdColumnBase = new ColumnBase("ProdId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDostProdTableBase); + blinkBackofficeServicesPcmDbEntitiesDostProdTableBase.Columns.Add("ProdId", prodIdColumnBase); + var rabatProdColumnBase = new ColumnBase("RabatProd", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesDostProdTableBase); + blinkBackofficeServicesPcmDbEntitiesDostProdTableBase.Columns.Add("RabatProd", rabatProdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DostProd", blinkBackofficeServicesPcmDbEntitiesDostProdTableBase); + var blinkBackofficeServicesPcmDbEntitiesDostProdMappingBase = new TableMappingBase(dostProd, blinkBackofficeServicesPcmDbEntitiesDostProdTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDostProdTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDostProdMappingBase, false); + defaultTableMappings18.Add(blinkBackofficeServicesPcmDbEntitiesDostProdMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dostIdColumnBase, dostProd.FindProperty("DostId")!, blinkBackofficeServicesPcmDbEntitiesDostProdMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prodIdColumnBase, dostProd.FindProperty("ProdId")!, blinkBackofficeServicesPcmDbEntitiesDostProdMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatProdColumnBase, dostProd.FindProperty("RabatProd")!, blinkBackofficeServicesPcmDbEntitiesDostProdMappingBase); + + var tableMappings18 = new List(); + dostProd.SetRuntimeAnnotation("Relational:TableMappings", tableMappings18); + var dostProdTable = new Table("DostProd", null, relationalModel); + var dostIdColumn = new Column("DostId", "numeric(9,0)", dostProdTable); + dostProdTable.Columns.Add("DostId", dostIdColumn); + var prodIdColumn = new Column("ProdId", "numeric(9,0)", dostProdTable); + dostProdTable.Columns.Add("ProdId", prodIdColumn); + var rabatProdColumn = new Column("RabatProd", "decimal(10,4)", dostProdTable); + dostProdTable.Columns.Add("RabatProd", rabatProdColumn); + var pK_DOSTPROD = new UniqueConstraint("PK_DOSTPROD", dostProdTable, new[] { dostIdColumn, prodIdColumn }); + dostProdTable.PrimaryKey = pK_DOSTPROD; + var pK_DOSTPRODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DostProd", + new[] { "DostId", "ProdId" }); + pK_DOSTPROD.MappedKeys.Add(pK_DOSTPRODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOSTPRODUc).Add(pK_DOSTPROD); + dostProdTable.UniqueConstraints.Add("PK_DOSTPROD", pK_DOSTPROD); + var iX_DostProd_ProdId = new TableIndex( + "IX_DostProd_ProdId", dostProdTable, new[] { prodIdColumn }, false); + var iX_DostProd_ProdIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DostProd", + new[] { "ProdId" }); + iX_DostProd_ProdId.MappedIndexes.Add(iX_DostProd_ProdIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_DostProd_ProdIdIx).Add(iX_DostProd_ProdId); + dostProdTable.Indexes.Add("IX_DostProd_ProdId", iX_DostProd_ProdId); + relationalModel.Tables.Add(("DostProd", null), dostProdTable); + var dostProdTableMapping = new TableMapping(dostProd, dostProdTable, true); + dostProdTable.AddTypeMapping(dostProdTableMapping, false); + tableMappings18.Add(dostProdTableMapping); + RelationalModel.CreateColumnMapping(dostIdColumn, dostProd.FindProperty("DostId")!, dostProdTableMapping); + RelationalModel.CreateColumnMapping(prodIdColumn, dostProd.FindProperty("ProdId")!, dostProdTableMapping); + RelationalModel.CreateColumnMapping(rabatProdColumn, dostProd.FindProperty("RabatProd")!, dostProdTableMapping); + + var dostawca = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Dostawca")!; + + var defaultTableMappings19 = new List>(); + dostawca.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings19); + var blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Dostawca", null, relationalModel); + var cenaZakColumnBase = new ColumnBase("CenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase); + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.Columns.Add("CenaZak", cenaZakColumnBase); + var ileWZgrzewceColumnBase = new ColumnBase("IleWZgrzewce", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.Columns.Add("IleWZgrzewce", ileWZgrzewceColumnBase); + var kodColumnBase = new ColumnBase("Kod", "varchar(30)", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.Columns.Add("Kod", kodColumnBase); + var kontrIdColumnBase2 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase); + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.Columns.Add("KontrId", kontrIdColumnBase2); + var narzucanyColumnBase = new ColumnBase("Narzucany", "smallint", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.Columns.Add("Narzucany", narzucanyColumnBase); + var rabatOdWartColumnBase = new ColumnBase("RabatOdWart", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase); + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.Columns.Add("RabatOdWart", rabatOdWartColumnBase); + var towIdColumnBase0 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase); + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.Columns.Add("TowId", towIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Dostawca", blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase); + var blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase = new TableMappingBase(dostawca, blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDostawcaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase, false); + defaultTableMappings19.Add(blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase2, dostawca.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase0, dostawca.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakColumnBase, dostawca.FindProperty("CenaZak")!, blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWZgrzewceColumnBase, dostawca.FindProperty("IleWZgrzewce")!, blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase, dostawca.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzucanyColumnBase, dostawca.FindProperty("Narzucany")!, blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatOdWartColumnBase, dostawca.FindProperty("RabatOdWart")!, blinkBackofficeServicesPcmDbEntitiesDostawcaMappingBase); + + var tableMappings19 = new List(); + dostawca.SetRuntimeAnnotation("Relational:TableMappings", tableMappings19); + var dostawcaTable = new Table("Dostawca", null, relationalModel); + var kontrIdColumn2 = new Column("KontrId", "numeric(9,0)", dostawcaTable); + dostawcaTable.Columns.Add("KontrId", kontrIdColumn2); + var towIdColumn0 = new Column("TowId", "numeric(9,0)", dostawcaTable); + dostawcaTable.Columns.Add("TowId", towIdColumn0); + var cenaZakColumn = new Column("CenaZak", "decimal(15,4)", dostawcaTable); + dostawcaTable.Columns.Add("CenaZak", cenaZakColumn); + var ileWZgrzewceColumn = new Column("IleWZgrzewce", "decimal(15,4)", dostawcaTable) + { + IsNullable = true + }; + dostawcaTable.Columns.Add("IleWZgrzewce", ileWZgrzewceColumn); + var kodColumn = new Column("Kod", "varchar(30)", dostawcaTable) + { + IsNullable = true + }; + dostawcaTable.Columns.Add("Kod", kodColumn); + var narzucanyColumn = new Column("Narzucany", "smallint", dostawcaTable) + { + IsNullable = true + }; + dostawcaTable.Columns.Add("Narzucany", narzucanyColumn); + var rabatOdWartColumn = new Column("RabatOdWart", "decimal(10,4)", dostawcaTable); + dostawcaTable.Columns.Add("RabatOdWart", rabatOdWartColumn); + var pK_DOSTAWCA = new UniqueConstraint("PK_DOSTAWCA", dostawcaTable, new[] { kontrIdColumn2, towIdColumn0 }); + dostawcaTable.PrimaryKey = pK_DOSTAWCA; + var pK_DOSTAWCAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dostawca", + new[] { "KontrId", "TowId" }); + pK_DOSTAWCA.MappedKeys.Add(pK_DOSTAWCAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DOSTAWCAUc).Add(pK_DOSTAWCA); + dostawcaTable.UniqueConstraints.Add("PK_DOSTAWCA", pK_DOSTAWCA); + var idx_DostTowId = new TableIndex( + "idx_DostTowId", dostawcaTable, new[] { towIdColumn0 }, false); + var idx_DostTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dostawca", + "idx_DostTowId"); + idx_DostTowId.MappedIndexes.Add(idx_DostTowIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_DostTowIdIx).Add(idx_DostTowId); + dostawcaTable.Indexes.Add("idx_DostTowId", idx_DostTowId); + relationalModel.Tables.Add(("Dostawca", null), dostawcaTable); + var dostawcaTableMapping = new TableMapping(dostawca, dostawcaTable, true); + dostawcaTable.AddTypeMapping(dostawcaTableMapping, false); + tableMappings19.Add(dostawcaTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn2, dostawca.FindProperty("KontrId")!, dostawcaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn0, dostawca.FindProperty("TowId")!, dostawcaTableMapping); + RelationalModel.CreateColumnMapping(cenaZakColumn, dostawca.FindProperty("CenaZak")!, dostawcaTableMapping); + RelationalModel.CreateColumnMapping(ileWZgrzewceColumn, dostawca.FindProperty("IleWZgrzewce")!, dostawcaTableMapping); + RelationalModel.CreateColumnMapping(kodColumn, dostawca.FindProperty("Kod")!, dostawcaTableMapping); + RelationalModel.CreateColumnMapping(narzucanyColumn, dostawca.FindProperty("Narzucany")!, dostawcaTableMapping); + RelationalModel.CreateColumnMapping(rabatOdWartColumn, dostawca.FindProperty("RabatOdWart")!, dostawcaTableMapping); + + var dzienRozl = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DzienRozl")!; + + var defaultTableMappings20 = new List>(); + dzienRozl.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings20); + var blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DzienRozl", null, relationalModel); + var dzienColumnBase0 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase); + blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase.Columns.Add("Dzien", dzienColumnBase0); + var statusColumnBase0 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase); + blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase.Columns.Add("Status", statusColumnBase0); + var zmianaColumnBase3 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase); + blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase.Columns.Add("Zmiana", zmianaColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DzienRozl", blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase); + var blinkBackofficeServicesPcmDbEntitiesDzienRozlMappingBase = new TableMappingBase(dzienRozl, blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDzienRozlTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDzienRozlMappingBase, false); + defaultTableMappings20.Add(blinkBackofficeServicesPcmDbEntitiesDzienRozlMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase0, dzienRozl.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesDzienRozlMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase0, dzienRozl.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesDzienRozlMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase3, dzienRozl.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesDzienRozlMappingBase); + + var tableMappings20 = new List(); + dzienRozl.SetRuntimeAnnotation("Relational:TableMappings", tableMappings20); + var dzienRozlTable = new Table("DzienRozl", null, relationalModel); + var dzienColumn0 = new Column("Dzien", "datetime", dzienRozlTable); + dzienRozlTable.Columns.Add("Dzien", dzienColumn0); + var statusColumn0 = new Column("Status", "smallint", dzienRozlTable); + dzienRozlTable.Columns.Add("Status", statusColumn0); + var zmianaColumn3 = new Column("Zmiana", "datetime", dzienRozlTable); + dzienRozlTable.Columns.Add("Zmiana", zmianaColumn3); + var pK_DZIENROZL = new UniqueConstraint("PK_DZIENROZL", dzienRozlTable, new[] { dzienColumn0 }); + dzienRozlTable.PrimaryKey = pK_DZIENROZL; + var pK_DZIENROZLUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozl", + new[] { "Dzien" }); + pK_DZIENROZL.MappedKeys.Add(pK_DZIENROZLUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DZIENROZLUc).Add(pK_DZIENROZL); + dzienRozlTable.UniqueConstraints.Add("PK_DZIENROZL", pK_DZIENROZL); + var idx_DzienZmiana = new TableIndex( + "idx_DzienZmiana", dzienRozlTable, new[] { zmianaColumn3 }, false); + var idx_DzienZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozl", + "idx_DzienZmiana"); + idx_DzienZmiana.MappedIndexes.Add(idx_DzienZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_DzienZmianaIx).Add(idx_DzienZmiana); + dzienRozlTable.Indexes.Add("idx_DzienZmiana", idx_DzienZmiana); + relationalModel.Tables.Add(("DzienRozl", null), dzienRozlTable); + var dzienRozlTableMapping = new TableMapping(dzienRozl, dzienRozlTable, true); + dzienRozlTable.AddTypeMapping(dzienRozlTableMapping, false); + tableMappings20.Add(dzienRozlTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn0, dzienRozl.FindProperty("Dzien")!, dzienRozlTableMapping); + RelationalModel.CreateColumnMapping(statusColumn0, dzienRozl.FindProperty("Status")!, dzienRozlTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn3, dzienRozl.FindProperty("Zmiana")!, dzienRozlTableMapping); + + var dzienRozlParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.DzienRozlParam")!; + + var defaultTableMappings21 = new List>(); + dzienRozlParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings21); + var blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.DzienRozlParam", null, relationalModel); + var dzienColumnBase1 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase); + blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase.Columns.Add("Dzien", dzienColumnBase1); + var wartoscColumnBase = new ColumnBase("Wartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase); + blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase.Columns.Add("Wartosc", wartoscColumnBase); + var znaczenieColumnBase1 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase); + blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase.Columns.Add("Znaczenie", znaczenieColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.DzienRozlParam", blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesDzienRozlParamMappingBase = new TableMappingBase(dzienRozlParam, blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesDzienRozlParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesDzienRozlParamMappingBase, false); + defaultTableMappings21.Add(blinkBackofficeServicesPcmDbEntitiesDzienRozlParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase1, dzienRozlParam.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesDzienRozlParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase1, dzienRozlParam.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesDzienRozlParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase, dzienRozlParam.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesDzienRozlParamMappingBase); + + var tableMappings21 = new List(); + dzienRozlParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings21); + var dzienRozlParamTable = new Table("DzienRozlParam", null, relationalModel); + var dzienColumn1 = new Column("Dzien", "datetime", dzienRozlParamTable); + dzienRozlParamTable.Columns.Add("Dzien", dzienColumn1); + var znaczenieColumn1 = new Column("Znaczenie", "smallint", dzienRozlParamTable); + dzienRozlParamTable.Columns.Add("Znaczenie", znaczenieColumn1); + var wartoscColumn = new Column("Wartosc", "varchar(255)", dzienRozlParamTable); + dzienRozlParamTable.Columns.Add("Wartosc", wartoscColumn); + var pK_DZIENROZLPARAM = new UniqueConstraint("PK_DZIENROZLPARAM", dzienRozlParamTable, new[] { dzienColumn1, znaczenieColumn1 }); + dzienRozlParamTable.PrimaryKey = pK_DZIENROZLPARAM; + var pK_DZIENROZLPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozlParam", + new[] { "Dzien", "Znaczenie" }); + pK_DZIENROZLPARAM.MappedKeys.Add(pK_DZIENROZLPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DZIENROZLPARAMUc).Add(pK_DZIENROZLPARAM); + dzienRozlParamTable.UniqueConstraints.Add("PK_DZIENROZLPARAM", pK_DZIENROZLPARAM); + relationalModel.Tables.Add(("DzienRozlParam", null), dzienRozlParamTable); + var dzienRozlParamTableMapping = new TableMapping(dzienRozlParam, dzienRozlParamTable, true); + dzienRozlParamTable.AddTypeMapping(dzienRozlParamTableMapping, false); + tableMappings21.Add(dzienRozlParamTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn1, dzienRozlParam.FindProperty("Dzien")!, dzienRozlParamTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn1, dzienRozlParam.FindProperty("Znaczenie")!, dzienRozlParamTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn, dzienRozlParam.FindProperty("Wartosc")!, dzienRozlParamTableMapping); + + var email = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Email")!; + + var defaultTableMappings22 = new List>(); + email.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings22); + var blinkBackofficeServicesPcmDbEntitiesEmailTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Email", null, relationalModel); + var aktywnyColumnBase3 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Aktywny", aktywnyColumnBase3); + var authColumnBase = new ColumnBase("Auth", "smallint", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Auth", authColumnBase); + var emIdColumnBase = new ColumnBase("EmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("EmId", emIdColumnBase); + var hasloColumnBase = new ColumnBase("Haslo", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Haslo", hasloColumnBase); + var hostColumnBase = new ColumnBase("Host", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Host", hostColumnBase); + var kopiaColumnBase = new ColumnBase("Kopia", "smallint", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Kopia", kopiaColumnBase); + var kopiaEmailColumnBase = new ColumnBase("KopiaEmail", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("KopiaEmail", kopiaEmailColumnBase); + var loginColumnBase = new ColumnBase("Login", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Login", loginColumnBase); + var nadawcaColumnBase = new ColumnBase("Nadawca", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Nadawca", nadawcaColumnBase); + var nazwaColumnBase3 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Nazwa", nazwaColumnBase3); + var portColumnBase = new ColumnBase("Port", "varchar(5)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Port", portColumnBase); + var tEDIdColumnBase = new ColumnBase("TEDId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("TEDId", tEDIdColumnBase); + var tEHRIdColumnBase = new ColumnBase("TEHRId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("TEHRId", tEHRIdColumnBase); + var tERIdColumnBase = new ColumnBase("TERId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("TERId", tERIdColumnBase); + var tEWIdColumnBase = new ColumnBase("TEWId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("TEWId", tEWIdColumnBase); + var tEZIIdColumnBase = new ColumnBase("TEZIId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("TEZIId", tEZIIdColumnBase); + var tLSColumnBase = new ColumnBase("TLS", "smallint", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("TLS", tLSColumnBase); + var tLSVerColumnBase = new ColumnBase("TLSVer", "smallint", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("TLSVer", tLSVerColumnBase); + var uzIdColumnBase0 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("UzId", uzIdColumnBase0); + var zmianaColumnBase4 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.Columns.Add("Zmiana", zmianaColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Email", blinkBackofficeServicesPcmDbEntitiesEmailTableBase); + var blinkBackofficeServicesPcmDbEntitiesEmailMappingBase = new TableMappingBase(email, blinkBackofficeServicesPcmDbEntitiesEmailTableBase, true); + blinkBackofficeServicesPcmDbEntitiesEmailTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesEmailMappingBase, false); + defaultTableMappings22.Add(blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)emIdColumnBase, email.FindProperty("EmId")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase3, email.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)authColumnBase, email.FindProperty("Auth")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloColumnBase, email.FindProperty("Haslo")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hostColumnBase, email.FindProperty("Host")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kopiaColumnBase, email.FindProperty("Kopia")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kopiaEmailColumnBase, email.FindProperty("KopiaEmail")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)loginColumnBase, email.FindProperty("Login")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nadawcaColumnBase, email.FindProperty("Nadawca")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase3, email.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)portColumnBase, email.FindProperty("Port")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tEDIdColumnBase, email.FindProperty("TEDId")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tEHRIdColumnBase, email.FindProperty("TEHRId")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tERIdColumnBase, email.FindProperty("TERId")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tEWIdColumnBase, email.FindProperty("TEWId")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tEZIIdColumnBase, email.FindProperty("TEZIId")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tLSColumnBase, email.FindProperty("TLS")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tLSVerColumnBase, email.FindProperty("TLSVer")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase0, email.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase4, email.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesEmailMappingBase); + + var tableMappings22 = new List(); + email.SetRuntimeAnnotation("Relational:TableMappings", tableMappings22); + var emailTable = new Table("Email", null, relationalModel); + var emIdColumn = new Column("EmId", "numeric(9,0)", emailTable); + emailTable.Columns.Add("EmId", emIdColumn); + var aktywnyColumn3 = new Column("Aktywny", "smallint", emailTable); + emailTable.Columns.Add("Aktywny", aktywnyColumn3); + var authColumn = new Column("Auth", "smallint", emailTable); + emailTable.Columns.Add("Auth", authColumn); + var hasloColumn = new Column("Haslo", "varchar(255)", emailTable); + emailTable.Columns.Add("Haslo", hasloColumn); + var hostColumn = new Column("Host", "varchar(120)", emailTable); + emailTable.Columns.Add("Host", hostColumn); + var kopiaColumn = new Column("Kopia", "smallint", emailTable); + emailTable.Columns.Add("Kopia", kopiaColumn); + var kopiaEmailColumn = new Column("KopiaEmail", "varchar(255)", emailTable) + { + IsNullable = true + }; + emailTable.Columns.Add("KopiaEmail", kopiaEmailColumn); + var loginColumn = new Column("Login", "varchar(255)", emailTable); + emailTable.Columns.Add("Login", loginColumn); + var nadawcaColumn = new Column("Nadawca", "varchar(120)", emailTable); + emailTable.Columns.Add("Nadawca", nadawcaColumn); + var nazwaColumn3 = new Column("Nazwa", "varchar(60)", emailTable); + emailTable.Columns.Add("Nazwa", nazwaColumn3); + var portColumn = new Column("Port", "varchar(5)", emailTable); + emailTable.Columns.Add("Port", portColumn); + var tEDIdColumn = new Column("TEDId", "numeric(9,0)", emailTable) + { + IsNullable = true + }; + emailTable.Columns.Add("TEDId", tEDIdColumn); + var tEHRIdColumn = new Column("TEHRId", "numeric(9,0)", emailTable) + { + IsNullable = true + }; + emailTable.Columns.Add("TEHRId", tEHRIdColumn); + var tERIdColumn = new Column("TERId", "numeric(9,0)", emailTable) + { + IsNullable = true + }; + emailTable.Columns.Add("TERId", tERIdColumn); + var tEWIdColumn = new Column("TEWId", "numeric(9,0)", emailTable) + { + IsNullable = true + }; + emailTable.Columns.Add("TEWId", tEWIdColumn); + var tEZIIdColumn = new Column("TEZIId", "numeric(9,0)", emailTable) + { + IsNullable = true + }; + emailTable.Columns.Add("TEZIId", tEZIIdColumn); + var tLSColumn = new Column("TLS", "smallint", emailTable); + emailTable.Columns.Add("TLS", tLSColumn); + var tLSVerColumn = new Column("TLSVer", "smallint", emailTable); + emailTable.Columns.Add("TLSVer", tLSVerColumn); + var uzIdColumn0 = new Column("UzId", "numeric(9,0)", emailTable) + { + IsNullable = true + }; + emailTable.Columns.Add("UzId", uzIdColumn0); + var zmianaColumn4 = new Column("Zmiana", "datetime", emailTable); + emailTable.Columns.Add("Zmiana", zmianaColumn4); + var pK_Email = new UniqueConstraint("PK_Email", emailTable, new[] { emIdColumn }); + emailTable.PrimaryKey = pK_Email; + var pK_EmailUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "EmId" }); + pK_Email.MappedKeys.Add(pK_EmailUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_EmailUc).Add(pK_Email); + emailTable.UniqueConstraints.Add("PK_Email", pK_Email); + var iX_Email_TEDId = new TableIndex( + "IX_Email_TEDId", emailTable, new[] { tEDIdColumn }, false); + var iX_Email_TEDIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "TEDId" }); + iX_Email_TEDId.MappedIndexes.Add(iX_Email_TEDIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Email_TEDIdIx).Add(iX_Email_TEDId); + emailTable.Indexes.Add("IX_Email_TEDId", iX_Email_TEDId); + var iX_Email_TERId = new TableIndex( + "IX_Email_TERId", emailTable, new[] { tERIdColumn }, false); + var iX_Email_TERIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "TERId" }); + iX_Email_TERId.MappedIndexes.Add(iX_Email_TERIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Email_TERIdIx).Add(iX_Email_TERId); + emailTable.Indexes.Add("IX_Email_TERId", iX_Email_TERId); + var iX_Email_TEWId = new TableIndex( + "IX_Email_TEWId", emailTable, new[] { tEWIdColumn }, false); + var iX_Email_TEWIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "TEWId" }); + iX_Email_TEWId.MappedIndexes.Add(iX_Email_TEWIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Email_TEWIdIx).Add(iX_Email_TEWId); + emailTable.Indexes.Add("IX_Email_TEWId", iX_Email_TEWId); + var iX_Email_UzId = new TableIndex( + "IX_Email_UzId", emailTable, new[] { uzIdColumn0 }, false); + var iX_Email_UzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "UzId" }); + iX_Email_UzId.MappedIndexes.Add(iX_Email_UzIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Email_UzIdIx).Add(iX_Email_UzId); + emailTable.Indexes.Add("IX_Email_UzId", iX_Email_UzId); + relationalModel.Tables.Add(("Email", null), emailTable); + var emailTableMapping = new TableMapping(email, emailTable, true); + emailTable.AddTypeMapping(emailTableMapping, false); + tableMappings22.Add(emailTableMapping); + RelationalModel.CreateColumnMapping(emIdColumn, email.FindProperty("EmId")!, emailTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn3, email.FindProperty("Aktywny")!, emailTableMapping); + RelationalModel.CreateColumnMapping(authColumn, email.FindProperty("Auth")!, emailTableMapping); + RelationalModel.CreateColumnMapping(hasloColumn, email.FindProperty("Haslo")!, emailTableMapping); + RelationalModel.CreateColumnMapping(hostColumn, email.FindProperty("Host")!, emailTableMapping); + RelationalModel.CreateColumnMapping(kopiaColumn, email.FindProperty("Kopia")!, emailTableMapping); + RelationalModel.CreateColumnMapping(kopiaEmailColumn, email.FindProperty("KopiaEmail")!, emailTableMapping); + RelationalModel.CreateColumnMapping(loginColumn, email.FindProperty("Login")!, emailTableMapping); + RelationalModel.CreateColumnMapping(nadawcaColumn, email.FindProperty("Nadawca")!, emailTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn3, email.FindProperty("Nazwa")!, emailTableMapping); + RelationalModel.CreateColumnMapping(portColumn, email.FindProperty("Port")!, emailTableMapping); + RelationalModel.CreateColumnMapping(tEDIdColumn, email.FindProperty("TEDId")!, emailTableMapping); + RelationalModel.CreateColumnMapping(tEHRIdColumn, email.FindProperty("TEHRId")!, emailTableMapping); + RelationalModel.CreateColumnMapping(tERIdColumn, email.FindProperty("TERId")!, emailTableMapping); + RelationalModel.CreateColumnMapping(tEWIdColumn, email.FindProperty("TEWId")!, emailTableMapping); + RelationalModel.CreateColumnMapping(tEZIIdColumn, email.FindProperty("TEZIId")!, emailTableMapping); + RelationalModel.CreateColumnMapping(tLSColumn, email.FindProperty("TLS")!, emailTableMapping); + RelationalModel.CreateColumnMapping(tLSVerColumn, email.FindProperty("TLSVer")!, emailTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn0, email.FindProperty("UzId")!, emailTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn4, email.FindProperty("Zmiana")!, emailTableMapping); + + var formZgod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.FormZgod")!; + + var defaultTableMappings23 = new List>(); + formZgod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings23); + var blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.FormZgod", null, relationalModel); + var kolejnoscColumnBase = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase); + blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase); + var typOsIdColumnBase = new ColumnBase("TypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase); + blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase.Columns.Add("TypOsId", typOsIdColumnBase); + var wymaganaColumnBase = new ColumnBase("Wymagana", "smallint", blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase.Columns.Add("Wymagana", wymaganaColumnBase); + var zgIdColumnBase0 = new ColumnBase("ZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase); + blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase.Columns.Add("ZgId", zgIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.FormZgod", blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase); + var blinkBackofficeServicesPcmDbEntitiesFormZgodMappingBase = new TableMappingBase(formZgod, blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesFormZgodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesFormZgodMappingBase, false); + defaultTableMappings23.Add(blinkBackofficeServicesPcmDbEntitiesFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typOsIdColumnBase, formZgod.FindProperty("TypOsId")!, blinkBackofficeServicesPcmDbEntitiesFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zgIdColumnBase0, formZgod.FindProperty("ZgId")!, blinkBackofficeServicesPcmDbEntitiesFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase, formZgod.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wymaganaColumnBase, formZgod.FindProperty("Wymagana")!, blinkBackofficeServicesPcmDbEntitiesFormZgodMappingBase); + + var tableMappings23 = new List(); + formZgod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings23); + var formZgodTable = new Table("FormZgod", null, relationalModel); + var typOsIdColumn = new Column("TypOsId", "numeric(9,0)", formZgodTable); + formZgodTable.Columns.Add("TypOsId", typOsIdColumn); + var zgIdColumn0 = new Column("ZgId", "numeric(9,0)", formZgodTable); + formZgodTable.Columns.Add("ZgId", zgIdColumn0); + var kolejnoscColumn = new Column("Kolejnosc", "smallint", formZgodTable); + formZgodTable.Columns.Add("Kolejnosc", kolejnoscColumn); + var wymaganaColumn = new Column("Wymagana", "smallint", formZgodTable) + { + IsNullable = true + }; + formZgodTable.Columns.Add("Wymagana", wymaganaColumn); + var pK_FORMZGOD = new UniqueConstraint("PK_FORMZGOD", formZgodTable, new[] { typOsIdColumn, zgIdColumn0 }); + formZgodTable.PrimaryKey = pK_FORMZGOD; + var pK_FORMZGODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.FormZgod", + new[] { "TypOsId", "ZgId" }); + pK_FORMZGOD.MappedKeys.Add(pK_FORMZGODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_FORMZGODUc).Add(pK_FORMZGOD); + formZgodTable.UniqueConstraints.Add("PK_FORMZGOD", pK_FORMZGOD); + var idx_FMZG_ZGODA = new TableIndex( + "idx_FMZG_ZGODA", formZgodTable, new[] { zgIdColumn0 }, false); + var idx_FMZG_ZGODAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.FormZgod", + "idx_FMZG_ZGODA"); + idx_FMZG_ZGODA.MappedIndexes.Add(idx_FMZG_ZGODAIx); + RelationalModel.GetOrCreateTableIndexes(idx_FMZG_ZGODAIx).Add(idx_FMZG_ZGODA); + formZgodTable.Indexes.Add("idx_FMZG_ZGODA", idx_FMZG_ZGODA); + relationalModel.Tables.Add(("FormZgod", null), formZgodTable); + var formZgodTableMapping = new TableMapping(formZgod, formZgodTable, true); + formZgodTable.AddTypeMapping(formZgodTableMapping, false); + tableMappings23.Add(formZgodTableMapping); + RelationalModel.CreateColumnMapping(typOsIdColumn, formZgod.FindProperty("TypOsId")!, formZgodTableMapping); + RelationalModel.CreateColumnMapping(zgIdColumn0, formZgod.FindProperty("ZgId")!, formZgodTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn, formZgod.FindProperty("Kolejnosc")!, formZgodTableMapping); + RelationalModel.CreateColumnMapping(wymaganaColumn, formZgod.FindProperty("Wymagana")!, formZgodTableMapping); + + var formaPlatnPos7 = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnPos7")!; + + var defaultTableMappings24 = new List>(); + formaPlatnPos7.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings24); + var blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnPos7", null, relationalModel); + var aktywnyColumnBase4 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("Aktywny", aktywnyColumnBase4); + var autoryzacjaColumnBase0 = new ColumnBase("Autoryzacja", "smallint", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("Autoryzacja", autoryzacjaColumnBase0); + var centrFormaIdColumnBase = new ColumnBase("CentrFormaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("CentrFormaId", centrFormaIdColumnBase); + var formaIdColumnBase = new ColumnBase("FormaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("FormaId", formaIdColumnBase); + var kolejnoscColumnBase0 = new ColumnBase("Kolejnosc", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase0); + var nazwaColumnBase4 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("Nazwa", nazwaColumnBase4); + var resztaColumnBase = new ColumnBase("Reszta", "smallint", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("Reszta", resztaColumnBase); + var serwisPlatniczyColumnBase = new ColumnBase("SerwisPlatniczy", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("SerwisPlatniczy", serwisPlatniczyColumnBase); + var typColumnBase1 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("Typ", typColumnBase1); + var zmianaColumnBase5 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.Columns.Add("Zmiana", zmianaColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnPos7", blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase); + var blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase = new TableMappingBase(formaPlatnPos7, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase, true); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7TableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase, false); + defaultTableMappings24.Add(blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaIdColumnBase, formaPlatnPos7.FindProperty("FormaId")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase4, formaPlatnPos7.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)autoryzacjaColumnBase0, formaPlatnPos7.FindProperty("Autoryzacja")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrFormaIdColumnBase, formaPlatnPos7.FindProperty("CentrFormaId")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase0, formaPlatnPos7.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase4, formaPlatnPos7.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)resztaColumnBase, formaPlatnPos7.FindProperty("Reszta")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)serwisPlatniczyColumnBase, formaPlatnPos7.FindProperty("SerwisPlatniczy")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase1, formaPlatnPos7.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase5, formaPlatnPos7.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnPos7MappingBase); + + var tableMappings24 = new List(); + formaPlatnPos7.SetRuntimeAnnotation("Relational:TableMappings", tableMappings24); + var formaPlatnPos7Table = new Table("FormaPlatnPos7", null, relationalModel); + var formaIdColumn = new Column("FormaId", "numeric(9,0)", formaPlatnPos7Table); + formaPlatnPos7Table.Columns.Add("FormaId", formaIdColumn); + var aktywnyColumn4 = new Column("Aktywny", "smallint", formaPlatnPos7Table); + formaPlatnPos7Table.Columns.Add("Aktywny", aktywnyColumn4); + var autoryzacjaColumn0 = new Column("Autoryzacja", "smallint", formaPlatnPos7Table) + { + IsNullable = true + }; + formaPlatnPos7Table.Columns.Add("Autoryzacja", autoryzacjaColumn0); + var centrFormaIdColumn = new Column("CentrFormaId", "numeric(9,0)", formaPlatnPos7Table) + { + IsNullable = true + }; + formaPlatnPos7Table.Columns.Add("CentrFormaId", centrFormaIdColumn); + var kolejnoscColumn0 = new Column("Kolejnosc", "numeric(9,0)", formaPlatnPos7Table) + { + IsNullable = true + }; + formaPlatnPos7Table.Columns.Add("Kolejnosc", kolejnoscColumn0); + var nazwaColumn4 = new Column("Nazwa", "varchar(60)", formaPlatnPos7Table); + formaPlatnPos7Table.Columns.Add("Nazwa", nazwaColumn4); + var resztaColumn = new Column("Reszta", "smallint", formaPlatnPos7Table); + formaPlatnPos7Table.Columns.Add("Reszta", resztaColumn); + var serwisPlatniczyColumn = new Column("SerwisPlatniczy", "varchar(40)", formaPlatnPos7Table) + { + IsNullable = true + }; + formaPlatnPos7Table.Columns.Add("SerwisPlatniczy", serwisPlatniczyColumn); + var typColumn1 = new Column("Typ", "smallint", formaPlatnPos7Table); + formaPlatnPos7Table.Columns.Add("Typ", typColumn1); + var zmianaColumn5 = new Column("Zmiana", "datetime", formaPlatnPos7Table); + formaPlatnPos7Table.Columns.Add("Zmiana", zmianaColumn5); + var pK_FormaPlatnPos7 = new UniqueConstraint("PK_FormaPlatnPos7", formaPlatnPos7Table, new[] { formaIdColumn }); + formaPlatnPos7Table.PrimaryKey = pK_FormaPlatnPos7; + var pK_FormaPlatnPos7Uc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnPos7", + new[] { "FormaId" }); + pK_FormaPlatnPos7.MappedKeys.Add(pK_FormaPlatnPos7Uc); + RelationalModel.GetOrCreateUniqueConstraints(pK_FormaPlatnPos7Uc).Add(pK_FormaPlatnPos7); + formaPlatnPos7Table.UniqueConstraints.Add("PK_FormaPlatnPos7", pK_FormaPlatnPos7); + relationalModel.Tables.Add(("FormaPlatnPos7", null), formaPlatnPos7Table); + var formaPlatnPos7TableMapping = new TableMapping(formaPlatnPos7, formaPlatnPos7Table, true); + formaPlatnPos7Table.AddTypeMapping(formaPlatnPos7TableMapping, false); + tableMappings24.Add(formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(formaIdColumn, formaPlatnPos7.FindProperty("FormaId")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn4, formaPlatnPos7.FindProperty("Aktywny")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(autoryzacjaColumn0, formaPlatnPos7.FindProperty("Autoryzacja")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(centrFormaIdColumn, formaPlatnPos7.FindProperty("CentrFormaId")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn0, formaPlatnPos7.FindProperty("Kolejnosc")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn4, formaPlatnPos7.FindProperty("Nazwa")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(resztaColumn, formaPlatnPos7.FindProperty("Reszta")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(serwisPlatniczyColumn, formaPlatnPos7.FindProperty("SerwisPlatniczy")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(typColumn1, formaPlatnPos7.FindProperty("Typ")!, formaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn5, formaPlatnPos7.FindProperty("Zmiana")!, formaPlatnPos7TableMapping); + + var formaPlatnosci = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnosci")!; + + var defaultTableMappings25 = new List>(); + formaPlatnosci.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings25); + var blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnosci", null, relationalModel); + var formaPlatColumnBase0 = new ColumnBase("FormaPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase.Columns.Add("FormaPlat", formaPlatColumnBase0); + var maxTermPlatColumnBase = new ColumnBase("MaxTermPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase.Columns.Add("MaxTermPlat", maxTermPlatColumnBase); + var minTermPlatColumnBase = new ColumnBase("MinTermPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase.Columns.Add("MinTermPlat", minTermPlatColumnBase); + var tekstColumnBase = new ColumnBase("Tekst", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase.Columns.Add("Tekst", tekstColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnosci", blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase); + var blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciMappingBase = new TableMappingBase(formaPlatnosci, blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase, true); + blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciMappingBase, false); + defaultTableMappings25.Add(blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaPlatColumnBase0, formaPlatnosci.FindProperty("FormaPlat")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)maxTermPlatColumnBase, formaPlatnosci.FindProperty("MaxTermPlat")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minTermPlatColumnBase, formaPlatnosci.FindProperty("MinTermPlat")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase, formaPlatnosci.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesFormaPlatnosciMappingBase); + + var tableMappings25 = new List(); + formaPlatnosci.SetRuntimeAnnotation("Relational:TableMappings", tableMappings25); + var formaPlatnosciTable = new Table("FormaPlatnosci", null, relationalModel); + var formaPlatColumn0 = new Column("FormaPlat", "smallint", formaPlatnosciTable); + formaPlatnosciTable.Columns.Add("FormaPlat", formaPlatColumn0); + var maxTermPlatColumn = new Column("MaxTermPlat", "smallint", formaPlatnosciTable); + formaPlatnosciTable.Columns.Add("MaxTermPlat", maxTermPlatColumn); + var minTermPlatColumn = new Column("MinTermPlat", "smallint", formaPlatnosciTable); + formaPlatnosciTable.Columns.Add("MinTermPlat", minTermPlatColumn); + var tekstColumn = new Column("Tekst", "varchar(40)", formaPlatnosciTable); + formaPlatnosciTable.Columns.Add("Tekst", tekstColumn); + var pK_FORMAPLATNOSCI = new UniqueConstraint("PK_FORMAPLATNOSCI", formaPlatnosciTable, new[] { formaPlatColumn0 }); + formaPlatnosciTable.PrimaryKey = pK_FORMAPLATNOSCI; + var pK_FORMAPLATNOSCIUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnosci", + new[] { "FormaPlat" }); + pK_FORMAPLATNOSCI.MappedKeys.Add(pK_FORMAPLATNOSCIUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_FORMAPLATNOSCIUc).Add(pK_FORMAPLATNOSCI); + formaPlatnosciTable.UniqueConstraints.Add("PK_FORMAPLATNOSCI", pK_FORMAPLATNOSCI); + relationalModel.Tables.Add(("FormaPlatnosci", null), formaPlatnosciTable); + var formaPlatnosciTableMapping = new TableMapping(formaPlatnosci, formaPlatnosciTable, true); + formaPlatnosciTable.AddTypeMapping(formaPlatnosciTableMapping, false); + tableMappings25.Add(formaPlatnosciTableMapping); + RelationalModel.CreateColumnMapping(formaPlatColumn0, formaPlatnosci.FindProperty("FormaPlat")!, formaPlatnosciTableMapping); + RelationalModel.CreateColumnMapping(maxTermPlatColumn, formaPlatnosci.FindProperty("MaxTermPlat")!, formaPlatnosciTableMapping); + RelationalModel.CreateColumnMapping(minTermPlatColumn, formaPlatnosci.FindProperty("MinTermPlat")!, formaPlatnosciTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn, formaPlatnosci.FindProperty("Tekst")!, formaPlatnosciTableMapping); + + var grWartosc = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.GrWartosc")!; + + var defaultTableMappings26 = new List>(); + grWartosc.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings26); + var blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.GrWartosc", null, relationalModel); + var grIdColumnBase = new ColumnBase("GrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase.Columns.Add("GrId", grIdColumnBase); + var parIdColumnBase = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase.Columns.Add("ParId", parIdColumnBase); + var wartoscColumnBase0 = new ColumnBase("Wartosc", "int", blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase.Columns.Add("Wartosc", wartoscColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.GrWartosc", blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase); + var blinkBackofficeServicesPcmDbEntitiesGrWartoscMappingBase = new TableMappingBase(grWartosc, blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase, true); + blinkBackofficeServicesPcmDbEntitiesGrWartoscTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesGrWartoscMappingBase, false); + defaultTableMappings26.Add(blinkBackofficeServicesPcmDbEntitiesGrWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grIdColumnBase, grWartosc.FindProperty("GrId")!, blinkBackofficeServicesPcmDbEntitiesGrWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase, grWartosc.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesGrWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase0, grWartosc.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesGrWartoscMappingBase); + + var tableMappings26 = new List(); + grWartosc.SetRuntimeAnnotation("Relational:TableMappings", tableMappings26); + var grWartoscTable = new Table("GrWartosc", null, relationalModel); + var grIdColumn = new Column("GrId", "numeric(9,0)", grWartoscTable); + grWartoscTable.Columns.Add("GrId", grIdColumn); + var parIdColumn = new Column("ParId", "numeric(9,0)", grWartoscTable); + grWartoscTable.Columns.Add("ParId", parIdColumn); + var wartoscColumn0 = new Column("Wartosc", "int", grWartoscTable); + grWartoscTable.Columns.Add("Wartosc", wartoscColumn0); + var pK_GRWARTOSC = new UniqueConstraint("PK_GRWARTOSC", grWartoscTable, new[] { grIdColumn, parIdColumn, wartoscColumn0 }); + grWartoscTable.PrimaryKey = pK_GRWARTOSC; + var pK_GRWARTOSCUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrWartosc", + new[] { "GrId", "ParId", "Wartosc" }); + pK_GRWARTOSC.MappedKeys.Add(pK_GRWARTOSCUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_GRWARTOSCUc).Add(pK_GRWARTOSC); + grWartoscTable.UniqueConstraints.Add("PK_GRWARTOSC", pK_GRWARTOSC); + var iX_GrWartosc_ParId = new TableIndex( + "IX_GrWartosc_ParId", grWartoscTable, new[] { parIdColumn }, false); + var iX_GrWartosc_ParIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrWartosc", + new[] { "ParId" }); + iX_GrWartosc_ParId.MappedIndexes.Add(iX_GrWartosc_ParIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_GrWartosc_ParIdIx).Add(iX_GrWartosc_ParId); + grWartoscTable.Indexes.Add("IX_GrWartosc_ParId", iX_GrWartosc_ParId); + relationalModel.Tables.Add(("GrWartosc", null), grWartoscTable); + var grWartoscTableMapping = new TableMapping(grWartosc, grWartoscTable, true); + grWartoscTable.AddTypeMapping(grWartoscTableMapping, false); + tableMappings26.Add(grWartoscTableMapping); + RelationalModel.CreateColumnMapping(grIdColumn, grWartosc.FindProperty("GrId")!, grWartoscTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn, grWartosc.FindProperty("ParId")!, grWartoscTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn0, grWartosc.FindProperty("Wartosc")!, grWartoscTableMapping); + + var grupaAkcyzowa = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa")!; + + var defaultTableMappings27 = new List>(); + grupaAkcyzowa.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings27); + var blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa", null, relationalModel); + var akcJMColumnBase = new ColumnBase("AkcJM", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("AkcJM", akcJMColumnBase); + var centrGrAkcIdColumnBase = new ColumnBase("CentrGrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("CentrGrAkcId", centrGrAkcIdColumnBase); + var dodJMColumnBase = new ColumnBase("DodJM", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("DodJM", dodJMColumnBase); + var grAkcIdColumnBase = new ColumnBase("GrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("GrAkcId", grAkcIdColumnBase); + var ileDodJMWAkcJMColumnBase = new ColumnBase("IleDodJMWAkcJM", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("IleDodJMWAkcJM", ileDodJMWAkcJMColumnBase); + var kodColumnBase0 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("Kod", kodColumnBase0); + var nazwaColumnBase5 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("Nazwa", nazwaColumnBase5); + var opcjeWzoruColumnBase = new ColumnBase("OpcjeWzoru", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("OpcjeWzoru", opcjeWzoruColumnBase); + var opisColumnBase0 = new ColumnBase("Opis", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("Opis", opisColumnBase0); + var prefiksyCNColumnBase = new ColumnBase("PrefiksyCN", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("PrefiksyCN", prefiksyCNColumnBase); + var zmianaColumnBase6 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.Columns.Add("Zmiana", zmianaColumnBase6); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa", blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase); + var blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase = new TableMappingBase(grupaAkcyzowa, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase, false); + defaultTableMappings27.Add(blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grAkcIdColumnBase, grupaAkcyzowa.FindProperty("GrAkcId")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akcJMColumnBase, grupaAkcyzowa.FindProperty("AkcJM")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrGrAkcIdColumnBase, grupaAkcyzowa.FindProperty("CentrGrAkcId")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodJMColumnBase, grupaAkcyzowa.FindProperty("DodJM")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileDodJMWAkcJMColumnBase, grupaAkcyzowa.FindProperty("IleDodJMWAkcJM")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase0, grupaAkcyzowa.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase5, grupaAkcyzowa.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjeWzoruColumnBase, grupaAkcyzowa.FindProperty("OpcjeWzoru")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase0, grupaAkcyzowa.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prefiksyCNColumnBase, grupaAkcyzowa.FindProperty("PrefiksyCN")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase6, grupaAkcyzowa.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesGrupaAkcyzowaMappingBase); + + var tableMappings27 = new List(); + grupaAkcyzowa.SetRuntimeAnnotation("Relational:TableMappings", tableMappings27); + var grupaAkcyzowaTable = new Table("GrupaAkcyzowa", null, relationalModel); + var grAkcIdColumn = new Column("GrAkcId", "numeric(9,0)", grupaAkcyzowaTable); + grupaAkcyzowaTable.Columns.Add("GrAkcId", grAkcIdColumn); + var akcJMColumn = new Column("AkcJM", "varchar(20)", grupaAkcyzowaTable); + grupaAkcyzowaTable.Columns.Add("AkcJM", akcJMColumn); + var centrGrAkcIdColumn = new Column("CentrGrAkcId", "numeric(9,0)", grupaAkcyzowaTable) + { + IsNullable = true + }; + grupaAkcyzowaTable.Columns.Add("CentrGrAkcId", centrGrAkcIdColumn); + var dodJMColumn = new Column("DodJM", "varchar(20)", grupaAkcyzowaTable) + { + IsNullable = true + }; + grupaAkcyzowaTable.Columns.Add("DodJM", dodJMColumn); + var ileDodJMWAkcJMColumn = new Column("IleDodJMWAkcJM", "decimal(15,4)", grupaAkcyzowaTable) + { + IsNullable = true + }; + grupaAkcyzowaTable.Columns.Add("IleDodJMWAkcJM", ileDodJMWAkcJMColumn); + var kodColumn0 = new Column("Kod", "varchar(20)", grupaAkcyzowaTable); + grupaAkcyzowaTable.Columns.Add("Kod", kodColumn0); + var nazwaColumn5 = new Column("Nazwa", "varchar(120)", grupaAkcyzowaTable); + grupaAkcyzowaTable.Columns.Add("Nazwa", nazwaColumn5); + var opcjeWzoruColumn = new Column("OpcjeWzoru", "varchar(40)", grupaAkcyzowaTable); + grupaAkcyzowaTable.Columns.Add("OpcjeWzoru", opcjeWzoruColumn); + var opisColumn0 = new Column("Opis", "varchar(255)", grupaAkcyzowaTable) + { + IsNullable = true + }; + grupaAkcyzowaTable.Columns.Add("Opis", opisColumn0); + var prefiksyCNColumn = new Column("PrefiksyCN", "varchar(255)", grupaAkcyzowaTable) + { + IsNullable = true + }; + grupaAkcyzowaTable.Columns.Add("PrefiksyCN", prefiksyCNColumn); + var zmianaColumn6 = new Column("Zmiana", "datetime", grupaAkcyzowaTable); + grupaAkcyzowaTable.Columns.Add("Zmiana", zmianaColumn6); + var pK_GRUPAAKCYZOWA = new UniqueConstraint("PK_GRUPAAKCYZOWA", grupaAkcyzowaTable, new[] { grAkcIdColumn }); + grupaAkcyzowaTable.PrimaryKey = pK_GRUPAAKCYZOWA; + var pK_GRUPAAKCYZOWAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa", + new[] { "GrAkcId" }); + pK_GRUPAAKCYZOWA.MappedKeys.Add(pK_GRUPAAKCYZOWAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_GRUPAAKCYZOWAUc).Add(pK_GRUPAAKCYZOWA); + grupaAkcyzowaTable.UniqueConstraints.Add("PK_GRUPAAKCYZOWA", pK_GRUPAAKCYZOWA); + relationalModel.Tables.Add(("GrupaAkcyzowa", null), grupaAkcyzowaTable); + var grupaAkcyzowaTableMapping = new TableMapping(grupaAkcyzowa, grupaAkcyzowaTable, true); + grupaAkcyzowaTable.AddTypeMapping(grupaAkcyzowaTableMapping, false); + tableMappings27.Add(grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(grAkcIdColumn, grupaAkcyzowa.FindProperty("GrAkcId")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(akcJMColumn, grupaAkcyzowa.FindProperty("AkcJM")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(centrGrAkcIdColumn, grupaAkcyzowa.FindProperty("CentrGrAkcId")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(dodJMColumn, grupaAkcyzowa.FindProperty("DodJM")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(ileDodJMWAkcJMColumn, grupaAkcyzowa.FindProperty("IleDodJMWAkcJM")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(kodColumn0, grupaAkcyzowa.FindProperty("Kod")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn5, grupaAkcyzowa.FindProperty("Nazwa")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(opcjeWzoruColumn, grupaAkcyzowa.FindProperty("OpcjeWzoru")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(opisColumn0, grupaAkcyzowa.FindProperty("Opis")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(prefiksyCNColumn, grupaAkcyzowa.FindProperty("PrefiksyCN")!, grupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn6, grupaAkcyzowa.FindProperty("Zmiana")!, grupaAkcyzowaTableMapping); + + var grupaPromocji = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.GrupaPromocji")!; + + var defaultTableMappings28 = new List>(); + grupaPromocji.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings28); + var blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.GrupaPromocji", null, relationalModel); + var aktywnaColumnBase = new ColumnBase("Aktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.Columns.Add("Aktywna", aktywnaColumnBase); + var centrGrupaIdColumnBase = new ColumnBase("CentrGrupaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.Columns.Add("CentrGrupaId", centrGrupaIdColumnBase); + var grupaIdColumnBase = new ColumnBase("GrupaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.Columns.Add("GrupaId", grupaIdColumnBase); + var nazwaColumnBase6 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.Columns.Add("Nazwa", nazwaColumnBase6); + var opisColumnBase1 = new ColumnBase("Opis", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.Columns.Add("Opis", opisColumnBase1); + var typColumnBase2 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.Columns.Add("Typ", typColumnBase2); + var zmianaColumnBase7 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.Columns.Add("Zmiana", zmianaColumnBase7); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.GrupaPromocji", blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase); + var blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase = new TableMappingBase(grupaPromocji, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase, true); + blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase, false); + defaultTableMappings28.Add(blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupaIdColumnBase, grupaPromocji.FindProperty("GrupaId")!, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnaColumnBase, grupaPromocji.FindProperty("Aktywna")!, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrGrupaIdColumnBase, grupaPromocji.FindProperty("CentrGrupaId")!, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase6, grupaPromocji.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase1, grupaPromocji.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase2, grupaPromocji.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase7, grupaPromocji.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesGrupaPromocjiMappingBase); + + var tableMappings28 = new List(); + grupaPromocji.SetRuntimeAnnotation("Relational:TableMappings", tableMappings28); + var grupaPromocjiTable = new Table("GrupaPromocji", null, relationalModel); + var grupaIdColumn = new Column("GrupaId", "numeric(9,0)", grupaPromocjiTable); + grupaPromocjiTable.Columns.Add("GrupaId", grupaIdColumn); + var aktywnaColumn = new Column("Aktywna", "smallint", grupaPromocjiTable); + grupaPromocjiTable.Columns.Add("Aktywna", aktywnaColumn); + var centrGrupaIdColumn = new Column("CentrGrupaId", "numeric(9,0)", grupaPromocjiTable) + { + IsNullable = true + }; + grupaPromocjiTable.Columns.Add("CentrGrupaId", centrGrupaIdColumn); + var nazwaColumn6 = new Column("Nazwa", "varchar(255)", grupaPromocjiTable); + grupaPromocjiTable.Columns.Add("Nazwa", nazwaColumn6); + var opisColumn1 = new Column("Opis", "varchar(255)", grupaPromocjiTable); + grupaPromocjiTable.Columns.Add("Opis", opisColumn1); + var typColumn2 = new Column("Typ", "smallint", grupaPromocjiTable); + grupaPromocjiTable.Columns.Add("Typ", typColumn2); + var zmianaColumn7 = new Column("Zmiana", "datetime", grupaPromocjiTable); + grupaPromocjiTable.Columns.Add("Zmiana", zmianaColumn7); + var pK_GrupaPromocji = new UniqueConstraint("PK_GrupaPromocji", grupaPromocjiTable, new[] { grupaIdColumn }); + grupaPromocjiTable.PrimaryKey = pK_GrupaPromocji; + var pK_GrupaPromocjiUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaPromocji", + new[] { "GrupaId" }); + pK_GrupaPromocji.MappedKeys.Add(pK_GrupaPromocjiUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_GrupaPromocjiUc).Add(pK_GrupaPromocji); + grupaPromocjiTable.UniqueConstraints.Add("PK_GrupaPromocji", pK_GrupaPromocji); + relationalModel.Tables.Add(("GrupaPromocji", null), grupaPromocjiTable); + var grupaPromocjiTableMapping = new TableMapping(grupaPromocji, grupaPromocjiTable, true); + grupaPromocjiTable.AddTypeMapping(grupaPromocjiTableMapping, false); + tableMappings28.Add(grupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(grupaIdColumn, grupaPromocji.FindProperty("GrupaId")!, grupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(aktywnaColumn, grupaPromocji.FindProperty("Aktywna")!, grupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(centrGrupaIdColumn, grupaPromocji.FindProperty("CentrGrupaId")!, grupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn6, grupaPromocji.FindProperty("Nazwa")!, grupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(opisColumn1, grupaPromocji.FindProperty("Opis")!, grupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(typColumn2, grupaPromocji.FindProperty("Typ")!, grupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn7, grupaPromocji.FindProperty("Zmiana")!, grupaPromocjiTableMapping); + + var grupaTow = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.GrupaTow")!; + + var defaultTableMappings29 = new List>(); + grupaTow.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings29); + var blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.GrupaTow", null, relationalModel); + var grIdColumnBase0 = new ColumnBase("GrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase.Columns.Add("GrId", grIdColumnBase0); + var nazwaColumnBase7 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase.Columns.Add("Nazwa", nazwaColumnBase7); + var opisColumnBase2 = new ColumnBase("Opis", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase.Columns.Add("Opis", opisColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.GrupaTow", blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase); + var blinkBackofficeServicesPcmDbEntitiesGrupaTowMappingBase = new TableMappingBase(grupaTow, blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase, true); + blinkBackofficeServicesPcmDbEntitiesGrupaTowTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesGrupaTowMappingBase, false); + defaultTableMappings29.Add(blinkBackofficeServicesPcmDbEntitiesGrupaTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grIdColumnBase0, grupaTow.FindProperty("GrId")!, blinkBackofficeServicesPcmDbEntitiesGrupaTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase7, grupaTow.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesGrupaTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase2, grupaTow.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesGrupaTowMappingBase); + + var tableMappings29 = new List(); + grupaTow.SetRuntimeAnnotation("Relational:TableMappings", tableMappings29); + var grupaTowTable = new Table("GrupaTow", null, relationalModel); + var grIdColumn0 = new Column("GrId", "numeric(9,0)", grupaTowTable); + grupaTowTable.Columns.Add("GrId", grIdColumn0); + var nazwaColumn7 = new Column("Nazwa", "varchar(40)", grupaTowTable); + grupaTowTable.Columns.Add("Nazwa", nazwaColumn7); + var opisColumn2 = new Column("Opis", "varchar(255)", grupaTowTable); + grupaTowTable.Columns.Add("Opis", opisColumn2); + var pK_GRUPATOW = new UniqueConstraint("PK_GRUPATOW", grupaTowTable, new[] { grIdColumn0 }); + grupaTowTable.PrimaryKey = pK_GRUPATOW; + var pK_GRUPATOWUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaTow", + new[] { "GrId" }); + pK_GRUPATOW.MappedKeys.Add(pK_GRUPATOWUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_GRUPATOWUc).Add(pK_GRUPATOW); + grupaTowTable.UniqueConstraints.Add("PK_GRUPATOW", pK_GRUPATOW); + relationalModel.Tables.Add(("GrupaTow", null), grupaTowTable); + var grupaTowTableMapping = new TableMapping(grupaTow, grupaTowTable, true); + grupaTowTable.AddTypeMapping(grupaTowTableMapping, false); + tableMappings29.Add(grupaTowTableMapping); + RelationalModel.CreateColumnMapping(grIdColumn0, grupaTow.FindProperty("GrId")!, grupaTowTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn7, grupaTow.FindProperty("Nazwa")!, grupaTowTableMapping); + RelationalModel.CreateColumnMapping(opisColumn2, grupaTow.FindProperty("Opis")!, grupaTowTableMapping); + + var grupaUz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.GrupaUz")!; + + var defaultTableMappings30 = new List>(); + grupaUz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings30); + var blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.GrupaUz", null, relationalModel); + var rolaIdColumnBase = new ColumnBase("RolaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase.Columns.Add("RolaId", rolaIdColumnBase); + var uzIdColumnBase1 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase); + blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase.Columns.Add("UzId", uzIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.GrupaUz", blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase); + var blinkBackofficeServicesPcmDbEntitiesGrupaUzMappingBase = new TableMappingBase(grupaUz, blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase, true); + blinkBackofficeServicesPcmDbEntitiesGrupaUzTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesGrupaUzMappingBase, false); + defaultTableMappings30.Add(blinkBackofficeServicesPcmDbEntitiesGrupaUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase1, grupaUz.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesGrupaUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaIdColumnBase, grupaUz.FindProperty("RolaId")!, blinkBackofficeServicesPcmDbEntitiesGrupaUzMappingBase); + + var tableMappings30 = new List(); + grupaUz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings30); + var grupaUzTable = new Table("GrupaUz", null, relationalModel); + var uzIdColumn1 = new Column("UzId", "numeric(9,0)", grupaUzTable); + grupaUzTable.Columns.Add("UzId", uzIdColumn1); + var rolaIdColumn = new Column("RolaId", "numeric(9,0)", grupaUzTable); + grupaUzTable.Columns.Add("RolaId", rolaIdColumn); + var pK_GRUPAUZ = new UniqueConstraint("PK_GRUPAUZ", grupaUzTable, new[] { uzIdColumn1 }); + grupaUzTable.PrimaryKey = pK_GRUPAUZ; + var pK_GRUPAUZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaUz", + new[] { "UzId" }); + pK_GRUPAUZ.MappedKeys.Add(pK_GRUPAUZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_GRUPAUZUc).Add(pK_GRUPAUZ); + grupaUzTable.UniqueConstraints.Add("PK_GRUPAUZ", pK_GRUPAUZ); + var idx_Rola = new TableIndex( + "idx_Rola", grupaUzTable, new[] { rolaIdColumn }, false); + var idx_RolaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaUz", + "idx_Rola"); + idx_Rola.MappedIndexes.Add(idx_RolaIx); + RelationalModel.GetOrCreateTableIndexes(idx_RolaIx).Add(idx_Rola); + grupaUzTable.Indexes.Add("idx_Rola", idx_Rola); + relationalModel.Tables.Add(("GrupaUz", null), grupaUzTable); + var grupaUzTableMapping = new TableMapping(grupaUz, grupaUzTable, true); + grupaUzTable.AddTypeMapping(grupaUzTableMapping, false); + tableMappings30.Add(grupaUzTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn1, grupaUz.FindProperty("UzId")!, grupaUzTableMapping); + RelationalModel.CreateColumnMapping(rolaIdColumn, grupaUz.FindProperty("RolaId")!, grupaUzTableMapping); + + var harmCeny = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmCeny")!; + + var defaultTableMappings31 = new List>(); + harmCeny.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings31); + var blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmCeny", null, relationalModel); + var cena5ColumnBase = new ColumnBase("Cena5", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("Cena5", cena5ColumnBase); + var cena6ColumnBase = new ColumnBase("Cena6", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("Cena6", cena6ColumnBase); + var cena7ColumnBase = new ColumnBase("Cena7", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("Cena7", cena7ColumnBase); + var cena8ColumnBase = new ColumnBase("Cena8", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("Cena8", cena8ColumnBase); + var cenaDetColumnBase = new ColumnBase("CenaDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("CenaDet", cenaDetColumnBase); + var cenaDodColumnBase = new ColumnBase("CenaDod", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("CenaDod", cenaDodColumnBase); + var cenaHurtColumnBase = new ColumnBase("CenaHurt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("CenaHurt", cenaHurtColumnBase); + var cenaNocColumnBase = new ColumnBase("CenaNoc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("CenaNoc", cenaNocColumnBase); + var cenaOtwartaColumnBase = new ColumnBase("CenaOtwarta", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("CenaOtwarta", cenaOtwartaColumnBase); + var harmIdColumnBase = new ColumnBase("HarmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("HarmId", harmIdColumnBase); + var inneColumnBase = new ColumnBase("Inne", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("Inne", inneColumnBase); + var progPromocjiColumnBase = new ColumnBase("ProgPromocji", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("ProgPromocji", progPromocjiColumnBase); + var stawkaColumnBase = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("Stawka", stawkaColumnBase); + var towIdColumnBase1 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.Columns.Add("TowId", towIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmCeny", blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase = new TableMappingBase(harmCeny, blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmCenyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase, false); + defaultTableMappings31.Add(blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)harmIdColumnBase, harmCeny.FindProperty("HarmId")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase1, harmCeny.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena5ColumnBase, harmCeny.FindProperty("Cena5")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena6ColumnBase, harmCeny.FindProperty("Cena6")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena7ColumnBase, harmCeny.FindProperty("Cena7")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena8ColumnBase, harmCeny.FindProperty("Cena8")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDetColumnBase, harmCeny.FindProperty("CenaDet")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDodColumnBase, harmCeny.FindProperty("CenaDod")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaHurtColumnBase, harmCeny.FindProperty("CenaHurt")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaNocColumnBase, harmCeny.FindProperty("CenaNoc")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaOtwartaColumnBase, harmCeny.FindProperty("CenaOtwarta")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)inneColumnBase, harmCeny.FindProperty("Inne")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)progPromocjiColumnBase, harmCeny.FindProperty("ProgPromocji")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase, harmCeny.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesHarmCenyMappingBase); + + var tableMappings31 = new List(); + harmCeny.SetRuntimeAnnotation("Relational:TableMappings", tableMappings31); + var harmCenyTable = new Table("HarmCeny", null, relationalModel); + var harmIdColumn = new Column("HarmId", "numeric(9,0)", harmCenyTable); + harmCenyTable.Columns.Add("HarmId", harmIdColumn); + var towIdColumn1 = new Column("TowId", "numeric(9,0)", harmCenyTable); + harmCenyTable.Columns.Add("TowId", towIdColumn1); + var cena5Column = new Column("Cena5", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("Cena5", cena5Column); + var cena6Column = new Column("Cena6", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("Cena6", cena6Column); + var cena7Column = new Column("Cena7", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("Cena7", cena7Column); + var cena8Column = new Column("Cena8", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("Cena8", cena8Column); + var cenaDetColumn = new Column("CenaDet", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("CenaDet", cenaDetColumn); + var cenaDodColumn = new Column("CenaDod", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("CenaDod", cenaDodColumn); + var cenaHurtColumn = new Column("CenaHurt", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("CenaHurt", cenaHurtColumn); + var cenaNocColumn = new Column("CenaNoc", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("CenaNoc", cenaNocColumn); + var cenaOtwartaColumn = new Column("CenaOtwarta", "smallint", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("CenaOtwarta", cenaOtwartaColumn); + var inneColumn = new Column("Inne", "varchar(40)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("Inne", inneColumn); + var progPromocjiColumn = new Column("ProgPromocji", "decimal(15,4)", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("ProgPromocji", progPromocjiColumn); + var stawkaColumn = new Column("Stawka", "smallint", harmCenyTable) + { + IsNullable = true + }; + harmCenyTable.Columns.Add("Stawka", stawkaColumn); + var pK_HARMCENY = new UniqueConstraint("PK_HARMCENY", harmCenyTable, new[] { harmIdColumn, towIdColumn1 }); + harmCenyTable.PrimaryKey = pK_HARMCENY; + var pK_HARMCENYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmCeny", + new[] { "HarmId", "TowId" }); + pK_HARMCENY.MappedKeys.Add(pK_HARMCENYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HARMCENYUc).Add(pK_HARMCENY); + harmCenyTable.UniqueConstraints.Add("PK_HARMCENY", pK_HARMCENY); + var idx_HarmTow = new TableIndex( + "idx_HarmTow", harmCenyTable, new[] { towIdColumn1 }, false); + var idx_HarmTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmCeny", + "idx_HarmTow"); + idx_HarmTow.MappedIndexes.Add(idx_HarmTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_HarmTowIx).Add(idx_HarmTow); + harmCenyTable.Indexes.Add("idx_HarmTow", idx_HarmTow); + relationalModel.Tables.Add(("HarmCeny", null), harmCenyTable); + var harmCenyTableMapping = new TableMapping(harmCeny, harmCenyTable, true); + harmCenyTable.AddTypeMapping(harmCenyTableMapping, false); + tableMappings31.Add(harmCenyTableMapping); + RelationalModel.CreateColumnMapping(harmIdColumn, harmCeny.FindProperty("HarmId")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn1, harmCeny.FindProperty("TowId")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cena5Column, harmCeny.FindProperty("Cena5")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cena6Column, harmCeny.FindProperty("Cena6")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cena7Column, harmCeny.FindProperty("Cena7")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cena8Column, harmCeny.FindProperty("Cena8")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cenaDetColumn, harmCeny.FindProperty("CenaDet")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cenaDodColumn, harmCeny.FindProperty("CenaDod")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cenaHurtColumn, harmCeny.FindProperty("CenaHurt")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cenaNocColumn, harmCeny.FindProperty("CenaNoc")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(cenaOtwartaColumn, harmCeny.FindProperty("CenaOtwarta")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(inneColumn, harmCeny.FindProperty("Inne")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(progPromocjiColumn, harmCeny.FindProperty("ProgPromocji")!, harmCenyTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn, harmCeny.FindProperty("Stawka")!, harmCenyTableMapping); + + var harmCykl = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmCykl")!; + + var defaultTableMappings32 = new List>(); + harmCykl.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings32); + var blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmCykl", null, relationalModel); + var doDniaColumnBase = new ColumnBase("DoDnia", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.Columns.Add("DoDnia", doDniaColumnBase); + var doGodzColumnBase = new ColumnBase("DoGodz", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.Columns.Add("DoGodz", doGodzColumnBase); + var doMinColumnBase = new ColumnBase("DoMin", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.Columns.Add("DoMin", doMinColumnBase); + var harmIdColumnBase0 = new ColumnBase("HarmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.Columns.Add("HarmId", harmIdColumnBase0); + var odDniaColumnBase = new ColumnBase("OdDnia", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.Columns.Add("OdDnia", odDniaColumnBase); + var odGodzColumnBase = new ColumnBase("OdGodz", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.Columns.Add("OdGodz", odGodzColumnBase); + var odMinColumnBase = new ColumnBase("OdMin", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.Columns.Add("OdMin", odMinColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmCykl", blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase = new TableMappingBase(harmCykl, blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmCyklTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase, false); + defaultTableMappings32.Add(blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)harmIdColumnBase0, harmCykl.FindProperty("HarmId")!, blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odDniaColumnBase, harmCykl.FindProperty("OdDnia")!, blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odGodzColumnBase, harmCykl.FindProperty("OdGodz")!, blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odMinColumnBase, harmCykl.FindProperty("OdMin")!, blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)doDniaColumnBase, harmCykl.FindProperty("DoDnia")!, blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)doGodzColumnBase, harmCykl.FindProperty("DoGodz")!, blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)doMinColumnBase, harmCykl.FindProperty("DoMin")!, blinkBackofficeServicesPcmDbEntitiesHarmCyklMappingBase); + + var tableMappings32 = new List(); + harmCykl.SetRuntimeAnnotation("Relational:TableMappings", tableMappings32); + var harmCyklTable = new Table("HarmCykl", null, relationalModel); + var harmIdColumn0 = new Column("HarmId", "numeric(9,0)", harmCyklTable); + harmCyklTable.Columns.Add("HarmId", harmIdColumn0); + var odDniaColumn = new Column("OdDnia", "smallint", harmCyklTable); + harmCyklTable.Columns.Add("OdDnia", odDniaColumn); + var odGodzColumn = new Column("OdGodz", "smallint", harmCyklTable); + harmCyklTable.Columns.Add("OdGodz", odGodzColumn); + var odMinColumn = new Column("OdMin", "smallint", harmCyklTable); + harmCyklTable.Columns.Add("OdMin", odMinColumn); + var doDniaColumn = new Column("DoDnia", "smallint", harmCyklTable) + { + IsNullable = true + }; + harmCyklTable.Columns.Add("DoDnia", doDniaColumn); + var doGodzColumn = new Column("DoGodz", "smallint", harmCyklTable) + { + IsNullable = true + }; + harmCyklTable.Columns.Add("DoGodz", doGodzColumn); + var doMinColumn = new Column("DoMin", "smallint", harmCyklTable) + { + IsNullable = true + }; + harmCyklTable.Columns.Add("DoMin", doMinColumn); + var pK_HARMCYKL = new UniqueConstraint("PK_HARMCYKL", harmCyklTable, new[] { harmIdColumn0, odDniaColumn, odGodzColumn, odMinColumn }); + harmCyklTable.PrimaryKey = pK_HARMCYKL; + var pK_HARMCYKLUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmCykl", + new[] { "HarmId", "OdDnia", "OdGodz", "OdMin" }); + pK_HARMCYKL.MappedKeys.Add(pK_HARMCYKLUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HARMCYKLUc).Add(pK_HARMCYKL); + harmCyklTable.UniqueConstraints.Add("PK_HARMCYKL", pK_HARMCYKL); + relationalModel.Tables.Add(("HarmCykl", null), harmCyklTable); + var harmCyklTableMapping = new TableMapping(harmCykl, harmCyklTable, true); + harmCyklTable.AddTypeMapping(harmCyklTableMapping, false); + tableMappings32.Add(harmCyklTableMapping); + RelationalModel.CreateColumnMapping(harmIdColumn0, harmCykl.FindProperty("HarmId")!, harmCyklTableMapping); + RelationalModel.CreateColumnMapping(odDniaColumn, harmCykl.FindProperty("OdDnia")!, harmCyklTableMapping); + RelationalModel.CreateColumnMapping(odGodzColumn, harmCykl.FindProperty("OdGodz")!, harmCyklTableMapping); + RelationalModel.CreateColumnMapping(odMinColumn, harmCykl.FindProperty("OdMin")!, harmCyklTableMapping); + RelationalModel.CreateColumnMapping(doDniaColumn, harmCykl.FindProperty("DoDnia")!, harmCyklTableMapping); + RelationalModel.CreateColumnMapping(doGodzColumn, harmCykl.FindProperty("DoGodz")!, harmCyklTableMapping); + RelationalModel.CreateColumnMapping(doMinColumn, harmCykl.FindProperty("DoMin")!, harmCyklTableMapping); + + var harmHarm = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmHarm")!; + + var defaultTableMappings33 = new List>(); + harmHarm.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings33); + var blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmHarm", null, relationalModel); + var harmIdColumnBase1 = new ColumnBase("HarmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase.Columns.Add("HarmId", harmIdColumnBase1); + var poprzHarmIdColumnBase = new ColumnBase("PoprzHarmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase.Columns.Add("PoprzHarmId", poprzHarmIdColumnBase); + var znaczenieColumnBase2 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase.Columns.Add("Znaczenie", znaczenieColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmHarm", blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmHarmMappingBase = new TableMappingBase(harmHarm, blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmHarmTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmHarmMappingBase, false); + defaultTableMappings33.Add(blinkBackofficeServicesPcmDbEntitiesHarmHarmMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)harmIdColumnBase1, harmHarm.FindProperty("HarmId")!, blinkBackofficeServicesPcmDbEntitiesHarmHarmMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase2, harmHarm.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesHarmHarmMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poprzHarmIdColumnBase, harmHarm.FindProperty("PoprzHarmId")!, blinkBackofficeServicesPcmDbEntitiesHarmHarmMappingBase); + + var tableMappings33 = new List(); + harmHarm.SetRuntimeAnnotation("Relational:TableMappings", tableMappings33); + var harmHarmTable = new Table("HarmHarm", null, relationalModel); + var harmIdColumn1 = new Column("HarmId", "numeric(9,0)", harmHarmTable); + harmHarmTable.Columns.Add("HarmId", harmIdColumn1); + var znaczenieColumn2 = new Column("Znaczenie", "smallint", harmHarmTable); + harmHarmTable.Columns.Add("Znaczenie", znaczenieColumn2); + var poprzHarmIdColumn = new Column("PoprzHarmId", "numeric(9,0)", harmHarmTable); + harmHarmTable.Columns.Add("PoprzHarmId", poprzHarmIdColumn); + var pK_HARMHARM = new UniqueConstraint("PK_HARMHARM", harmHarmTable, new[] { harmIdColumn1, znaczenieColumn2 }); + harmHarmTable.PrimaryKey = pK_HARMHARM; + var pK_HARMHARMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmHarm", + new[] { "HarmId", "Znaczenie" }); + pK_HARMHARM.MappedKeys.Add(pK_HARMHARMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HARMHARMUc).Add(pK_HARMHARM); + harmHarmTable.UniqueConstraints.Add("PK_HARMHARM", pK_HARMHARM); + var iX_HarmHarm_PoprzHarmId = new TableIndex( + "IX_HarmHarm_PoprzHarmId", harmHarmTable, new[] { poprzHarmIdColumn }, false); + var iX_HarmHarm_PoprzHarmIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmHarm", + new[] { "PoprzHarmId" }); + iX_HarmHarm_PoprzHarmId.MappedIndexes.Add(iX_HarmHarm_PoprzHarmIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_HarmHarm_PoprzHarmIdIx).Add(iX_HarmHarm_PoprzHarmId); + harmHarmTable.Indexes.Add("IX_HarmHarm_PoprzHarmId", iX_HarmHarm_PoprzHarmId); + relationalModel.Tables.Add(("HarmHarm", null), harmHarmTable); + var harmHarmTableMapping = new TableMapping(harmHarm, harmHarmTable, true); + harmHarmTable.AddTypeMapping(harmHarmTableMapping, false); + tableMappings33.Add(harmHarmTableMapping); + RelationalModel.CreateColumnMapping(harmIdColumn1, harmHarm.FindProperty("HarmId")!, harmHarmTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn2, harmHarm.FindProperty("Znaczenie")!, harmHarmTableMapping); + RelationalModel.CreateColumnMapping(poprzHarmIdColumn, harmHarm.FindProperty("PoprzHarmId")!, harmHarmTableMapping); + + var harmRap = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmRap")!; + + var defaultTableMappings34 = new List>(); + harmRap.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings34); + var blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmRap", null, relationalModel); + var aktywnyColumnBase5 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("Aktywny", aktywnyColumnBase5); + var dataDoColumnBase0 = new ColumnBase("DataDo", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("DataDo", dataDoColumnBase0); + var dataOdColumnBase0 = new ColumnBase("DataOd", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("DataOd", dataOdColumnBase0); + var hRIdColumnBase = new ColumnBase("HRId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("HRId", hRIdColumnBase); + var nazwaColumnBase8 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("Nazwa", nazwaColumnBase8); + var rodzajCyklicznosciColumnBase = new ColumnBase("RodzajCyklicznosci", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("RodzajCyklicznosci", rodzajCyklicznosciColumnBase); + var rodzajEksportuColumnBase = new ColumnBase("RodzajEksportu", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("RodzajEksportu", rodzajEksportuColumnBase); + var typColumnBase3 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("Typ", typColumnBase3); + var wysylajEmailColumnBase = new ColumnBase("WysylajEmail", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("WysylajEmail", wysylajEmailColumnBase); + var zmianaColumnBase8 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.Columns.Add("Zmiana", zmianaColumnBase8); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmRap", blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase = new TableMappingBase(harmRap, blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmRapTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase, false); + defaultTableMappings34.Add(blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hRIdColumnBase, harmRap.FindProperty("HRId")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase5, harmRap.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDoColumnBase0, harmRap.FindProperty("DataDo")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataOdColumnBase0, harmRap.FindProperty("DataOd")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase8, harmRap.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajCyklicznosciColumnBase, harmRap.FindProperty("RodzajCyklicznosci")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajEksportuColumnBase, harmRap.FindProperty("RodzajEksportu")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase3, harmRap.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wysylajEmailColumnBase, harmRap.FindProperty("WysylajEmail")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase8, harmRap.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesHarmRapMappingBase); + + var tableMappings34 = new List(); + harmRap.SetRuntimeAnnotation("Relational:TableMappings", tableMappings34); + var harmRapTable = new Table("HarmRap", null, relationalModel); + var hRIdColumn = new Column("HRId", "numeric(9,0)", harmRapTable); + harmRapTable.Columns.Add("HRId", hRIdColumn); + var aktywnyColumn5 = new Column("Aktywny", "smallint", harmRapTable); + harmRapTable.Columns.Add("Aktywny", aktywnyColumn5); + var dataDoColumn0 = new Column("DataDo", "datetime", harmRapTable) + { + IsNullable = true + }; + harmRapTable.Columns.Add("DataDo", dataDoColumn0); + var dataOdColumn0 = new Column("DataOd", "datetime", harmRapTable); + harmRapTable.Columns.Add("DataOd", dataOdColumn0); + var nazwaColumn8 = new Column("Nazwa", "varchar(255)", harmRapTable); + harmRapTable.Columns.Add("Nazwa", nazwaColumn8); + var rodzajCyklicznosciColumn = new Column("RodzajCyklicznosci", "smallint", harmRapTable); + harmRapTable.Columns.Add("RodzajCyklicznosci", rodzajCyklicznosciColumn); + var rodzajEksportuColumn = new Column("RodzajEksportu", "smallint", harmRapTable) + { + IsNullable = true + }; + harmRapTable.Columns.Add("RodzajEksportu", rodzajEksportuColumn); + var typColumn3 = new Column("Typ", "smallint", harmRapTable); + harmRapTable.Columns.Add("Typ", typColumn3); + var wysylajEmailColumn = new Column("WysylajEmail", "smallint", harmRapTable) + { + IsNullable = true + }; + harmRapTable.Columns.Add("WysylajEmail", wysylajEmailColumn); + var zmianaColumn8 = new Column("Zmiana", "datetime", harmRapTable); + harmRapTable.Columns.Add("Zmiana", zmianaColumn8); + var pK_HarmRap = new UniqueConstraint("PK_HarmRap", harmRapTable, new[] { hRIdColumn }); + harmRapTable.PrimaryKey = pK_HarmRap; + var pK_HarmRapUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRap", + new[] { "HRId" }); + pK_HarmRap.MappedKeys.Add(pK_HarmRapUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HarmRapUc).Add(pK_HarmRap); + harmRapTable.UniqueConstraints.Add("PK_HarmRap", pK_HarmRap); + relationalModel.Tables.Add(("HarmRap", null), harmRapTable); + var harmRapTableMapping = new TableMapping(harmRap, harmRapTable, true); + harmRapTable.AddTypeMapping(harmRapTableMapping, false); + tableMappings34.Add(harmRapTableMapping); + RelationalModel.CreateColumnMapping(hRIdColumn, harmRap.FindProperty("HRId")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn5, harmRap.FindProperty("Aktywny")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(dataDoColumn0, harmRap.FindProperty("DataDo")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(dataOdColumn0, harmRap.FindProperty("DataOd")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn8, harmRap.FindProperty("Nazwa")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(rodzajCyklicznosciColumn, harmRap.FindProperty("RodzajCyklicznosci")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(rodzajEksportuColumn, harmRap.FindProperty("RodzajEksportu")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(typColumn3, harmRap.FindProperty("Typ")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(wysylajEmailColumn, harmRap.FindProperty("WysylajEmail")!, harmRapTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn8, harmRap.FindProperty("Zmiana")!, harmRapTableMapping); + + var harmRapCykl = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmRapCykl")!; + + var defaultTableMappings35 = new List>(); + harmRapCykl.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings35); + var blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmRapCykl", null, relationalModel); + var dzienColumnBase2 = new ColumnBase("Dzien", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase.Columns.Add("Dzien", dzienColumnBase2); + var godzinaColumnBase = new ColumnBase("Godzina", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase.Columns.Add("Godzina", godzinaColumnBase); + var hRIdColumnBase0 = new ColumnBase("HRId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase.Columns.Add("HRId", hRIdColumnBase0); + var minutaColumnBase = new ColumnBase("Minuta", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase.Columns.Add("Minuta", minutaColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmRapCykl", blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmRapCyklMappingBase = new TableMappingBase(harmRapCykl, blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmRapCyklTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmRapCyklMappingBase, false); + defaultTableMappings35.Add(blinkBackofficeServicesPcmDbEntitiesHarmRapCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase2, harmRapCykl.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesHarmRapCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)godzinaColumnBase, harmRapCykl.FindProperty("Godzina")!, blinkBackofficeServicesPcmDbEntitiesHarmRapCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hRIdColumnBase0, harmRapCykl.FindProperty("HRId")!, blinkBackofficeServicesPcmDbEntitiesHarmRapCyklMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minutaColumnBase, harmRapCykl.FindProperty("Minuta")!, blinkBackofficeServicesPcmDbEntitiesHarmRapCyklMappingBase); + + var tableMappings35 = new List(); + harmRapCykl.SetRuntimeAnnotation("Relational:TableMappings", tableMappings35); + var harmRapCyklTable = new Table("HarmRapCykl", null, relationalModel); + var hRIdColumn0 = new Column("HRId", "numeric(9,0)", harmRapCyklTable); + harmRapCyklTable.Columns.Add("HRId", hRIdColumn0); + var dzienColumn2 = new Column("Dzien", "smallint", harmRapCyklTable); + harmRapCyklTable.Columns.Add("Dzien", dzienColumn2); + var godzinaColumn = new Column("Godzina", "smallint", harmRapCyklTable); + harmRapCyklTable.Columns.Add("Godzina", godzinaColumn); + var minutaColumn = new Column("Minuta", "smallint", harmRapCyklTable); + harmRapCyklTable.Columns.Add("Minuta", minutaColumn); + var pK_HarmRapCykl = new UniqueConstraint("PK_HarmRapCykl", harmRapCyklTable, new[] { hRIdColumn0, dzienColumn2, godzinaColumn, minutaColumn }); + harmRapCyklTable.PrimaryKey = pK_HarmRapCykl; + var pK_HarmRapCyklUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapCykl", + new[] { "HRId", "Dzien", "Godzina", "Minuta" }); + pK_HarmRapCykl.MappedKeys.Add(pK_HarmRapCyklUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HarmRapCyklUc).Add(pK_HarmRapCykl); + harmRapCyklTable.UniqueConstraints.Add("PK_HarmRapCykl", pK_HarmRapCykl); + relationalModel.Tables.Add(("HarmRapCykl", null), harmRapCyklTable); + var harmRapCyklTableMapping = new TableMapping(harmRapCykl, harmRapCyklTable, true); + harmRapCyklTable.AddTypeMapping(harmRapCyklTableMapping, false); + tableMappings35.Add(harmRapCyklTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn2, harmRapCykl.FindProperty("Dzien")!, harmRapCyklTableMapping); + RelationalModel.CreateColumnMapping(godzinaColumn, harmRapCykl.FindProperty("Godzina")!, harmRapCyklTableMapping); + RelationalModel.CreateColumnMapping(hRIdColumn0, harmRapCykl.FindProperty("HRId")!, harmRapCyklTableMapping); + RelationalModel.CreateColumnMapping(minutaColumn, harmRapCykl.FindProperty("Minuta")!, harmRapCyklTableMapping); + + var harmRapParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmRapParam")!; + + var defaultTableMappings36 = new List>(); + harmRapParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings36); + var blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmRapParam", null, relationalModel); + var hRIdColumnBase1 = new ColumnBase("HRId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase.Columns.Add("HRId", hRIdColumnBase1); + var parNazwaColumnBase = new ColumnBase("ParNazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase.Columns.Add("ParNazwa", parNazwaColumnBase); + var parWartoscColumnBase = new ColumnBase("ParWartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase.Columns.Add("ParWartosc", parWartoscColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmRapParam", blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmRapParamMappingBase = new TableMappingBase(harmRapParam, blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmRapParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmRapParamMappingBase, false); + defaultTableMappings36.Add(blinkBackofficeServicesPcmDbEntitiesHarmRapParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hRIdColumnBase1, harmRapParam.FindProperty("HRId")!, blinkBackofficeServicesPcmDbEntitiesHarmRapParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase, harmRapParam.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesHarmRapParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parWartoscColumnBase, harmRapParam.FindProperty("ParWartosc")!, blinkBackofficeServicesPcmDbEntitiesHarmRapParamMappingBase); + + var tableMappings36 = new List(); + harmRapParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings36); + var harmRapParamTable = new Table("HarmRapParam", null, relationalModel); + var hRIdColumn1 = new Column("HRId", "numeric(9,0)", harmRapParamTable); + harmRapParamTable.Columns.Add("HRId", hRIdColumn1); + var parNazwaColumn = new Column("ParNazwa", "varchar(40)", harmRapParamTable); + harmRapParamTable.Columns.Add("ParNazwa", parNazwaColumn); + var parWartoscColumn = new Column("ParWartosc", "varchar(255)", harmRapParamTable); + harmRapParamTable.Columns.Add("ParWartosc", parWartoscColumn); + var pK_HarmRapParam = new UniqueConstraint("PK_HarmRapParam", harmRapParamTable, new[] { hRIdColumn1, parNazwaColumn }); + harmRapParamTable.PrimaryKey = pK_HarmRapParam; + var pK_HarmRapParamUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapParam", + new[] { "HRId", "ParNazwa" }); + pK_HarmRapParam.MappedKeys.Add(pK_HarmRapParamUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HarmRapParamUc).Add(pK_HarmRapParam); + harmRapParamTable.UniqueConstraints.Add("PK_HarmRapParam", pK_HarmRapParam); + relationalModel.Tables.Add(("HarmRapParam", null), harmRapParamTable); + var harmRapParamTableMapping = new TableMapping(harmRapParam, harmRapParamTable, true); + harmRapParamTable.AddTypeMapping(harmRapParamTableMapping, false); + tableMappings36.Add(harmRapParamTableMapping); + RelationalModel.CreateColumnMapping(hRIdColumn1, harmRapParam.FindProperty("HRId")!, harmRapParamTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn, harmRapParam.FindProperty("ParNazwa")!, harmRapParamTableMapping); + RelationalModel.CreateColumnMapping(parWartoscColumn, harmRapParam.FindProperty("ParWartosc")!, harmRapParamTableMapping); + + var harmRapZlecenie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmRapZlecenie")!; + + var defaultTableMappings37 = new List>(); + harmRapZlecenie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings37); + var blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmRapZlecenie", null, relationalModel); + var dataCzasColumnBase = new ColumnBase("DataCzas", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase.Columns.Add("DataCzas", dataCzasColumnBase); + var hRIdColumnBase2 = new ColumnBase("HRId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase.Columns.Add("HRId", hRIdColumnBase2); + var komentarzColumnBase = new ColumnBase("Komentarz", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase.Columns.Add("Komentarz", komentarzColumnBase); + var statusColumnBase1 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase.Columns.Add("Status", statusColumnBase1); + var zmianaColumnBase9 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase.Columns.Add("Zmiana", zmianaColumnBase9); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmRapZlecenie", blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase = new TableMappingBase(harmRapZlecenie, blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase, false); + defaultTableMappings37.Add(blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasColumnBase, harmRapZlecenie.FindProperty("DataCzas")!, blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hRIdColumnBase2, harmRapZlecenie.FindProperty("HRId")!, blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)komentarzColumnBase, harmRapZlecenie.FindProperty("Komentarz")!, blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase1, harmRapZlecenie.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase9, harmRapZlecenie.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesHarmRapZlecenieMappingBase); + + var tableMappings37 = new List(); + harmRapZlecenie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings37); + var harmRapZlecenieTable = new Table("HarmRapZlecenie", null, relationalModel); + var hRIdColumn2 = new Column("HRId", "numeric(9,0)", harmRapZlecenieTable); + harmRapZlecenieTable.Columns.Add("HRId", hRIdColumn2); + var dataCzasColumn = new Column("DataCzas", "datetime", harmRapZlecenieTable); + harmRapZlecenieTable.Columns.Add("DataCzas", dataCzasColumn); + var komentarzColumn = new Column("Komentarz", "varchar(255)", harmRapZlecenieTable) + { + IsNullable = true + }; + harmRapZlecenieTable.Columns.Add("Komentarz", komentarzColumn); + var statusColumn1 = new Column("Status", "smallint", harmRapZlecenieTable); + harmRapZlecenieTable.Columns.Add("Status", statusColumn1); + var zmianaColumn9 = new Column("Zmiana", "datetime", harmRapZlecenieTable); + harmRapZlecenieTable.Columns.Add("Zmiana", zmianaColumn9); + var pK_HarmRapZlecenie = new UniqueConstraint("PK_HarmRapZlecenie", harmRapZlecenieTable, new[] { hRIdColumn2, dataCzasColumn }); + harmRapZlecenieTable.PrimaryKey = pK_HarmRapZlecenie; + var pK_HarmRapZlecenieUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapZlecenie", + new[] { "HRId", "DataCzas" }); + pK_HarmRapZlecenie.MappedKeys.Add(pK_HarmRapZlecenieUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HarmRapZlecenieUc).Add(pK_HarmRapZlecenie); + harmRapZlecenieTable.UniqueConstraints.Add("PK_HarmRapZlecenie", pK_HarmRapZlecenie); + var idx_HarmRapZlecenieDataCzas = new TableIndex( + "idx_HarmRapZlecenieDataCzas", harmRapZlecenieTable, new[] { dataCzasColumn }, false); + var idx_HarmRapZlecenieDataCzasIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapZlecenie", + "idx_HarmRapZlecenieDataCzas"); + idx_HarmRapZlecenieDataCzas.MappedIndexes.Add(idx_HarmRapZlecenieDataCzasIx); + RelationalModel.GetOrCreateTableIndexes(idx_HarmRapZlecenieDataCzasIx).Add(idx_HarmRapZlecenieDataCzas); + harmRapZlecenieTable.Indexes.Add("idx_HarmRapZlecenieDataCzas", idx_HarmRapZlecenieDataCzas); + relationalModel.Tables.Add(("HarmRapZlecenie", null), harmRapZlecenieTable); + var harmRapZlecenieTableMapping = new TableMapping(harmRapZlecenie, harmRapZlecenieTable, true); + harmRapZlecenieTable.AddTypeMapping(harmRapZlecenieTableMapping, false); + tableMappings37.Add(harmRapZlecenieTableMapping); + RelationalModel.CreateColumnMapping(dataCzasColumn, harmRapZlecenie.FindProperty("DataCzas")!, harmRapZlecenieTableMapping); + RelationalModel.CreateColumnMapping(hRIdColumn2, harmRapZlecenie.FindProperty("HRId")!, harmRapZlecenieTableMapping); + RelationalModel.CreateColumnMapping(komentarzColumn, harmRapZlecenie.FindProperty("Komentarz")!, harmRapZlecenieTableMapping); + RelationalModel.CreateColumnMapping(statusColumn1, harmRapZlecenie.FindProperty("Status")!, harmRapZlecenieTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn9, harmRapZlecenie.FindProperty("Zmiana")!, harmRapZlecenieTableMapping); + + var harmWpis = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.HarmWpis")!; + + var defaultTableMappings38 = new List>(); + harmWpis.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings38); + var blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", null, relationalModel); + var aktywnyColumnBase6 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("Aktywny", aktywnyColumnBase6); + var centrHarmIdColumnBase = new ColumnBase("CentrHarmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("CentrHarmId", centrHarmIdColumnBase); + var cenyBruttoColumnBase = new ColumnBase("CenyBrutto", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("CenyBrutto", cenyBruttoColumnBase); + var harmIdColumnBase2 = new ColumnBase("HarmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("HarmId", harmIdColumnBase2); + var harmTypColumnBase = new ColumnBase("HarmTyp", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("HarmTyp", harmTypColumnBase); + var krajIdColumnBase = new ColumnBase("KrajId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("KrajId", krajIdColumnBase); + var nazwaColumnBase9 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("Nazwa", nazwaColumnBase9); + var opcjeColumnBase0 = new ColumnBase("Opcje", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("Opcje", opcjeColumnBase0); + var polIdColumnBase = new ColumnBase("PolId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("PolId", polIdColumnBase); + var uwzglednionyColumnBase = new ColumnBase("Uwzgledniony", "smallint", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("Uwzgledniony", uwzglednionyColumnBase); + var waznyDoColumnBase = new ColumnBase("WaznyDo", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("WaznyDo", waznyDoColumnBase); + var waznyOdColumnBase = new ColumnBase("WaznyOd", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("WaznyOd", waznyOdColumnBase); + var zmianaColumnBase10 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.Columns.Add("Zmiana", zmianaColumnBase10); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase); + var blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase = new TableMappingBase(harmWpis, blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase, true); + blinkBackofficeServicesPcmDbEntitiesHarmWpisTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase, false); + defaultTableMappings38.Add(blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)harmIdColumnBase2, harmWpis.FindProperty("HarmId")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase6, harmWpis.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrHarmIdColumnBase, harmWpis.FindProperty("CentrHarmId")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenyBruttoColumnBase, harmWpis.FindProperty("CenyBrutto")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)harmTypColumnBase, harmWpis.FindProperty("HarmTyp")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)krajIdColumnBase, harmWpis.FindProperty("KrajId")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase9, harmWpis.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjeColumnBase0, harmWpis.FindProperty("Opcje")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)polIdColumnBase, harmWpis.FindProperty("PolId")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uwzglednionyColumnBase, harmWpis.FindProperty("Uwzgledniony")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)waznyDoColumnBase, harmWpis.FindProperty("WaznyDo")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)waznyOdColumnBase, harmWpis.FindProperty("WaznyOd")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase10, harmWpis.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesHarmWpisMappingBase); + + var tableMappings38 = new List(); + harmWpis.SetRuntimeAnnotation("Relational:TableMappings", tableMappings38); + var harmWpisTable = new Table("HarmWpis", null, relationalModel); + var harmIdColumn2 = new Column("HarmId", "numeric(9,0)", harmWpisTable); + harmWpisTable.Columns.Add("HarmId", harmIdColumn2); + var aktywnyColumn6 = new Column("Aktywny", "smallint", harmWpisTable); + harmWpisTable.Columns.Add("Aktywny", aktywnyColumn6); + var centrHarmIdColumn = new Column("CentrHarmId", "numeric(9,0)", harmWpisTable) + { + IsNullable = true + }; + harmWpisTable.Columns.Add("CentrHarmId", centrHarmIdColumn); + var cenyBruttoColumn = new Column("CenyBrutto", "smallint", harmWpisTable) + { + IsNullable = true + }; + harmWpisTable.Columns.Add("CenyBrutto", cenyBruttoColumn); + var harmTypColumn = new Column("HarmTyp", "smallint", harmWpisTable); + harmWpisTable.Columns.Add("HarmTyp", harmTypColumn); + var krajIdColumn = new Column("KrajId", "numeric(9,0)", harmWpisTable) + { + IsNullable = true + }; + harmWpisTable.Columns.Add("KrajId", krajIdColumn); + var nazwaColumn9 = new Column("Nazwa", "varchar(40)", harmWpisTable); + harmWpisTable.Columns.Add("Nazwa", nazwaColumn9); + var opcjeColumn0 = new Column("Opcje", "varchar(255)", harmWpisTable); + harmWpisTable.Columns.Add("Opcje", opcjeColumn0); + var polIdColumn = new Column("PolId", "numeric(9,0)", harmWpisTable) + { + IsNullable = true + }; + harmWpisTable.Columns.Add("PolId", polIdColumn); + var uwzglednionyColumn = new Column("Uwzgledniony", "smallint", harmWpisTable); + harmWpisTable.Columns.Add("Uwzgledniony", uwzglednionyColumn); + var waznyDoColumn = new Column("WaznyDo", "datetime", harmWpisTable) + { + IsNullable = true + }; + harmWpisTable.Columns.Add("WaznyDo", waznyDoColumn); + var waznyOdColumn = new Column("WaznyOd", "datetime", harmWpisTable) + { + IsNullable = true + }; + harmWpisTable.Columns.Add("WaznyOd", waznyOdColumn); + var zmianaColumn10 = new Column("Zmiana", "datetime", harmWpisTable); + harmWpisTable.Columns.Add("Zmiana", zmianaColumn10); + var pK_HARMWPIS = new UniqueConstraint("PK_HARMWPIS", harmWpisTable, new[] { harmIdColumn2 }); + harmWpisTable.PrimaryKey = pK_HARMWPIS; + var pK_HARMWPISUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + new[] { "HarmId" }); + pK_HARMWPIS.MappedKeys.Add(pK_HARMWPISUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_HARMWPISUc).Add(pK_HARMWPIS); + harmWpisTable.UniqueConstraints.Add("PK_HARMWPIS", pK_HARMWPIS); + var idx_HarmKraj = new TableIndex( + "idx_HarmKraj", harmWpisTable, new[] { krajIdColumn, harmIdColumn2 }, false); + var idx_HarmKrajIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + "idx_HarmKraj"); + idx_HarmKraj.MappedIndexes.Add(idx_HarmKrajIx); + RelationalModel.GetOrCreateTableIndexes(idx_HarmKrajIx).Add(idx_HarmKraj); + harmWpisTable.Indexes.Add("idx_HarmKraj", idx_HarmKraj); + var idx_HarmPol = new TableIndex( + "idx_HarmPol", harmWpisTable, new[] { polIdColumn }, false); + var idx_HarmPolIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + "idx_HarmPol"); + idx_HarmPol.MappedIndexes.Add(idx_HarmPolIx); + RelationalModel.GetOrCreateTableIndexes(idx_HarmPolIx).Add(idx_HarmPol); + harmWpisTable.Indexes.Add("idx_HarmPol", idx_HarmPol); + relationalModel.Tables.Add(("HarmWpis", null), harmWpisTable); + var harmWpisTableMapping = new TableMapping(harmWpis, harmWpisTable, true); + harmWpisTable.AddTypeMapping(harmWpisTableMapping, false); + tableMappings38.Add(harmWpisTableMapping); + RelationalModel.CreateColumnMapping(harmIdColumn2, harmWpis.FindProperty("HarmId")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn6, harmWpis.FindProperty("Aktywny")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(centrHarmIdColumn, harmWpis.FindProperty("CentrHarmId")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(cenyBruttoColumn, harmWpis.FindProperty("CenyBrutto")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(harmTypColumn, harmWpis.FindProperty("HarmTyp")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(krajIdColumn, harmWpis.FindProperty("KrajId")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn9, harmWpis.FindProperty("Nazwa")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(opcjeColumn0, harmWpis.FindProperty("Opcje")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(polIdColumn, harmWpis.FindProperty("PolId")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(uwzglednionyColumn, harmWpis.FindProperty("Uwzgledniony")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(waznyDoColumn, harmWpis.FindProperty("WaznyDo")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(waznyOdColumn, harmWpis.FindProperty("WaznyOd")!, harmWpisTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn10, harmWpis.FindProperty("Zmiana")!, harmWpisTableMapping); + + var istw = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Istw")!; + + var defaultTableMappings39 = new List>(); + istw.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings39); + var blinkBackofficeServicesPcmDbEntitiesIstwTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Istw", null, relationalModel); + var blokadaMagColumnBase = new ColumnBase("BlokadaMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("BlokadaMag", blokadaMagColumnBase); + var cenaMagColumnBase = new ColumnBase("CenaMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("CenaMag", cenaMagColumnBase); + var magIdColumnBase1 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("MagId", magIdColumnBase1); + var rezerwacjaMagColumnBase = new ColumnBase("RezerwacjaMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("RezerwacjaMag", rezerwacjaMagColumnBase); + var stanMagColumnBase = new ColumnBase("StanMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("StanMag", stanMagColumnBase); + var stanMaxColumnBase = new ColumnBase("StanMax", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("StanMax", stanMaxColumnBase); + var stanMinColumnBase = new ColumnBase("StanMin", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("StanMin", stanMinColumnBase); + var towIdColumnBase2 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.Columns.Add("TowId", towIdColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Istw", blinkBackofficeServicesPcmDbEntitiesIstwTableBase); + var blinkBackofficeServicesPcmDbEntitiesIstwMappingBase = new TableMappingBase(istw, blinkBackofficeServicesPcmDbEntitiesIstwTableBase, true); + blinkBackofficeServicesPcmDbEntitiesIstwTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesIstwMappingBase, false); + defaultTableMappings39.Add(blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase1, istw.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase2, istw.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokadaMagColumnBase, istw.FindProperty("BlokadaMag")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaMagColumnBase, istw.FindProperty("CenaMag")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwacjaMagColumnBase, istw.FindProperty("RezerwacjaMag")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanMagColumnBase, istw.FindProperty("StanMag")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanMaxColumnBase, istw.FindProperty("StanMax")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanMinColumnBase, istw.FindProperty("StanMin")!, blinkBackofficeServicesPcmDbEntitiesIstwMappingBase); + + var tableMappings39 = new List(); + istw.SetRuntimeAnnotation("Relational:TableMappings", tableMappings39); + var istwTable = new Table("Istw", null, relationalModel); + var towIdColumn2 = new Column("TowId", "numeric(9,0)", istwTable); + istwTable.Columns.Add("TowId", towIdColumn2); + var magIdColumn1 = new Column("MagId", "numeric(9,0)", istwTable); + istwTable.Columns.Add("MagId", magIdColumn1); + var blokadaMagColumn = new Column("BlokadaMag", "decimal(15,4)", istwTable); + istwTable.Columns.Add("BlokadaMag", blokadaMagColumn); + var cenaMagColumn = new Column("CenaMag", "decimal(15,4)", istwTable); + istwTable.Columns.Add("CenaMag", cenaMagColumn); + var rezerwacjaMagColumn = new Column("RezerwacjaMag", "decimal(15,4)", istwTable) + { + IsNullable = true + }; + istwTable.Columns.Add("RezerwacjaMag", rezerwacjaMagColumn); + var stanMagColumn = new Column("StanMag", "decimal(15,4)", istwTable); + istwTable.Columns.Add("StanMag", stanMagColumn); + var stanMaxColumn = new Column("StanMax", "decimal(15,4)", istwTable); + istwTable.Columns.Add("StanMax", stanMaxColumn); + var stanMinColumn = new Column("StanMin", "decimal(15,4)", istwTable); + istwTable.Columns.Add("StanMin", stanMinColumn); + var pK_ISTW = new UniqueConstraint("PK_ISTW", istwTable, new[] { towIdColumn2, magIdColumn1 }); + istwTable.PrimaryKey = pK_ISTW; + var pK_ISTWUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Istw", + new[] { "TowId", "MagId" }); + pK_ISTW.MappedKeys.Add(pK_ISTWUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ISTWUc).Add(pK_ISTW); + istwTable.UniqueConstraints.Add("PK_ISTW", pK_ISTW); + var iX_Istw_MagId = new TableIndex( + "IX_Istw_MagId", istwTable, new[] { magIdColumn1 }, false); + var iX_Istw_MagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Istw", + new[] { "MagId" }); + iX_Istw_MagId.MappedIndexes.Add(iX_Istw_MagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Istw_MagIdIx).Add(iX_Istw_MagId); + istwTable.Indexes.Add("IX_Istw_MagId", iX_Istw_MagId); + relationalModel.Tables.Add(("Istw", null), istwTable); + var istwTableMapping = new TableMapping(istw, istwTable, true); + istwTable.AddTypeMapping(istwTableMapping, false); + tableMappings39.Add(istwTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn1, istw.FindProperty("MagId")!, istwTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn2, istw.FindProperty("TowId")!, istwTableMapping); + RelationalModel.CreateColumnMapping(blokadaMagColumn, istw.FindProperty("BlokadaMag")!, istwTableMapping); + RelationalModel.CreateColumnMapping(cenaMagColumn, istw.FindProperty("CenaMag")!, istwTableMapping); + RelationalModel.CreateColumnMapping(rezerwacjaMagColumn, istw.FindProperty("RezerwacjaMag")!, istwTableMapping); + RelationalModel.CreateColumnMapping(stanMagColumn, istw.FindProperty("StanMag")!, istwTableMapping); + RelationalModel.CreateColumnMapping(stanMaxColumn, istw.FindProperty("StanMax")!, istwTableMapping); + RelationalModel.CreateColumnMapping(stanMinColumn, istw.FindProperty("StanMin")!, istwTableMapping); + + var jM = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.JM")!; + + var defaultTableMappings40 = new List>(); + jM.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings40); + var blinkBackofficeServicesPcmDbEntitiesJMTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.JM", null, relationalModel); + var centrJMIdColumnBase = new ColumnBase("CentrJMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesJMTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesJMTableBase.Columns.Add("CentrJMId", centrJMIdColumnBase); + var jMIdColumnBase = new ColumnBase("JMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesJMTableBase); + blinkBackofficeServicesPcmDbEntitiesJMTableBase.Columns.Add("JMId", jMIdColumnBase); + var nazwaColumnBase10 = new ColumnBase("Nazwa", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesJMTableBase); + blinkBackofficeServicesPcmDbEntitiesJMTableBase.Columns.Add("Nazwa", nazwaColumnBase10); + var precyzjaColumnBase = new ColumnBase("Precyzja", "smallint", blinkBackofficeServicesPcmDbEntitiesJMTableBase); + blinkBackofficeServicesPcmDbEntitiesJMTableBase.Columns.Add("Precyzja", precyzjaColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.JM", blinkBackofficeServicesPcmDbEntitiesJMTableBase); + var blinkBackofficeServicesPcmDbEntitiesJMMappingBase = new TableMappingBase(jM, blinkBackofficeServicesPcmDbEntitiesJMTableBase, true); + blinkBackofficeServicesPcmDbEntitiesJMTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesJMMappingBase, false); + defaultTableMappings40.Add(blinkBackofficeServicesPcmDbEntitiesJMMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jMIdColumnBase, jM.FindProperty("JMId")!, blinkBackofficeServicesPcmDbEntitiesJMMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrJMIdColumnBase, jM.FindProperty("CentrJMId")!, blinkBackofficeServicesPcmDbEntitiesJMMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase10, jM.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesJMMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)precyzjaColumnBase, jM.FindProperty("Precyzja")!, blinkBackofficeServicesPcmDbEntitiesJMMappingBase); + + var tableMappings40 = new List(); + jM.SetRuntimeAnnotation("Relational:TableMappings", tableMappings40); + var jMTable = new Table("JM", null, relationalModel); + var jMIdColumn = new Column("JMId", "numeric(9,0)", jMTable); + jMTable.Columns.Add("JMId", jMIdColumn); + var centrJMIdColumn = new Column("CentrJMId", "numeric(9,0)", jMTable) + { + IsNullable = true + }; + jMTable.Columns.Add("CentrJMId", centrJMIdColumn); + var nazwaColumn10 = new Column("Nazwa", "varchar(10)", jMTable); + jMTable.Columns.Add("Nazwa", nazwaColumn10); + var precyzjaColumn = new Column("Precyzja", "smallint", jMTable); + jMTable.Columns.Add("Precyzja", precyzjaColumn); + var pK_JM = new UniqueConstraint("PK_JM", jMTable, new[] { jMIdColumn }); + jMTable.PrimaryKey = pK_JM; + var pK_JMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.JM", + new[] { "JMId" }); + pK_JM.MappedKeys.Add(pK_JMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_JMUc).Add(pK_JM); + jMTable.UniqueConstraints.Add("PK_JM", pK_JM); + var idx_CentrJMId = new TableIndex( + "idx_CentrJMId", jMTable, new[] { centrJMIdColumn }, false); + var idx_CentrJMIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.JM", + "idx_CentrJMId"); + idx_CentrJMId.MappedIndexes.Add(idx_CentrJMIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrJMIdIx).Add(idx_CentrJMId); + jMTable.Indexes.Add("idx_CentrJMId", idx_CentrJMId); + relationalModel.Tables.Add(("JM", null), jMTable); + var jMTableMapping = new TableMapping(jM, jMTable, true); + jMTable.AddTypeMapping(jMTableMapping, false); + tableMappings40.Add(jMTableMapping); + RelationalModel.CreateColumnMapping(jMIdColumn, jM.FindProperty("JMId")!, jMTableMapping); + RelationalModel.CreateColumnMapping(centrJMIdColumn, jM.FindProperty("CentrJMId")!, jMTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn10, jM.FindProperty("Nazwa")!, jMTableMapping); + RelationalModel.CreateColumnMapping(precyzjaColumn, jM.FindProperty("Precyzja")!, jMTableMapping); + + var kartaLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KartaLoj")!; + + var defaultTableMappings41 = new List>(); + kartaLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings41); + var blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", null, relationalModel); + var centrKartaIdColumnBase = new ColumnBase("CentrKartaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("CentrKartaId", centrKartaIdColumnBase); + var kartaIdColumnBase = new ColumnBase("KartaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("KartaId", kartaIdColumnBase); + var kodKartyColumnBase = new ColumnBase("KodKarty", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("KodKarty", kodKartyColumnBase); + var kontoIdColumnBase = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("KontoId", kontoIdColumnBase); + var opis1ColumnBase = new ColumnBase("Opis1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("Opis1", opis1ColumnBase); + var opis2ColumnBase = new ColumnBase("Opis2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("Opis2", opis2ColumnBase); + var posiadaczColumnBase = new ColumnBase("Posiadacz", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("Posiadacz", posiadaczColumnBase); + var typKartyColumnBase = new ColumnBase("TypKarty", "smallint", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("TypKarty", typKartyColumnBase); + var uniewaznionoColumnBase = new ColumnBase("Uniewazniono", "datetime", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("Uniewazniono", uniewaznionoColumnBase); + var waznaDoColumnBase = new ColumnBase("WaznaDo", "datetime", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("WaznaDo", waznaDoColumnBase); + var waznaOdColumnBase = new ColumnBase("WaznaOd", "datetime", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.Columns.Add("WaznaOd", waznaOdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase = new TableMappingBase(kartaLoj, blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKartaLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase, false); + defaultTableMappings41.Add(blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kartaIdColumnBase, kartaLoj.FindProperty("KartaId")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKartaIdColumnBase, kartaLoj.FindProperty("CentrKartaId")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKartyColumnBase, kartaLoj.FindProperty("KodKarty")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase, kartaLoj.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis1ColumnBase, kartaLoj.FindProperty("Opis1")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis2ColumnBase, kartaLoj.FindProperty("Opis2")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posiadaczColumnBase, kartaLoj.FindProperty("Posiadacz")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKartyColumnBase, kartaLoj.FindProperty("TypKarty")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uniewaznionoColumnBase, kartaLoj.FindProperty("Uniewazniono")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)waznaDoColumnBase, kartaLoj.FindProperty("WaznaDo")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)waznaOdColumnBase, kartaLoj.FindProperty("WaznaOd")!, blinkBackofficeServicesPcmDbEntitiesKartaLojMappingBase); + + var tableMappings41 = new List(); + kartaLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings41); + var kartaLojTable = new Table("KartaLoj", null, relationalModel); + var kartaIdColumn = new Column("KartaId", "numeric(9,0)", kartaLojTable); + kartaLojTable.Columns.Add("KartaId", kartaIdColumn); + var centrKartaIdColumn = new Column("CentrKartaId", "numeric(9,0)", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("CentrKartaId", centrKartaIdColumn); + var kodKartyColumn = new Column("KodKarty", "varchar(40)", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("KodKarty", kodKartyColumn); + var kontoIdColumn = new Column("KontoId", "numeric(9,0)", kartaLojTable); + kartaLojTable.Columns.Add("KontoId", kontoIdColumn); + var opis1Column = new Column("Opis1", "varchar(40)", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("Opis1", opis1Column); + var opis2Column = new Column("Opis2", "varchar(40)", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("Opis2", opis2Column); + var posiadaczColumn = new Column("Posiadacz", "varchar(40)", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("Posiadacz", posiadaczColumn); + var typKartyColumn = new Column("TypKarty", "smallint", kartaLojTable); + kartaLojTable.Columns.Add("TypKarty", typKartyColumn); + var uniewaznionoColumn = new Column("Uniewazniono", "datetime", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("Uniewazniono", uniewaznionoColumn); + var waznaDoColumn = new Column("WaznaDo", "datetime", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("WaznaDo", waznaDoColumn); + var waznaOdColumn = new Column("WaznaOd", "datetime", kartaLojTable) + { + IsNullable = true + }; + kartaLojTable.Columns.Add("WaznaOd", waznaOdColumn); + var pK_KARTALOJ = new UniqueConstraint("PK_KARTALOJ", kartaLojTable, new[] { kartaIdColumn }); + kartaLojTable.PrimaryKey = pK_KARTALOJ; + var pK_KARTALOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + new[] { "KartaId" }); + pK_KARTALOJ.MappedKeys.Add(pK_KARTALOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KARTALOJUc).Add(pK_KARTALOJ); + kartaLojTable.UniqueConstraints.Add("PK_KARTALOJ", pK_KARTALOJ); + var idx_CentrKartaId = new TableIndex( + "idx_CentrKartaId", kartaLojTable, new[] { centrKartaIdColumn }, false); + var idx_CentrKartaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + "idx_CentrKartaId"); + idx_CentrKartaId.MappedIndexes.Add(idx_CentrKartaIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrKartaIdIx).Add(idx_CentrKartaId); + kartaLojTable.Indexes.Add("idx_CentrKartaId", idx_CentrKartaId); + var idx_KLoj_KodKarty = new TableIndex( + "idx_KLoj_KodKarty", kartaLojTable, new[] { kodKartyColumn }, false); + var idx_KLoj_KodKartyIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + "idx_KLoj_KodKarty"); + idx_KLoj_KodKarty.MappedIndexes.Add(idx_KLoj_KodKartyIx); + RelationalModel.GetOrCreateTableIndexes(idx_KLoj_KodKartyIx).Add(idx_KLoj_KodKarty); + kartaLojTable.Indexes.Add("idx_KLoj_KodKarty", idx_KLoj_KodKarty); + var idx_KLoj_Konto = new TableIndex( + "idx_KLoj_Konto", kartaLojTable, new[] { kontoIdColumn }, false); + var idx_KLoj_KontoIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + "idx_KLoj_Konto"); + idx_KLoj_Konto.MappedIndexes.Add(idx_KLoj_KontoIx); + RelationalModel.GetOrCreateTableIndexes(idx_KLoj_KontoIx).Add(idx_KLoj_Konto); + kartaLojTable.Indexes.Add("idx_KLoj_Konto", idx_KLoj_Konto); + relationalModel.Tables.Add(("KartaLoj", null), kartaLojTable); + var kartaLojTableMapping = new TableMapping(kartaLoj, kartaLojTable, true); + kartaLojTable.AddTypeMapping(kartaLojTableMapping, false); + tableMappings41.Add(kartaLojTableMapping); + RelationalModel.CreateColumnMapping(kartaIdColumn, kartaLoj.FindProperty("KartaId")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(centrKartaIdColumn, kartaLoj.FindProperty("CentrKartaId")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(kodKartyColumn, kartaLoj.FindProperty("KodKarty")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn, kartaLoj.FindProperty("KontoId")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(opis1Column, kartaLoj.FindProperty("Opis1")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(opis2Column, kartaLoj.FindProperty("Opis2")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(posiadaczColumn, kartaLoj.FindProperty("Posiadacz")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(typKartyColumn, kartaLoj.FindProperty("TypKarty")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(uniewaznionoColumn, kartaLoj.FindProperty("Uniewazniono")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(waznaDoColumn, kartaLoj.FindProperty("WaznaDo")!, kartaLojTableMapping); + RelationalModel.CreateColumnMapping(waznaOdColumn, kartaLoj.FindProperty("WaznaOd")!, kartaLojTableMapping); + + var kasKod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KasKod")!; + + var defaultTableMappings42 = new List>(); + kasKod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings42); + var blinkBackofficeServicesPcmDbEntitiesKasKodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KasKod", null, relationalModel); + var bylyZmianyCenColumnBase = new ColumnBase("BylyZmianyCen", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("BylyZmianyCen", bylyZmianyCenColumnBase); + var bylyZmianyInneColumnBase = new ColumnBase("BylyZmianyInne", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("BylyZmianyInne", bylyZmianyInneColumnBase); + var dodIndeksColumnBase = new ColumnBase("DodIndeks", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("DodIndeks", dodIndeksColumnBase); + var ileWKodzieColumnBase = new ColumnBase("IleWKodzie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("IleWKodzie", ileWKodzieColumnBase); + var kasPrefPLUColumnBase = new ColumnBase("KasPrefPLU", "int", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("KasPrefPLU", kasPrefPLUColumnBase); + var kasaIdColumnBase0 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("KasaId", kasaIdColumnBase0); + var kodColumnBase1 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("Kod", kodColumnBase1); + var kodOpakColumnBase = new ColumnBase("KodOpak", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("KodOpak", kodOpakColumnBase); + var kolejnoscColumnBase1 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase1); + var pLUColumnBase = new ColumnBase("PLU", "int", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("PLU", pLUColumnBase); + var pLUOpakColumnBase = new ColumnBase("PLUOpak", "int", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("PLUOpak", pLUOpakColumnBase); + var poziomCenColumnBase0 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("PoziomCen", poziomCenColumnBase0); + var rezerwaColumnBase = new ColumnBase("Rezerwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("Rezerwa", rezerwaColumnBase); + var skrotColumnBase = new ColumnBase("Skrot", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("Skrot", skrotColumnBase); + var statusColumnBase2 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("Status", statusColumnBase2); + var stawkaColumnBase0 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("Stawka", stawkaColumnBase0); + var towIdColumnBase3 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("TowId", towIdColumnBase3); + var typTowaruColumnBase = new ColumnBase("TypTowaru", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("TypTowaru", typTowaruColumnBase); + var zmianyCenColumnBase = new ColumnBase("ZmianyCen", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("ZmianyCen", zmianyCenColumnBase); + var zmianyInneColumnBase = new ColumnBase("ZmianyInne", "smallint", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.Columns.Add("ZmianyInne", zmianyInneColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KasKod", blinkBackofficeServicesPcmDbEntitiesKasKodTableBase); + var blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase = new TableMappingBase(kasKod, blinkBackofficeServicesPcmDbEntitiesKasKodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKasKodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase, false); + defaultTableMappings42.Add(blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase0, kasKod.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase1, kasKod.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase3, kasKod.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bylyZmianyCenColumnBase, kasKod.FindProperty("BylyZmianyCen")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bylyZmianyInneColumnBase, kasKod.FindProperty("BylyZmianyInne")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodIndeksColumnBase, kasKod.FindProperty("DodIndeks")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWKodzieColumnBase, kasKod.FindProperty("IleWKodzie")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasPrefPLUColumnBase, kasKod.FindProperty("KasPrefPLU")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase1, kasKod.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodOpakColumnBase, kasKod.FindProperty("KodOpak")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pLUColumnBase, kasKod.FindProperty("PLU")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pLUOpakColumnBase, kasKod.FindProperty("PLUOpak")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase0, kasKod.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwaColumnBase, kasKod.FindProperty("Rezerwa")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase, kasKod.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase2, kasKod.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase0, kasKod.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typTowaruColumnBase, kasKod.FindProperty("TypTowaru")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianyCenColumnBase, kasKod.FindProperty("ZmianyCen")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianyInneColumnBase, kasKod.FindProperty("ZmianyInne")!, blinkBackofficeServicesPcmDbEntitiesKasKodMappingBase); + + var tableMappings42 = new List(); + kasKod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings42); + var kasKodTable = new Table("KasKod", null, relationalModel); + var kasaIdColumn0 = new Column("KasaId", "numeric(9,0)", kasKodTable); + kasKodTable.Columns.Add("KasaId", kasaIdColumn0); + var towIdColumn3 = new Column("TowId", "numeric(9,0)", kasKodTable); + kasKodTable.Columns.Add("TowId", towIdColumn3); + var kolejnoscColumn1 = new Column("Kolejnosc", "smallint", kasKodTable); + kasKodTable.Columns.Add("Kolejnosc", kolejnoscColumn1); + var bylyZmianyCenColumn = new Column("BylyZmianyCen", "smallint", kasKodTable); + kasKodTable.Columns.Add("BylyZmianyCen", bylyZmianyCenColumn); + var bylyZmianyInneColumn = new Column("BylyZmianyInne", "smallint", kasKodTable); + kasKodTable.Columns.Add("BylyZmianyInne", bylyZmianyInneColumn); + var dodIndeksColumn = new Column("DodIndeks", "smallint", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("DodIndeks", dodIndeksColumn); + var ileWKodzieColumn = new Column("IleWKodzie", "decimal(15,4)", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("IleWKodzie", ileWKodzieColumn); + var kasPrefPLUColumn = new Column("KasPrefPLU", "int", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("KasPrefPLU", kasPrefPLUColumn); + var kodColumn1 = new Column("Kod", "varchar(20)", kasKodTable); + kasKodTable.Columns.Add("Kod", kodColumn1); + var kodOpakColumn = new Column("KodOpak", "varchar(20)", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("KodOpak", kodOpakColumn); + var pLUColumn = new Column("PLU", "int", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("PLU", pLUColumn); + var pLUOpakColumn = new Column("PLUOpak", "int", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("PLUOpak", pLUOpakColumn); + var poziomCenColumn0 = new Column("PoziomCen", "smallint", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("PoziomCen", poziomCenColumn0); + var rezerwaColumn = new Column("Rezerwa", "varchar(40)", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("Rezerwa", rezerwaColumn); + var skrotColumn = new Column("Skrot", "varchar(40)", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("Skrot", skrotColumn); + var statusColumn2 = new Column("Status", "smallint", kasKodTable); + kasKodTable.Columns.Add("Status", statusColumn2); + var stawkaColumn0 = new Column("Stawka", "smallint", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("Stawka", stawkaColumn0); + var typTowaruColumn = new Column("TypTowaru", "smallint", kasKodTable) + { + IsNullable = true + }; + kasKodTable.Columns.Add("TypTowaru", typTowaruColumn); + var zmianyCenColumn = new Column("ZmianyCen", "smallint", kasKodTable); + kasKodTable.Columns.Add("ZmianyCen", zmianyCenColumn); + var zmianyInneColumn = new Column("ZmianyInne", "smallint", kasKodTable); + kasKodTable.Columns.Add("ZmianyInne", zmianyInneColumn); + var pK_KASKOD = new UniqueConstraint("PK_KASKOD", kasKodTable, new[] { kasaIdColumn0, towIdColumn3, kolejnoscColumn1 }); + kasKodTable.PrimaryKey = pK_KASKOD; + var pK_KASKODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasKod", + new[] { "KasaId", "TowId", "Kolejnosc" }); + pK_KASKOD.MappedKeys.Add(pK_KASKODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KASKODUc).Add(pK_KASKOD); + kasKodTable.UniqueConstraints.Add("PK_KASKOD", pK_KASKOD); + var idx_KasKodTow = new TableIndex( + "idx_KasKodTow", kasKodTable, new[] { towIdColumn3, kolejnoscColumn1 }, false); + var idx_KasKodTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasKod", + "idx_KasKodTow"); + idx_KasKodTow.MappedIndexes.Add(idx_KasKodTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_KasKodTowIx).Add(idx_KasKodTow); + kasKodTable.Indexes.Add("idx_KasKodTow", idx_KasKodTow); + relationalModel.Tables.Add(("KasKod", null), kasKodTable); + var kasKodTableMapping = new TableMapping(kasKod, kasKodTable, true); + kasKodTable.AddTypeMapping(kasKodTableMapping, false); + tableMappings42.Add(kasKodTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn0, kasKod.FindProperty("KasaId")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn1, kasKod.FindProperty("Kolejnosc")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn3, kasKod.FindProperty("TowId")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(bylyZmianyCenColumn, kasKod.FindProperty("BylyZmianyCen")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(bylyZmianyInneColumn, kasKod.FindProperty("BylyZmianyInne")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(dodIndeksColumn, kasKod.FindProperty("DodIndeks")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(ileWKodzieColumn, kasKod.FindProperty("IleWKodzie")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(kasPrefPLUColumn, kasKod.FindProperty("KasPrefPLU")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(kodColumn1, kasKod.FindProperty("Kod")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(kodOpakColumn, kasKod.FindProperty("KodOpak")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(pLUColumn, kasKod.FindProperty("PLU")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(pLUOpakColumn, kasKod.FindProperty("PLUOpak")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn0, kasKod.FindProperty("PoziomCen")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(rezerwaColumn, kasKod.FindProperty("Rezerwa")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn, kasKod.FindProperty("Skrot")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(statusColumn2, kasKod.FindProperty("Status")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn0, kasKod.FindProperty("Stawka")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(typTowaruColumn, kasKod.FindProperty("TypTowaru")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(zmianyCenColumn, kasKod.FindProperty("ZmianyCen")!, kasKodTableMapping); + RelationalModel.CreateColumnMapping(zmianyInneColumn, kasKod.FindProperty("ZmianyInne")!, kasKodTableMapping); + + var kasPar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KasPar")!; + + var defaultTableMappings43 = new List>(); + kasPar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings43); + var blinkBackofficeServicesPcmDbEntitiesKasParTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KasPar", null, relationalModel); + var kasaIdColumnBase1 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasParTableBase); + blinkBackofficeServicesPcmDbEntitiesKasParTableBase.Columns.Add("KasaId", kasaIdColumnBase1); + var parNazwaColumnBase0 = new ColumnBase("ParNazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKasParTableBase); + blinkBackofficeServicesPcmDbEntitiesKasParTableBase.Columns.Add("ParNazwa", parNazwaColumnBase0); + var parWartoscColumnBase0 = new ColumnBase("ParWartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesKasParTableBase); + blinkBackofficeServicesPcmDbEntitiesKasParTableBase.Columns.Add("ParWartosc", parWartoscColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KasPar", blinkBackofficeServicesPcmDbEntitiesKasParTableBase); + var blinkBackofficeServicesPcmDbEntitiesKasParMappingBase = new TableMappingBase(kasPar, blinkBackofficeServicesPcmDbEntitiesKasParTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKasParTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKasParMappingBase, false); + defaultTableMappings43.Add(blinkBackofficeServicesPcmDbEntitiesKasParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase1, kasPar.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesKasParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase0, kasPar.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesKasParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parWartoscColumnBase0, kasPar.FindProperty("ParWartosc")!, blinkBackofficeServicesPcmDbEntitiesKasParMappingBase); + + var tableMappings43 = new List(); + kasPar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings43); + var kasParTable = new Table("KasPar", null, relationalModel); + var kasaIdColumn1 = new Column("KasaId", "numeric(9,0)", kasParTable); + kasParTable.Columns.Add("KasaId", kasaIdColumn1); + var parNazwaColumn0 = new Column("ParNazwa", "varchar(60)", kasParTable); + kasParTable.Columns.Add("ParNazwa", parNazwaColumn0); + var parWartoscColumn0 = new Column("ParWartosc", "varchar(255)", kasParTable); + kasParTable.Columns.Add("ParWartosc", parWartoscColumn0); + var pK_KASPAR = new UniqueConstraint("PK_KASPAR", kasParTable, new[] { kasaIdColumn1, parNazwaColumn0 }); + kasParTable.PrimaryKey = pK_KASPAR; + var pK_KASPARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasPar", + new[] { "KasaId", "ParNazwa" }); + pK_KASPAR.MappedKeys.Add(pK_KASPARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KASPARUc).Add(pK_KASPAR); + kasParTable.UniqueConstraints.Add("PK_KASPAR", pK_KASPAR); + relationalModel.Tables.Add(("KasPar", null), kasParTable); + var kasParTableMapping = new TableMapping(kasPar, kasParTable, true); + kasParTable.AddTypeMapping(kasParTableMapping, false); + tableMappings43.Add(kasParTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn1, kasPar.FindProperty("KasaId")!, kasParTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn0, kasPar.FindProperty("ParNazwa")!, kasParTableMapping); + RelationalModel.CreateColumnMapping(parWartoscColumn0, kasPar.FindProperty("ParWartosc")!, kasParTableMapping); + + var kasTow = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KasTow")!; + + var defaultTableMappings44 = new List>(); + kasTow.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings44); + var blinkBackofficeServicesPcmDbEntitiesKasTowTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KasTow", null, relationalModel); + var dodIndeksColumnBase0 = new ColumnBase("DodIndeks", "smallint", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("DodIndeks", dodIndeksColumnBase0); + var dodatkowyColumnBase = new ColumnBase("Dodatkowy", "smallint", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("Dodatkowy", dodatkowyColumnBase); + var flagaExpColumnBase = new ColumnBase("FlagaExp", "smallint", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("FlagaExp", flagaExpColumnBase); + var kasaIdColumnBase2 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("KasaId", kasaIdColumnBase2); + var kodWyslanyColumnBase = new ColumnBase("KodWyslany", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("KodWyslany", kodWyslanyColumnBase); + var pluColumnBase = new ColumnBase("Plu", "int", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("Plu", pluColumnBase); + var towIdColumnBase4 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("TowId", towIdColumnBase4); + var typTowaruColumnBase0 = new ColumnBase("TypTowaru", "smallint", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("TypTowaru", typTowaruColumnBase0); + var zmianyCenColumnBase0 = new ColumnBase("ZmianyCen", "smallint", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("ZmianyCen", zmianyCenColumnBase0); + var zmianyInneColumnBase0 = new ColumnBase("ZmianyInne", "smallint", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.Columns.Add("ZmianyInne", zmianyInneColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KasTow", blinkBackofficeServicesPcmDbEntitiesKasTowTableBase); + var blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase = new TableMappingBase(kasTow, blinkBackofficeServicesPcmDbEntitiesKasTowTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKasTowTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase, false); + defaultTableMappings44.Add(blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase2, kasTow.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodWyslanyColumnBase, kasTow.FindProperty("KodWyslany")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodIndeksColumnBase0, kasTow.FindProperty("DodIndeks")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodatkowyColumnBase, kasTow.FindProperty("Dodatkowy")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)flagaExpColumnBase, kasTow.FindProperty("FlagaExp")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pluColumnBase, kasTow.FindProperty("Plu")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase4, kasTow.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typTowaruColumnBase0, kasTow.FindProperty("TypTowaru")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianyCenColumnBase0, kasTow.FindProperty("ZmianyCen")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianyInneColumnBase0, kasTow.FindProperty("ZmianyInne")!, blinkBackofficeServicesPcmDbEntitiesKasTowMappingBase); + + var tableMappings44 = new List(); + kasTow.SetRuntimeAnnotation("Relational:TableMappings", tableMappings44); + var kasTowTable = new Table("KasTow", null, relationalModel); + var kasaIdColumn2 = new Column("KasaId", "numeric(9,0)", kasTowTable); + kasTowTable.Columns.Add("KasaId", kasaIdColumn2); + var kodWyslanyColumn = new Column("KodWyslany", "varchar(20)", kasTowTable); + kasTowTable.Columns.Add("KodWyslany", kodWyslanyColumn); + var dodIndeksColumn0 = new Column("DodIndeks", "smallint", kasTowTable); + kasTowTable.Columns.Add("DodIndeks", dodIndeksColumn0); + var dodatkowyColumn = new Column("Dodatkowy", "smallint", kasTowTable); + kasTowTable.Columns.Add("Dodatkowy", dodatkowyColumn); + var flagaExpColumn = new Column("FlagaExp", "smallint", kasTowTable); + kasTowTable.Columns.Add("FlagaExp", flagaExpColumn); + var pluColumn = new Column("Plu", "int", kasTowTable); + kasTowTable.Columns.Add("Plu", pluColumn); + var towIdColumn4 = new Column("TowId", "numeric(9,0)", kasTowTable); + kasTowTable.Columns.Add("TowId", towIdColumn4); + var typTowaruColumn0 = new Column("TypTowaru", "smallint", kasTowTable); + kasTowTable.Columns.Add("TypTowaru", typTowaruColumn0); + var zmianyCenColumn0 = new Column("ZmianyCen", "smallint", kasTowTable); + kasTowTable.Columns.Add("ZmianyCen", zmianyCenColumn0); + var zmianyInneColumn0 = new Column("ZmianyInne", "smallint", kasTowTable); + kasTowTable.Columns.Add("ZmianyInne", zmianyInneColumn0); + var pK_KASTOW = new UniqueConstraint("PK_KASTOW", kasTowTable, new[] { kasaIdColumn2, kodWyslanyColumn }); + kasTowTable.PrimaryKey = pK_KASTOW; + var pK_KASTOWUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasTow", + new[] { "KasaId", "KodWyslany" }); + pK_KASTOW.MappedKeys.Add(pK_KASTOWUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KASTOWUc).Add(pK_KASTOW); + kasTowTable.UniqueConstraints.Add("PK_KASTOW", pK_KASTOW); + var idx_KasTowKasaPluDodIndeks = new TableIndex( + "idx_KasTowKasaPluDodIndeks", kasTowTable, new[] { kasaIdColumn2, pluColumn, dodIndeksColumn0 }, false); + var idx_KasTowKasaPluDodIndeksIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasTow", + "idx_KasTowKasaPluDodIndeks"); + idx_KasTowKasaPluDodIndeks.MappedIndexes.Add(idx_KasTowKasaPluDodIndeksIx); + RelationalModel.GetOrCreateTableIndexes(idx_KasTowKasaPluDodIndeksIx).Add(idx_KasTowKasaPluDodIndeks); + kasTowTable.Indexes.Add("idx_KasTowKasaPluDodIndeks", idx_KasTowKasaPluDodIndeks); + var idx_KasTowTowId = new TableIndex( + "idx_KasTowTowId", kasTowTable, new[] { towIdColumn4 }, false); + var idx_KasTowTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasTow", + "idx_KasTowTowId"); + idx_KasTowTowId.MappedIndexes.Add(idx_KasTowTowIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_KasTowTowIdIx).Add(idx_KasTowTowId); + kasTowTable.Indexes.Add("idx_KasTowTowId", idx_KasTowTowId); + relationalModel.Tables.Add(("KasTow", null), kasTowTable); + var kasTowTableMapping = new TableMapping(kasTow, kasTowTable, true); + kasTowTable.AddTypeMapping(kasTowTableMapping, false); + tableMappings44.Add(kasTowTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn2, kasTow.FindProperty("KasaId")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(kodWyslanyColumn, kasTow.FindProperty("KodWyslany")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(dodIndeksColumn0, kasTow.FindProperty("DodIndeks")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(dodatkowyColumn, kasTow.FindProperty("Dodatkowy")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(flagaExpColumn, kasTow.FindProperty("FlagaExp")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(pluColumn, kasTow.FindProperty("Plu")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn4, kasTow.FindProperty("TowId")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(typTowaruColumn0, kasTow.FindProperty("TypTowaru")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(zmianyCenColumn0, kasTow.FindProperty("ZmianyCen")!, kasTowTableMapping); + RelationalModel.CreateColumnMapping(zmianyInneColumn0, kasTow.FindProperty("ZmianyInne")!, kasTowTableMapping); + + var kasa = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Kasa")!; + + var defaultTableMappings45 = new List>(); + kasa.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings45); + var blinkBackofficeServicesPcmDbEntitiesKasaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Kasa", null, relationalModel); + var aktywnyColumnBase7 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("Aktywny", aktywnyColumnBase7); + var kasaIdColumnBase3 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("KasaId", kasaIdColumnBase3); + var magIdColumnBase2 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("MagId", magIdColumnBase2); + var nazwaColumnBase11 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("Nazwa", nazwaColumnBase11); + var nrUnikatowyColumnBase = new ColumnBase("NrUnikatowy", "varchar(30)", blinkBackofficeServicesPcmDbEntitiesKasaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("NrUnikatowy", nrUnikatowyColumnBase); + var numerColumnBase = new ColumnBase("Numer", "smallint", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("Numer", numerColumnBase); + var rodzajColumnBase = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("Rodzaj", rodzajColumnBase); + var stanowiskoColumnBase = new ColumnBase("Stanowisko", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("Stanowisko", stanowiskoColumnBase); + var typColumnBase4 = new ColumnBase("Typ", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.Columns.Add("Typ", typColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Kasa", blinkBackofficeServicesPcmDbEntitiesKasaTableBase); + var blinkBackofficeServicesPcmDbEntitiesKasaMappingBase = new TableMappingBase(kasa, blinkBackofficeServicesPcmDbEntitiesKasaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKasaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKasaMappingBase, false); + defaultTableMappings45.Add(blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase3, kasa.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase7, kasa.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase2, kasa.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase11, kasa.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrUnikatowyColumnBase, kasa.FindProperty("NrUnikatowy")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase, kasa.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase, kasa.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanowiskoColumnBase, kasa.FindProperty("Stanowisko")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase4, kasa.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesKasaMappingBase); + + var tableMappings45 = new List(); + kasa.SetRuntimeAnnotation("Relational:TableMappings", tableMappings45); + var kasaTable = new Table("Kasa", null, relationalModel); + var kasaIdColumn3 = new Column("KasaId", "numeric(9,0)", kasaTable); + kasaTable.Columns.Add("KasaId", kasaIdColumn3); + var aktywnyColumn7 = new Column("Aktywny", "smallint", kasaTable); + kasaTable.Columns.Add("Aktywny", aktywnyColumn7); + var magIdColumn2 = new Column("MagId", "numeric(9,0)", kasaTable); + kasaTable.Columns.Add("MagId", magIdColumn2); + var nazwaColumn11 = new Column("Nazwa", "varchar(40)", kasaTable); + kasaTable.Columns.Add("Nazwa", nazwaColumn11); + var nrUnikatowyColumn = new Column("NrUnikatowy", "varchar(30)", kasaTable) + { + IsNullable = true + }; + kasaTable.Columns.Add("NrUnikatowy", nrUnikatowyColumn); + var numerColumn = new Column("Numer", "smallint", kasaTable); + kasaTable.Columns.Add("Numer", numerColumn); + var rodzajColumn = new Column("Rodzaj", "smallint", kasaTable); + kasaTable.Columns.Add("Rodzaj", rodzajColumn); + var stanowiskoColumn = new Column("Stanowisko", "varchar(40)", kasaTable); + kasaTable.Columns.Add("Stanowisko", stanowiskoColumn); + var typColumn4 = new Column("Typ", "varchar(40)", kasaTable); + kasaTable.Columns.Add("Typ", typColumn4); + var pK_KASA = new UniqueConstraint("PK_KASA", kasaTable, new[] { kasaIdColumn3 }); + kasaTable.PrimaryKey = pK_KASA; + var pK_KASAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + pK_KASA.MappedKeys.Add(pK_KASAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KASAUc).Add(pK_KASA); + kasaTable.UniqueConstraints.Add("PK_KASA", pK_KASA); + var iX_Kasa_MagId = new TableIndex( + "IX_Kasa_MagId", kasaTable, new[] { magIdColumn2 }, false); + var iX_Kasa_MagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "MagId" }); + iX_Kasa_MagId.MappedIndexes.Add(iX_Kasa_MagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Kasa_MagIdIx).Add(iX_Kasa_MagId); + kasaTable.Indexes.Add("IX_Kasa_MagId", iX_Kasa_MagId); + relationalModel.Tables.Add(("Kasa", null), kasaTable); + var kasaTableMapping = new TableMapping(kasa, kasaTable, true); + kasaTable.AddTypeMapping(kasaTableMapping, false); + tableMappings45.Add(kasaTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn3, kasa.FindProperty("KasaId")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn7, kasa.FindProperty("Aktywny")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn2, kasa.FindProperty("MagId")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn11, kasa.FindProperty("Nazwa")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(nrUnikatowyColumn, kasa.FindProperty("NrUnikatowy")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(numerColumn, kasa.FindProperty("Numer")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn, kasa.FindProperty("Rodzaj")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(stanowiskoColumn, kasa.FindProperty("Stanowisko")!, kasaTableMapping); + RelationalModel.CreateColumnMapping(typColumn4, kasa.FindProperty("Typ")!, kasaTableMapping); + + var kasaFormaPlatn = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn")!; + + var defaultTableMappings46 = new List>(); + kasaFormaPlatn.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings46); + var blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn", null, relationalModel); + var aktywnyColumnBase8 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase.Columns.Add("Aktywny", aktywnyColumnBase8); + var formaIdColumnBase0 = new ColumnBase("FormaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase.Columns.Add("FormaId", formaIdColumnBase0); + var kasaIdColumnBase4 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase); + blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase.Columns.Add("KasaId", kasaIdColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn", blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase); + var blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnMappingBase = new TableMappingBase(kasaFormaPlatn, blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnMappingBase, false); + defaultTableMappings46.Add(blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaIdColumnBase0, kasaFormaPlatn.FindProperty("FormaId")!, blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase4, kasaFormaPlatn.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase8, kasaFormaPlatn.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesKasaFormaPlatnMappingBase); + + var tableMappings46 = new List(); + kasaFormaPlatn.SetRuntimeAnnotation("Relational:TableMappings", tableMappings46); + var kasaFormaPlatnTable = new Table("KasaFormaPlatn", null, relationalModel); + var formaIdColumn0 = new Column("FormaId", "numeric(9,0)", kasaFormaPlatnTable); + kasaFormaPlatnTable.Columns.Add("FormaId", formaIdColumn0); + var kasaIdColumn4 = new Column("KasaId", "numeric(9,0)", kasaFormaPlatnTable); + kasaFormaPlatnTable.Columns.Add("KasaId", kasaIdColumn4); + var aktywnyColumn8 = new Column("Aktywny", "smallint", kasaFormaPlatnTable); + kasaFormaPlatnTable.Columns.Add("Aktywny", aktywnyColumn8); + var pK_KasaFormaPlatn = new UniqueConstraint("PK_KasaFormaPlatn", kasaFormaPlatnTable, new[] { formaIdColumn0, kasaIdColumn4 }); + kasaFormaPlatnTable.PrimaryKey = pK_KasaFormaPlatn; + var pK_KasaFormaPlatnUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn", + new[] { "FormaId", "KasaId" }); + pK_KasaFormaPlatn.MappedKeys.Add(pK_KasaFormaPlatnUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KasaFormaPlatnUc).Add(pK_KasaFormaPlatn); + kasaFormaPlatnTable.UniqueConstraints.Add("PK_KasaFormaPlatn", pK_KasaFormaPlatn); + var iX_KasaFormaPlatn_KasaId = new TableIndex( + "IX_KasaFormaPlatn_KasaId", kasaFormaPlatnTable, new[] { kasaIdColumn4 }, false); + var iX_KasaFormaPlatn_KasaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn", + new[] { "KasaId" }); + iX_KasaFormaPlatn_KasaId.MappedIndexes.Add(iX_KasaFormaPlatn_KasaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KasaFormaPlatn_KasaIdIx).Add(iX_KasaFormaPlatn_KasaId); + kasaFormaPlatnTable.Indexes.Add("IX_KasaFormaPlatn_KasaId", iX_KasaFormaPlatn_KasaId); + relationalModel.Tables.Add(("KasaFormaPlatn", null), kasaFormaPlatnTable); + var kasaFormaPlatnTableMapping = new TableMapping(kasaFormaPlatn, kasaFormaPlatnTable, true); + kasaFormaPlatnTable.AddTypeMapping(kasaFormaPlatnTableMapping, false); + tableMappings46.Add(kasaFormaPlatnTableMapping); + RelationalModel.CreateColumnMapping(formaIdColumn0, kasaFormaPlatn.FindProperty("FormaId")!, kasaFormaPlatnTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn4, kasaFormaPlatn.FindProperty("KasaId")!, kasaFormaPlatnTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn8, kasaFormaPlatn.FindProperty("Aktywny")!, kasaFormaPlatnTableMapping); + + var katParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KatParam")!; + + var defaultTableMappings47 = new List>(); + katParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings47); + var blinkBackofficeServicesPcmDbEntitiesKatParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KatParam", null, relationalModel); + var katIdColumnBase = new ColumnBase("KatId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKatParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKatParamTableBase.Columns.Add("KatId", katIdColumnBase); + var kolejnoscColumnBase2 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesKatParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKatParamTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase2); + var parIdColumnBase0 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKatParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKatParamTableBase.Columns.Add("ParId", parIdColumnBase0); + var wartDomColumnBase = new ColumnBase("WartDom", "int", blinkBackofficeServicesPcmDbEntitiesKatParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKatParamTableBase.Columns.Add("WartDom", wartDomColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KatParam", blinkBackofficeServicesPcmDbEntitiesKatParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesKatParamMappingBase = new TableMappingBase(katParam, blinkBackofficeServicesPcmDbEntitiesKatParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKatParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKatParamMappingBase, false); + defaultTableMappings47.Add(blinkBackofficeServicesPcmDbEntitiesKatParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)katIdColumnBase, katParam.FindProperty("KatId")!, blinkBackofficeServicesPcmDbEntitiesKatParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase0, katParam.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesKatParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase2, katParam.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesKatParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartDomColumnBase, katParam.FindProperty("WartDom")!, blinkBackofficeServicesPcmDbEntitiesKatParamMappingBase); + + var tableMappings47 = new List(); + katParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings47); + var katParamTable = new Table("KatParam", null, relationalModel); + var katIdColumn = new Column("KatId", "numeric(9,0)", katParamTable); + katParamTable.Columns.Add("KatId", katIdColumn); + var parIdColumn0 = new Column("ParId", "numeric(9,0)", katParamTable); + katParamTable.Columns.Add("ParId", parIdColumn0); + var kolejnoscColumn2 = new Column("Kolejnosc", "smallint", katParamTable); + katParamTable.Columns.Add("Kolejnosc", kolejnoscColumn2); + var wartDomColumn = new Column("WartDom", "int", katParamTable); + katParamTable.Columns.Add("WartDom", wartDomColumn); + var pK_KATPARAM = new UniqueConstraint("PK_KATPARAM", katParamTable, new[] { katIdColumn, parIdColumn0 }); + katParamTable.PrimaryKey = pK_KATPARAM; + var pK_KATPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KatParam", + new[] { "KatId", "ParId" }); + pK_KATPARAM.MappedKeys.Add(pK_KATPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KATPARAMUc).Add(pK_KATPARAM); + katParamTable.UniqueConstraints.Add("PK_KATPARAM", pK_KATPARAM); + var idx_KatParKat = new TableIndex( + "idx_KatParKat", katParamTable, new[] { katIdColumn }, false); + var idx_KatParKatIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KatParam", + "idx_KatParKat"); + idx_KatParKat.MappedIndexes.Add(idx_KatParKatIx); + RelationalModel.GetOrCreateTableIndexes(idx_KatParKatIx).Add(idx_KatParKat); + katParamTable.Indexes.Add("idx_KatParKat", idx_KatParKat); + var idx_KatParPar = new TableIndex( + "idx_KatParPar", katParamTable, new[] { parIdColumn0 }, false); + var idx_KatParParIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KatParam", + "idx_KatParPar"); + idx_KatParPar.MappedIndexes.Add(idx_KatParParIx); + RelationalModel.GetOrCreateTableIndexes(idx_KatParParIx).Add(idx_KatParPar); + katParamTable.Indexes.Add("idx_KatParPar", idx_KatParPar); + relationalModel.Tables.Add(("KatParam", null), katParamTable); + var katParamTableMapping = new TableMapping(katParam, katParamTable, true); + katParamTable.AddTypeMapping(katParamTableMapping, false); + tableMappings47.Add(katParamTableMapping); + RelationalModel.CreateColumnMapping(katIdColumn, katParam.FindProperty("KatId")!, katParamTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn0, katParam.FindProperty("ParId")!, katParamTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn2, katParam.FindProperty("Kolejnosc")!, katParamTableMapping); + RelationalModel.CreateColumnMapping(wartDomColumn, katParam.FindProperty("WartDom")!, katParamTableMapping); + + var kategoria = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Kategoria")!; + + var defaultTableMappings48 = new List>(); + kategoria.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings48); + var blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Kategoria", null, relationalModel); + var centrKatIdColumnBase = new ColumnBase("CentrKatId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase.Columns.Add("CentrKatId", centrKatIdColumnBase); + var katIdColumnBase0 = new ColumnBase("KatId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase); + blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase.Columns.Add("KatId", katIdColumnBase0); + var nazwaColumnBase12 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase); + blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase.Columns.Add("Nazwa", nazwaColumnBase12); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Kategoria", blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase); + var blinkBackofficeServicesPcmDbEntitiesKategoriaMappingBase = new TableMappingBase(kategoria, blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKategoriaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKategoriaMappingBase, false); + defaultTableMappings48.Add(blinkBackofficeServicesPcmDbEntitiesKategoriaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)katIdColumnBase0, kategoria.FindProperty("KatId")!, blinkBackofficeServicesPcmDbEntitiesKategoriaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKatIdColumnBase, kategoria.FindProperty("CentrKatId")!, blinkBackofficeServicesPcmDbEntitiesKategoriaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase12, kategoria.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKategoriaMappingBase); + + var tableMappings48 = new List(); + kategoria.SetRuntimeAnnotation("Relational:TableMappings", tableMappings48); + var kategoriaTable = new Table("Kategoria", null, relationalModel); + var katIdColumn0 = new Column("KatId", "numeric(9,0)", kategoriaTable); + kategoriaTable.Columns.Add("KatId", katIdColumn0); + var centrKatIdColumn = new Column("CentrKatId", "numeric(9,0)", kategoriaTable) + { + IsNullable = true + }; + kategoriaTable.Columns.Add("CentrKatId", centrKatIdColumn); + var nazwaColumn12 = new Column("Nazwa", "varchar(40)", kategoriaTable); + kategoriaTable.Columns.Add("Nazwa", nazwaColumn12); + var pK_KATEGORIA = new UniqueConstraint("PK_KATEGORIA", kategoriaTable, new[] { katIdColumn0 }); + kategoriaTable.PrimaryKey = pK_KATEGORIA; + var pK_KATEGORIAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kategoria", + new[] { "KatId" }); + pK_KATEGORIA.MappedKeys.Add(pK_KATEGORIAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KATEGORIAUc).Add(pK_KATEGORIA); + kategoriaTable.UniqueConstraints.Add("PK_KATEGORIA", pK_KATEGORIA); + var idx_CentrKatId = new TableIndex( + "idx_CentrKatId", kategoriaTable, new[] { centrKatIdColumn }, false); + var idx_CentrKatIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kategoria", + "idx_CentrKatId"); + idx_CentrKatId.MappedIndexes.Add(idx_CentrKatIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrKatIdIx).Add(idx_CentrKatId); + kategoriaTable.Indexes.Add("idx_CentrKatId", idx_CentrKatId); + relationalModel.Tables.Add(("Kategoria", null), kategoriaTable); + var kategoriaTableMapping = new TableMapping(kategoria, kategoriaTable, true); + kategoriaTable.AddTypeMapping(kategoriaTableMapping, false); + tableMappings48.Add(kategoriaTableMapping); + RelationalModel.CreateColumnMapping(katIdColumn0, kategoria.FindProperty("KatId")!, kategoriaTableMapping); + RelationalModel.CreateColumnMapping(centrKatIdColumn, kategoria.FindProperty("CentrKatId")!, kategoriaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn12, kategoria.FindProperty("Nazwa")!, kategoriaTableMapping); + + var kodDod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KodDod")!; + + var defaultTableMappings49 = new List>(); + kodDod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings49); + var blinkBackofficeServicesPcmDbEntitiesKodDodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KodDod", null, relationalModel); + var ileWKodzieColumnBase0 = new ColumnBase("IleWKodzie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("IleWKodzie", ileWKodzieColumnBase0); + var kodColumnBase2 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase); + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("Kod", kodColumnBase2); + var kodCentralnyColumnBase = new ColumnBase("KodCentralny", "smallint", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("KodCentralny", kodCentralnyColumnBase); + var kolejnoscColumnBase3 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase); + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase3); + var poziomCenColumnBase1 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase); + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("PoziomCen", poziomCenColumnBase1); + var prefPLUColumnBase = new ColumnBase("PrefPLU", "int", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase); + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("PrefPLU", prefPLUColumnBase); + var skrotColumnBase0 = new ColumnBase("Skrot", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase); + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("Skrot", skrotColumnBase0); + var subsysKoduDodColumnBase = new ColumnBase("SubsysKoduDod", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("SubsysKoduDod", subsysKoduDodColumnBase); + var towIdColumnBase5 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase); + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("TowId", towIdColumnBase5); + var typKoduColumnBase = new ColumnBase("TypKodu", "smallint", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.Columns.Add("TypKodu", typKoduColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KodDod", blinkBackofficeServicesPcmDbEntitiesKodDodTableBase); + var blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase = new TableMappingBase(kodDod, blinkBackofficeServicesPcmDbEntitiesKodDodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKodDodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase, false); + defaultTableMappings49.Add(blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase3, kodDod.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase5, kodDod.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWKodzieColumnBase0, kodDod.FindProperty("IleWKodzie")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase2, kodDod.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodCentralnyColumnBase, kodDod.FindProperty("KodCentralny")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase1, kodDod.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prefPLUColumnBase, kodDod.FindProperty("PrefPLU")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase0, kodDod.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)subsysKoduDodColumnBase, kodDod.FindProperty("SubsysKoduDod")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKoduColumnBase, kodDod.FindProperty("TypKodu")!, blinkBackofficeServicesPcmDbEntitiesKodDodMappingBase); + + var tableMappings49 = new List(); + kodDod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings49); + var kodDodTable = new Table("KodDod", null, relationalModel); + var towIdColumn5 = new Column("TowId", "numeric(9,0)", kodDodTable); + kodDodTable.Columns.Add("TowId", towIdColumn5); + var kolejnoscColumn3 = new Column("Kolejnosc", "smallint", kodDodTable); + kodDodTable.Columns.Add("Kolejnosc", kolejnoscColumn3); + var ileWKodzieColumn0 = new Column("IleWKodzie", "decimal(15,4)", kodDodTable) + { + IsNullable = true + }; + kodDodTable.Columns.Add("IleWKodzie", ileWKodzieColumn0); + var kodColumn2 = new Column("Kod", "varchar(20)", kodDodTable); + kodDodTable.Columns.Add("Kod", kodColumn2); + var kodCentralnyColumn = new Column("KodCentralny", "smallint", kodDodTable) + { + IsNullable = true + }; + kodDodTable.Columns.Add("KodCentralny", kodCentralnyColumn); + var poziomCenColumn1 = new Column("PoziomCen", "smallint", kodDodTable); + kodDodTable.Columns.Add("PoziomCen", poziomCenColumn1); + var prefPLUColumn = new Column("PrefPLU", "int", kodDodTable); + kodDodTable.Columns.Add("PrefPLU", prefPLUColumn); + var skrotColumn0 = new Column("Skrot", "varchar(120)", kodDodTable); + kodDodTable.Columns.Add("Skrot", skrotColumn0); + var subsysKoduDodColumn = new Column("SubsysKoduDod", "varchar(40)", kodDodTable) + { + IsNullable = true + }; + kodDodTable.Columns.Add("SubsysKoduDod", subsysKoduDodColumn); + var typKoduColumn = new Column("TypKodu", "smallint", kodDodTable) + { + IsNullable = true + }; + kodDodTable.Columns.Add("TypKodu", typKoduColumn); + var pK_KODDOD = new UniqueConstraint("PK_KODDOD", kodDodTable, new[] { towIdColumn5, kolejnoscColumn3 }); + kodDodTable.PrimaryKey = pK_KODDOD; + var pK_KODDODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodDod", + new[] { "TowId", "Kolejnosc" }); + pK_KODDOD.MappedKeys.Add(pK_KODDODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KODDODUc).Add(pK_KODDOD); + kodDodTable.UniqueConstraints.Add("PK_KODDOD", pK_KODDOD); + var idx_KodDodKod = new TableIndex( + "idx_KodDodKod", kodDodTable, new[] { kodColumn2 }, false); + var idx_KodDodKodIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodDod", + "idx_KodDodKod"); + idx_KodDodKod.MappedIndexes.Add(idx_KodDodKodIx); + RelationalModel.GetOrCreateTableIndexes(idx_KodDodKodIx).Add(idx_KodDodKod); + kodDodTable.Indexes.Add("idx_KodDodKod", idx_KodDodKod); + var idx_KodDodSkrot = new TableIndex( + "idx_KodDodSkrot", kodDodTable, new[] { skrotColumn0 }, false); + var idx_KodDodSkrotIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodDod", + "idx_KodDodSkrot"); + idx_KodDodSkrot.MappedIndexes.Add(idx_KodDodSkrotIx); + RelationalModel.GetOrCreateTableIndexes(idx_KodDodSkrotIx).Add(idx_KodDodSkrot); + kodDodTable.Indexes.Add("idx_KodDodSkrot", idx_KodDodSkrot); + relationalModel.Tables.Add(("KodDod", null), kodDodTable); + var kodDodTableMapping = new TableMapping(kodDod, kodDodTable, true); + kodDodTable.AddTypeMapping(kodDodTableMapping, false); + tableMappings49.Add(kodDodTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn3, kodDod.FindProperty("Kolejnosc")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn5, kodDod.FindProperty("TowId")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(ileWKodzieColumn0, kodDod.FindProperty("IleWKodzie")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(kodColumn2, kodDod.FindProperty("Kod")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(kodCentralnyColumn, kodDod.FindProperty("KodCentralny")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn1, kodDod.FindProperty("PoziomCen")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(prefPLUColumn, kodDod.FindProperty("PrefPLU")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn0, kodDod.FindProperty("Skrot")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(subsysKoduDodColumn, kodDod.FindProperty("SubsysKoduDod")!, kodDodTableMapping); + RelationalModel.CreateColumnMapping(typKoduColumn, kodDod.FindProperty("TypKodu")!, kodDodTableMapping); + + var kodWazony = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KodWazony")!; + + var defaultTableMappings50 = new List>(); + kodWazony.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings50); + var blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KodWazony", null, relationalModel); + var centrKWIdColumnBase = new ColumnBase("CentrKWId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("CentrKWId", centrKWIdColumnBase); + var czescStalaColumnBase = new ColumnBase("CzescStala", "smallint", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("CzescStala", czescStalaColumnBase); + var dodKontrolaColumnBase = new ColumnBase("DodKontrola", "smallint", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("DodKontrola", dodKontrolaColumnBase); + var jMIdColumnBase0 = new ColumnBase("JMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("JMId", jMIdColumnBase0); + var kWIdColumnBase = new ColumnBase("KWId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("KWId", kWIdColumnBase); + var nazwaColumnBase13 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("Nazwa", nazwaColumnBase13); + var precyzjaWKodzieColumnBase = new ColumnBase("PrecyzjaWKodzie", "smallint", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("PrecyzjaWKodzie", precyzjaWKodzieColumnBase); + var prefixColumnBase = new ColumnBase("Prefix", "smallint", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("Prefix", prefixColumnBase); + var wartoscWKodzieColumnBase = new ColumnBase("WartoscWKodzie", "smallint", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.Columns.Add("WartoscWKodzie", wartoscWKodzieColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KodWazony", blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase); + var blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase = new TableMappingBase(kodWazony, blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKodWazonyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase, false); + defaultTableMappings50.Add(blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kWIdColumnBase, kodWazony.FindProperty("KWId")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKWIdColumnBase, kodWazony.FindProperty("CentrKWId")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czescStalaColumnBase, kodWazony.FindProperty("CzescStala")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodKontrolaColumnBase, kodWazony.FindProperty("DodKontrola")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jMIdColumnBase0, kodWazony.FindProperty("JMId")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase13, kodWazony.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)precyzjaWKodzieColumnBase, kodWazony.FindProperty("PrecyzjaWKodzie")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prefixColumnBase, kodWazony.FindProperty("Prefix")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscWKodzieColumnBase, kodWazony.FindProperty("WartoscWKodzie")!, blinkBackofficeServicesPcmDbEntitiesKodWazonyMappingBase); + + var tableMappings50 = new List(); + kodWazony.SetRuntimeAnnotation("Relational:TableMappings", tableMappings50); + var kodWazonyTable = new Table("KodWazony", null, relationalModel); + var kWIdColumn = new Column("KWId", "numeric(9,0)", kodWazonyTable); + kodWazonyTable.Columns.Add("KWId", kWIdColumn); + var centrKWIdColumn = new Column("CentrKWId", "numeric(9,0)", kodWazonyTable) + { + IsNullable = true + }; + kodWazonyTable.Columns.Add("CentrKWId", centrKWIdColumn); + var czescStalaColumn = new Column("CzescStala", "smallint", kodWazonyTable); + kodWazonyTable.Columns.Add("CzescStala", czescStalaColumn); + var dodKontrolaColumn = new Column("DodKontrola", "smallint", kodWazonyTable); + kodWazonyTable.Columns.Add("DodKontrola", dodKontrolaColumn); + var jMIdColumn0 = new Column("JMId", "numeric(9,0)", kodWazonyTable) + { + IsNullable = true + }; + kodWazonyTable.Columns.Add("JMId", jMIdColumn0); + var nazwaColumn13 = new Column("Nazwa", "varchar(40)", kodWazonyTable); + kodWazonyTable.Columns.Add("Nazwa", nazwaColumn13); + var precyzjaWKodzieColumn = new Column("PrecyzjaWKodzie", "smallint", kodWazonyTable); + kodWazonyTable.Columns.Add("PrecyzjaWKodzie", precyzjaWKodzieColumn); + var prefixColumn = new Column("Prefix", "smallint", kodWazonyTable); + kodWazonyTable.Columns.Add("Prefix", prefixColumn); + var wartoscWKodzieColumn = new Column("WartoscWKodzie", "smallint", kodWazonyTable); + kodWazonyTable.Columns.Add("WartoscWKodzie", wartoscWKodzieColumn); + var pK_KODWAZONY = new UniqueConstraint("PK_KODWAZONY", kodWazonyTable, new[] { kWIdColumn }); + kodWazonyTable.PrimaryKey = pK_KODWAZONY; + var pK_KODWAZONYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodWazony", + new[] { "KWId" }); + pK_KODWAZONY.MappedKeys.Add(pK_KODWAZONYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KODWAZONYUc).Add(pK_KODWAZONY); + kodWazonyTable.UniqueConstraints.Add("PK_KODWAZONY", pK_KODWAZONY); + var idx_CentrKWId = new TableIndex( + "idx_CentrKWId", kodWazonyTable, new[] { centrKWIdColumn }, false); + var idx_CentrKWIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodWazony", + "idx_CentrKWId"); + idx_CentrKWId.MappedIndexes.Add(idx_CentrKWIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrKWIdIx).Add(idx_CentrKWId); + kodWazonyTable.Indexes.Add("idx_CentrKWId", idx_CentrKWId); + var iX_KodWazony_JMId = new TableIndex( + "IX_KodWazony_JMId", kodWazonyTable, new[] { jMIdColumn0 }, false); + var iX_KodWazony_JMIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodWazony", + new[] { "JMId" }); + iX_KodWazony_JMId.MappedIndexes.Add(iX_KodWazony_JMIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KodWazony_JMIdIx).Add(iX_KodWazony_JMId); + kodWazonyTable.Indexes.Add("IX_KodWazony_JMId", iX_KodWazony_JMId); + relationalModel.Tables.Add(("KodWazony", null), kodWazonyTable); + var kodWazonyTableMapping = new TableMapping(kodWazony, kodWazonyTable, true); + kodWazonyTable.AddTypeMapping(kodWazonyTableMapping, false); + tableMappings50.Add(kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(kWIdColumn, kodWazony.FindProperty("KWId")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(centrKWIdColumn, kodWazony.FindProperty("CentrKWId")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(czescStalaColumn, kodWazony.FindProperty("CzescStala")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(dodKontrolaColumn, kodWazony.FindProperty("DodKontrola")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(jMIdColumn0, kodWazony.FindProperty("JMId")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn13, kodWazony.FindProperty("Nazwa")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(precyzjaWKodzieColumn, kodWazony.FindProperty("PrecyzjaWKodzie")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(prefixColumn, kodWazony.FindProperty("Prefix")!, kodWazonyTableMapping); + RelationalModel.CreateColumnMapping(wartoscWKodzieColumn, kodWazony.FindProperty("WartoscWKodzie")!, kodWazonyTableMapping); + + var komentarz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Komentarz")!; + + var defaultTableMappings51 = new List>(); + komentarz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings51); + var blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Komentarz", null, relationalModel); + var opisColumnBase3 = new ColumnBase("Opis", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase); + blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase.Columns.Add("Opis", opisColumnBase3); + var zmIdColumnBase = new ColumnBase("ZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase); + blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase.Columns.Add("ZmId", zmIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Komentarz", blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase); + var blinkBackofficeServicesPcmDbEntitiesKomentarzMappingBase = new TableMappingBase(komentarz, blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKomentarzTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKomentarzMappingBase, false); + defaultTableMappings51.Add(blinkBackofficeServicesPcmDbEntitiesKomentarzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmIdColumnBase, komentarz.FindProperty("ZmId")!, blinkBackofficeServicesPcmDbEntitiesKomentarzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase3, komentarz.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesKomentarzMappingBase); + + var tableMappings51 = new List(); + komentarz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings51); + var komentarzTable = new Table("Komentarz", null, relationalModel); + var zmIdColumn = new Column("ZmId", "numeric(9,0)", komentarzTable); + komentarzTable.Columns.Add("ZmId", zmIdColumn); + var opisColumn3 = new Column("Opis", "varchar(255)", komentarzTable); + komentarzTable.Columns.Add("Opis", opisColumn3); + var pK_KOMENTARZ = new UniqueConstraint("PK_KOMENTARZ", komentarzTable, new[] { zmIdColumn }); + komentarzTable.PrimaryKey = pK_KOMENTARZ; + var pK_KOMENTARZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Komentarz", + new[] { "ZmId" }); + pK_KOMENTARZ.MappedKeys.Add(pK_KOMENTARZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KOMENTARZUc).Add(pK_KOMENTARZ); + komentarzTable.UniqueConstraints.Add("PK_KOMENTARZ", pK_KOMENTARZ); + relationalModel.Tables.Add(("Komentarz", null), komentarzTable); + var komentarzTableMapping = new TableMapping(komentarz, komentarzTable, true); + komentarzTable.AddTypeMapping(komentarzTableMapping, false); + tableMappings51.Add(komentarzTableMapping); + RelationalModel.CreateColumnMapping(zmIdColumn, komentarz.FindProperty("ZmId")!, komentarzTableMapping); + RelationalModel.CreateColumnMapping(opisColumn3, komentarz.FindProperty("Opis")!, komentarzTableMapping); + + var konfig = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Konfig")!; + + var defaultTableMappings52 = new List>(); + konfig.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings52); + var blinkBackofficeServicesPcmDbEntitiesKonfigTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Konfig", null, relationalModel); + var parGrupaColumnBase = new ColumnBase("ParGrupa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesKonfigTableBase.Columns.Add("ParGrupa", parGrupaColumnBase); + var parNazwaColumnBase1 = new ColumnBase("ParNazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesKonfigTableBase.Columns.Add("ParNazwa", parNazwaColumnBase1); + var parWartoscColumnBase1 = new ColumnBase("ParWartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesKonfigTableBase.Columns.Add("ParWartosc", parWartoscColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Konfig", blinkBackofficeServicesPcmDbEntitiesKonfigTableBase); + var blinkBackofficeServicesPcmDbEntitiesKonfigMappingBase = new TableMappingBase(konfig, blinkBackofficeServicesPcmDbEntitiesKonfigTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKonfigTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKonfigMappingBase, false); + defaultTableMappings52.Add(blinkBackofficeServicesPcmDbEntitiesKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parGrupaColumnBase, konfig.FindProperty("ParGrupa")!, blinkBackofficeServicesPcmDbEntitiesKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase1, konfig.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parWartoscColumnBase1, konfig.FindProperty("ParWartosc")!, blinkBackofficeServicesPcmDbEntitiesKonfigMappingBase); + + var tableMappings52 = new List(); + konfig.SetRuntimeAnnotation("Relational:TableMappings", tableMappings52); + var konfigTable = new Table("Konfig", null, relationalModel); + var parGrupaColumn = new Column("ParGrupa", "varchar(40)", konfigTable); + konfigTable.Columns.Add("ParGrupa", parGrupaColumn); + var parNazwaColumn1 = new Column("ParNazwa", "varchar(40)", konfigTable); + konfigTable.Columns.Add("ParNazwa", parNazwaColumn1); + var parWartoscColumn1 = new Column("ParWartosc", "varchar(255)", konfigTable); + konfigTable.Columns.Add("ParWartosc", parWartoscColumn1); + var pK_KONFIG = new UniqueConstraint("PK_KONFIG", konfigTable, new[] { parGrupaColumn, parNazwaColumn1 }); + konfigTable.PrimaryKey = pK_KONFIG; + var pK_KONFIGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Konfig", + new[] { "ParGrupa", "ParNazwa" }); + pK_KONFIG.MappedKeys.Add(pK_KONFIGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KONFIGUc).Add(pK_KONFIG); + konfigTable.UniqueConstraints.Add("PK_KONFIG", pK_KONFIG); + relationalModel.Tables.Add(("Konfig", null), konfigTable); + var konfigTableMapping = new TableMapping(konfig, konfigTable, true); + konfigTable.AddTypeMapping(konfigTableMapping, false); + tableMappings52.Add(konfigTableMapping); + RelationalModel.CreateColumnMapping(parGrupaColumn, konfig.FindProperty("ParGrupa")!, konfigTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn1, konfig.FindProperty("ParNazwa")!, konfigTableMapping); + RelationalModel.CreateColumnMapping(parWartoscColumn1, konfig.FindProperty("ParWartosc")!, konfigTableMapping); + + var kontoBankowe = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe")!; + + var defaultTableMappings53 = new List>(); + kontoBankowe.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings53); + var blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", null, relationalModel); + var aktywneColumnBase = new ColumnBase("Aktywne", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("Aktywne", aktywneColumnBase); + var bankIdColumnBase0 = new ColumnBase("BankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("BankId", bankIdColumnBase0); + var centrKBIdColumnBase = new ColumnBase("CentrKBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("CentrKBId", centrKBIdColumnBase); + var domyslneColumnBase = new ColumnBase("Domyslne", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("Domyslne", domyslneColumnBase); + var kBIdColumnBase = new ColumnBase("KBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("KBId", kBIdColumnBase); + var kBIdOplatColumnBase = new ColumnBase("KBIdOplat", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("KBIdOplat", kBIdOplatColumnBase); + var magIdColumnBase3 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("MagId", magIdColumnBase3); + var nazwaColumnBase14 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("Nazwa", nazwaColumnBase14); + var numerColumnBase0 = new ColumnBase("Numer", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("Numer", numerColumnBase0); + var powKBIdColumnBase = new ColumnBase("PowKBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("PowKBId", powKBIdColumnBase); + var sufixColumnBase = new ColumnBase("Sufix", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("Sufix", sufixColumnBase); + var typColumnBase5 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("Typ", typColumnBase5); + var walIdColumnBase2 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("WalId", walIdColumnBase2); + var zmianaColumnBase11 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.Columns.Add("Zmiana", zmianaColumnBase11); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase); + var blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase = new TableMappingBase(kontoBankowe, blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase, false); + defaultTableMappings53.Add(blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kBIdColumnBase, kontoBankowe.FindProperty("KBId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywneColumnBase, kontoBankowe.FindProperty("Aktywne")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bankIdColumnBase0, kontoBankowe.FindProperty("BankId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKBIdColumnBase, kontoBankowe.FindProperty("CentrKBId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslneColumnBase, kontoBankowe.FindProperty("Domyslne")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kBIdOplatColumnBase, kontoBankowe.FindProperty("KBIdOplat")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase3, kontoBankowe.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase14, kontoBankowe.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase0, kontoBankowe.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powKBIdColumnBase, kontoBankowe.FindProperty("PowKBId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sufixColumnBase, kontoBankowe.FindProperty("Sufix")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase5, kontoBankowe.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase2, kontoBankowe.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase11, kontoBankowe.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweMappingBase); + + var tableMappings53 = new List(); + kontoBankowe.SetRuntimeAnnotation("Relational:TableMappings", tableMappings53); + var kontoBankoweTable = new Table("KontoBankowe", null, relationalModel); + var kBIdColumn = new Column("KBId", "numeric(9,0)", kontoBankoweTable); + kontoBankoweTable.Columns.Add("KBId", kBIdColumn); + var aktywneColumn = new Column("Aktywne", "smallint", kontoBankoweTable); + kontoBankoweTable.Columns.Add("Aktywne", aktywneColumn); + var bankIdColumn0 = new Column("BankId", "numeric(9,0)", kontoBankoweTable); + kontoBankoweTable.Columns.Add("BankId", bankIdColumn0); + var centrKBIdColumn = new Column("CentrKBId", "numeric(9,0)", kontoBankoweTable) + { + IsNullable = true + }; + kontoBankoweTable.Columns.Add("CentrKBId", centrKBIdColumn); + var domyslneColumn = new Column("Domyslne", "smallint", kontoBankoweTable); + kontoBankoweTable.Columns.Add("Domyslne", domyslneColumn); + var kBIdOplatColumn = new Column("KBIdOplat", "numeric(9,0)", kontoBankoweTable) + { + IsNullable = true + }; + kontoBankoweTable.Columns.Add("KBIdOplat", kBIdOplatColumn); + var magIdColumn3 = new Column("MagId", "numeric(9,0)", kontoBankoweTable) + { + IsNullable = true + }; + kontoBankoweTable.Columns.Add("MagId", magIdColumn3); + var nazwaColumn14 = new Column("Nazwa", "varchar(120)", kontoBankoweTable); + kontoBankoweTable.Columns.Add("Nazwa", nazwaColumn14); + var numerColumn0 = new Column("Numer", "varchar(40)", kontoBankoweTable); + kontoBankoweTable.Columns.Add("Numer", numerColumn0); + var powKBIdColumn = new Column("PowKBId", "numeric(9,0)", kontoBankoweTable) + { + IsNullable = true + }; + kontoBankoweTable.Columns.Add("PowKBId", powKBIdColumn); + var sufixColumn = new Column("Sufix", "varchar(10)", kontoBankoweTable); + kontoBankoweTable.Columns.Add("Sufix", sufixColumn); + var typColumn5 = new Column("Typ", "smallint", kontoBankoweTable); + kontoBankoweTable.Columns.Add("Typ", typColumn5); + var walIdColumn2 = new Column("WalId", "numeric(9,0)", kontoBankoweTable); + kontoBankoweTable.Columns.Add("WalId", walIdColumn2); + var zmianaColumn11 = new Column("Zmiana", "datetime", kontoBankoweTable); + kontoBankoweTable.Columns.Add("Zmiana", zmianaColumn11); + var pK_KontoBankowe = new UniqueConstraint("PK_KontoBankowe", kontoBankoweTable, new[] { kBIdColumn }); + kontoBankoweTable.PrimaryKey = pK_KontoBankowe; + var pK_KontoBankoweUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "KBId" }); + pK_KontoBankowe.MappedKeys.Add(pK_KontoBankoweUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KontoBankoweUc).Add(pK_KontoBankowe); + kontoBankoweTable.UniqueConstraints.Add("PK_KontoBankowe", pK_KontoBankowe); + var iX_KontoBankowe_BankId = new TableIndex( + "IX_KontoBankowe_BankId", kontoBankoweTable, new[] { bankIdColumn0 }, false); + var iX_KontoBankowe_BankIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "BankId" }); + iX_KontoBankowe_BankId.MappedIndexes.Add(iX_KontoBankowe_BankIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KontoBankowe_BankIdIx).Add(iX_KontoBankowe_BankId); + kontoBankoweTable.Indexes.Add("IX_KontoBankowe_BankId", iX_KontoBankowe_BankId); + var iX_KontoBankowe_MagId = new TableIndex( + "IX_KontoBankowe_MagId", kontoBankoweTable, new[] { magIdColumn3 }, false); + var iX_KontoBankowe_MagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "MagId" }); + iX_KontoBankowe_MagId.MappedIndexes.Add(iX_KontoBankowe_MagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KontoBankowe_MagIdIx).Add(iX_KontoBankowe_MagId); + kontoBankoweTable.Indexes.Add("IX_KontoBankowe_MagId", iX_KontoBankowe_MagId); + var iX_KontoBankowe_WalId = new TableIndex( + "IX_KontoBankowe_WalId", kontoBankoweTable, new[] { walIdColumn2 }, false); + var iX_KontoBankowe_WalIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "WalId" }); + iX_KontoBankowe_WalId.MappedIndexes.Add(iX_KontoBankowe_WalIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KontoBankowe_WalIdIx).Add(iX_KontoBankowe_WalId); + kontoBankoweTable.Indexes.Add("IX_KontoBankowe_WalId", iX_KontoBankowe_WalId); + relationalModel.Tables.Add(("KontoBankowe", null), kontoBankoweTable); + var kontoBankoweTableMapping = new TableMapping(kontoBankowe, kontoBankoweTable, true); + kontoBankoweTable.AddTypeMapping(kontoBankoweTableMapping, false); + tableMappings53.Add(kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(kBIdColumn, kontoBankowe.FindProperty("KBId")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(aktywneColumn, kontoBankowe.FindProperty("Aktywne")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(bankIdColumn0, kontoBankowe.FindProperty("BankId")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(centrKBIdColumn, kontoBankowe.FindProperty("CentrKBId")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(domyslneColumn, kontoBankowe.FindProperty("Domyslne")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(kBIdOplatColumn, kontoBankowe.FindProperty("KBIdOplat")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn3, kontoBankowe.FindProperty("MagId")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn14, kontoBankowe.FindProperty("Nazwa")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(numerColumn0, kontoBankowe.FindProperty("Numer")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(powKBIdColumn, kontoBankowe.FindProperty("PowKBId")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sufixColumn, kontoBankowe.FindProperty("Sufix")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(typColumn5, kontoBankowe.FindProperty("Typ")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn2, kontoBankowe.FindProperty("WalId")!, kontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn11, kontoBankowe.FindProperty("Zmiana")!, kontoBankoweTableMapping); + + var kontoBankoweKontr = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr")!; + + var defaultTableMappings54 = new List>(); + kontoBankoweKontr.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings54); + var blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", null, relationalModel); + var aktywneColumnBase0 = new ColumnBase("Aktywne", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("Aktywne", aktywneColumnBase0); + var bankIdColumnBase1 = new ColumnBase("BankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("BankId", bankIdColumnBase1); + var centrKBKIdColumnBase = new ColumnBase("CentrKBKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("CentrKBKId", centrKBKIdColumnBase); + var domyslneColumnBase0 = new ColumnBase("Domyslne", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("Domyslne", domyslneColumnBase0); + var kBKIdColumnBase = new ColumnBase("KBKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("KBKId", kBKIdColumnBase); + var kontrIdColumnBase3 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("KontrId", kontrIdColumnBase3); + var nazwaColumnBase15 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("Nazwa", nazwaColumnBase15); + var numerColumnBase1 = new ColumnBase("Numer", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("Numer", numerColumnBase1); + var powKBKIdColumnBase = new ColumnBase("PowKBKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("PowKBKId", powKBKIdColumnBase); + var typColumnBase6 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("Typ", typColumnBase6); + var walIdColumnBase3 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("WalId", walIdColumnBase3); + var wykazVatColumnBase = new ColumnBase("WykazVat", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.Columns.Add("WykazVat", wykazVatColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase); + var blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase = new TableMappingBase(kontoBankoweKontr, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase, false); + defaultTableMappings54.Add(blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kBKIdColumnBase, kontoBankoweKontr.FindProperty("KBKId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywneColumnBase0, kontoBankoweKontr.FindProperty("Aktywne")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bankIdColumnBase1, kontoBankoweKontr.FindProperty("BankId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKBKIdColumnBase, kontoBankoweKontr.FindProperty("CentrKBKId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslneColumnBase0, kontoBankoweKontr.FindProperty("Domyslne")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase3, kontoBankoweKontr.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase15, kontoBankoweKontr.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase1, kontoBankoweKontr.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powKBKIdColumnBase, kontoBankoweKontr.FindProperty("PowKBKId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase6, kontoBankoweKontr.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase3, kontoBankoweKontr.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wykazVatColumnBase, kontoBankoweKontr.FindProperty("WykazVat")!, blinkBackofficeServicesPcmDbEntitiesKontoBankoweKontrMappingBase); + + var tableMappings54 = new List(); + kontoBankoweKontr.SetRuntimeAnnotation("Relational:TableMappings", tableMappings54); + var kontoBankoweKontrTable = new Table("KontoBankoweKontr", null, relationalModel); + var kBKIdColumn = new Column("KBKId", "numeric(9,0)", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("KBKId", kBKIdColumn); + var aktywneColumn0 = new Column("Aktywne", "smallint", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("Aktywne", aktywneColumn0); + var bankIdColumn1 = new Column("BankId", "numeric(9,0)", kontoBankoweKontrTable) + { + IsNullable = true + }; + kontoBankoweKontrTable.Columns.Add("BankId", bankIdColumn1); + var centrKBKIdColumn = new Column("CentrKBKId", "numeric(9,0)", kontoBankoweKontrTable) + { + IsNullable = true + }; + kontoBankoweKontrTable.Columns.Add("CentrKBKId", centrKBKIdColumn); + var domyslneColumn0 = new Column("Domyslne", "smallint", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("Domyslne", domyslneColumn0); + var kontrIdColumn3 = new Column("KontrId", "numeric(9,0)", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("KontrId", kontrIdColumn3); + var nazwaColumn15 = new Column("Nazwa", "varchar(120)", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("Nazwa", nazwaColumn15); + var numerColumn1 = new Column("Numer", "varchar(40)", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("Numer", numerColumn1); + var powKBKIdColumn = new Column("PowKBKId", "numeric(9,0)", kontoBankoweKontrTable) + { + IsNullable = true + }; + kontoBankoweKontrTable.Columns.Add("PowKBKId", powKBKIdColumn); + var typColumn6 = new Column("Typ", "smallint", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("Typ", typColumn6); + var walIdColumn3 = new Column("WalId", "numeric(9,0)", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("WalId", walIdColumn3); + var wykazVatColumn = new Column("WykazVat", "smallint", kontoBankoweKontrTable); + kontoBankoweKontrTable.Columns.Add("WykazVat", wykazVatColumn); + var pK_KontoBankoweKontr = new UniqueConstraint("PK_KontoBankoweKontr", kontoBankoweKontrTable, new[] { kBKIdColumn }); + kontoBankoweKontrTable.PrimaryKey = pK_KontoBankoweKontr; + var pK_KontoBankoweKontrUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + new[] { "KBKId" }); + pK_KontoBankoweKontr.MappedKeys.Add(pK_KontoBankoweKontrUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KontoBankoweKontrUc).Add(pK_KontoBankoweKontr); + kontoBankoweKontrTable.UniqueConstraints.Add("PK_KontoBankoweKontr", pK_KontoBankoweKontr); + var iX_KontoBankoweKontr_BankId = new TableIndex( + "IX_KontoBankoweKontr_BankId", kontoBankoweKontrTable, new[] { bankIdColumn1 }, false); + var iX_KontoBankoweKontr_BankIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + new[] { "BankId" }); + iX_KontoBankoweKontr_BankId.MappedIndexes.Add(iX_KontoBankoweKontr_BankIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KontoBankoweKontr_BankIdIx).Add(iX_KontoBankoweKontr_BankId); + kontoBankoweKontrTable.Indexes.Add("IX_KontoBankoweKontr_BankId", iX_KontoBankoweKontr_BankId); + var iX_KontoBankoweKontr_KontrId = new TableIndex( + "IX_KontoBankoweKontr_KontrId", kontoBankoweKontrTable, new[] { kontrIdColumn3 }, false); + var iX_KontoBankoweKontr_KontrIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + new[] { "KontrId" }); + iX_KontoBankoweKontr_KontrId.MappedIndexes.Add(iX_KontoBankoweKontr_KontrIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KontoBankoweKontr_KontrIdIx).Add(iX_KontoBankoweKontr_KontrId); + kontoBankoweKontrTable.Indexes.Add("IX_KontoBankoweKontr_KontrId", iX_KontoBankoweKontr_KontrId); + var iX_KontoBankoweKontr_WalId = new TableIndex( + "IX_KontoBankoweKontr_WalId", kontoBankoweKontrTable, new[] { walIdColumn3 }, false); + var iX_KontoBankoweKontr_WalIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + new[] { "WalId" }); + iX_KontoBankoweKontr_WalId.MappedIndexes.Add(iX_KontoBankoweKontr_WalIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KontoBankoweKontr_WalIdIx).Add(iX_KontoBankoweKontr_WalId); + kontoBankoweKontrTable.Indexes.Add("IX_KontoBankoweKontr_WalId", iX_KontoBankoweKontr_WalId); + relationalModel.Tables.Add(("KontoBankoweKontr", null), kontoBankoweKontrTable); + var kontoBankoweKontrTableMapping = new TableMapping(kontoBankoweKontr, kontoBankoweKontrTable, true); + kontoBankoweKontrTable.AddTypeMapping(kontoBankoweKontrTableMapping, false); + tableMappings54.Add(kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(kBKIdColumn, kontoBankoweKontr.FindProperty("KBKId")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(aktywneColumn0, kontoBankoweKontr.FindProperty("Aktywne")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(bankIdColumn1, kontoBankoweKontr.FindProperty("BankId")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(centrKBKIdColumn, kontoBankoweKontr.FindProperty("CentrKBKId")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(domyslneColumn0, kontoBankoweKontr.FindProperty("Domyslne")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn3, kontoBankoweKontr.FindProperty("KontrId")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn15, kontoBankoweKontr.FindProperty("Nazwa")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(numerColumn1, kontoBankoweKontr.FindProperty("Numer")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(powKBKIdColumn, kontoBankoweKontr.FindProperty("PowKBKId")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(typColumn6, kontoBankoweKontr.FindProperty("Typ")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn3, kontoBankoweKontr.FindProperty("WalId")!, kontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(wykazVatColumn, kontoBankoweKontr.FindProperty("WykazVat")!, kontoBankoweKontrTableMapping); + + var kontoLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KontoLoj")!; + + var defaultTableMappings55 = new List>(); + kontoLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings55); + var blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", null, relationalModel); + var aktywneColumnBase1 = new ColumnBase("Aktywne", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("Aktywne", aktywneColumnBase1); + var centrKontoIdColumnBase = new ColumnBase("CentrKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("CentrKontoId", centrKontoIdColumnBase); + var kontoIdColumnBase0 = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("KontoId", kontoIdColumnBase0); + var kontrIdColumnBase4 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("KontrId", kontrIdColumnBase4); + var nazwaColumnBase16 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("Nazwa", nazwaColumnBase16); + var stanColumnBase = new ColumnBase("Stan", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("Stan", stanColumnBase); + var stanPoczColumnBase = new ColumnBase("StanPocz", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("StanPocz", stanPoczColumnBase); + var typKontaColumnBase = new ColumnBase("TypKonta", "smallint", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("TypKonta", typKontaColumnBase); + var zmianaColumnBase12 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("Zmiana", zmianaColumnBase12); + var zmianaStanuColumnBase = new ColumnBase("ZmianaStanu", "datetime", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.Columns.Add("ZmianaStanu", zmianaStanuColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase = new TableMappingBase(kontoLoj, blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKontoLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase, false); + defaultTableMappings55.Add(blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase0, kontoLoj.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywneColumnBase1, kontoLoj.FindProperty("Aktywne")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKontoIdColumnBase, kontoLoj.FindProperty("CentrKontoId")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase4, kontoLoj.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase16, kontoLoj.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanColumnBase, kontoLoj.FindProperty("Stan")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanPoczColumnBase, kontoLoj.FindProperty("StanPocz")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKontaColumnBase, kontoLoj.FindProperty("TypKonta")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase12, kontoLoj.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaStanuColumnBase, kontoLoj.FindProperty("ZmianaStanu")!, blinkBackofficeServicesPcmDbEntitiesKontoLojMappingBase); + + var tableMappings55 = new List(); + kontoLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings55); + var kontoLojTable = new Table("KontoLoj", null, relationalModel); + var kontoIdColumn0 = new Column("KontoId", "numeric(9,0)", kontoLojTable); + kontoLojTable.Columns.Add("KontoId", kontoIdColumn0); + var aktywneColumn1 = new Column("Aktywne", "smallint", kontoLojTable); + kontoLojTable.Columns.Add("Aktywne", aktywneColumn1); + var centrKontoIdColumn = new Column("CentrKontoId", "numeric(9,0)", kontoLojTable) + { + IsNullable = true + }; + kontoLojTable.Columns.Add("CentrKontoId", centrKontoIdColumn); + var kontrIdColumn4 = new Column("KontrId", "numeric(9,0)", kontoLojTable); + kontoLojTable.Columns.Add("KontrId", kontrIdColumn4); + var nazwaColumn16 = new Column("Nazwa", "varchar(40)", kontoLojTable) + { + IsNullable = true + }; + kontoLojTable.Columns.Add("Nazwa", nazwaColumn16); + var stanColumn = new Column("Stan", "decimal(15,4)", kontoLojTable); + kontoLojTable.Columns.Add("Stan", stanColumn); + var stanPoczColumn = new Column("StanPocz", "decimal(15,4)", kontoLojTable); + kontoLojTable.Columns.Add("StanPocz", stanPoczColumn); + var typKontaColumn = new Column("TypKonta", "smallint", kontoLojTable); + kontoLojTable.Columns.Add("TypKonta", typKontaColumn); + var zmianaColumn12 = new Column("Zmiana", "datetime", kontoLojTable); + kontoLojTable.Columns.Add("Zmiana", zmianaColumn12); + var zmianaStanuColumn = new Column("ZmianaStanu", "datetime", kontoLojTable); + kontoLojTable.Columns.Add("ZmianaStanu", zmianaStanuColumn); + var pK_KONTOLOJ = new UniqueConstraint("PK_KONTOLOJ", kontoLojTable, new[] { kontoIdColumn0 }); + kontoLojTable.PrimaryKey = pK_KONTOLOJ; + var pK_KONTOLOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + pK_KONTOLOJ.MappedKeys.Add(pK_KONTOLOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KONTOLOJUc).Add(pK_KONTOLOJ); + kontoLojTable.UniqueConstraints.Add("PK_KONTOLOJ", pK_KONTOLOJ); + var idx_CentrKontoId = new TableIndex( + "idx_CentrKontoId", kontoLojTable, new[] { centrKontoIdColumn }, false); + var idx_CentrKontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + "idx_CentrKontoId"); + idx_CentrKontoId.MappedIndexes.Add(idx_CentrKontoIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrKontoIdIx).Add(idx_CentrKontoId); + kontoLojTable.Indexes.Add("idx_CentrKontoId", idx_CentrKontoId); + var idx_KLoj_KontrId = new TableIndex( + "idx_KLoj_KontrId", kontoLojTable, new[] { kontrIdColumn4 }, false); + var idx_KLoj_KontrIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + "idx_KLoj_KontrId"); + idx_KLoj_KontrId.MappedIndexes.Add(idx_KLoj_KontrIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_KLoj_KontrIdIx).Add(idx_KLoj_KontrId); + kontoLojTable.Indexes.Add("idx_KLoj_KontrId", idx_KLoj_KontrId); + var idx_KLoj_Zmiana = new TableIndex( + "idx_KLoj_Zmiana", kontoLojTable, new[] { zmianaColumn12 }, false); + var idx_KLoj_ZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + "idx_KLoj_Zmiana"); + idx_KLoj_Zmiana.MappedIndexes.Add(idx_KLoj_ZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_KLoj_ZmianaIx).Add(idx_KLoj_Zmiana); + kontoLojTable.Indexes.Add("idx_KLoj_Zmiana", idx_KLoj_Zmiana); + var idx_KLoj_ZmStanu = new TableIndex( + "idx_KLoj_ZmStanu", kontoLojTable, new[] { zmianaStanuColumn }, false); + var idx_KLoj_ZmStanuIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + "idx_KLoj_ZmStanu"); + idx_KLoj_ZmStanu.MappedIndexes.Add(idx_KLoj_ZmStanuIx); + RelationalModel.GetOrCreateTableIndexes(idx_KLoj_ZmStanuIx).Add(idx_KLoj_ZmStanu); + kontoLojTable.Indexes.Add("idx_KLoj_ZmStanu", idx_KLoj_ZmStanu); + relationalModel.Tables.Add(("KontoLoj", null), kontoLojTable); + var kontoLojTableMapping = new TableMapping(kontoLoj, kontoLojTable, true); + kontoLojTable.AddTypeMapping(kontoLojTableMapping, false); + tableMappings55.Add(kontoLojTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn0, kontoLoj.FindProperty("KontoId")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(aktywneColumn1, kontoLoj.FindProperty("Aktywne")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(centrKontoIdColumn, kontoLoj.FindProperty("CentrKontoId")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn4, kontoLoj.FindProperty("KontrId")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn16, kontoLoj.FindProperty("Nazwa")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(stanColumn, kontoLoj.FindProperty("Stan")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(stanPoczColumn, kontoLoj.FindProperty("StanPocz")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(typKontaColumn, kontoLoj.FindProperty("TypKonta")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn12, kontoLoj.FindProperty("Zmiana")!, kontoLojTableMapping); + RelationalModel.CreateColumnMapping(zmianaStanuColumn, kontoLoj.FindProperty("ZmianaStanu")!, kontoLojTableMapping); + + var kontrOpis = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KontrOpis")!; + + var defaultTableMappings56 = new List>(); + kontrOpis.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings56); + var blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KontrOpis", null, relationalModel); + var kontrIdColumnBase5 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase.Columns.Add("KontrId", kontrIdColumnBase5); + var tekstColumnBase0 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase.Columns.Add("Tekst", tekstColumnBase0); + var znaczenieColumnBase3 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase.Columns.Add("Znaczenie", znaczenieColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KontrOpis", blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase); + var blinkBackofficeServicesPcmDbEntitiesKontrOpisMappingBase = new TableMappingBase(kontrOpis, blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKontrOpisTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKontrOpisMappingBase, false); + defaultTableMappings56.Add(blinkBackofficeServicesPcmDbEntitiesKontrOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase5, kontrOpis.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesKontrOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase3, kontrOpis.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesKontrOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase0, kontrOpis.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesKontrOpisMappingBase); + + var tableMappings56 = new List(); + kontrOpis.SetRuntimeAnnotation("Relational:TableMappings", tableMappings56); + var kontrOpisTable = new Table("KontrOpis", null, relationalModel); + var kontrIdColumn5 = new Column("KontrId", "numeric(9,0)", kontrOpisTable); + kontrOpisTable.Columns.Add("KontrId", kontrIdColumn5); + var znaczenieColumn3 = new Column("Znaczenie", "smallint", kontrOpisTable); + kontrOpisTable.Columns.Add("Znaczenie", znaczenieColumn3); + var tekstColumn0 = new Column("Tekst", "varchar(255)", kontrOpisTable); + kontrOpisTable.Columns.Add("Tekst", tekstColumn0); + var pK_KONTROPIS = new UniqueConstraint("PK_KONTROPIS", kontrOpisTable, new[] { kontrIdColumn5, znaczenieColumn3 }); + kontrOpisTable.PrimaryKey = pK_KONTROPIS; + var pK_KONTROPISUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontrOpis", + new[] { "KontrId", "Znaczenie" }); + pK_KONTROPIS.MappedKeys.Add(pK_KONTROPISUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KONTROPISUc).Add(pK_KONTROPIS); + kontrOpisTable.UniqueConstraints.Add("PK_KONTROPIS", pK_KONTROPIS); + relationalModel.Tables.Add(("KontrOpis", null), kontrOpisTable); + var kontrOpisTableMapping = new TableMapping(kontrOpis, kontrOpisTable, true); + kontrOpisTable.AddTypeMapping(kontrOpisTableMapping, false); + tableMappings56.Add(kontrOpisTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn5, kontrOpis.FindProperty("KontrId")!, kontrOpisTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn3, kontrOpis.FindProperty("Znaczenie")!, kontrOpisTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn0, kontrOpis.FindProperty("Tekst")!, kontrOpisTableMapping); + + var kontrahent = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Kontrahent")!; + + var defaultTableMappings57 = new List>(); + kontrahent.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings57); + var blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", null, relationalModel); + var aktywnyColumnBase9 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Aktywny", aktywnyColumnBase9); + var akwIdColumnBase0 = new ColumnBase("AkwId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("AkwId", akwIdColumnBase0); + var bankColumnBase = new ColumnBase("Bank", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Bank", bankColumnBase); + var centrKontrIdColumnBase = new ColumnBase("CentrKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("CentrKontrId", centrKontrIdColumnBase); + var czasRealZamColumnBase = new ColumnBase("CzasRealZam", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("CzasRealZam", czasRealZamColumnBase); + var dostawcaColumnBase = new ColumnBase("Dostawca", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Dostawca", dostawcaColumnBase); + var eMailColumnBase = new ColumnBase("EMail", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("EMail", eMailColumnBase); + var faxColumnBase = new ColumnBase("Fax", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Fax", faxColumnBase); + var formaPlatDostColumnBase = new ColumnBase("FormaPlatDost", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("FormaPlatDost", formaPlatDostColumnBase); + var formaPlatOdbColumnBase = new ColumnBase("FormaPlatOdb", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("FormaPlatOdb", formaPlatOdbColumnBase); + var indeksCentrColumnBase = new ColumnBase("IndeksCentr", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("IndeksCentr", indeksCentrColumnBase); + var kartaAktywnaColumnBase = new ColumnBase("KartaAktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("KartaAktywna", kartaAktywnaColumnBase); + var kodColumnBase3 = new ColumnBase("Kod", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Kod", kodColumnBase3); + var kodKartyColumnBase0 = new ColumnBase("KodKarty", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("KodKarty", kodKartyColumnBase0); + var kodKontrColumnBase = new ColumnBase("KodKontr", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("KodKontr", kodKontrColumnBase); + var kontoColumnBase = new ColumnBase("Konto", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Konto", kontoColumnBase); + var kontrIdColumnBase6 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("KontrId", kontrIdColumnBase6); + var kontrKrajIdColumnBase = new ColumnBase("KontrKrajId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("KontrKrajId", kontrKrajIdColumnBase); + var maxKredytColumnBase = new ColumnBase("MaxKredyt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("MaxKredyt", maxKredytColumnBase); + var maxPoTermPlatColumnBase = new ColumnBase("MaxPoTermPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("MaxPoTermPlat", maxPoTermPlatColumnBase); + var miastoColumnBase = new ColumnBase("Miasto", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Miasto", miastoColumnBase); + var nIPColumnBase = new ColumnBase("NIP", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("NIP", nIPColumnBase); + var naPrzelewie1ColumnBase = new ColumnBase("NaPrzelewie1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("NaPrzelewie1", naPrzelewie1ColumnBase); + var naPrzelewie2ColumnBase = new ColumnBase("NaPrzelewie2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("NaPrzelewie2", naPrzelewie2ColumnBase); + var nazwaColumnBase17 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Nazwa", nazwaColumnBase17); + var nrAnalitykiColumnBase = new ColumnBase("NrAnalityki", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("NrAnalityki", nrAnalitykiColumnBase); + var nrDomuColumnBase = new ColumnBase("NrDomu", "varchar(9)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("NrDomu", nrDomuColumnBase); + var nrLokaluColumnBase = new ColumnBase("NrLokalu", "varchar(9)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("NrLokalu", nrLokaluColumnBase); + var odbiorcaColumnBase = new ColumnBase("Odbiorca", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Odbiorca", odbiorcaColumnBase); + var osobaColumnBase = new ColumnBase("Osoba", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Osoba", osobaColumnBase); + var pocztaColumnBase = new ColumnBase("Poczta", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Poczta", pocztaColumnBase); + var poziomRabatuColumnBase = new ColumnBase("PoziomRabatu", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("PoziomRabatu", poziomRabatuColumnBase); + var producentColumnBase = new ColumnBase("Producent", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Producent", producentColumnBase); + var rabatDostColumnBase = new ColumnBase("RabatDost", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("RabatDost", rabatDostColumnBase); + var rabatOdbColumnBase = new ColumnBase("RabatOdb", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("RabatOdb", rabatOdbColumnBase); + var rezerwa1ColumnBase = new ColumnBase("Rezerwa1", "varchar(80)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Rezerwa1", rezerwa1ColumnBase); + var rezerwa2ColumnBase = new ColumnBase("Rezerwa2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Rezerwa2", rezerwa2ColumnBase); + var skrotColumnBase1 = new ColumnBase("Skrot", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Skrot", skrotColumnBase1); + var stalyColumnBase = new ColumnBase("Staly", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Staly", stalyColumnBase); + var telefonColumnBase = new ColumnBase("Telefon", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Telefon", telefonColumnBase); + var termPlatDostColumnBase = new ColumnBase("TermPlatDost", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("TermPlatDost", termPlatDostColumnBase); + var termPlatOdbColumnBase = new ColumnBase("TermPlatOdb", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("TermPlatOdb", termPlatOdbColumnBase); + var termWaznKartyColumnBase = new ColumnBase("TermWaznKarty", "datetime", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("TermWaznKarty", termWaznKartyColumnBase); + var ulicaColumnBase = new ColumnBase("Ulica", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Ulica", ulicaColumnBase); + var zakPracChronColumnBase = new ColumnBase("ZakPracChron", "smallint", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("ZakPracChron", zakPracChronColumnBase); + var zmianaColumnBase13 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.Columns.Add("Zmiana", zmianaColumnBase13); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase); + var blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase = new TableMappingBase(kontrahent, blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKontrahentTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase, false); + defaultTableMappings57.Add(blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase6, kontrahent.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase9, kontrahent.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akwIdColumnBase0, kontrahent.FindProperty("AkwId")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bankColumnBase, kontrahent.FindProperty("Bank")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKontrIdColumnBase, kontrahent.FindProperty("CentrKontrId")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czasRealZamColumnBase, kontrahent.FindProperty("CzasRealZam")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dostawcaColumnBase, kontrahent.FindProperty("Dostawca")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)eMailColumnBase, kontrahent.FindProperty("EMail")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)faxColumnBase, kontrahent.FindProperty("Fax")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaPlatDostColumnBase, kontrahent.FindProperty("FormaPlatDost")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaPlatOdbColumnBase, kontrahent.FindProperty("FormaPlatOdb")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeksCentrColumnBase, kontrahent.FindProperty("IndeksCentr")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kartaAktywnaColumnBase, kontrahent.FindProperty("KartaAktywna")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase3, kontrahent.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKartyColumnBase0, kontrahent.FindProperty("KodKarty")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKontrColumnBase, kontrahent.FindProperty("KodKontr")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoColumnBase, kontrahent.FindProperty("Konto")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrKrajIdColumnBase, kontrahent.FindProperty("KontrKrajId")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)maxKredytColumnBase, kontrahent.FindProperty("MaxKredyt")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)maxPoTermPlatColumnBase, kontrahent.FindProperty("MaxPoTermPlat")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)miastoColumnBase, kontrahent.FindProperty("Miasto")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nIPColumnBase, kontrahent.FindProperty("NIP")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)naPrzelewie1ColumnBase, kontrahent.FindProperty("NaPrzelewie1")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)naPrzelewie2ColumnBase, kontrahent.FindProperty("NaPrzelewie2")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase17, kontrahent.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrAnalitykiColumnBase, kontrahent.FindProperty("NrAnalityki")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDomuColumnBase, kontrahent.FindProperty("NrDomu")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrLokaluColumnBase, kontrahent.FindProperty("NrLokalu")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odbiorcaColumnBase, kontrahent.FindProperty("Odbiorca")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)osobaColumnBase, kontrahent.FindProperty("Osoba")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pocztaColumnBase, kontrahent.FindProperty("Poczta")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomRabatuColumnBase, kontrahent.FindProperty("PoziomRabatu")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)producentColumnBase, kontrahent.FindProperty("Producent")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatDostColumnBase, kontrahent.FindProperty("RabatDost")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatOdbColumnBase, kontrahent.FindProperty("RabatOdb")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa1ColumnBase, kontrahent.FindProperty("Rezerwa1")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa2ColumnBase, kontrahent.FindProperty("Rezerwa2")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase1, kontrahent.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stalyColumnBase, kontrahent.FindProperty("Staly")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)telefonColumnBase, kontrahent.FindProperty("Telefon")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termPlatDostColumnBase, kontrahent.FindProperty("TermPlatDost")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termPlatOdbColumnBase, kontrahent.FindProperty("TermPlatOdb")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termWaznKartyColumnBase, kontrahent.FindProperty("TermWaznKarty")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ulicaColumnBase, kontrahent.FindProperty("Ulica")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zakPracChronColumnBase, kontrahent.FindProperty("ZakPracChron")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase13, kontrahent.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesKontrahentMappingBase); + + var tableMappings57 = new List(); + kontrahent.SetRuntimeAnnotation("Relational:TableMappings", tableMappings57); + var kontrahentTable = new Table("Kontrahent", null, relationalModel); + var kontrIdColumn6 = new Column("KontrId", "numeric(9,0)", kontrahentTable); + kontrahentTable.Columns.Add("KontrId", kontrIdColumn6); + var aktywnyColumn9 = new Column("Aktywny", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("Aktywny", aktywnyColumn9); + var akwIdColumn0 = new Column("AkwId", "numeric(9,0)", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("AkwId", akwIdColumn0); + var bankColumn = new Column("Bank", "varchar(255)", kontrahentTable); + kontrahentTable.Columns.Add("Bank", bankColumn); + var centrKontrIdColumn = new Column("CentrKontrId", "numeric(9,0)", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("CentrKontrId", centrKontrIdColumn); + var czasRealZamColumn = new Column("CzasRealZam", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("CzasRealZam", czasRealZamColumn); + var dostawcaColumn = new Column("Dostawca", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("Dostawca", dostawcaColumn); + var eMailColumn = new Column("EMail", "varchar(120)", kontrahentTable); + kontrahentTable.Columns.Add("EMail", eMailColumn); + var faxColumn = new Column("Fax", "varchar(60)", kontrahentTable); + kontrahentTable.Columns.Add("Fax", faxColumn); + var formaPlatDostColumn = new Column("FormaPlatDost", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("FormaPlatDost", formaPlatDostColumn); + var formaPlatOdbColumn = new Column("FormaPlatOdb", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("FormaPlatOdb", formaPlatOdbColumn); + var indeksCentrColumn = new Column("IndeksCentr", "varchar(40)", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("IndeksCentr", indeksCentrColumn); + var kartaAktywnaColumn = new Column("KartaAktywna", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("KartaAktywna", kartaAktywnaColumn); + var kodColumn3 = new Column("Kod", "varchar(10)", kontrahentTable); + kontrahentTable.Columns.Add("Kod", kodColumn3); + var kodKartyColumn0 = new Column("KodKarty", "varchar(20)", kontrahentTable); + kontrahentTable.Columns.Add("KodKarty", kodKartyColumn0); + var kodKontrColumn = new Column("KodKontr", "varchar(20)", kontrahentTable); + kontrahentTable.Columns.Add("KodKontr", kodKontrColumn); + var kontoColumn = new Column("Konto", "varchar(60)", kontrahentTable); + kontrahentTable.Columns.Add("Konto", kontoColumn); + var kontrKrajIdColumn = new Column("KontrKrajId", "numeric(9,0)", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("KontrKrajId", kontrKrajIdColumn); + var maxKredytColumn = new Column("MaxKredyt", "decimal(15,4)", kontrahentTable); + kontrahentTable.Columns.Add("MaxKredyt", maxKredytColumn); + var maxPoTermPlatColumn = new Column("MaxPoTermPlat", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("MaxPoTermPlat", maxPoTermPlatColumn); + var miastoColumn = new Column("Miasto", "varchar(40)", kontrahentTable); + kontrahentTable.Columns.Add("Miasto", miastoColumn); + var nIPColumn = new Column("NIP", "varchar(40)", kontrahentTable); + kontrahentTable.Columns.Add("NIP", nIPColumn); + var naPrzelewie1Column = new Column("NaPrzelewie1", "varchar(40)", kontrahentTable); + kontrahentTable.Columns.Add("NaPrzelewie1", naPrzelewie1Column); + var naPrzelewie2Column = new Column("NaPrzelewie2", "varchar(40)", kontrahentTable); + kontrahentTable.Columns.Add("NaPrzelewie2", naPrzelewie2Column); + var nazwaColumn17 = new Column("Nazwa", "varchar(255)", kontrahentTable); + kontrahentTable.Columns.Add("Nazwa", nazwaColumn17); + var nrAnalitykiColumn = new Column("NrAnalityki", "varchar(20)", kontrahentTable); + kontrahentTable.Columns.Add("NrAnalityki", nrAnalitykiColumn); + var nrDomuColumn = new Column("NrDomu", "varchar(9)", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("NrDomu", nrDomuColumn); + var nrLokaluColumn = new Column("NrLokalu", "varchar(9)", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("NrLokalu", nrLokaluColumn); + var odbiorcaColumn = new Column("Odbiorca", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("Odbiorca", odbiorcaColumn); + var osobaColumn = new Column("Osoba", "smallint", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("Osoba", osobaColumn); + var pocztaColumn = new Column("Poczta", "varchar(40)", kontrahentTable) + { + IsNullable = true + }; + kontrahentTable.Columns.Add("Poczta", pocztaColumn); + var poziomRabatuColumn = new Column("PoziomRabatu", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("PoziomRabatu", poziomRabatuColumn); + var producentColumn = new Column("Producent", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("Producent", producentColumn); + var rabatDostColumn = new Column("RabatDost", "decimal(10,4)", kontrahentTable); + kontrahentTable.Columns.Add("RabatDost", rabatDostColumn); + var rabatOdbColumn = new Column("RabatOdb", "decimal(10,4)", kontrahentTable); + kontrahentTable.Columns.Add("RabatOdb", rabatOdbColumn); + var rezerwa1Column = new Column("Rezerwa1", "varchar(80)", kontrahentTable); + kontrahentTable.Columns.Add("Rezerwa1", rezerwa1Column); + var rezerwa2Column = new Column("Rezerwa2", "varchar(40)", kontrahentTable); + kontrahentTable.Columns.Add("Rezerwa2", rezerwa2Column); + var skrotColumn1 = new Column("Skrot", "varchar(40)", kontrahentTable); + kontrahentTable.Columns.Add("Skrot", skrotColumn1); + var stalyColumn = new Column("Staly", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("Staly", stalyColumn); + var telefonColumn = new Column("Telefon", "varchar(60)", kontrahentTable); + kontrahentTable.Columns.Add("Telefon", telefonColumn); + var termPlatDostColumn = new Column("TermPlatDost", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("TermPlatDost", termPlatDostColumn); + var termPlatOdbColumn = new Column("TermPlatOdb", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("TermPlatOdb", termPlatOdbColumn); + var termWaznKartyColumn = new Column("TermWaznKarty", "datetime", kontrahentTable); + kontrahentTable.Columns.Add("TermWaznKarty", termWaznKartyColumn); + var ulicaColumn = new Column("Ulica", "varchar(60)", kontrahentTable); + kontrahentTable.Columns.Add("Ulica", ulicaColumn); + var zakPracChronColumn = new Column("ZakPracChron", "smallint", kontrahentTable); + kontrahentTable.Columns.Add("ZakPracChron", zakPracChronColumn); + var zmianaColumn13 = new Column("Zmiana", "datetime", kontrahentTable); + kontrahentTable.Columns.Add("Zmiana", zmianaColumn13); + var pK_KONTRAHENT = new UniqueConstraint("PK_KONTRAHENT", kontrahentTable, new[] { kontrIdColumn6 }); + kontrahentTable.PrimaryKey = pK_KONTRAHENT; + var pK_KONTRAHENTUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + pK_KONTRAHENT.MappedKeys.Add(pK_KONTRAHENTUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KONTRAHENTUc).Add(pK_KONTRAHENT); + kontrahentTable.UniqueConstraints.Add("PK_KONTRAHENT", pK_KONTRAHENT); + var idx_KontrIndCentr = new TableIndex( + "idx_KontrIndCentr", kontrahentTable, new[] { indeksCentrColumn }, false); + var idx_KontrIndCentrIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + "idx_KontrIndCentr"); + idx_KontrIndCentr.MappedIndexes.Add(idx_KontrIndCentrIx); + RelationalModel.GetOrCreateTableIndexes(idx_KontrIndCentrIx).Add(idx_KontrIndCentr); + kontrahentTable.Indexes.Add("idx_KontrIndCentr", idx_KontrIndCentr); + var idx_KontrNIP = new TableIndex( + "idx_KontrNIP", kontrahentTable, new[] { nIPColumn }, false); + var idx_KontrNIPIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + "idx_KontrNIP"); + idx_KontrNIP.MappedIndexes.Add(idx_KontrNIPIx); + RelationalModel.GetOrCreateTableIndexes(idx_KontrNIPIx).Add(idx_KontrNIP); + kontrahentTable.Indexes.Add("idx_KontrNIP", idx_KontrNIP); + var idx_KontrZmiana = new TableIndex( + "idx_KontrZmiana", kontrahentTable, new[] { zmianaColumn13 }, false); + var idx_KontrZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + "idx_KontrZmiana"); + idx_KontrZmiana.MappedIndexes.Add(idx_KontrZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_KontrZmianaIx).Add(idx_KontrZmiana); + kontrahentTable.Indexes.Add("idx_KontrZmiana", idx_KontrZmiana); + var iX_Kontrahent_AkwId = new TableIndex( + "IX_Kontrahent_AkwId", kontrahentTable, new[] { akwIdColumn0 }, false); + var iX_Kontrahent_AkwIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "AkwId" }); + iX_Kontrahent_AkwId.MappedIndexes.Add(iX_Kontrahent_AkwIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Kontrahent_AkwIdIx).Add(iX_Kontrahent_AkwId); + kontrahentTable.Indexes.Add("IX_Kontrahent_AkwId", iX_Kontrahent_AkwId); + var iX_Kontrahent_KontrKrajId = new TableIndex( + "IX_Kontrahent_KontrKrajId", kontrahentTable, new[] { kontrKrajIdColumn }, false); + var iX_Kontrahent_KontrKrajIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrKrajId" }); + iX_Kontrahent_KontrKrajId.MappedIndexes.Add(iX_Kontrahent_KontrKrajIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Kontrahent_KontrKrajIdIx).Add(iX_Kontrahent_KontrKrajId); + kontrahentTable.Indexes.Add("IX_Kontrahent_KontrKrajId", iX_Kontrahent_KontrKrajId); + relationalModel.Tables.Add(("Kontrahent", null), kontrahentTable); + var kontrahentTableMapping = new TableMapping(kontrahent, kontrahentTable, true); + kontrahentTable.AddTypeMapping(kontrahentTableMapping, false); + tableMappings57.Add(kontrahentTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn6, kontrahent.FindProperty("KontrId")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn9, kontrahent.FindProperty("Aktywny")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(akwIdColumn0, kontrahent.FindProperty("AkwId")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(bankColumn, kontrahent.FindProperty("Bank")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(centrKontrIdColumn, kontrahent.FindProperty("CentrKontrId")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(czasRealZamColumn, kontrahent.FindProperty("CzasRealZam")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(dostawcaColumn, kontrahent.FindProperty("Dostawca")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(eMailColumn, kontrahent.FindProperty("EMail")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(faxColumn, kontrahent.FindProperty("Fax")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(formaPlatDostColumn, kontrahent.FindProperty("FormaPlatDost")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(formaPlatOdbColumn, kontrahent.FindProperty("FormaPlatOdb")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(indeksCentrColumn, kontrahent.FindProperty("IndeksCentr")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(kartaAktywnaColumn, kontrahent.FindProperty("KartaAktywna")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(kodColumn3, kontrahent.FindProperty("Kod")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(kodKartyColumn0, kontrahent.FindProperty("KodKarty")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(kodKontrColumn, kontrahent.FindProperty("KodKontr")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(kontoColumn, kontrahent.FindProperty("Konto")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(kontrKrajIdColumn, kontrahent.FindProperty("KontrKrajId")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(maxKredytColumn, kontrahent.FindProperty("MaxKredyt")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(maxPoTermPlatColumn, kontrahent.FindProperty("MaxPoTermPlat")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(miastoColumn, kontrahent.FindProperty("Miasto")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(nIPColumn, kontrahent.FindProperty("NIP")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(naPrzelewie1Column, kontrahent.FindProperty("NaPrzelewie1")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(naPrzelewie2Column, kontrahent.FindProperty("NaPrzelewie2")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn17, kontrahent.FindProperty("Nazwa")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(nrAnalitykiColumn, kontrahent.FindProperty("NrAnalityki")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(nrDomuColumn, kontrahent.FindProperty("NrDomu")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(nrLokaluColumn, kontrahent.FindProperty("NrLokalu")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(odbiorcaColumn, kontrahent.FindProperty("Odbiorca")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(osobaColumn, kontrahent.FindProperty("Osoba")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(pocztaColumn, kontrahent.FindProperty("Poczta")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(poziomRabatuColumn, kontrahent.FindProperty("PoziomRabatu")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(producentColumn, kontrahent.FindProperty("Producent")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(rabatDostColumn, kontrahent.FindProperty("RabatDost")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(rabatOdbColumn, kontrahent.FindProperty("RabatOdb")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(rezerwa1Column, kontrahent.FindProperty("Rezerwa1")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(rezerwa2Column, kontrahent.FindProperty("Rezerwa2")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn1, kontrahent.FindProperty("Skrot")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(stalyColumn, kontrahent.FindProperty("Staly")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(telefonColumn, kontrahent.FindProperty("Telefon")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(termPlatDostColumn, kontrahent.FindProperty("TermPlatDost")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(termPlatOdbColumn, kontrahent.FindProperty("TermPlatOdb")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(termWaznKartyColumn, kontrahent.FindProperty("TermWaznKarty")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(ulicaColumn, kontrahent.FindProperty("Ulica")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(zakPracChronColumn, kontrahent.FindProperty("ZakPracChron")!, kontrahentTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn13, kontrahent.FindProperty("Zmiana")!, kontrahentTableMapping); + + var kraj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Kraj")!; + + var defaultTableMappings58 = new List>(); + kraj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings58); + var blinkBackofficeServicesPcmDbEntitiesKrajTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Kraj", null, relationalModel); + var aktywnyColumnBase10 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesKrajTableBase.Columns.Add("Aktywny", aktywnyColumnBase10); + var kodColumnBase4 = new ColumnBase("Kod", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesKrajTableBase.Columns.Add("Kod", kodColumnBase4); + var krajIdColumnBase0 = new ColumnBase("KrajId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesKrajTableBase.Columns.Add("KrajId", krajIdColumnBase0); + var nazwaColumnBase18 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesKrajTableBase.Columns.Add("Nazwa", nazwaColumnBase18); + var walIdColumnBase4 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesKrajTableBase.Columns.Add("WalId", walIdColumnBase4); + var zdjecieFlagiColumnBase = new ColumnBase("ZdjecieFlagi", "varchar(100)", blinkBackofficeServicesPcmDbEntitiesKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKrajTableBase.Columns.Add("ZdjecieFlagi", zdjecieFlagiColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Kraj", blinkBackofficeServicesPcmDbEntitiesKrajTableBase); + var blinkBackofficeServicesPcmDbEntitiesKrajMappingBase = new TableMappingBase(kraj, blinkBackofficeServicesPcmDbEntitiesKrajTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKrajTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKrajMappingBase, false); + defaultTableMappings58.Add(blinkBackofficeServicesPcmDbEntitiesKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)krajIdColumnBase0, kraj.FindProperty("KrajId")!, blinkBackofficeServicesPcmDbEntitiesKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase10, kraj.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase4, kraj.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase18, kraj.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase4, kraj.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zdjecieFlagiColumnBase, kraj.FindProperty("ZdjecieFlagi")!, blinkBackofficeServicesPcmDbEntitiesKrajMappingBase); + + var tableMappings58 = new List(); + kraj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings58); + var krajTable = new Table("Kraj", null, relationalModel); + var krajIdColumn0 = new Column("KrajId", "numeric(9,0)", krajTable); + krajTable.Columns.Add("KrajId", krajIdColumn0); + var aktywnyColumn10 = new Column("Aktywny", "smallint", krajTable); + krajTable.Columns.Add("Aktywny", aktywnyColumn10); + var kodColumn4 = new Column("Kod", "varchar(10)", krajTable); + krajTable.Columns.Add("Kod", kodColumn4); + var nazwaColumn18 = new Column("Nazwa", "varchar(60)", krajTable); + krajTable.Columns.Add("Nazwa", nazwaColumn18); + var walIdColumn4 = new Column("WalId", "numeric(9,0)", krajTable); + krajTable.Columns.Add("WalId", walIdColumn4); + var zdjecieFlagiColumn = new Column("ZdjecieFlagi", "varchar(100)", krajTable) + { + IsNullable = true + }; + krajTable.Columns.Add("ZdjecieFlagi", zdjecieFlagiColumn); + var pK_KRAJ = new UniqueConstraint("PK_KRAJ", krajTable, new[] { krajIdColumn0 }); + krajTable.PrimaryKey = pK_KRAJ; + var pK_KRAJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "KrajId" }); + pK_KRAJ.MappedKeys.Add(pK_KRAJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KRAJUc).Add(pK_KRAJ); + krajTable.UniqueConstraints.Add("PK_KRAJ", pK_KRAJ); + var iX_Kraj_WalId = new TableIndex( + "IX_Kraj_WalId", krajTable, new[] { walIdColumn4 }, false); + var iX_Kraj_WalIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "WalId" }); + iX_Kraj_WalId.MappedIndexes.Add(iX_Kraj_WalIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Kraj_WalIdIx).Add(iX_Kraj_WalId); + krajTable.Indexes.Add("IX_Kraj_WalId", iX_Kraj_WalId); + relationalModel.Tables.Add(("Kraj", null), krajTable); + var krajTableMapping = new TableMapping(kraj, krajTable, true); + krajTable.AddTypeMapping(krajTableMapping, false); + tableMappings58.Add(krajTableMapping); + RelationalModel.CreateColumnMapping(krajIdColumn0, kraj.FindProperty("KrajId")!, krajTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn10, kraj.FindProperty("Aktywny")!, krajTableMapping); + RelationalModel.CreateColumnMapping(kodColumn4, kraj.FindProperty("Kod")!, krajTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn18, kraj.FindProperty("Nazwa")!, krajTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn4, kraj.FindProperty("WalId")!, krajTableMapping); + RelationalModel.CreateColumnMapping(zdjecieFlagiColumn, kraj.FindProperty("ZdjecieFlagi")!, krajTableMapping); + + var krajStawka = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KrajStawka")!; + + var defaultTableMappings59 = new List>(); + krajStawka.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings59); + var blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KrajStawka", null, relationalModel); + var krajIdColumnBase1 = new ColumnBase("KrajId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase); + blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase.Columns.Add("KrajId", krajIdColumnBase1); + var podstawowaColumnBase = new ColumnBase("Podstawowa", "smallint", blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase.Columns.Add("Podstawowa", podstawowaColumnBase); + var stawkaColumnBase1 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase); + blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase.Columns.Add("Stawka", stawkaColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KrajStawka", blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase); + var blinkBackofficeServicesPcmDbEntitiesKrajStawkaMappingBase = new TableMappingBase(krajStawka, blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKrajStawkaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKrajStawkaMappingBase, false); + defaultTableMappings59.Add(blinkBackofficeServicesPcmDbEntitiesKrajStawkaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)krajIdColumnBase1, krajStawka.FindProperty("KrajId")!, blinkBackofficeServicesPcmDbEntitiesKrajStawkaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase1, krajStawka.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesKrajStawkaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podstawowaColumnBase, krajStawka.FindProperty("Podstawowa")!, blinkBackofficeServicesPcmDbEntitiesKrajStawkaMappingBase); + + var tableMappings59 = new List(); + krajStawka.SetRuntimeAnnotation("Relational:TableMappings", tableMappings59); + var krajStawkaTable = new Table("KrajStawka", null, relationalModel); + var krajIdColumn1 = new Column("KrajId", "numeric(9,0)", krajStawkaTable); + krajStawkaTable.Columns.Add("KrajId", krajIdColumn1); + var stawkaColumn1 = new Column("Stawka", "smallint", krajStawkaTable); + krajStawkaTable.Columns.Add("Stawka", stawkaColumn1); + var podstawowaColumn = new Column("Podstawowa", "smallint", krajStawkaTable) + { + IsNullable = true + }; + krajStawkaTable.Columns.Add("Podstawowa", podstawowaColumn); + var pK_KRAJSTAWKA = new UniqueConstraint("PK_KRAJSTAWKA", krajStawkaTable, new[] { krajIdColumn1, stawkaColumn1 }); + krajStawkaTable.PrimaryKey = pK_KRAJSTAWKA; + var pK_KRAJSTAWKAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KrajStawka", + new[] { "KrajId", "Stawka" }); + pK_KRAJSTAWKA.MappedKeys.Add(pK_KRAJSTAWKAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KRAJSTAWKAUc).Add(pK_KRAJSTAWKA); + krajStawkaTable.UniqueConstraints.Add("PK_KRAJSTAWKA", pK_KRAJSTAWKA); + relationalModel.Tables.Add(("KrajStawka", null), krajStawkaTable); + var krajStawkaTableMapping = new TableMapping(krajStawka, krajStawkaTable, true); + krajStawkaTable.AddTypeMapping(krajStawkaTableMapping, false); + tableMappings59.Add(krajStawkaTableMapping); + RelationalModel.CreateColumnMapping(krajIdColumn1, krajStawka.FindProperty("KrajId")!, krajStawkaTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn1, krajStawka.FindProperty("Stawka")!, krajStawkaTableMapping); + RelationalModel.CreateColumnMapping(podstawowaColumn, krajStawka.FindProperty("Podstawowa")!, krajStawkaTableMapping); + + var kthParWartosc = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc")!; + + var defaultTableMappings60 = new List>(); + kthParWartosc.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings60); + var blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", null, relationalModel); + var centrKPWIdColumnBase = new ColumnBase("CentrKPWId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase.Columns.Add("CentrKPWId", centrKPWIdColumnBase); + var kPWIdColumnBase = new ColumnBase("KPWId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase.Columns.Add("KPWId", kPWIdColumnBase); + var kolejnoscColumnBase4 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase4); + var kthParIdColumnBase = new ColumnBase("KthParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase.Columns.Add("KthParId", kthParIdColumnBase); + var tekstColumnBase1 = new ColumnBase("Tekst", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase.Columns.Add("Tekst", tekstColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase); + var blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase = new TableMappingBase(kthParWartosc, blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKthParWartoscTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase, false); + defaultTableMappings60.Add(blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kPWIdColumnBase, kthParWartosc.FindProperty("KPWId")!, blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKPWIdColumnBase, kthParWartosc.FindProperty("CentrKPWId")!, blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase4, kthParWartosc.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kthParIdColumnBase, kthParWartosc.FindProperty("KthParId")!, blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase1, kthParWartosc.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesKthParWartoscMappingBase); + + var tableMappings60 = new List(); + kthParWartosc.SetRuntimeAnnotation("Relational:TableMappings", tableMappings60); + var kthParWartoscTable = new Table("KthParWartosc", null, relationalModel); + var kPWIdColumn = new Column("KPWId", "numeric(9,0)", kthParWartoscTable); + kthParWartoscTable.Columns.Add("KPWId", kPWIdColumn); + var centrKPWIdColumn = new Column("CentrKPWId", "numeric(9,0)", kthParWartoscTable) + { + IsNullable = true + }; + kthParWartoscTable.Columns.Add("CentrKPWId", centrKPWIdColumn); + var kolejnoscColumn4 = new Column("Kolejnosc", "smallint", kthParWartoscTable); + kthParWartoscTable.Columns.Add("Kolejnosc", kolejnoscColumn4); + var kthParIdColumn = new Column("KthParId", "numeric(9,0)", kthParWartoscTable); + kthParWartoscTable.Columns.Add("KthParId", kthParIdColumn); + var tekstColumn1 = new Column("Tekst", "varchar(40)", kthParWartoscTable); + kthParWartoscTable.Columns.Add("Tekst", tekstColumn1); + var pK_KTHPARWARTOSC = new UniqueConstraint("PK_KTHPARWARTOSC", kthParWartoscTable, new[] { kPWIdColumn }); + kthParWartoscTable.PrimaryKey = pK_KTHPARWARTOSC; + var pK_KTHPARWARTOSCUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", + new[] { "KPWId" }); + pK_KTHPARWARTOSC.MappedKeys.Add(pK_KTHPARWARTOSCUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KTHPARWARTOSCUc).Add(pK_KTHPARWARTOSC); + kthParWartoscTable.UniqueConstraints.Add("PK_KTHPARWARTOSC", pK_KTHPARWARTOSC); + var idx_KPWPar = new TableIndex( + "idx_KPWPar", kthParWartoscTable, new[] { kthParIdColumn }, false); + var idx_KPWParIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", + "idx_KPWPar"); + idx_KPWPar.MappedIndexes.Add(idx_KPWParIx); + RelationalModel.GetOrCreateTableIndexes(idx_KPWParIx).Add(idx_KPWPar); + kthParWartoscTable.Indexes.Add("idx_KPWPar", idx_KPWPar); + relationalModel.Tables.Add(("KthParWartosc", null), kthParWartoscTable); + var kthParWartoscTableMapping = new TableMapping(kthParWartosc, kthParWartoscTable, true); + kthParWartoscTable.AddTypeMapping(kthParWartoscTableMapping, false); + tableMappings60.Add(kthParWartoscTableMapping); + RelationalModel.CreateColumnMapping(kPWIdColumn, kthParWartosc.FindProperty("KPWId")!, kthParWartoscTableMapping); + RelationalModel.CreateColumnMapping(centrKPWIdColumn, kthParWartosc.FindProperty("CentrKPWId")!, kthParWartoscTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn4, kthParWartosc.FindProperty("Kolejnosc")!, kthParWartoscTableMapping); + RelationalModel.CreateColumnMapping(kthParIdColumn, kthParWartosc.FindProperty("KthParId")!, kthParWartoscTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn1, kthParWartosc.FindProperty("Tekst")!, kthParWartoscTableMapping); + + var kthParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KthParam")!; + + var defaultTableMappings61 = new List>(); + kthParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings61); + var blinkBackofficeServicesPcmDbEntitiesKthParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KthParam", null, relationalModel); + var centrKthParIdColumnBase = new ColumnBase("CentrKthParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKthParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKthParamTableBase.Columns.Add("CentrKthParId", centrKthParIdColumnBase); + var kPWDomyslnaIdColumnBase = new ColumnBase("KPWDomyslnaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKthParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKthParamTableBase.Columns.Add("KPWDomyslnaId", kPWDomyslnaIdColumnBase); + var kolejnoscColumnBase5 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesKthParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParamTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase5); + var kthParIdColumnBase0 = new ColumnBase("KthParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKthParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParamTableBase.Columns.Add("KthParId", kthParIdColumnBase0); + var nazwaColumnBase19 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesKthParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParamTableBase.Columns.Add("Nazwa", nazwaColumnBase19); + var wymaganyColumnBase = new ColumnBase("Wymagany", "smallint", blinkBackofficeServicesPcmDbEntitiesKthParamTableBase); + blinkBackofficeServicesPcmDbEntitiesKthParamTableBase.Columns.Add("Wymagany", wymaganyColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KthParam", blinkBackofficeServicesPcmDbEntitiesKthParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase = new TableMappingBase(kthParam, blinkBackofficeServicesPcmDbEntitiesKthParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKthParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase, false); + defaultTableMappings61.Add(blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kthParIdColumnBase0, kthParam.FindProperty("KthParId")!, blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKthParIdColumnBase, kthParam.FindProperty("CentrKthParId")!, blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kPWDomyslnaIdColumnBase, kthParam.FindProperty("KPWDomyslnaId")!, blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase5, kthParam.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase19, kthParam.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wymaganyColumnBase, kthParam.FindProperty("Wymagany")!, blinkBackofficeServicesPcmDbEntitiesKthParamMappingBase); + + var tableMappings61 = new List(); + kthParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings61); + var kthParamTable = new Table("KthParam", null, relationalModel); + var kthParIdColumn0 = new Column("KthParId", "numeric(9,0)", kthParamTable); + kthParamTable.Columns.Add("KthParId", kthParIdColumn0); + var centrKthParIdColumn = new Column("CentrKthParId", "numeric(9,0)", kthParamTable) + { + IsNullable = true + }; + kthParamTable.Columns.Add("CentrKthParId", centrKthParIdColumn); + var kPWDomyslnaIdColumn = new Column("KPWDomyslnaId", "numeric(9,0)", kthParamTable) + { + IsNullable = true + }; + kthParamTable.Columns.Add("KPWDomyslnaId", kPWDomyslnaIdColumn); + var kolejnoscColumn5 = new Column("Kolejnosc", "smallint", kthParamTable); + kthParamTable.Columns.Add("Kolejnosc", kolejnoscColumn5); + var nazwaColumn19 = new Column("Nazwa", "varchar(40)", kthParamTable); + kthParamTable.Columns.Add("Nazwa", nazwaColumn19); + var wymaganyColumn = new Column("Wymagany", "smallint", kthParamTable); + kthParamTable.Columns.Add("Wymagany", wymaganyColumn); + var pK_KTHPARAM = new UniqueConstraint("PK_KTHPARAM", kthParamTable, new[] { kthParIdColumn0 }); + kthParamTable.PrimaryKey = pK_KTHPARAM; + var pK_KTHPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KthParam", + new[] { "KthParId" }); + pK_KTHPARAM.MappedKeys.Add(pK_KTHPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KTHPARAMUc).Add(pK_KTHPARAM); + kthParamTable.UniqueConstraints.Add("PK_KTHPARAM", pK_KTHPARAM); + var iX_KthParam_KPWDomyslnaId = new TableIndex( + "IX_KthParam_KPWDomyslnaId", kthParamTable, new[] { kPWDomyslnaIdColumn }, false); + var iX_KthParam_KPWDomyslnaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.KthParam", + new[] { "KPWDomyslnaId" }); + iX_KthParam_KPWDomyslnaId.MappedIndexes.Add(iX_KthParam_KPWDomyslnaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_KthParam_KPWDomyslnaIdIx).Add(iX_KthParam_KPWDomyslnaId); + kthParamTable.Indexes.Add("IX_KthParam_KPWDomyslnaId", iX_KthParam_KPWDomyslnaId); + relationalModel.Tables.Add(("KthParam", null), kthParamTable); + var kthParamTableMapping = new TableMapping(kthParam, kthParamTable, true); + kthParamTable.AddTypeMapping(kthParamTableMapping, false); + tableMappings61.Add(kthParamTableMapping); + RelationalModel.CreateColumnMapping(kthParIdColumn0, kthParam.FindProperty("KthParId")!, kthParamTableMapping); + RelationalModel.CreateColumnMapping(centrKthParIdColumn, kthParam.FindProperty("CentrKthParId")!, kthParamTableMapping); + RelationalModel.CreateColumnMapping(kPWDomyslnaIdColumn, kthParam.FindProperty("KPWDomyslnaId")!, kthParamTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn5, kthParam.FindProperty("Kolejnosc")!, kthParamTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn19, kthParam.FindProperty("Nazwa")!, kthParamTableMapping); + RelationalModel.CreateColumnMapping(wymaganyColumn, kthParam.FindProperty("Wymagany")!, kthParamTableMapping); + + var kursWaluty = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.KursWaluty")!; + + var defaultTableMappings62 = new List>(); + kursWaluty.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings62); + var blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.KursWaluty", null, relationalModel); + var dataColumnBase2 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase); + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("Data", dataColumnBase2); + var kursColumnBase2 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("Kurs", kursColumnBase2); + var kursZakColumnBase = new ColumnBase("KursZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("KursZak", kursZakColumnBase); + var kursZakZrColumnBase = new ColumnBase("KursZakZr", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("KursZakZr", kursZakZrColumnBase); + var kursZrColumnBase = new ColumnBase("KursZr", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("KursZr", kursZrColumnBase); + var nrTabeliColumnBase0 = new ColumnBase("NrTabeli", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("NrTabeli", nrTabeliColumnBase0); + var nrTabeliZakColumnBase = new ColumnBase("NrTabeliZak", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("NrTabeliZak", nrTabeliZakColumnBase); + var spreadColumnBase = new ColumnBase("Spread", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("Spread", spreadColumnBase); + var spreadZakColumnBase = new ColumnBase("SpreadZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("SpreadZak", spreadZakColumnBase); + var walIdColumnBase5 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase); + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.Columns.Add("WalId", walIdColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.KursWaluty", blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase); + var blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase = new TableMappingBase(kursWaluty, blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesKursWalutyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase, false); + defaultTableMappings62.Add(blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase2, kursWaluty.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase5, kursWaluty.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase2, kursWaluty.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursZakColumnBase, kursWaluty.FindProperty("KursZak")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursZakZrColumnBase, kursWaluty.FindProperty("KursZakZr")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursZrColumnBase, kursWaluty.FindProperty("KursZr")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrTabeliColumnBase0, kursWaluty.FindProperty("NrTabeli")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrTabeliZakColumnBase, kursWaluty.FindProperty("NrTabeliZak")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)spreadColumnBase, kursWaluty.FindProperty("Spread")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)spreadZakColumnBase, kursWaluty.FindProperty("SpreadZak")!, blinkBackofficeServicesPcmDbEntitiesKursWalutyMappingBase); + + var tableMappings62 = new List(); + kursWaluty.SetRuntimeAnnotation("Relational:TableMappings", tableMappings62); + var kursWalutyTable = new Table("KursWaluty", null, relationalModel); + var walIdColumn5 = new Column("WalId", "numeric(9,0)", kursWalutyTable); + kursWalutyTable.Columns.Add("WalId", walIdColumn5); + var dataColumn2 = new Column("Data", "datetime", kursWalutyTable); + kursWalutyTable.Columns.Add("Data", dataColumn2); + var kursColumn2 = new Column("Kurs", "decimal(15,4)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("Kurs", kursColumn2); + var kursZakColumn = new Column("KursZak", "decimal(15,4)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("KursZak", kursZakColumn); + var kursZakZrColumn = new Column("KursZakZr", "decimal(15,4)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("KursZakZr", kursZakZrColumn); + var kursZrColumn = new Column("KursZr", "decimal(15,4)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("KursZr", kursZrColumn); + var nrTabeliColumn0 = new Column("NrTabeli", "varchar(60)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("NrTabeli", nrTabeliColumn0); + var nrTabeliZakColumn = new Column("NrTabeliZak", "varchar(60)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("NrTabeliZak", nrTabeliZakColumn); + var spreadColumn = new Column("Spread", "decimal(15,4)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("Spread", spreadColumn); + var spreadZakColumn = new Column("SpreadZak", "decimal(15,4)", kursWalutyTable) + { + IsNullable = true + }; + kursWalutyTable.Columns.Add("SpreadZak", spreadZakColumn); + var pK_KURSWALUTY = new UniqueConstraint("PK_KURSWALUTY", kursWalutyTable, new[] { walIdColumn5, dataColumn2 }); + kursWalutyTable.PrimaryKey = pK_KURSWALUTY; + var pK_KURSWALUTYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KursWaluty", + new[] { "WalId", "Data" }); + pK_KURSWALUTY.MappedKeys.Add(pK_KURSWALUTYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KURSWALUTYUc).Add(pK_KURSWALUTY); + kursWalutyTable.UniqueConstraints.Add("PK_KURSWALUTY", pK_KURSWALUTY); + relationalModel.Tables.Add(("KursWaluty", null), kursWalutyTable); + var kursWalutyTableMapping = new TableMapping(kursWaluty, kursWalutyTable, true); + kursWalutyTable.AddTypeMapping(kursWalutyTableMapping, false); + tableMappings62.Add(kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(dataColumn2, kursWaluty.FindProperty("Data")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn5, kursWaluty.FindProperty("WalId")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(kursColumn2, kursWaluty.FindProperty("Kurs")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(kursZakColumn, kursWaluty.FindProperty("KursZak")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(kursZakZrColumn, kursWaluty.FindProperty("KursZakZr")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(kursZrColumn, kursWaluty.FindProperty("KursZr")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(nrTabeliColumn0, kursWaluty.FindProperty("NrTabeli")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(nrTabeliZakColumn, kursWaluty.FindProperty("NrTabeliZak")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(spreadColumn, kursWaluty.FindProperty("Spread")!, kursWalutyTableMapping); + RelationalModel.CreateColumnMapping(spreadZakColumn, kursWaluty.FindProperty("SpreadZak")!, kursWalutyTableMapping); + + var liniaLotnicza = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.LiniaLotnicza")!; + + var defaultTableMappings63 = new List>(); + liniaLotnicza.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings63); + var blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.LiniaLotnicza", null, relationalModel); + var aktywnyColumnBase11 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase); + blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase.Columns.Add("Aktywny", aktywnyColumnBase11); + var kodColumnBase5 = new ColumnBase("Kod", "varchar(16)", blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase); + blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase.Columns.Add("Kod", kodColumnBase5); + var liniaIdColumnBase = new ColumnBase("LiniaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase); + blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase.Columns.Add("LiniaId", liniaIdColumnBase); + var nazwaColumnBase20 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase.Columns.Add("Nazwa", nazwaColumnBase20); + var zmianaColumnBase14 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase); + blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase.Columns.Add("Zmiana", zmianaColumnBase14); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.LiniaLotnicza", blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase); + var blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase = new TableMappingBase(liniaLotnicza, blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase, false); + defaultTableMappings63.Add(blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)liniaIdColumnBase, liniaLotnicza.FindProperty("LiniaId")!, blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase11, liniaLotnicza.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase5, liniaLotnicza.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase20, liniaLotnicza.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase14, liniaLotnicza.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesLiniaLotniczaMappingBase); + + var tableMappings63 = new List(); + liniaLotnicza.SetRuntimeAnnotation("Relational:TableMappings", tableMappings63); + var liniaLotniczaTable = new Table("LiniaLotnicza", null, relationalModel); + var liniaIdColumn = new Column("LiniaId", "numeric(9,0)", liniaLotniczaTable); + liniaLotniczaTable.Columns.Add("LiniaId", liniaIdColumn); + var aktywnyColumn11 = new Column("Aktywny", "smallint", liniaLotniczaTable); + liniaLotniczaTable.Columns.Add("Aktywny", aktywnyColumn11); + var kodColumn5 = new Column("Kod", "varchar(16)", liniaLotniczaTable); + liniaLotniczaTable.Columns.Add("Kod", kodColumn5); + var nazwaColumn20 = new Column("Nazwa", "varchar(255)", liniaLotniczaTable) + { + IsNullable = true + }; + liniaLotniczaTable.Columns.Add("Nazwa", nazwaColumn20); + var zmianaColumn14 = new Column("Zmiana", "datetime", liniaLotniczaTable); + liniaLotniczaTable.Columns.Add("Zmiana", zmianaColumn14); + var pK_LINIALOTN = new UniqueConstraint("PK_LINIALOTN", liniaLotniczaTable, new[] { liniaIdColumn }); + liniaLotniczaTable.PrimaryKey = pK_LINIALOTN; + var pK_LINIALOTNUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.LiniaLotnicza", + new[] { "LiniaId" }); + pK_LINIALOTN.MappedKeys.Add(pK_LINIALOTNUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_LINIALOTNUc).Add(pK_LINIALOTN); + liniaLotniczaTable.UniqueConstraints.Add("PK_LINIALOTN", pK_LINIALOTN); + var idx_LinLotKod = new TableIndex( + "idx_LinLotKod", liniaLotniczaTable, new[] { kodColumn5 }, false); + var idx_LinLotKodIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.LiniaLotnicza", + "idx_LinLotKod"); + idx_LinLotKod.MappedIndexes.Add(idx_LinLotKodIx); + RelationalModel.GetOrCreateTableIndexes(idx_LinLotKodIx).Add(idx_LinLotKod); + liniaLotniczaTable.Indexes.Add("idx_LinLotKod", idx_LinLotKod); + var idx_LinLotZmiana = new TableIndex( + "idx_LinLotZmiana", liniaLotniczaTable, new[] { zmianaColumn14 }, false); + var idx_LinLotZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.LiniaLotnicza", + "idx_LinLotZmiana"); + idx_LinLotZmiana.MappedIndexes.Add(idx_LinLotZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_LinLotZmianaIx).Add(idx_LinLotZmiana); + liniaLotniczaTable.Indexes.Add("idx_LinLotZmiana", idx_LinLotZmiana); + relationalModel.Tables.Add(("LiniaLotnicza", null), liniaLotniczaTable); + var liniaLotniczaTableMapping = new TableMapping(liniaLotnicza, liniaLotniczaTable, true); + liniaLotniczaTable.AddTypeMapping(liniaLotniczaTableMapping, false); + tableMappings63.Add(liniaLotniczaTableMapping); + RelationalModel.CreateColumnMapping(liniaIdColumn, liniaLotnicza.FindProperty("LiniaId")!, liniaLotniczaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn11, liniaLotnicza.FindProperty("Aktywny")!, liniaLotniczaTableMapping); + RelationalModel.CreateColumnMapping(kodColumn5, liniaLotnicza.FindProperty("Kod")!, liniaLotniczaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn20, liniaLotnicza.FindProperty("Nazwa")!, liniaLotniczaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn14, liniaLotnicza.FindProperty("Zmiana")!, liniaLotniczaTableMapping); + + var logOperation = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.LogOperation")!; + + var defaultTableMappings64 = new List>(); + logOperation.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings64); + var blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.LogOperation", null, relationalModel); + var additionalDescColumnBase = new ColumnBase("AdditionalDesc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("AdditionalDesc", additionalDescColumnBase); + var appTypeIdColumnBase = new ColumnBase("AppTypeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase); + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("AppTypeId", appTypeIdColumnBase); + var lastUpdateColumnBase = new ColumnBase("LastUpdate", "datetime", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("LastUpdate", lastUpdateColumnBase); + var modItemIdColumnBase = new ColumnBase("ModItemId", "varchar(30)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("ModItemId", modItemIdColumnBase); + var modTableTypeIdColumnBase = new ColumnBase("ModTableTypeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("ModTableTypeId", modTableTypeIdColumnBase); + var moduleTypeIdColumnBase = new ColumnBase("ModuleTypeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase); + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("ModuleTypeId", moduleTypeIdColumnBase); + var operationIdColumnBase = new ColumnBase("OperationId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase); + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("OperationId", operationIdColumnBase); + var operationTimeColumnBase = new ColumnBase("OperationTime", "datetime", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase); + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("OperationTime", operationTimeColumnBase); + var operationTypeIdColumnBase = new ColumnBase("OperationTypeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase); + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("OperationTypeId", operationTypeIdColumnBase); + var operatorIdColumnBase = new ColumnBase("OperatorId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("OperatorId", operatorIdColumnBase); + var posIdColumnBase = new ColumnBase("PosId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase); + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.Columns.Add("PosId", posIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.LogOperation", blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase); + var blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase = new TableMappingBase(logOperation, blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase, true); + blinkBackofficeServicesPcmDbEntitiesLogOperationTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase, false); + defaultTableMappings64.Add(blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)operationIdColumnBase, logOperation.FindProperty("OperationId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)additionalDescColumnBase, logOperation.FindProperty("AdditionalDesc")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)appTypeIdColumnBase, logOperation.FindProperty("AppTypeId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lastUpdateColumnBase, logOperation.FindProperty("LastUpdate")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)modItemIdColumnBase, logOperation.FindProperty("ModItemId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)modTableTypeIdColumnBase, logOperation.FindProperty("ModTableTypeId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)moduleTypeIdColumnBase, logOperation.FindProperty("ModuleTypeId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)operationTimeColumnBase, logOperation.FindProperty("OperationTime")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)operationTypeIdColumnBase, logOperation.FindProperty("OperationTypeId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)operatorIdColumnBase, logOperation.FindProperty("OperatorId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posIdColumnBase, logOperation.FindProperty("PosId")!, blinkBackofficeServicesPcmDbEntitiesLogOperationMappingBase); + + var tableMappings64 = new List(); + logOperation.SetRuntimeAnnotation("Relational:TableMappings", tableMappings64); + var logOperationTable = new Table("LogOperation", null, relationalModel); + var operationIdColumn = new Column("OperationId", "numeric(9,0)", logOperationTable); + logOperationTable.Columns.Add("OperationId", operationIdColumn); + var additionalDescColumn = new Column("AdditionalDesc", "varchar(255)", logOperationTable) + { + IsNullable = true + }; + logOperationTable.Columns.Add("AdditionalDesc", additionalDescColumn); + var appTypeIdColumn = new Column("AppTypeId", "numeric(9,0)", logOperationTable); + logOperationTable.Columns.Add("AppTypeId", appTypeIdColumn); + var lastUpdateColumn = new Column("LastUpdate", "datetime", logOperationTable) + { + IsNullable = true + }; + logOperationTable.Columns.Add("LastUpdate", lastUpdateColumn); + var modItemIdColumn = new Column("ModItemId", "varchar(30)", logOperationTable) + { + IsNullable = true + }; + logOperationTable.Columns.Add("ModItemId", modItemIdColumn); + var modTableTypeIdColumn = new Column("ModTableTypeId", "numeric(9,0)", logOperationTable) + { + IsNullable = true + }; + logOperationTable.Columns.Add("ModTableTypeId", modTableTypeIdColumn); + var moduleTypeIdColumn = new Column("ModuleTypeId", "numeric(9,0)", logOperationTable); + logOperationTable.Columns.Add("ModuleTypeId", moduleTypeIdColumn); + var operationTimeColumn = new Column("OperationTime", "datetime", logOperationTable); + logOperationTable.Columns.Add("OperationTime", operationTimeColumn); + var operationTypeIdColumn = new Column("OperationTypeId", "numeric(9,0)", logOperationTable); + logOperationTable.Columns.Add("OperationTypeId", operationTypeIdColumn); + var operatorIdColumn = new Column("OperatorId", "numeric(9,0)", logOperationTable) + { + IsNullable = true + }; + logOperationTable.Columns.Add("OperatorId", operatorIdColumn); + var posIdColumn = new Column("PosId", "numeric(9,0)", logOperationTable); + logOperationTable.Columns.Add("PosId", posIdColumn); + var pK_LOGOPERATION = new UniqueConstraint("PK_LOGOPERATION", logOperationTable, new[] { operationIdColumn }); + logOperationTable.PrimaryKey = pK_LOGOPERATION; + var pK_LOGOPERATIONUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogOperation", + new[] { "OperationId" }); + pK_LOGOPERATION.MappedKeys.Add(pK_LOGOPERATIONUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_LOGOPERATIONUc).Add(pK_LOGOPERATION); + logOperationTable.UniqueConstraints.Add("PK_LOGOPERATION", pK_LOGOPERATION); + relationalModel.Tables.Add(("LogOperation", null), logOperationTable); + var logOperationTableMapping = new TableMapping(logOperation, logOperationTable, true); + logOperationTable.AddTypeMapping(logOperationTableMapping, false); + tableMappings64.Add(logOperationTableMapping); + RelationalModel.CreateColumnMapping(operationIdColumn, logOperation.FindProperty("OperationId")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(additionalDescColumn, logOperation.FindProperty("AdditionalDesc")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(appTypeIdColumn, logOperation.FindProperty("AppTypeId")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(lastUpdateColumn, logOperation.FindProperty("LastUpdate")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(modItemIdColumn, logOperation.FindProperty("ModItemId")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(modTableTypeIdColumn, logOperation.FindProperty("ModTableTypeId")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(moduleTypeIdColumn, logOperation.FindProperty("ModuleTypeId")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(operationTimeColumn, logOperation.FindProperty("OperationTime")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(operationTypeIdColumn, logOperation.FindProperty("OperationTypeId")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(operatorIdColumn, logOperation.FindProperty("OperatorId")!, logOperationTableMapping); + RelationalModel.CreateColumnMapping(posIdColumn, logOperation.FindProperty("PosId")!, logOperationTableMapping); + + var logTypeDef = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.LogTypeDef")!; + + var defaultTableMappings65 = new List>(); + logTypeDef.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings65); + var blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.LogTypeDef", null, relationalModel); + var lastUpdateColumnBase0 = new ColumnBase("LastUpdate", "datetime", blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase.Columns.Add("LastUpdate", lastUpdateColumnBase0); + var typeColumnBase = new ColumnBase("Type", "int", blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase); + blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase.Columns.Add("Type", typeColumnBase); + var typeCategoryColumnBase = new ColumnBase("TypeCategory", "varchar(50)", blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase.Columns.Add("TypeCategory", typeCategoryColumnBase); + var typeIdColumnBase = new ColumnBase("TypeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase); + blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase.Columns.Add("TypeId", typeIdColumnBase); + var typeValueColumnBase = new ColumnBase("TypeValue", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase); + blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase.Columns.Add("TypeValue", typeValueColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.LogTypeDef", blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase); + var blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase = new TableMappingBase(logTypeDef, blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase, true); + blinkBackofficeServicesPcmDbEntitiesLogTypeDefTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase, false); + defaultTableMappings65.Add(blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typeIdColumnBase, logTypeDef.FindProperty("TypeId")!, blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lastUpdateColumnBase0, logTypeDef.FindProperty("LastUpdate")!, blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typeColumnBase, logTypeDef.FindProperty("Type")!, blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typeCategoryColumnBase, logTypeDef.FindProperty("TypeCategory")!, blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typeValueColumnBase, logTypeDef.FindProperty("TypeValue")!, blinkBackofficeServicesPcmDbEntitiesLogTypeDefMappingBase); + + var tableMappings65 = new List(); + logTypeDef.SetRuntimeAnnotation("Relational:TableMappings", tableMappings65); + var logTypeDefTable = new Table("LogTypeDef", null, relationalModel); + var typeIdColumn = new Column("TypeId", "numeric(9,0)", logTypeDefTable); + logTypeDefTable.Columns.Add("TypeId", typeIdColumn); + var lastUpdateColumn0 = new Column("LastUpdate", "datetime", logTypeDefTable) + { + IsNullable = true + }; + logTypeDefTable.Columns.Add("LastUpdate", lastUpdateColumn0); + var typeColumn = new Column("Type", "int", logTypeDefTable); + logTypeDefTable.Columns.Add("Type", typeColumn); + var typeCategoryColumn = new Column("TypeCategory", "varchar(50)", logTypeDefTable) + { + IsNullable = true + }; + logTypeDefTable.Columns.Add("TypeCategory", typeCategoryColumn); + var typeValueColumn = new Column("TypeValue", "varchar(255)", logTypeDefTable); + logTypeDefTable.Columns.Add("TypeValue", typeValueColumn); + var pK_LOGTYPEDEF = new UniqueConstraint("PK_LOGTYPEDEF", logTypeDefTable, new[] { typeIdColumn }); + logTypeDefTable.PrimaryKey = pK_LOGTYPEDEF; + var pK_LOGTYPEDEFUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogTypeDef", + new[] { "TypeId" }); + pK_LOGTYPEDEF.MappedKeys.Add(pK_LOGTYPEDEFUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_LOGTYPEDEFUc).Add(pK_LOGTYPEDEF); + logTypeDefTable.UniqueConstraints.Add("PK_LOGTYPEDEF", pK_LOGTYPEDEF); + relationalModel.Tables.Add(("LogTypeDef", null), logTypeDefTable); + var logTypeDefTableMapping = new TableMapping(logTypeDef, logTypeDefTable, true); + logTypeDefTable.AddTypeMapping(logTypeDefTableMapping, false); + tableMappings65.Add(logTypeDefTableMapping); + RelationalModel.CreateColumnMapping(typeIdColumn, logTypeDef.FindProperty("TypeId")!, logTypeDefTableMapping); + RelationalModel.CreateColumnMapping(lastUpdateColumn0, logTypeDef.FindProperty("LastUpdate")!, logTypeDefTableMapping); + RelationalModel.CreateColumnMapping(typeColumn, logTypeDef.FindProperty("Type")!, logTypeDefTableMapping); + RelationalModel.CreateColumnMapping(typeCategoryColumn, logTypeDef.FindProperty("TypeCategory")!, logTypeDefTableMapping); + RelationalModel.CreateColumnMapping(typeValueColumn, logTypeDef.FindProperty("TypeValue")!, logTypeDefTableMapping); + + var logValChangeNum = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.LogValChangeNum")!; + + var defaultTableMappings66 = new List>(); + logValChangeNum.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings66); + var blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.LogValChangeNum", null, relationalModel); + var lastUpdateColumnBase1 = new ColumnBase("LastUpdate", "datetime", blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase.Columns.Add("LastUpdate", lastUpdateColumnBase1); + var operationIdColumnBase0 = new ColumnBase("OperationId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase.Columns.Add("OperationId", operationIdColumnBase0); + var valChangeIdColumnBase = new ColumnBase("ValChangeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase.Columns.Add("ValChangeId", valChangeIdColumnBase); + var valChangeTypeIdColumnBase = new ColumnBase("ValChangeTypeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase.Columns.Add("ValChangeTypeId", valChangeTypeIdColumnBase); + var valueAfterColumnBase = new ColumnBase("ValueAfter", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase.Columns.Add("ValueAfter", valueAfterColumnBase); + var valueBeforeColumnBase = new ColumnBase("ValueBefore", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase.Columns.Add("ValueBefore", valueBeforeColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.LogValChangeNum", blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase); + var blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase = new TableMappingBase(logValChangeNum, blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase, true); + blinkBackofficeServicesPcmDbEntitiesLogValChangeNumTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase, false); + defaultTableMappings66.Add(blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valChangeIdColumnBase, logValChangeNum.FindProperty("ValChangeId")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lastUpdateColumnBase1, logValChangeNum.FindProperty("LastUpdate")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)operationIdColumnBase0, logValChangeNum.FindProperty("OperationId")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valChangeTypeIdColumnBase, logValChangeNum.FindProperty("ValChangeTypeId")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valueAfterColumnBase, logValChangeNum.FindProperty("ValueAfter")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valueBeforeColumnBase, logValChangeNum.FindProperty("ValueBefore")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeNumMappingBase); + + var tableMappings66 = new List(); + logValChangeNum.SetRuntimeAnnotation("Relational:TableMappings", tableMappings66); + var logValChangeNumTable = new Table("LogValChangeNum", null, relationalModel); + var valChangeIdColumn = new Column("ValChangeId", "numeric(9,0)", logValChangeNumTable); + logValChangeNumTable.Columns.Add("ValChangeId", valChangeIdColumn); + var lastUpdateColumn1 = new Column("LastUpdate", "datetime", logValChangeNumTable) + { + IsNullable = true + }; + logValChangeNumTable.Columns.Add("LastUpdate", lastUpdateColumn1); + var operationIdColumn0 = new Column("OperationId", "numeric(9,0)", logValChangeNumTable); + logValChangeNumTable.Columns.Add("OperationId", operationIdColumn0); + var valChangeTypeIdColumn = new Column("ValChangeTypeId", "numeric(9,0)", logValChangeNumTable); + logValChangeNumTable.Columns.Add("ValChangeTypeId", valChangeTypeIdColumn); + var valueAfterColumn = new Column("ValueAfter", "decimal(15,4)", logValChangeNumTable); + logValChangeNumTable.Columns.Add("ValueAfter", valueAfterColumn); + var valueBeforeColumn = new Column("ValueBefore", "decimal(15,4)", logValChangeNumTable); + logValChangeNumTable.Columns.Add("ValueBefore", valueBeforeColumn); + var pK_LOGVALCHANGENUM = new UniqueConstraint("PK_LOGVALCHANGENUM", logValChangeNumTable, new[] { valChangeIdColumn }); + logValChangeNumTable.PrimaryKey = pK_LOGVALCHANGENUM; + var pK_LOGVALCHANGENUMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeNum", + new[] { "ValChangeId" }); + pK_LOGVALCHANGENUM.MappedKeys.Add(pK_LOGVALCHANGENUMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_LOGVALCHANGENUMUc).Add(pK_LOGVALCHANGENUM); + logValChangeNumTable.UniqueConstraints.Add("PK_LOGVALCHANGENUM", pK_LOGVALCHANGENUM); + var iX_LogValChangeNum_OperationId = new TableIndex( + "IX_LogValChangeNum_OperationId", logValChangeNumTable, new[] { operationIdColumn0 }, false); + var iX_LogValChangeNum_OperationIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeNum", + new[] { "OperationId" }); + iX_LogValChangeNum_OperationId.MappedIndexes.Add(iX_LogValChangeNum_OperationIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_LogValChangeNum_OperationIdIx).Add(iX_LogValChangeNum_OperationId); + logValChangeNumTable.Indexes.Add("IX_LogValChangeNum_OperationId", iX_LogValChangeNum_OperationId); + relationalModel.Tables.Add(("LogValChangeNum", null), logValChangeNumTable); + var logValChangeNumTableMapping = new TableMapping(logValChangeNum, logValChangeNumTable, true); + logValChangeNumTable.AddTypeMapping(logValChangeNumTableMapping, false); + tableMappings66.Add(logValChangeNumTableMapping); + RelationalModel.CreateColumnMapping(valChangeIdColumn, logValChangeNum.FindProperty("ValChangeId")!, logValChangeNumTableMapping); + RelationalModel.CreateColumnMapping(lastUpdateColumn1, logValChangeNum.FindProperty("LastUpdate")!, logValChangeNumTableMapping); + RelationalModel.CreateColumnMapping(operationIdColumn0, logValChangeNum.FindProperty("OperationId")!, logValChangeNumTableMapping); + RelationalModel.CreateColumnMapping(valChangeTypeIdColumn, logValChangeNum.FindProperty("ValChangeTypeId")!, logValChangeNumTableMapping); + RelationalModel.CreateColumnMapping(valueAfterColumn, logValChangeNum.FindProperty("ValueAfter")!, logValChangeNumTableMapping); + RelationalModel.CreateColumnMapping(valueBeforeColumn, logValChangeNum.FindProperty("ValueBefore")!, logValChangeNumTableMapping); + + var logValChangeTxt = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.LogValChangeTxt")!; + + var defaultTableMappings67 = new List>(); + logValChangeTxt.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings67); + var blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.LogValChangeTxt", null, relationalModel); + var lastUpdateColumnBase2 = new ColumnBase("LastUpdate", "datetime", blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase.Columns.Add("LastUpdate", lastUpdateColumnBase2); + var operationIdColumnBase1 = new ColumnBase("OperationId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase.Columns.Add("OperationId", operationIdColumnBase1); + var valChangeIdColumnBase0 = new ColumnBase("ValChangeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase.Columns.Add("ValChangeId", valChangeIdColumnBase0); + var valChangeTypeIdColumnBase0 = new ColumnBase("ValChangeTypeId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase.Columns.Add("ValChangeTypeId", valChangeTypeIdColumnBase0); + var valueAfterColumnBase0 = new ColumnBase("ValueAfter", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase.Columns.Add("ValueAfter", valueAfterColumnBase0); + var valueBeforeColumnBase0 = new ColumnBase("ValueBefore", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase); + blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase.Columns.Add("ValueBefore", valueBeforeColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.LogValChangeTxt", blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase); + var blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase = new TableMappingBase(logValChangeTxt, blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase, true); + blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase, false); + defaultTableMappings67.Add(blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valChangeIdColumnBase0, logValChangeTxt.FindProperty("ValChangeId")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lastUpdateColumnBase2, logValChangeTxt.FindProperty("LastUpdate")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)operationIdColumnBase1, logValChangeTxt.FindProperty("OperationId")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valChangeTypeIdColumnBase0, logValChangeTxt.FindProperty("ValChangeTypeId")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valueAfterColumnBase0, logValChangeTxt.FindProperty("ValueAfter")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valueBeforeColumnBase0, logValChangeTxt.FindProperty("ValueBefore")!, blinkBackofficeServicesPcmDbEntitiesLogValChangeTxtMappingBase); + + var tableMappings67 = new List(); + logValChangeTxt.SetRuntimeAnnotation("Relational:TableMappings", tableMappings67); + var logValChangeTxtTable = new Table("LogValChangeTxt", null, relationalModel); + var valChangeIdColumn0 = new Column("ValChangeId", "numeric(9,0)", logValChangeTxtTable); + logValChangeTxtTable.Columns.Add("ValChangeId", valChangeIdColumn0); + var lastUpdateColumn2 = new Column("LastUpdate", "datetime", logValChangeTxtTable) + { + IsNullable = true + }; + logValChangeTxtTable.Columns.Add("LastUpdate", lastUpdateColumn2); + var operationIdColumn1 = new Column("OperationId", "numeric(9,0)", logValChangeTxtTable); + logValChangeTxtTable.Columns.Add("OperationId", operationIdColumn1); + var valChangeTypeIdColumn0 = new Column("ValChangeTypeId", "numeric(9,0)", logValChangeTxtTable); + logValChangeTxtTable.Columns.Add("ValChangeTypeId", valChangeTypeIdColumn0); + var valueAfterColumn0 = new Column("ValueAfter", "varchar(255)", logValChangeTxtTable); + logValChangeTxtTable.Columns.Add("ValueAfter", valueAfterColumn0); + var valueBeforeColumn0 = new Column("ValueBefore", "varchar(255)", logValChangeTxtTable); + logValChangeTxtTable.Columns.Add("ValueBefore", valueBeforeColumn0); + var pK_LOGVALCHANGETXT = new UniqueConstraint("PK_LOGVALCHANGETXT", logValChangeTxtTable, new[] { valChangeIdColumn0 }); + logValChangeTxtTable.PrimaryKey = pK_LOGVALCHANGETXT; + var pK_LOGVALCHANGETXTUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeTxt", + new[] { "ValChangeId" }); + pK_LOGVALCHANGETXT.MappedKeys.Add(pK_LOGVALCHANGETXTUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_LOGVALCHANGETXTUc).Add(pK_LOGVALCHANGETXT); + logValChangeTxtTable.UniqueConstraints.Add("PK_LOGVALCHANGETXT", pK_LOGVALCHANGETXT); + var iX_LogValChangeTxt_OperationId = new TableIndex( + "IX_LogValChangeTxt_OperationId", logValChangeTxtTable, new[] { operationIdColumn1 }, false); + var iX_LogValChangeTxt_OperationIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeTxt", + new[] { "OperationId" }); + iX_LogValChangeTxt_OperationId.MappedIndexes.Add(iX_LogValChangeTxt_OperationIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_LogValChangeTxt_OperationIdIx).Add(iX_LogValChangeTxt_OperationId); + logValChangeTxtTable.Indexes.Add("IX_LogValChangeTxt_OperationId", iX_LogValChangeTxt_OperationId); + relationalModel.Tables.Add(("LogValChangeTxt", null), logValChangeTxtTable); + var logValChangeTxtTableMapping = new TableMapping(logValChangeTxt, logValChangeTxtTable, true); + logValChangeTxtTable.AddTypeMapping(logValChangeTxtTableMapping, false); + tableMappings67.Add(logValChangeTxtTableMapping); + RelationalModel.CreateColumnMapping(valChangeIdColumn0, logValChangeTxt.FindProperty("ValChangeId")!, logValChangeTxtTableMapping); + RelationalModel.CreateColumnMapping(lastUpdateColumn2, logValChangeTxt.FindProperty("LastUpdate")!, logValChangeTxtTableMapping); + RelationalModel.CreateColumnMapping(operationIdColumn1, logValChangeTxt.FindProperty("OperationId")!, logValChangeTxtTableMapping); + RelationalModel.CreateColumnMapping(valChangeTypeIdColumn0, logValChangeTxt.FindProperty("ValChangeTypeId")!, logValChangeTxtTableMapping); + RelationalModel.CreateColumnMapping(valueAfterColumn0, logValChangeTxt.FindProperty("ValueAfter")!, logValChangeTxtTableMapping); + RelationalModel.CreateColumnMapping(valueBeforeColumn0, logValChangeTxt.FindProperty("ValueBefore")!, logValChangeTxtTableMapping); + + var lotnisko = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Lotnisko")!; + + var defaultTableMappings68 = new List>(); + lotnisko.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings68); + var blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Lotnisko", null, relationalModel); + var aktywnyColumnBase12 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase); + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.Columns.Add("Aktywny", aktywnyColumnBase12); + var dutyFreeColumnBase = new ColumnBase("DutyFree", "smallint", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase); + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.Columns.Add("DutyFree", dutyFreeColumnBase); + var kodColumnBase6 = new ColumnBase("Kod", "varchar(16)", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase); + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.Columns.Add("Kod", kodColumnBase6); + var krajColumnBase = new ColumnBase("Kraj", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.Columns.Add("Kraj", krajColumnBase); + var lotnIdColumnBase = new ColumnBase("LotnId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase); + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.Columns.Add("LotnId", lotnIdColumnBase); + var nazwaColumnBase21 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.Columns.Add("Nazwa", nazwaColumnBase21); + var zmianaColumnBase15 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase); + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.Columns.Add("Zmiana", zmianaColumnBase15); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Lotnisko", blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase); + var blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase = new TableMappingBase(lotnisko, blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase, true); + blinkBackofficeServicesPcmDbEntitiesLotniskoTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase, false); + defaultTableMappings68.Add(blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lotnIdColumnBase, lotnisko.FindProperty("LotnId")!, blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase12, lotnisko.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dutyFreeColumnBase, lotnisko.FindProperty("DutyFree")!, blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase6, lotnisko.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)krajColumnBase, lotnisko.FindProperty("Kraj")!, blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase21, lotnisko.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase15, lotnisko.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesLotniskoMappingBase); + + var tableMappings68 = new List(); + lotnisko.SetRuntimeAnnotation("Relational:TableMappings", tableMappings68); + var lotniskoTable = new Table("Lotnisko", null, relationalModel); + var lotnIdColumn = new Column("LotnId", "numeric(9,0)", lotniskoTable); + lotniskoTable.Columns.Add("LotnId", lotnIdColumn); + var aktywnyColumn12 = new Column("Aktywny", "smallint", lotniskoTable); + lotniskoTable.Columns.Add("Aktywny", aktywnyColumn12); + var dutyFreeColumn = new Column("DutyFree", "smallint", lotniskoTable); + lotniskoTable.Columns.Add("DutyFree", dutyFreeColumn); + var kodColumn6 = new Column("Kod", "varchar(16)", lotniskoTable); + lotniskoTable.Columns.Add("Kod", kodColumn6); + var krajColumn = new Column("Kraj", "varchar(120)", lotniskoTable) + { + IsNullable = true + }; + lotniskoTable.Columns.Add("Kraj", krajColumn); + var nazwaColumn21 = new Column("Nazwa", "varchar(255)", lotniskoTable) + { + IsNullable = true + }; + lotniskoTable.Columns.Add("Nazwa", nazwaColumn21); + var zmianaColumn15 = new Column("Zmiana", "datetime", lotniskoTable); + lotniskoTable.Columns.Add("Zmiana", zmianaColumn15); + var pK_LOTNISKO = new UniqueConstraint("PK_LOTNISKO", lotniskoTable, new[] { lotnIdColumn }); + lotniskoTable.PrimaryKey = pK_LOTNISKO; + var pK_LOTNISKOUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Lotnisko", + new[] { "LotnId" }); + pK_LOTNISKO.MappedKeys.Add(pK_LOTNISKOUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_LOTNISKOUc).Add(pK_LOTNISKO); + lotniskoTable.UniqueConstraints.Add("PK_LOTNISKO", pK_LOTNISKO); + var idx_LotnKod = new TableIndex( + "idx_LotnKod", lotniskoTable, new[] { kodColumn6 }, false); + var idx_LotnKodIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Lotnisko", + "idx_LotnKod"); + idx_LotnKod.MappedIndexes.Add(idx_LotnKodIx); + RelationalModel.GetOrCreateTableIndexes(idx_LotnKodIx).Add(idx_LotnKod); + lotniskoTable.Indexes.Add("idx_LotnKod", idx_LotnKod); + var idx_LotnZmiana = new TableIndex( + "idx_LotnZmiana", lotniskoTable, new[] { zmianaColumn15 }, false); + var idx_LotnZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Lotnisko", + "idx_LotnZmiana"); + idx_LotnZmiana.MappedIndexes.Add(idx_LotnZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_LotnZmianaIx).Add(idx_LotnZmiana); + lotniskoTable.Indexes.Add("idx_LotnZmiana", idx_LotnZmiana); + relationalModel.Tables.Add(("Lotnisko", null), lotniskoTable); + var lotniskoTableMapping = new TableMapping(lotnisko, lotniskoTable, true); + lotniskoTable.AddTypeMapping(lotniskoTableMapping, false); + tableMappings68.Add(lotniskoTableMapping); + RelationalModel.CreateColumnMapping(lotnIdColumn, lotnisko.FindProperty("LotnId")!, lotniskoTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn12, lotnisko.FindProperty("Aktywny")!, lotniskoTableMapping); + RelationalModel.CreateColumnMapping(dutyFreeColumn, lotnisko.FindProperty("DutyFree")!, lotniskoTableMapping); + RelationalModel.CreateColumnMapping(kodColumn6, lotnisko.FindProperty("Kod")!, lotniskoTableMapping); + RelationalModel.CreateColumnMapping(krajColumn, lotnisko.FindProperty("Kraj")!, lotniskoTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn21, lotnisko.FindProperty("Nazwa")!, lotniskoTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn15, lotnisko.FindProperty("Zmiana")!, lotniskoTableMapping); + + var magazyn = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Magazyn")!; + + var defaultTableMappings69 = new List>(); + magazyn.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings69); + var blinkBackofficeServicesPcmDbEntitiesMagazynTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Magazyn", null, relationalModel); + var magIdColumnBase4 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesMagazynTableBase); + blinkBackofficeServicesPcmDbEntitiesMagazynTableBase.Columns.Add("MagId", magIdColumnBase4); + var nazwaColumnBase22 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesMagazynTableBase); + blinkBackofficeServicesPcmDbEntitiesMagazynTableBase.Columns.Add("Nazwa", nazwaColumnBase22); + var numerColumnBase2 = new ColumnBase("Numer", "smallint", blinkBackofficeServicesPcmDbEntitiesMagazynTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMagazynTableBase.Columns.Add("Numer", numerColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Magazyn", blinkBackofficeServicesPcmDbEntitiesMagazynTableBase); + var blinkBackofficeServicesPcmDbEntitiesMagazynMappingBase = new TableMappingBase(magazyn, blinkBackofficeServicesPcmDbEntitiesMagazynTableBase, true); + blinkBackofficeServicesPcmDbEntitiesMagazynTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesMagazynMappingBase, false); + defaultTableMappings69.Add(blinkBackofficeServicesPcmDbEntitiesMagazynMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase4, magazyn.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesMagazynMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase22, magazyn.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesMagazynMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase2, magazyn.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesMagazynMappingBase); + + var tableMappings69 = new List(); + magazyn.SetRuntimeAnnotation("Relational:TableMappings", tableMappings69); + var magazynTable = new Table("Magazyn", null, relationalModel); + var magIdColumn4 = new Column("MagId", "numeric(9,0)", magazynTable); + magazynTable.Columns.Add("MagId", magIdColumn4); + var nazwaColumn22 = new Column("Nazwa", "varchar(40)", magazynTable); + magazynTable.Columns.Add("Nazwa", nazwaColumn22); + var numerColumn2 = new Column("Numer", "smallint", magazynTable) + { + IsNullable = true + }; + magazynTable.Columns.Add("Numer", numerColumn2); + var pK_MAGAZYN = new UniqueConstraint("PK_MAGAZYN", magazynTable, new[] { magIdColumn4 }); + magazynTable.PrimaryKey = pK_MAGAZYN; + var pK_MAGAZYNUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + pK_MAGAZYN.MappedKeys.Add(pK_MAGAZYNUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_MAGAZYNUc).Add(pK_MAGAZYN); + magazynTable.UniqueConstraints.Add("PK_MAGAZYN", pK_MAGAZYN); + relationalModel.Tables.Add(("Magazyn", null), magazynTable); + var magazynTableMapping = new TableMapping(magazyn, magazynTable, true); + magazynTable.AddTypeMapping(magazynTableMapping, false); + tableMappings69.Add(magazynTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn4, magazyn.FindProperty("MagId")!, magazynTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn22, magazyn.FindProperty("Nazwa")!, magazynTableMapping); + RelationalModel.CreateColumnMapping(numerColumn2, magazyn.FindProperty("Numer")!, magazynTableMapping); + + var marZakres = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.MarZakres")!; + + var defaultTableMappings70 = new List>(); + marZakres.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings70); + var blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.MarZakres", null, relationalModel); + var koncowkiColumnBase = new ColumnBase("Koncowki", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase); + blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase.Columns.Add("Koncowki", koncowkiColumnBase); + var marIdColumnBase = new ColumnBase("MarId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase); + blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase.Columns.Add("MarId", marIdColumnBase); + var odCenyColumnBase = new ColumnBase("OdCeny", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase); + blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase.Columns.Add("OdCeny", odCenyColumnBase); + var zaokraglanieColumnBase = new ColumnBase("Zaokraglanie", "smallint", blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase); + blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase.Columns.Add("Zaokraglanie", zaokraglanieColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.MarZakres", blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase); + var blinkBackofficeServicesPcmDbEntitiesMarZakresMappingBase = new TableMappingBase(marZakres, blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase, true); + blinkBackofficeServicesPcmDbEntitiesMarZakresTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesMarZakresMappingBase, false); + defaultTableMappings70.Add(blinkBackofficeServicesPcmDbEntitiesMarZakresMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)marIdColumnBase, marZakres.FindProperty("MarId")!, blinkBackofficeServicesPcmDbEntitiesMarZakresMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odCenyColumnBase, marZakres.FindProperty("OdCeny")!, blinkBackofficeServicesPcmDbEntitiesMarZakresMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)koncowkiColumnBase, marZakres.FindProperty("Koncowki")!, blinkBackofficeServicesPcmDbEntitiesMarZakresMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zaokraglanieColumnBase, marZakres.FindProperty("Zaokraglanie")!, blinkBackofficeServicesPcmDbEntitiesMarZakresMappingBase); + + var tableMappings70 = new List(); + marZakres.SetRuntimeAnnotation("Relational:TableMappings", tableMappings70); + var marZakresTable = new Table("MarZakres", null, relationalModel); + var marIdColumn = new Column("MarId", "numeric(9,0)", marZakresTable); + marZakresTable.Columns.Add("MarId", marIdColumn); + var odCenyColumn = new Column("OdCeny", "decimal(15,4)", marZakresTable); + marZakresTable.Columns.Add("OdCeny", odCenyColumn); + var koncowkiColumn = new Column("Koncowki", "varchar(255)", marZakresTable); + marZakresTable.Columns.Add("Koncowki", koncowkiColumn); + var zaokraglanieColumn = new Column("Zaokraglanie", "smallint", marZakresTable); + marZakresTable.Columns.Add("Zaokraglanie", zaokraglanieColumn); + var pK_MARZAKRES = new UniqueConstraint("PK_MARZAKRES", marZakresTable, new[] { marIdColumn, odCenyColumn }); + marZakresTable.PrimaryKey = pK_MARZAKRES; + var pK_MARZAKRESUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.MarZakres", + new[] { "MarId", "OdCeny" }); + pK_MARZAKRES.MappedKeys.Add(pK_MARZAKRESUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_MARZAKRESUc).Add(pK_MARZAKRES); + marZakresTable.UniqueConstraints.Add("PK_MARZAKRES", pK_MARZAKRES); + relationalModel.Tables.Add(("MarZakres", null), marZakresTable); + var marZakresTableMapping = new TableMapping(marZakres, marZakresTable, true); + marZakresTable.AddTypeMapping(marZakresTableMapping, false); + tableMappings70.Add(marZakresTableMapping); + RelationalModel.CreateColumnMapping(marIdColumn, marZakres.FindProperty("MarId")!, marZakresTableMapping); + RelationalModel.CreateColumnMapping(odCenyColumn, marZakres.FindProperty("OdCeny")!, marZakresTableMapping); + RelationalModel.CreateColumnMapping(koncowkiColumn, marZakres.FindProperty("Koncowki")!, marZakresTableMapping); + RelationalModel.CreateColumnMapping(zaokraglanieColumn, marZakres.FindProperty("Zaokraglanie")!, marZakresTableMapping); + + var marzownik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Marzownik")!; + + var defaultTableMappings71 = new List>(); + marzownik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings71); + var blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Marzownik", null, relationalModel); + var asIdColumnBase0 = new ColumnBase("AsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("AsId", asIdColumnBase0); + var magIdColumnBase5 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("MagId", magIdColumnBase5); + var marIdColumnBase0 = new ColumnBase("MarId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase); + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("MarId", marIdColumnBase0); + var minMarzaJestColumnBase = new ColumnBase("MinMarzaJest", "smallint", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("MinMarzaJest", minMarzaJestColumnBase); + var minMarzaOd100ColumnBase = new ColumnBase("MinMarzaOd100", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("MinMarzaOd100", minMarzaOd100ColumnBase); + var minMarzaW100ColumnBase = new ColumnBase("MinMarzaW100", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("MinMarzaW100", minMarzaW100ColumnBase); + var modOd100ColumnBase = new ColumnBase("ModOd100", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("ModOd100", modOd100ColumnBase); + var modW100ColumnBase = new ColumnBase("ModW100", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("ModW100", modW100ColumnBase); + var modZnaczenieColumnBase = new ColumnBase("ModZnaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("ModZnaczenie", modZnaczenieColumnBase); + var poziomCenColumnBase2 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase); + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("PoziomCen", poziomCenColumnBase2); + var towIdColumnBase6 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("TowId", towIdColumnBase6); + var zakresyColumnBase = new ColumnBase("Zakresy", "smallint", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase); + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.Columns.Add("Zakresy", zakresyColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Marzownik", blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase); + var blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase = new TableMappingBase(marzownik, blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesMarzownikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase, false); + defaultTableMappings71.Add(blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)marIdColumnBase0, marzownik.FindProperty("MarId")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asIdColumnBase0, marzownik.FindProperty("AsId")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase5, marzownik.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minMarzaJestColumnBase, marzownik.FindProperty("MinMarzaJest")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minMarzaOd100ColumnBase, marzownik.FindProperty("MinMarzaOd100")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minMarzaW100ColumnBase, marzownik.FindProperty("MinMarzaW100")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)modOd100ColumnBase, marzownik.FindProperty("ModOd100")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)modW100ColumnBase, marzownik.FindProperty("ModW100")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)modZnaczenieColumnBase, marzownik.FindProperty("ModZnaczenie")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase2, marzownik.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase6, marzownik.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zakresyColumnBase, marzownik.FindProperty("Zakresy")!, blinkBackofficeServicesPcmDbEntitiesMarzownikMappingBase); + + var tableMappings71 = new List(); + marzownik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings71); + var marzownikTable = new Table("Marzownik", null, relationalModel); + var marIdColumn0 = new Column("MarId", "numeric(9,0)", marzownikTable); + marzownikTable.Columns.Add("MarId", marIdColumn0); + var asIdColumn0 = new Column("AsId", "numeric(9,0)", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("AsId", asIdColumn0); + var magIdColumn5 = new Column("MagId", "numeric(9,0)", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("MagId", magIdColumn5); + var minMarzaJestColumn = new Column("MinMarzaJest", "smallint", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("MinMarzaJest", minMarzaJestColumn); + var minMarzaOd100Column = new Column("MinMarzaOd100", "decimal(10,4)", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("MinMarzaOd100", minMarzaOd100Column); + var minMarzaW100Column = new Column("MinMarzaW100", "decimal(10,4)", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("MinMarzaW100", minMarzaW100Column); + var modOd100Column = new Column("ModOd100", "decimal(10,4)", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("ModOd100", modOd100Column); + var modW100Column = new Column("ModW100", "decimal(10,4)", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("ModW100", modW100Column); + var modZnaczenieColumn = new Column("ModZnaczenie", "smallint", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("ModZnaczenie", modZnaczenieColumn); + var poziomCenColumn2 = new Column("PoziomCen", "smallint", marzownikTable); + marzownikTable.Columns.Add("PoziomCen", poziomCenColumn2); + var towIdColumn6 = new Column("TowId", "numeric(9,0)", marzownikTable) + { + IsNullable = true + }; + marzownikTable.Columns.Add("TowId", towIdColumn6); + var zakresyColumn = new Column("Zakresy", "smallint", marzownikTable); + marzownikTable.Columns.Add("Zakresy", zakresyColumn); + var pK_MARZOWNIK = new UniqueConstraint("PK_MARZOWNIK", marzownikTable, new[] { marIdColumn0 }); + marzownikTable.PrimaryKey = pK_MARZOWNIK; + var pK_MARZOWNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + new[] { "MarId" }); + pK_MARZOWNIK.MappedKeys.Add(pK_MARZOWNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_MARZOWNIKUc).Add(pK_MARZOWNIK); + marzownikTable.UniqueConstraints.Add("PK_MARZOWNIK", pK_MARZOWNIK); + var idxMarAs = new TableIndex( + "idxMarAs", marzownikTable, new[] { asIdColumn0 }, false); + var idxMarAsIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + "idxMarAs"); + idxMarAs.MappedIndexes.Add(idxMarAsIx); + RelationalModel.GetOrCreateTableIndexes(idxMarAsIx).Add(idxMarAs); + marzownikTable.Indexes.Add("idxMarAs", idxMarAs); + var idxMarMag = new TableIndex( + "idxMarMag", marzownikTable, new[] { magIdColumn5 }, false); + var idxMarMagIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + "idxMarMag"); + idxMarMag.MappedIndexes.Add(idxMarMagIx); + RelationalModel.GetOrCreateTableIndexes(idxMarMagIx).Add(idxMarMag); + marzownikTable.Indexes.Add("idxMarMag", idxMarMag); + var idxMarTow = new TableIndex( + "idxMarTow", marzownikTable, new[] { towIdColumn6 }, false); + var idxMarTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + "idxMarTow"); + idxMarTow.MappedIndexes.Add(idxMarTowIx); + RelationalModel.GetOrCreateTableIndexes(idxMarTowIx).Add(idxMarTow); + marzownikTable.Indexes.Add("idxMarTow", idxMarTow); + relationalModel.Tables.Add(("Marzownik", null), marzownikTable); + var marzownikTableMapping = new TableMapping(marzownik, marzownikTable, true); + marzownikTable.AddTypeMapping(marzownikTableMapping, false); + tableMappings71.Add(marzownikTableMapping); + RelationalModel.CreateColumnMapping(marIdColumn0, marzownik.FindProperty("MarId")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(asIdColumn0, marzownik.FindProperty("AsId")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn5, marzownik.FindProperty("MagId")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(minMarzaJestColumn, marzownik.FindProperty("MinMarzaJest")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(minMarzaOd100Column, marzownik.FindProperty("MinMarzaOd100")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(minMarzaW100Column, marzownik.FindProperty("MinMarzaW100")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(modOd100Column, marzownik.FindProperty("ModOd100")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(modW100Column, marzownik.FindProperty("ModW100")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(modZnaczenieColumn, marzownik.FindProperty("ModZnaczenie")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn2, marzownik.FindProperty("PoziomCen")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn6, marzownik.FindProperty("TowId")!, marzownikTableMapping); + RelationalModel.CreateColumnMapping(zakresyColumn, marzownik.FindProperty("Zakresy")!, marzownikTableMapping); + + var miasto = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Miasto")!; + + var defaultTableMappings72 = new List>(); + miasto.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings72); + var blinkBackofficeServicesPcmDbEntitiesMiastoTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Miasto", null, relationalModel); + var aktywnyColumnBase13 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesMiastoTableBase); + blinkBackofficeServicesPcmDbEntitiesMiastoTableBase.Columns.Add("Aktywny", aktywnyColumnBase13); + var domyslneColumnBase1 = new ColumnBase("Domyslne", "smallint", blinkBackofficeServicesPcmDbEntitiesMiastoTableBase); + blinkBackofficeServicesPcmDbEntitiesMiastoTableBase.Columns.Add("Domyslne", domyslneColumnBase1); + var mIdColumnBase = new ColumnBase("MId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesMiastoTableBase); + blinkBackofficeServicesPcmDbEntitiesMiastoTableBase.Columns.Add("MId", mIdColumnBase); + var nazwaColumnBase23 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesMiastoTableBase); + blinkBackofficeServicesPcmDbEntitiesMiastoTableBase.Columns.Add("Nazwa", nazwaColumnBase23); + var zmianaColumnBase16 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesMiastoTableBase); + blinkBackofficeServicesPcmDbEntitiesMiastoTableBase.Columns.Add("Zmiana", zmianaColumnBase16); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Miasto", blinkBackofficeServicesPcmDbEntitiesMiastoTableBase); + var blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase = new TableMappingBase(miasto, blinkBackofficeServicesPcmDbEntitiesMiastoTableBase, true); + blinkBackofficeServicesPcmDbEntitiesMiastoTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase, false); + defaultTableMappings72.Add(blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)mIdColumnBase, miasto.FindProperty("MId")!, blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase13, miasto.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslneColumnBase1, miasto.FindProperty("Domyslne")!, blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase23, miasto.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase16, miasto.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesMiastoMappingBase); + + var tableMappings72 = new List(); + miasto.SetRuntimeAnnotation("Relational:TableMappings", tableMappings72); + var miastoTable = new Table("Miasto", null, relationalModel); + var mIdColumn = new Column("MId", "numeric(9,0)", miastoTable); + miastoTable.Columns.Add("MId", mIdColumn); + var aktywnyColumn13 = new Column("Aktywny", "smallint", miastoTable); + miastoTable.Columns.Add("Aktywny", aktywnyColumn13); + var domyslneColumn1 = new Column("Domyslne", "smallint", miastoTable); + miastoTable.Columns.Add("Domyslne", domyslneColumn1); + var nazwaColumn23 = new Column("Nazwa", "varchar(255)", miastoTable); + miastoTable.Columns.Add("Nazwa", nazwaColumn23); + var zmianaColumn16 = new Column("Zmiana", "datetime", miastoTable); + miastoTable.Columns.Add("Zmiana", zmianaColumn16); + var pK_Miasto = new UniqueConstraint("PK_Miasto", miastoTable, new[] { mIdColumn }); + miastoTable.PrimaryKey = pK_Miasto; + var pK_MiastoUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Miasto", + new[] { "MId" }); + pK_Miasto.MappedKeys.Add(pK_MiastoUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_MiastoUc).Add(pK_Miasto); + miastoTable.UniqueConstraints.Add("PK_Miasto", pK_Miasto); + relationalModel.Tables.Add(("Miasto", null), miastoTable); + var miastoTableMapping = new TableMapping(miasto, miastoTable, true); + miastoTable.AddTypeMapping(miastoTableMapping, false); + tableMappings72.Add(miastoTableMapping); + RelationalModel.CreateColumnMapping(mIdColumn, miasto.FindProperty("MId")!, miastoTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn13, miasto.FindProperty("Aktywny")!, miastoTableMapping); + RelationalModel.CreateColumnMapping(domyslneColumn1, miasto.FindProperty("Domyslne")!, miastoTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn23, miasto.FindProperty("Nazwa")!, miastoTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn16, miasto.FindProperty("Zmiana")!, miastoTableMapping); + + var notatki = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Notatki")!; + + var defaultTableMappings73 = new List>(); + notatki.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings73); + var blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Notatki", null, relationalModel); + var kolejnoscColumnBase6 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase6); + var koniecLiniiColumnBase = new ColumnBase("KoniecLinii", "smallint", blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase.Columns.Add("KoniecLinii", koniecLiniiColumnBase); + var tekstColumnBase2 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase.Columns.Add("Tekst", tekstColumnBase2); + var towIdColumnBase7 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase.Columns.Add("TowId", towIdColumnBase7); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Notatki", blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase); + var blinkBackofficeServicesPcmDbEntitiesNotatkiMappingBase = new TableMappingBase(notatki, blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase, true); + blinkBackofficeServicesPcmDbEntitiesNotatkiTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesNotatkiMappingBase, false); + defaultTableMappings73.Add(blinkBackofficeServicesPcmDbEntitiesNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase6, notatki.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase7, notatki.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)koniecLiniiColumnBase, notatki.FindProperty("KoniecLinii")!, blinkBackofficeServicesPcmDbEntitiesNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase2, notatki.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesNotatkiMappingBase); + + var tableMappings73 = new List(); + notatki.SetRuntimeAnnotation("Relational:TableMappings", tableMappings73); + var notatkiTable = new Table("Notatki", null, relationalModel); + var towIdColumn7 = new Column("TowId", "numeric(9,0)", notatkiTable); + notatkiTable.Columns.Add("TowId", towIdColumn7); + var kolejnoscColumn6 = new Column("Kolejnosc", "smallint", notatkiTable); + notatkiTable.Columns.Add("Kolejnosc", kolejnoscColumn6); + var koniecLiniiColumn = new Column("KoniecLinii", "smallint", notatkiTable); + notatkiTable.Columns.Add("KoniecLinii", koniecLiniiColumn); + var tekstColumn2 = new Column("Tekst", "varchar(255)", notatkiTable); + notatkiTable.Columns.Add("Tekst", tekstColumn2); + var pK_NOTATKI = new UniqueConstraint("PK_NOTATKI", notatkiTable, new[] { towIdColumn7, kolejnoscColumn6 }); + notatkiTable.PrimaryKey = pK_NOTATKI; + var pK_NOTATKIUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Notatki", + new[] { "TowId", "Kolejnosc" }); + pK_NOTATKI.MappedKeys.Add(pK_NOTATKIUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_NOTATKIUc).Add(pK_NOTATKI); + notatkiTable.UniqueConstraints.Add("PK_NOTATKI", pK_NOTATKI); + notatkiTable.Triggers.Add("SwwDoNotatek", notatki.FindDeclaredTrigger("SwwDoNotatek")); + relationalModel.Tables.Add(("Notatki", null), notatkiTable); + var notatkiTableMapping = new TableMapping(notatki, notatkiTable, true); + notatkiTable.AddTypeMapping(notatkiTableMapping, false); + tableMappings73.Add(notatkiTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn6, notatki.FindProperty("Kolejnosc")!, notatkiTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn7, notatki.FindProperty("TowId")!, notatkiTableMapping); + RelationalModel.CreateColumnMapping(koniecLiniiColumn, notatki.FindProperty("KoniecLinii")!, notatkiTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn2, notatki.FindProperty("Tekst")!, notatkiTableMapping); + + var nrRej = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.NrRej")!; + + var defaultTableMappings74 = new List>(); + nrRej.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings74); + var blinkBackofficeServicesPcmDbEntitiesNrRejTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.NrRej", null, relationalModel); + var kontrIdColumnBase7 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesNrRejTableBase.Columns.Add("KontrId", kontrIdColumnBase7); + var nrFormatColumnBase = new ColumnBase("NrFormat", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesNrRejTableBase.Columns.Add("NrFormat", nrFormatColumnBase); + var nrWpisanyColumnBase = new ColumnBase("NrWpisany", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesNrRejTableBase.Columns.Add("NrWpisany", nrWpisanyColumnBase); + var wyborKartColumnBase = new ColumnBase("WyborKart", "smallint", blinkBackofficeServicesPcmDbEntitiesNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesNrRejTableBase.Columns.Add("WyborKart", wyborKartColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.NrRej", blinkBackofficeServicesPcmDbEntitiesNrRejTableBase); + var blinkBackofficeServicesPcmDbEntitiesNrRejMappingBase = new TableMappingBase(nrRej, blinkBackofficeServicesPcmDbEntitiesNrRejTableBase, true); + blinkBackofficeServicesPcmDbEntitiesNrRejTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesNrRejMappingBase, false); + defaultTableMappings74.Add(blinkBackofficeServicesPcmDbEntitiesNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase7, nrRej.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrFormatColumnBase, nrRej.FindProperty("NrFormat")!, blinkBackofficeServicesPcmDbEntitiesNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrWpisanyColumnBase, nrRej.FindProperty("NrWpisany")!, blinkBackofficeServicesPcmDbEntitiesNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wyborKartColumnBase, nrRej.FindProperty("WyborKart")!, blinkBackofficeServicesPcmDbEntitiesNrRejMappingBase); + + var tableMappings74 = new List(); + nrRej.SetRuntimeAnnotation("Relational:TableMappings", tableMappings74); + var nrRejTable = new Table("NrRej", null, relationalModel); + var kontrIdColumn7 = new Column("KontrId", "numeric(9,0)", nrRejTable); + nrRejTable.Columns.Add("KontrId", kontrIdColumn7); + var nrFormatColumn = new Column("NrFormat", "varchar(60)", nrRejTable); + nrRejTable.Columns.Add("NrFormat", nrFormatColumn); + var nrWpisanyColumn = new Column("NrWpisany", "varchar(60)", nrRejTable); + nrRejTable.Columns.Add("NrWpisany", nrWpisanyColumn); + var wyborKartColumn = new Column("WyborKart", "smallint", nrRejTable); + nrRejTable.Columns.Add("WyborKart", wyborKartColumn); + var pK_NRREJ = new UniqueConstraint("PK_NRREJ", nrRejTable, new[] { kontrIdColumn7, nrFormatColumn }); + nrRejTable.PrimaryKey = pK_NRREJ; + var pK_NRREJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.NrRej", + new[] { "KontrId", "NrFormat" }); + pK_NRREJ.MappedKeys.Add(pK_NRREJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_NRREJUc).Add(pK_NRREJ); + nrRejTable.UniqueConstraints.Add("PK_NRREJ", pK_NRREJ); + var idx_NumerRej = new TableIndex( + "idx_NumerRej", nrRejTable, new[] { nrFormatColumn, kontrIdColumn7 }, false); + var idx_NumerRejIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.NrRej", + "idx_NumerRej"); + idx_NumerRej.MappedIndexes.Add(idx_NumerRejIx); + RelationalModel.GetOrCreateTableIndexes(idx_NumerRejIx).Add(idx_NumerRej); + nrRejTable.Indexes.Add("idx_NumerRej", idx_NumerRej); + relationalModel.Tables.Add(("NrRej", null), nrRejTable); + var nrRejTableMapping = new TableMapping(nrRej, nrRejTable, true); + nrRejTable.AddTypeMapping(nrRejTableMapping, false); + tableMappings74.Add(nrRejTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn7, nrRej.FindProperty("KontrId")!, nrRejTableMapping); + RelationalModel.CreateColumnMapping(nrFormatColumn, nrRej.FindProperty("NrFormat")!, nrRejTableMapping); + RelationalModel.CreateColumnMapping(nrWpisanyColumn, nrRej.FindProperty("NrWpisany")!, nrRejTableMapping); + RelationalModel.CreateColumnMapping(wyborKartColumn, nrRej.FindProperty("WyborKart")!, nrRejTableMapping); + + var numDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.NumDok")!; + + var defaultTableMappings75 = new List>(); + numDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings75); + var blinkBackofficeServicesPcmDbEntitiesNumDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.NumDok", null, relationalModel); + var formatColumnBase = new ColumnBase("Format", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesNumDokTableBase); + blinkBackofficeServicesPcmDbEntitiesNumDokTableBase.Columns.Add("Format", formatColumnBase); + var licznikColumnBase = new ColumnBase("Licznik", "int", blinkBackofficeServicesPcmDbEntitiesNumDokTableBase); + blinkBackofficeServicesPcmDbEntitiesNumDokTableBase.Columns.Add("Licznik", licznikColumnBase); + var typNumeruColumnBase = new ColumnBase("TypNumeru", "smallint", blinkBackofficeServicesPcmDbEntitiesNumDokTableBase); + blinkBackofficeServicesPcmDbEntitiesNumDokTableBase.Columns.Add("TypNumeru", typNumeruColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.NumDok", blinkBackofficeServicesPcmDbEntitiesNumDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesNumDokMappingBase = new TableMappingBase(numDok, blinkBackofficeServicesPcmDbEntitiesNumDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesNumDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesNumDokMappingBase, false); + defaultTableMappings75.Add(blinkBackofficeServicesPcmDbEntitiesNumDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typNumeruColumnBase, numDok.FindProperty("TypNumeru")!, blinkBackofficeServicesPcmDbEntitiesNumDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formatColumnBase, numDok.FindProperty("Format")!, blinkBackofficeServicesPcmDbEntitiesNumDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)licznikColumnBase, numDok.FindProperty("Licznik")!, blinkBackofficeServicesPcmDbEntitiesNumDokMappingBase); + + var tableMappings75 = new List(); + numDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings75); + var numDokTable = new Table("NumDok", null, relationalModel); + var typNumeruColumn = new Column("TypNumeru", "smallint", numDokTable); + numDokTable.Columns.Add("TypNumeru", typNumeruColumn); + var formatColumn = new Column("Format", "varchar(255)", numDokTable); + numDokTable.Columns.Add("Format", formatColumn); + var licznikColumn = new Column("Licznik", "int", numDokTable); + numDokTable.Columns.Add("Licznik", licznikColumn); + var pK_NUMDOK = new UniqueConstraint("PK_NUMDOK", numDokTable, new[] { typNumeruColumn }); + numDokTable.PrimaryKey = pK_NUMDOK; + var pK_NUMDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.NumDok", + new[] { "TypNumeru" }); + pK_NUMDOK.MappedKeys.Add(pK_NUMDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_NUMDOKUc).Add(pK_NUMDOK); + numDokTable.UniqueConstraints.Add("PK_NUMDOK", pK_NUMDOK); + relationalModel.Tables.Add(("NumDok", null), numDokTable); + var numDokTableMapping = new TableMapping(numDok, numDokTable, true); + numDokTable.AddTypeMapping(numDokTableMapping, false); + tableMappings75.Add(numDokTableMapping); + RelationalModel.CreateColumnMapping(typNumeruColumn, numDok.FindProperty("TypNumeru")!, numDokTableMapping); + RelationalModel.CreateColumnMapping(formatColumn, numDok.FindProperty("Format")!, numDokTableMapping); + RelationalModel.CreateColumnMapping(licznikColumn, numDok.FindProperty("Licznik")!, numDokTableMapping); + + var numMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.NumMag")!; + + var defaultTableMappings76 = new List>(); + numMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings76); + var blinkBackofficeServicesPcmDbEntitiesNumMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.NumMag", null, relationalModel); + var formatColumnBase0 = new ColumnBase("Format", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesNumMagTableBase); + blinkBackofficeServicesPcmDbEntitiesNumMagTableBase.Columns.Add("Format", formatColumnBase0); + var licznikColumnBase0 = new ColumnBase("Licznik", "int", blinkBackofficeServicesPcmDbEntitiesNumMagTableBase); + blinkBackofficeServicesPcmDbEntitiesNumMagTableBase.Columns.Add("Licznik", licznikColumnBase0); + var magIdColumnBase6 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesNumMagTableBase); + blinkBackofficeServicesPcmDbEntitiesNumMagTableBase.Columns.Add("MagId", magIdColumnBase6); + var typNumeruColumnBase0 = new ColumnBase("TypNumeru", "smallint", blinkBackofficeServicesPcmDbEntitiesNumMagTableBase); + blinkBackofficeServicesPcmDbEntitiesNumMagTableBase.Columns.Add("TypNumeru", typNumeruColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.NumMag", blinkBackofficeServicesPcmDbEntitiesNumMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesNumMagMappingBase = new TableMappingBase(numMag, blinkBackofficeServicesPcmDbEntitiesNumMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesNumMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesNumMagMappingBase, false); + defaultTableMappings76.Add(blinkBackofficeServicesPcmDbEntitiesNumMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase6, numMag.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesNumMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typNumeruColumnBase0, numMag.FindProperty("TypNumeru")!, blinkBackofficeServicesPcmDbEntitiesNumMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formatColumnBase0, numMag.FindProperty("Format")!, blinkBackofficeServicesPcmDbEntitiesNumMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)licznikColumnBase0, numMag.FindProperty("Licznik")!, blinkBackofficeServicesPcmDbEntitiesNumMagMappingBase); + + var tableMappings76 = new List(); + numMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings76); + var numMagTable = new Table("NumMag", null, relationalModel); + var typNumeruColumn0 = new Column("TypNumeru", "smallint", numMagTable); + numMagTable.Columns.Add("TypNumeru", typNumeruColumn0); + var magIdColumn6 = new Column("MagId", "numeric(9,0)", numMagTable); + numMagTable.Columns.Add("MagId", magIdColumn6); + var formatColumn0 = new Column("Format", "varchar(255)", numMagTable); + numMagTable.Columns.Add("Format", formatColumn0); + var licznikColumn0 = new Column("Licznik", "int", numMagTable); + numMagTable.Columns.Add("Licznik", licznikColumn0); + var pK_NUMMAG = new UniqueConstraint("PK_NUMMAG", numMagTable, new[] { typNumeruColumn0, magIdColumn6 }); + numMagTable.PrimaryKey = pK_NUMMAG; + var pK_NUMMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.NumMag", + new[] { "TypNumeru", "MagId" }); + pK_NUMMAG.MappedKeys.Add(pK_NUMMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_NUMMAGUc).Add(pK_NUMMAG); + numMagTable.UniqueConstraints.Add("PK_NUMMAG", pK_NUMMAG); + var iX_NumMag_MagId = new TableIndex( + "IX_NumMag_MagId", numMagTable, new[] { magIdColumn6 }, false); + var iX_NumMag_MagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.NumMag", + new[] { "MagId" }); + iX_NumMag_MagId.MappedIndexes.Add(iX_NumMag_MagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_NumMag_MagIdIx).Add(iX_NumMag_MagId); + numMagTable.Indexes.Add("IX_NumMag_MagId", iX_NumMag_MagId); + relationalModel.Tables.Add(("NumMag", null), numMagTable); + var numMagTableMapping = new TableMapping(numMag, numMagTable, true); + numMagTable.AddTypeMapping(numMagTableMapping, false); + tableMappings76.Add(numMagTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn6, numMag.FindProperty("MagId")!, numMagTableMapping); + RelationalModel.CreateColumnMapping(typNumeruColumn0, numMag.FindProperty("TypNumeru")!, numMagTableMapping); + RelationalModel.CreateColumnMapping(formatColumn0, numMag.FindProperty("Format")!, numMagTableMapping); + RelationalModel.CreateColumnMapping(licznikColumn0, numMag.FindProperty("Licznik")!, numMagTableMapping); + + var odbProd = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.OdbProd")!; + + var defaultTableMappings77 = new List>(); + odbProd.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings77); + var blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.OdbProd", null, relationalModel); + var odbIdColumnBase = new ColumnBase("OdbId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase); + blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase.Columns.Add("OdbId", odbIdColumnBase); + var prodIdColumnBase0 = new ColumnBase("ProdId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase); + blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase.Columns.Add("ProdId", prodIdColumnBase0); + var rabatProdColumnBase0 = new ColumnBase("RabatProd", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase); + blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase.Columns.Add("RabatProd", rabatProdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.OdbProd", blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase); + var blinkBackofficeServicesPcmDbEntitiesOdbProdMappingBase = new TableMappingBase(odbProd, blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOdbProdTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOdbProdMappingBase, false); + defaultTableMappings77.Add(blinkBackofficeServicesPcmDbEntitiesOdbProdMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odbIdColumnBase, odbProd.FindProperty("OdbId")!, blinkBackofficeServicesPcmDbEntitiesOdbProdMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prodIdColumnBase0, odbProd.FindProperty("ProdId")!, blinkBackofficeServicesPcmDbEntitiesOdbProdMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatProdColumnBase0, odbProd.FindProperty("RabatProd")!, blinkBackofficeServicesPcmDbEntitiesOdbProdMappingBase); + + var tableMappings77 = new List(); + odbProd.SetRuntimeAnnotation("Relational:TableMappings", tableMappings77); + var odbProdTable = new Table("OdbProd", null, relationalModel); + var odbIdColumn = new Column("OdbId", "numeric(9,0)", odbProdTable); + odbProdTable.Columns.Add("OdbId", odbIdColumn); + var prodIdColumn0 = new Column("ProdId", "numeric(9,0)", odbProdTable); + odbProdTable.Columns.Add("ProdId", prodIdColumn0); + var rabatProdColumn0 = new Column("RabatProd", "decimal(10,4)", odbProdTable); + odbProdTable.Columns.Add("RabatProd", rabatProdColumn0); + var pK_ODBPROD = new UniqueConstraint("PK_ODBPROD", odbProdTable, new[] { odbIdColumn, prodIdColumn0 }); + odbProdTable.PrimaryKey = pK_ODBPROD; + var pK_ODBPRODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OdbProd", + new[] { "OdbId", "ProdId" }); + pK_ODBPROD.MappedKeys.Add(pK_ODBPRODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ODBPRODUc).Add(pK_ODBPROD); + odbProdTable.UniqueConstraints.Add("PK_ODBPROD", pK_ODBPROD); + var iX_OdbProd_ProdId = new TableIndex( + "IX_OdbProd_ProdId", odbProdTable, new[] { prodIdColumn0 }, false); + var iX_OdbProd_ProdIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.OdbProd", + new[] { "ProdId" }); + iX_OdbProd_ProdId.MappedIndexes.Add(iX_OdbProd_ProdIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_OdbProd_ProdIdIx).Add(iX_OdbProd_ProdId); + odbProdTable.Indexes.Add("IX_OdbProd_ProdId", iX_OdbProd_ProdId); + relationalModel.Tables.Add(("OdbProd", null), odbProdTable); + var odbProdTableMapping = new TableMapping(odbProd, odbProdTable, true); + odbProdTable.AddTypeMapping(odbProdTableMapping, false); + tableMappings77.Add(odbProdTableMapping); + RelationalModel.CreateColumnMapping(odbIdColumn, odbProd.FindProperty("OdbId")!, odbProdTableMapping); + RelationalModel.CreateColumnMapping(prodIdColumn0, odbProd.FindProperty("ProdId")!, odbProdTableMapping); + RelationalModel.CreateColumnMapping(rabatProdColumn0, odbProd.FindProperty("RabatProd")!, odbProdTableMapping); + + var odbiorca = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Odbiorca")!; + + var defaultTableMappings78 = new List>(); + odbiorca.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings78); + var blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Odbiorca", null, relationalModel); + var indeksColumnBase = new ColumnBase("Indeks", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("Indeks", indeksColumnBase); + var kontrIdColumnBase8 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("KontrId", kontrIdColumnBase8); + var naWylacznoscColumnBase = new ColumnBase("NaWylacznosc", "smallint", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("NaWylacznosc", naWylacznoscColumnBase); + var nazwaColumnBase24 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("Nazwa", nazwaColumnBase24); + var rabatTowColumnBase = new ColumnBase("RabatTow", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("RabatTow", rabatTowColumnBase); + var stalaCenaColumnBase = new ColumnBase("StalaCena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("StalaCena", stalaCenaColumnBase); + var towIdColumnBase8 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("TowId", towIdColumnBase8); + var zamowilColumnBase = new ColumnBase("Zamowil", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.Columns.Add("Zamowil", zamowilColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Odbiorca", blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase); + var blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase = new TableMappingBase(odbiorca, blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOdbiorcaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase, false); + defaultTableMappings78.Add(blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase8, odbiorca.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase8, odbiorca.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeksColumnBase, odbiorca.FindProperty("Indeks")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)naWylacznoscColumnBase, odbiorca.FindProperty("NaWylacznosc")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase24, odbiorca.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatTowColumnBase, odbiorca.FindProperty("RabatTow")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stalaCenaColumnBase, odbiorca.FindProperty("StalaCena")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zamowilColumnBase, odbiorca.FindProperty("Zamowil")!, blinkBackofficeServicesPcmDbEntitiesOdbiorcaMappingBase); + + var tableMappings78 = new List(); + odbiorca.SetRuntimeAnnotation("Relational:TableMappings", tableMappings78); + var odbiorcaTable = new Table("Odbiorca", null, relationalModel); + var kontrIdColumn8 = new Column("KontrId", "numeric(9,0)", odbiorcaTable); + odbiorcaTable.Columns.Add("KontrId", kontrIdColumn8); + var towIdColumn8 = new Column("TowId", "numeric(9,0)", odbiorcaTable); + odbiorcaTable.Columns.Add("TowId", towIdColumn8); + var indeksColumn = new Column("Indeks", "varchar(20)", odbiorcaTable) + { + IsNullable = true + }; + odbiorcaTable.Columns.Add("Indeks", indeksColumn); + var naWylacznoscColumn = new Column("NaWylacznosc", "smallint", odbiorcaTable) + { + IsNullable = true + }; + odbiorcaTable.Columns.Add("NaWylacznosc", naWylacznoscColumn); + var nazwaColumn24 = new Column("Nazwa", "varchar(120)", odbiorcaTable) + { + IsNullable = true + }; + odbiorcaTable.Columns.Add("Nazwa", nazwaColumn24); + var rabatTowColumn = new Column("RabatTow", "decimal(10,4)", odbiorcaTable) + { + IsNullable = true + }; + odbiorcaTable.Columns.Add("RabatTow", rabatTowColumn); + var stalaCenaColumn = new Column("StalaCena", "decimal(15,4)", odbiorcaTable) + { + IsNullable = true + }; + odbiorcaTable.Columns.Add("StalaCena", stalaCenaColumn); + var zamowilColumn = new Column("Zamowil", "decimal(15,4)", odbiorcaTable); + odbiorcaTable.Columns.Add("Zamowil", zamowilColumn); + var pK_ODBIORCA = new UniqueConstraint("PK_ODBIORCA", odbiorcaTable, new[] { kontrIdColumn8, towIdColumn8 }); + odbiorcaTable.PrimaryKey = pK_ODBIORCA; + var pK_ODBIORCAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Odbiorca", + new[] { "KontrId", "TowId" }); + pK_ODBIORCA.MappedKeys.Add(pK_ODBIORCAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ODBIORCAUc).Add(pK_ODBIORCA); + odbiorcaTable.UniqueConstraints.Add("PK_ODBIORCA", pK_ODBIORCA); + var idx_OdbTowId = new TableIndex( + "idx_OdbTowId", odbiorcaTable, new[] { towIdColumn8 }, false); + var idx_OdbTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Odbiorca", + "idx_OdbTowId"); + idx_OdbTowId.MappedIndexes.Add(idx_OdbTowIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_OdbTowIdIx).Add(idx_OdbTowId); + odbiorcaTable.Indexes.Add("idx_OdbTowId", idx_OdbTowId); + relationalModel.Tables.Add(("Odbiorca", null), odbiorcaTable); + var odbiorcaTableMapping = new TableMapping(odbiorca, odbiorcaTable, true); + odbiorcaTable.AddTypeMapping(odbiorcaTableMapping, false); + tableMappings78.Add(odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn8, odbiorca.FindProperty("KontrId")!, odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn8, odbiorca.FindProperty("TowId")!, odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(indeksColumn, odbiorca.FindProperty("Indeks")!, odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(naWylacznoscColumn, odbiorca.FindProperty("NaWylacznosc")!, odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn24, odbiorca.FindProperty("Nazwa")!, odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(rabatTowColumn, odbiorca.FindProperty("RabatTow")!, odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(stalaCenaColumn, odbiorca.FindProperty("StalaCena")!, odbiorcaTableMapping); + RelationalModel.CreateColumnMapping(zamowilColumn, odbiorca.FindProperty("Zamowil")!, odbiorcaTableMapping); + + var ofKod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.OfKod")!; + + var defaultTableMappings79 = new List>(); + ofKod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings79); + var blinkBackofficeServicesPcmDbEntitiesOfKodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.OfKod", null, relationalModel); + var kodColumnBase7 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesOfKodTableBase); + blinkBackofficeServicesPcmDbEntitiesOfKodTableBase.Columns.Add("Kod", kodColumnBase7); + var kolejnoscColumnBase7 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesOfKodTableBase); + blinkBackofficeServicesPcmDbEntitiesOfKodTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase7); + var kontrIdColumnBase9 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOfKodTableBase); + blinkBackofficeServicesPcmDbEntitiesOfKodTableBase.Columns.Add("KontrId", kontrIdColumnBase9); + var ofIdColumnBase = new ColumnBase("OfId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOfKodTableBase); + blinkBackofficeServicesPcmDbEntitiesOfKodTableBase.Columns.Add("OfId", ofIdColumnBase); + var typKoduColumnBase0 = new ColumnBase("TypKodu", "smallint", blinkBackofficeServicesPcmDbEntitiesOfKodTableBase); + blinkBackofficeServicesPcmDbEntitiesOfKodTableBase.Columns.Add("TypKodu", typKoduColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.OfKod", blinkBackofficeServicesPcmDbEntitiesOfKodTableBase); + var blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase = new TableMappingBase(ofKod, blinkBackofficeServicesPcmDbEntitiesOfKodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOfKodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase, false); + defaultTableMappings79.Add(blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase7, ofKod.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase9, ofKod.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ofIdColumnBase, ofKod.FindProperty("OfId")!, blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase7, ofKod.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKoduColumnBase0, ofKod.FindProperty("TypKodu")!, blinkBackofficeServicesPcmDbEntitiesOfKodMappingBase); + + var tableMappings79 = new List(); + ofKod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings79); + var ofKodTable = new Table("OfKod", null, relationalModel); + var kontrIdColumn9 = new Column("KontrId", "numeric(9,0)", ofKodTable); + ofKodTable.Columns.Add("KontrId", kontrIdColumn9); + var ofIdColumn = new Column("OfId", "numeric(9,0)", ofKodTable); + ofKodTable.Columns.Add("OfId", ofIdColumn); + var kolejnoscColumn7 = new Column("Kolejnosc", "smallint", ofKodTable); + ofKodTable.Columns.Add("Kolejnosc", kolejnoscColumn7); + var kodColumn7 = new Column("Kod", "varchar(20)", ofKodTable); + ofKodTable.Columns.Add("Kod", kodColumn7); + var typKoduColumn0 = new Column("TypKodu", "smallint", ofKodTable); + ofKodTable.Columns.Add("TypKodu", typKoduColumn0); + var pK_OFKOD = new UniqueConstraint("PK_OFKOD", ofKodTable, new[] { kontrIdColumn9, ofIdColumn, kolejnoscColumn7 }); + ofKodTable.PrimaryKey = pK_OFKOD; + var pK_OFKODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OfKod", + new[] { "KontrId", "OfId", "Kolejnosc" }); + pK_OFKOD.MappedKeys.Add(pK_OFKODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_OFKODUc).Add(pK_OFKOD); + ofKodTable.UniqueConstraints.Add("PK_OFKOD", pK_OFKOD); + var idx_OfKthKod = new TableIndex( + "idx_OfKthKod", ofKodTable, new[] { kontrIdColumn9, kodColumn7 }, false); + var idx_OfKthKodIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.OfKod", + "idx_OfKthKod"); + idx_OfKthKod.MappedIndexes.Add(idx_OfKthKodIx); + RelationalModel.GetOrCreateTableIndexes(idx_OfKthKodIx).Add(idx_OfKthKod); + ofKodTable.Indexes.Add("idx_OfKthKod", idx_OfKthKod); + relationalModel.Tables.Add(("OfKod", null), ofKodTable); + var ofKodTableMapping = new TableMapping(ofKod, ofKodTable, true); + ofKodTable.AddTypeMapping(ofKodTableMapping, false); + tableMappings79.Add(ofKodTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn7, ofKod.FindProperty("Kolejnosc")!, ofKodTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn9, ofKod.FindProperty("KontrId")!, ofKodTableMapping); + RelationalModel.CreateColumnMapping(ofIdColumn, ofKod.FindProperty("OfId")!, ofKodTableMapping); + RelationalModel.CreateColumnMapping(kodColumn7, ofKod.FindProperty("Kod")!, ofKodTableMapping); + RelationalModel.CreateColumnMapping(typKoduColumn0, ofKod.FindProperty("TypKodu")!, ofKodTableMapping); + + var ofSlownik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.OfSlownik")!; + + var defaultTableMappings80 = new List>(); + ofSlownik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings80); + var blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.OfSlownik", null, relationalModel); + var idColumnBase0 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase.Columns.Add("Id", idColumnBase0); + var kontrIdColumnBase10 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase); + blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase.Columns.Add("KontrId", kontrIdColumnBase10); + var opisColumnBase4 = new ColumnBase("Opis", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase); + blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase.Columns.Add("Opis", opisColumnBase4); + var typColumnBase7 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase); + blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase.Columns.Add("Typ", typColumnBase7); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.OfSlownik", blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase); + var blinkBackofficeServicesPcmDbEntitiesOfSlownikMappingBase = new TableMappingBase(ofSlownik, blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOfSlownikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOfSlownikMappingBase, false); + defaultTableMappings80.Add(blinkBackofficeServicesPcmDbEntitiesOfSlownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase10, ofSlownik.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesOfSlownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase4, ofSlownik.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesOfSlownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase7, ofSlownik.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesOfSlownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase0, ofSlownik.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesOfSlownikMappingBase); + + var tableMappings80 = new List(); + ofSlownik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings80); + var ofSlownikTable = new Table("OfSlownik", null, relationalModel); + var kontrIdColumn10 = new Column("KontrId", "numeric(9,0)", ofSlownikTable); + ofSlownikTable.Columns.Add("KontrId", kontrIdColumn10); + var typColumn7 = new Column("Typ", "smallint", ofSlownikTable); + ofSlownikTable.Columns.Add("Typ", typColumn7); + var opisColumn4 = new Column("Opis", "varchar(40)", ofSlownikTable); + ofSlownikTable.Columns.Add("Opis", opisColumn4); + var idColumn0 = new Column("Id", "numeric(9,0)", ofSlownikTable) + { + IsNullable = true + }; + ofSlownikTable.Columns.Add("Id", idColumn0); + var pK_OFSLOWNIK = new UniqueConstraint("PK_OFSLOWNIK", ofSlownikTable, new[] { kontrIdColumn10, typColumn7, opisColumn4 }); + ofSlownikTable.PrimaryKey = pK_OFSLOWNIK; + var pK_OFSLOWNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OfSlownik", + new[] { "KontrId", "Typ", "Opis" }); + pK_OFSLOWNIK.MappedKeys.Add(pK_OFSLOWNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_OFSLOWNIKUc).Add(pK_OFSLOWNIK); + ofSlownikTable.UniqueConstraints.Add("PK_OFSLOWNIK", pK_OFSLOWNIK); + relationalModel.Tables.Add(("OfSlownik", null), ofSlownikTable); + var ofSlownikTableMapping = new TableMapping(ofSlownik, ofSlownikTable, true); + ofSlownikTable.AddTypeMapping(ofSlownikTableMapping, false); + tableMappings80.Add(ofSlownikTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn10, ofSlownik.FindProperty("KontrId")!, ofSlownikTableMapping); + RelationalModel.CreateColumnMapping(opisColumn4, ofSlownik.FindProperty("Opis")!, ofSlownikTableMapping); + RelationalModel.CreateColumnMapping(typColumn7, ofSlownik.FindProperty("Typ")!, ofSlownikTableMapping); + RelationalModel.CreateColumnMapping(idColumn0, ofSlownik.FindProperty("Id")!, ofSlownikTableMapping); + + var oferta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Oferta")!; + + var defaultTableMappings81 = new List>(); + oferta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings81); + var blinkBackofficeServicesPcmDbEntitiesOfertaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Oferta", null, relationalModel); + var asortymentColumnBase = new ColumnBase("Asortyment", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Asortyment", asortymentColumnBase); + var cKUColumnBase = new ColumnBase("CKU", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("CKU", cKUColumnBase); + var cenaColumnBase = new ColumnBase("Cena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Cena", cenaColumnBase); + var indeks1ColumnBase = new ColumnBase("Indeks1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Indeks1", indeks1ColumnBase); + var indeks2ColumnBase = new ColumnBase("Indeks2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Indeks2", indeks2ColumnBase); + var jMColumnBase = new ColumnBase("JM", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("JM", jMColumnBase); + var kategoriaColumnBase = new ColumnBase("Kategoria", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Kategoria", kategoriaColumnBase); + var kontrIdColumnBase11 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase); + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("KontrId", kontrIdColumnBase11); + var nazwaColumnBase25 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Nazwa", nazwaColumnBase25); + var ofIdColumnBase0 = new ColumnBase("OfId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase); + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("OfId", ofIdColumnBase0); + var opis1ColumnBase0 = new ColumnBase("Opis1", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Opis1", opis1ColumnBase0); + var opis2ColumnBase0 = new ColumnBase("Opis2", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Opis2", opis2ColumnBase0); + var opis3ColumnBase = new ColumnBase("Opis3", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Opis3", opis3ColumnBase); + var opis4ColumnBase = new ColumnBase("Opis4", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Opis4", opis4ColumnBase); + var przelicznikColumnBase = new ColumnBase("Przelicznik", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Przelicznik", przelicznikColumnBase); + var skrotColumnBase2 = new ColumnBase("Skrot", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Skrot", skrotColumnBase2); + var stawkaColumnBase2 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("Stawka", stawkaColumnBase2); + var termWaznColumnBase = new ColumnBase("TermWazn", "smallint", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("TermWazn", termWaznColumnBase); + var towIdColumnBase9 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.Columns.Add("TowId", towIdColumnBase9); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Oferta", blinkBackofficeServicesPcmDbEntitiesOfertaTableBase); + var blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase = new TableMappingBase(oferta, blinkBackofficeServicesPcmDbEntitiesOfertaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOfertaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase, false); + defaultTableMappings81.Add(blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase11, oferta.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ofIdColumnBase0, oferta.FindProperty("OfId")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asortymentColumnBase, oferta.FindProperty("Asortyment")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cKUColumnBase, oferta.FindProperty("CKU")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase, oferta.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks1ColumnBase, oferta.FindProperty("Indeks1")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks2ColumnBase, oferta.FindProperty("Indeks2")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jMColumnBase, oferta.FindProperty("JM")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kategoriaColumnBase, oferta.FindProperty("Kategoria")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase25, oferta.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis1ColumnBase0, oferta.FindProperty("Opis1")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis2ColumnBase0, oferta.FindProperty("Opis2")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis3ColumnBase, oferta.FindProperty("Opis3")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis4ColumnBase, oferta.FindProperty("Opis4")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przelicznikColumnBase, oferta.FindProperty("Przelicznik")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase2, oferta.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase2, oferta.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termWaznColumnBase, oferta.FindProperty("TermWazn")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase9, oferta.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesOfertaMappingBase); + + var tableMappings81 = new List(); + oferta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings81); + var ofertaTable = new Table("Oferta", null, relationalModel); + var kontrIdColumn11 = new Column("KontrId", "numeric(9,0)", ofertaTable); + ofertaTable.Columns.Add("KontrId", kontrIdColumn11); + var ofIdColumn0 = new Column("OfId", "numeric(9,0)", ofertaTable); + ofertaTable.Columns.Add("OfId", ofIdColumn0); + var asortymentColumn = new Column("Asortyment", "varchar(40)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Asortyment", asortymentColumn); + var cKUColumn = new Column("CKU", "varchar(20)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("CKU", cKUColumn); + var cenaColumn = new Column("Cena", "decimal(15,4)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Cena", cenaColumn); + var indeks1Column = new Column("Indeks1", "varchar(40)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Indeks1", indeks1Column); + var indeks2Column = new Column("Indeks2", "varchar(40)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Indeks2", indeks2Column); + var jMColumn = new Column("JM", "varchar(10)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("JM", jMColumn); + var kategoriaColumn = new Column("Kategoria", "varchar(40)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Kategoria", kategoriaColumn); + var nazwaColumn25 = new Column("Nazwa", "varchar(120)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Nazwa", nazwaColumn25); + var opis1Column0 = new Column("Opis1", "varchar(60)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Opis1", opis1Column0); + var opis2Column0 = new Column("Opis2", "varchar(60)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Opis2", opis2Column0); + var opis3Column = new Column("Opis3", "varchar(60)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Opis3", opis3Column); + var opis4Column = new Column("Opis4", "varchar(60)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Opis4", opis4Column); + var przelicznikColumn = new Column("Przelicznik", "decimal(15,4)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Przelicznik", przelicznikColumn); + var skrotColumn2 = new Column("Skrot", "varchar(40)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Skrot", skrotColumn2); + var stawkaColumn2 = new Column("Stawka", "smallint", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("Stawka", stawkaColumn2); + var termWaznColumn = new Column("TermWazn", "smallint", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("TermWazn", termWaznColumn); + var towIdColumn9 = new Column("TowId", "numeric(9,0)", ofertaTable) + { + IsNullable = true + }; + ofertaTable.Columns.Add("TowId", towIdColumn9); + var pK_OFERTA = new UniqueConstraint("PK_OFERTA", ofertaTable, new[] { kontrIdColumn11, ofIdColumn0 }); + ofertaTable.PrimaryKey = pK_OFERTA; + var pK_OFERTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oferta", + new[] { "KontrId", "OfId" }); + pK_OFERTA.MappedKeys.Add(pK_OFERTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_OFERTAUc).Add(pK_OFERTA); + ofertaTable.UniqueConstraints.Add("PK_OFERTA", pK_OFERTA); + var idx_OfTow = new TableIndex( + "idx_OfTow", ofertaTable, new[] { towIdColumn9 }, false); + var idx_OfTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oferta", + "idx_OfTow"); + idx_OfTow.MappedIndexes.Add(idx_OfTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_OfTowIx).Add(idx_OfTow); + ofertaTable.Indexes.Add("idx_OfTow", idx_OfTow); + relationalModel.Tables.Add(("Oferta", null), ofertaTable); + var ofertaTableMapping = new TableMapping(oferta, ofertaTable, true); + ofertaTable.AddTypeMapping(ofertaTableMapping, false); + tableMappings81.Add(ofertaTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn11, oferta.FindProperty("KontrId")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(ofIdColumn0, oferta.FindProperty("OfId")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(asortymentColumn, oferta.FindProperty("Asortyment")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(cKUColumn, oferta.FindProperty("CKU")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn, oferta.FindProperty("Cena")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(indeks1Column, oferta.FindProperty("Indeks1")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(indeks2Column, oferta.FindProperty("Indeks2")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(jMColumn, oferta.FindProperty("JM")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(kategoriaColumn, oferta.FindProperty("Kategoria")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn25, oferta.FindProperty("Nazwa")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(opis1Column0, oferta.FindProperty("Opis1")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(opis2Column0, oferta.FindProperty("Opis2")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(opis3Column, oferta.FindProperty("Opis3")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(opis4Column, oferta.FindProperty("Opis4")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(przelicznikColumn, oferta.FindProperty("Przelicznik")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn2, oferta.FindProperty("Skrot")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn2, oferta.FindProperty("Stawka")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(termWaznColumn, oferta.FindProperty("TermWazn")!, ofertaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn9, oferta.FindProperty("TowId")!, ofertaTableMapping); + + var opisZdarzLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.OpisZdarzLoj")!; + + var defaultTableMappings82 = new List>(); + opisZdarzLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings82); + var blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.OpisZdarzLoj", null, relationalModel); + var kolejnoscColumnBase8 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase); + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase8); + var paramI1ColumnBase = new ColumnBase("ParamI1", "int", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("ParamI1", paramI1ColumnBase); + var paramI2ColumnBase = new ColumnBase("ParamI2", "int", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("ParamI2", paramI2ColumnBase); + var paramN1ColumnBase = new ColumnBase("ParamN1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("ParamN1", paramN1ColumnBase); + var paramN2ColumnBase = new ColumnBase("ParamN2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("ParamN2", paramN2ColumnBase); + var paramS1ColumnBase = new ColumnBase("ParamS1", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("ParamS1", paramS1ColumnBase); + var zdarzLojIdColumnBase = new ColumnBase("ZdarzLojId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase); + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("ZdarzLojId", zdarzLojIdColumnBase); + var znaczenieColumnBase4 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase); + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.Columns.Add("Znaczenie", znaczenieColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.OpisZdarzLoj", blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase = new TableMappingBase(opisZdarzLoj, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase, false); + defaultTableMappings82.Add(blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase8, opisZdarzLoj.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zdarzLojIdColumnBase, opisZdarzLoj.FindProperty("ZdarzLojId")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase4, opisZdarzLoj.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramI1ColumnBase, opisZdarzLoj.FindProperty("ParamI1")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramI2ColumnBase, opisZdarzLoj.FindProperty("ParamI2")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramN1ColumnBase, opisZdarzLoj.FindProperty("ParamN1")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramN2ColumnBase, opisZdarzLoj.FindProperty("ParamN2")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramS1ColumnBase, opisZdarzLoj.FindProperty("ParamS1")!, blinkBackofficeServicesPcmDbEntitiesOpisZdarzLojMappingBase); + + var tableMappings82 = new List(); + opisZdarzLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings82); + var opisZdarzLojTable = new Table("OpisZdarzLoj", null, relationalModel); + var zdarzLojIdColumn = new Column("ZdarzLojId", "numeric(9,0)", opisZdarzLojTable); + opisZdarzLojTable.Columns.Add("ZdarzLojId", zdarzLojIdColumn); + var znaczenieColumn4 = new Column("Znaczenie", "smallint", opisZdarzLojTable); + opisZdarzLojTable.Columns.Add("Znaczenie", znaczenieColumn4); + var kolejnoscColumn8 = new Column("Kolejnosc", "int", opisZdarzLojTable); + opisZdarzLojTable.Columns.Add("Kolejnosc", kolejnoscColumn8); + var paramI1Column = new Column("ParamI1", "int", opisZdarzLojTable) + { + IsNullable = true + }; + opisZdarzLojTable.Columns.Add("ParamI1", paramI1Column); + var paramI2Column = new Column("ParamI2", "int", opisZdarzLojTable) + { + IsNullable = true + }; + opisZdarzLojTable.Columns.Add("ParamI2", paramI2Column); + var paramN1Column = new Column("ParamN1", "decimal(15,4)", opisZdarzLojTable) + { + IsNullable = true + }; + opisZdarzLojTable.Columns.Add("ParamN1", paramN1Column); + var paramN2Column = new Column("ParamN2", "decimal(15,4)", opisZdarzLojTable) + { + IsNullable = true + }; + opisZdarzLojTable.Columns.Add("ParamN2", paramN2Column); + var paramS1Column = new Column("ParamS1", "varchar(64)", opisZdarzLojTable) + { + IsNullable = true + }; + opisZdarzLojTable.Columns.Add("ParamS1", paramS1Column); + var pK_OPISZDARZLOJ = new UniqueConstraint("PK_OPISZDARZLOJ", opisZdarzLojTable, new[] { zdarzLojIdColumn, znaczenieColumn4, kolejnoscColumn8 }); + opisZdarzLojTable.PrimaryKey = pK_OPISZDARZLOJ; + var pK_OPISZDARZLOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OpisZdarzLoj", + new[] { "ZdarzLojId", "Znaczenie", "Kolejnosc" }); + pK_OPISZDARZLOJ.MappedKeys.Add(pK_OPISZDARZLOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_OPISZDARZLOJUc).Add(pK_OPISZDARZLOJ); + opisZdarzLojTable.UniqueConstraints.Add("PK_OPISZDARZLOJ", pK_OPISZDARZLOJ); + relationalModel.Tables.Add(("OpisZdarzLoj", null), opisZdarzLojTable); + var opisZdarzLojTableMapping = new TableMapping(opisZdarzLoj, opisZdarzLojTable, true); + opisZdarzLojTable.AddTypeMapping(opisZdarzLojTableMapping, false); + tableMappings82.Add(opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn8, opisZdarzLoj.FindProperty("Kolejnosc")!, opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(zdarzLojIdColumn, opisZdarzLoj.FindProperty("ZdarzLojId")!, opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn4, opisZdarzLoj.FindProperty("Znaczenie")!, opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(paramI1Column, opisZdarzLoj.FindProperty("ParamI1")!, opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(paramI2Column, opisZdarzLoj.FindProperty("ParamI2")!, opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(paramN1Column, opisZdarzLoj.FindProperty("ParamN1")!, opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(paramN2Column, opisZdarzLoj.FindProperty("ParamN2")!, opisZdarzLojTableMapping); + RelationalModel.CreateColumnMapping(paramS1Column, opisZdarzLoj.FindProperty("ParamS1")!, opisZdarzLojTableMapping); + + var oplata = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Oplata")!; + + var defaultTableMappings83 = new List>(); + oplata.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings83); + var blinkBackofficeServicesPcmDbEntitiesOplataTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Oplata", null, relationalModel); + var aktywnyColumnBase14 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("Aktywny", aktywnyColumnBase14); + var centrOplataIdColumnBase = new ColumnBase("CentrOplataId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("CentrOplataId", centrOplataIdColumnBase); + var dataDoColumnBase1 = new ColumnBase("DataDo", "datetime", blinkBackofficeServicesPcmDbEntitiesOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("DataDo", dataDoColumnBase1); + var dataOdColumnBase1 = new ColumnBase("DataOd", "datetime", blinkBackofficeServicesPcmDbEntitiesOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("DataOd", dataOdColumnBase1); + var kBIdColumnBase0 = new ColumnBase("KBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("KBId", kBIdColumnBase0); + var komentarzColumnBase0 = new ColumnBase("Komentarz", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("Komentarz", komentarzColumnBase0); + var kwotaColumnBase1 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("Kwota", kwotaColumnBase1); + var nazwaColumnBase26 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("Nazwa", nazwaColumnBase26); + var oplataIdColumnBase = new ColumnBase("OplataId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("OplataId", oplataIdColumnBase); + var rodzajColumnBase0 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("Rodzaj", rodzajColumnBase0); + var stawkaProcColumnBase = new ColumnBase("StawkaProc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("StawkaProc", stawkaProcColumnBase); + var typColumnBase8 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("Typ", typColumnBase8); + var zmianaColumnBase17 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.Columns.Add("Zmiana", zmianaColumnBase17); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Oplata", blinkBackofficeServicesPcmDbEntitiesOplataTableBase); + var blinkBackofficeServicesPcmDbEntitiesOplataMappingBase = new TableMappingBase(oplata, blinkBackofficeServicesPcmDbEntitiesOplataTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOplataTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOplataMappingBase, false); + defaultTableMappings83.Add(blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)oplataIdColumnBase, oplata.FindProperty("OplataId")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase14, oplata.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrOplataIdColumnBase, oplata.FindProperty("CentrOplataId")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDoColumnBase1, oplata.FindProperty("DataDo")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataOdColumnBase1, oplata.FindProperty("DataOd")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kBIdColumnBase0, oplata.FindProperty("KBId")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)komentarzColumnBase0, oplata.FindProperty("Komentarz")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase1, oplata.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase26, oplata.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase0, oplata.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaProcColumnBase, oplata.FindProperty("StawkaProc")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase8, oplata.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase17, oplata.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesOplataMappingBase); + + var tableMappings83 = new List(); + oplata.SetRuntimeAnnotation("Relational:TableMappings", tableMappings83); + var oplataTable = new Table("Oplata", null, relationalModel); + var oplataIdColumn = new Column("OplataId", "numeric(9,0)", oplataTable); + oplataTable.Columns.Add("OplataId", oplataIdColumn); + var aktywnyColumn14 = new Column("Aktywny", "smallint", oplataTable); + oplataTable.Columns.Add("Aktywny", aktywnyColumn14); + var centrOplataIdColumn = new Column("CentrOplataId", "numeric(9,0)", oplataTable) + { + IsNullable = true + }; + oplataTable.Columns.Add("CentrOplataId", centrOplataIdColumn); + var dataDoColumn1 = new Column("DataDo", "datetime", oplataTable) + { + IsNullable = true + }; + oplataTable.Columns.Add("DataDo", dataDoColumn1); + var dataOdColumn1 = new Column("DataOd", "datetime", oplataTable) + { + IsNullable = true + }; + oplataTable.Columns.Add("DataOd", dataOdColumn1); + var kBIdColumn0 = new Column("KBId", "numeric(9,0)", oplataTable) + { + IsNullable = true + }; + oplataTable.Columns.Add("KBId", kBIdColumn0); + var komentarzColumn0 = new Column("Komentarz", "varchar(255)", oplataTable) + { + IsNullable = true + }; + oplataTable.Columns.Add("Komentarz", komentarzColumn0); + var kwotaColumn1 = new Column("Kwota", "decimal(15,4)", oplataTable) + { + IsNullable = true + }; + oplataTable.Columns.Add("Kwota", kwotaColumn1); + var nazwaColumn26 = new Column("Nazwa", "varchar(120)", oplataTable); + oplataTable.Columns.Add("Nazwa", nazwaColumn26); + var rodzajColumn0 = new Column("Rodzaj", "smallint", oplataTable); + oplataTable.Columns.Add("Rodzaj", rodzajColumn0); + var stawkaProcColumn = new Column("StawkaProc", "decimal(15,4)", oplataTable) + { + IsNullable = true + }; + oplataTable.Columns.Add("StawkaProc", stawkaProcColumn); + var typColumn8 = new Column("Typ", "smallint", oplataTable); + oplataTable.Columns.Add("Typ", typColumn8); + var zmianaColumn17 = new Column("Zmiana", "datetime", oplataTable); + oplataTable.Columns.Add("Zmiana", zmianaColumn17); + var pK_Oplata = new UniqueConstraint("PK_Oplata", oplataTable, new[] { oplataIdColumn }); + oplataTable.PrimaryKey = pK_Oplata; + var pK_OplataUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oplata", + new[] { "OplataId" }); + pK_Oplata.MappedKeys.Add(pK_OplataUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_OplataUc).Add(pK_Oplata); + oplataTable.UniqueConstraints.Add("PK_Oplata", pK_Oplata); + var iX_Oplata_KBId = new TableIndex( + "IX_Oplata_KBId", oplataTable, new[] { kBIdColumn0 }, false); + var iX_Oplata_KBIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oplata", + new[] { "KBId" }); + iX_Oplata_KBId.MappedIndexes.Add(iX_Oplata_KBIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Oplata_KBIdIx).Add(iX_Oplata_KBId); + oplataTable.Indexes.Add("IX_Oplata_KBId", iX_Oplata_KBId); + var ixOplata_DataOd = new TableIndex( + "IxOplata_DataOd", oplataTable, new[] { dataOdColumn1, dataDoColumn1 }, false); + var ixOplata_DataOdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oplata", + "IxOplata_DataOd"); + ixOplata_DataOd.MappedIndexes.Add(ixOplata_DataOdIx); + RelationalModel.GetOrCreateTableIndexes(ixOplata_DataOdIx).Add(ixOplata_DataOd); + oplataTable.Indexes.Add("IxOplata_DataOd", ixOplata_DataOd); + var ixOplata_Zmiana = new TableIndex( + "IxOplata_Zmiana", oplataTable, new[] { zmianaColumn17 }, false); + var ixOplata_ZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oplata", + "IxOplata_Zmiana"); + ixOplata_Zmiana.MappedIndexes.Add(ixOplata_ZmianaIx); + RelationalModel.GetOrCreateTableIndexes(ixOplata_ZmianaIx).Add(ixOplata_Zmiana); + oplataTable.Indexes.Add("IxOplata_Zmiana", ixOplata_Zmiana); + relationalModel.Tables.Add(("Oplata", null), oplataTable); + var oplataTableMapping = new TableMapping(oplata, oplataTable, true); + oplataTable.AddTypeMapping(oplataTableMapping, false); + tableMappings83.Add(oplataTableMapping); + RelationalModel.CreateColumnMapping(oplataIdColumn, oplata.FindProperty("OplataId")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn14, oplata.FindProperty("Aktywny")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(centrOplataIdColumn, oplata.FindProperty("CentrOplataId")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(dataDoColumn1, oplata.FindProperty("DataDo")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(dataOdColumn1, oplata.FindProperty("DataOd")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(kBIdColumn0, oplata.FindProperty("KBId")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(komentarzColumn0, oplata.FindProperty("Komentarz")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn1, oplata.FindProperty("Kwota")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn26, oplata.FindProperty("Nazwa")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn0, oplata.FindProperty("Rodzaj")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(stawkaProcColumn, oplata.FindProperty("StawkaProc")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(typColumn8, oplata.FindProperty("Typ")!, oplataTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn17, oplata.FindProperty("Zmiana")!, oplataTableMapping); + + var osoba = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Osoba")!; + + var defaultTableMappings84 = new List>(); + osoba.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings84); + var blinkBackofficeServicesPcmDbEntitiesOsobaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Osoba", null, relationalModel); + var kontrIdColumnBase12 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesOsobaTableBase); + blinkBackofficeServicesPcmDbEntitiesOsobaTableBase.Columns.Add("KontrId", kontrIdColumnBase12); + var nazwiskoColumnBase0 = new ColumnBase("Nazwisko", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesOsobaTableBase); + blinkBackofficeServicesPcmDbEntitiesOsobaTableBase.Columns.Add("Nazwisko", nazwiskoColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Osoba", blinkBackofficeServicesPcmDbEntitiesOsobaTableBase); + var blinkBackofficeServicesPcmDbEntitiesOsobaMappingBase = new TableMappingBase(osoba, blinkBackofficeServicesPcmDbEntitiesOsobaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesOsobaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesOsobaMappingBase, false); + defaultTableMappings84.Add(blinkBackofficeServicesPcmDbEntitiesOsobaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase12, osoba.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesOsobaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwiskoColumnBase0, osoba.FindProperty("Nazwisko")!, blinkBackofficeServicesPcmDbEntitiesOsobaMappingBase); + + var tableMappings84 = new List(); + osoba.SetRuntimeAnnotation("Relational:TableMappings", tableMappings84); + var osobaTable = new Table("Osoba", null, relationalModel); + var kontrIdColumn12 = new Column("KontrId", "numeric(9,0)", osobaTable); + osobaTable.Columns.Add("KontrId", kontrIdColumn12); + var nazwiskoColumn0 = new Column("Nazwisko", "varchar(60)", osobaTable); + osobaTable.Columns.Add("Nazwisko", nazwiskoColumn0); + var pK_OSOBA = new UniqueConstraint("PK_OSOBA", osobaTable, new[] { kontrIdColumn12, nazwiskoColumn0 }); + osobaTable.PrimaryKey = pK_OSOBA; + var pK_OSOBAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Osoba", + new[] { "KontrId", "Nazwisko" }); + pK_OSOBA.MappedKeys.Add(pK_OSOBAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_OSOBAUc).Add(pK_OSOBA); + osobaTable.UniqueConstraints.Add("PK_OSOBA", pK_OSOBA); + relationalModel.Tables.Add(("Osoba", null), osobaTable); + var osobaTableMapping = new TableMapping(osoba, osobaTable, true); + osobaTable.AddTypeMapping(osobaTableMapping, false); + tableMappings84.Add(osobaTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn12, osoba.FindProperty("KontrId")!, osobaTableMapping); + RelationalModel.CreateColumnMapping(nazwiskoColumn0, osoba.FindProperty("Nazwisko")!, osobaTableMapping); + + var pH = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PH")!; + + var defaultTableMappings85 = new List>(); + pH.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings85); + var blinkBackofficeServicesPcmDbEntitiesPHTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PH", null, relationalModel); + var aktywnyColumnBase15 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesPHTableBase); + blinkBackofficeServicesPcmDbEntitiesPHTableBase.Columns.Add("Aktywny", aktywnyColumnBase15); + var kontrIdColumnBase13 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPHTableBase.Columns.Add("KontrId", kontrIdColumnBase13); + var nazwaColumnBase27 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesPHTableBase); + blinkBackofficeServicesPcmDbEntitiesPHTableBase.Columns.Add("Nazwa", nazwaColumnBase27); + var pHIdColumnBase = new ColumnBase("PHId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHTableBase); + blinkBackofficeServicesPcmDbEntitiesPHTableBase.Columns.Add("PHId", pHIdColumnBase); + var zmianaColumnBase18 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesPHTableBase); + blinkBackofficeServicesPcmDbEntitiesPHTableBase.Columns.Add("Zmiana", zmianaColumnBase18); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PH", blinkBackofficeServicesPcmDbEntitiesPHTableBase); + var blinkBackofficeServicesPcmDbEntitiesPHMappingBase = new TableMappingBase(pH, blinkBackofficeServicesPcmDbEntitiesPHTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPHTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPHMappingBase, false); + defaultTableMappings85.Add(blinkBackofficeServicesPcmDbEntitiesPHMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pHIdColumnBase, pH.FindProperty("PHId")!, blinkBackofficeServicesPcmDbEntitiesPHMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase15, pH.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesPHMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase13, pH.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesPHMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase27, pH.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesPHMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase18, pH.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesPHMappingBase); + + var tableMappings85 = new List(); + pH.SetRuntimeAnnotation("Relational:TableMappings", tableMappings85); + var pHTable = new Table("PH", null, relationalModel); + var pHIdColumn = new Column("PHId", "numeric(9,0)", pHTable); + pHTable.Columns.Add("PHId", pHIdColumn); + var aktywnyColumn15 = new Column("Aktywny", "smallint", pHTable); + pHTable.Columns.Add("Aktywny", aktywnyColumn15); + var kontrIdColumn13 = new Column("KontrId", "numeric(9,0)", pHTable) + { + IsNullable = true + }; + pHTable.Columns.Add("KontrId", kontrIdColumn13); + var nazwaColumn27 = new Column("Nazwa", "varchar(60)", pHTable); + pHTable.Columns.Add("Nazwa", nazwaColumn27); + var zmianaColumn18 = new Column("Zmiana", "datetime", pHTable); + pHTable.Columns.Add("Zmiana", zmianaColumn18); + var pK_PH = new UniqueConstraint("PK_PH", pHTable, new[] { pHIdColumn }); + pHTable.PrimaryKey = pK_PH; + var pK_PHUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PH", + new[] { "PHId" }); + pK_PH.MappedKeys.Add(pK_PHUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PHUc).Add(pK_PH); + pHTable.UniqueConstraints.Add("PK_PH", pK_PH); + var idx_PHKth = new TableIndex( + "idx_PHKth", pHTable, new[] { kontrIdColumn13 }, false); + var idx_PHKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PH", + "idx_PHKth"); + idx_PHKth.MappedIndexes.Add(idx_PHKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_PHKthIx).Add(idx_PHKth); + pHTable.Indexes.Add("idx_PHKth", idx_PHKth); + relationalModel.Tables.Add(("PH", null), pHTable); + var pHTableMapping = new TableMapping(pH, pHTable, true); + pHTable.AddTypeMapping(pHTableMapping, false); + tableMappings85.Add(pHTableMapping); + RelationalModel.CreateColumnMapping(pHIdColumn, pH.FindProperty("PHId")!, pHTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn15, pH.FindProperty("Aktywny")!, pHTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn13, pH.FindProperty("KontrId")!, pHTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn27, pH.FindProperty("Nazwa")!, pHTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn18, pH.FindProperty("Zmiana")!, pHTableMapping); + + var pHDane = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PHDane")!; + + var defaultTableMappings86 = new List>(); + pHDane.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings86); + var blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PHDane", null, relationalModel); + var pHIdColumnBase0 = new ColumnBase("PHId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase.Columns.Add("PHId", pHIdColumnBase0); + var tekstColumnBase3 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase.Columns.Add("Tekst", tekstColumnBase3); + var znaczenieColumnBase5 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase.Columns.Add("Znaczenie", znaczenieColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PHDane", blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase); + var blinkBackofficeServicesPcmDbEntitiesPHDaneMappingBase = new TableMappingBase(pHDane, blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPHDaneTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPHDaneMappingBase, false); + defaultTableMappings86.Add(blinkBackofficeServicesPcmDbEntitiesPHDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pHIdColumnBase0, pHDane.FindProperty("PHId")!, blinkBackofficeServicesPcmDbEntitiesPHDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase5, pHDane.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesPHDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase3, pHDane.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesPHDaneMappingBase); + + var tableMappings86 = new List(); + pHDane.SetRuntimeAnnotation("Relational:TableMappings", tableMappings86); + var pHDaneTable = new Table("PHDane", null, relationalModel); + var pHIdColumn0 = new Column("PHId", "numeric(9,0)", pHDaneTable); + pHDaneTable.Columns.Add("PHId", pHIdColumn0); + var znaczenieColumn5 = new Column("Znaczenie", "smallint", pHDaneTable); + pHDaneTable.Columns.Add("Znaczenie", znaczenieColumn5); + var tekstColumn3 = new Column("Tekst", "varchar(255)", pHDaneTable); + pHDaneTable.Columns.Add("Tekst", tekstColumn3); + var pK_PHDANE = new UniqueConstraint("PK_PHDANE", pHDaneTable, new[] { pHIdColumn0, znaczenieColumn5 }); + pHDaneTable.PrimaryKey = pK_PHDANE; + var pK_PHDANEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHDane", + new[] { "PHId", "Znaczenie" }); + pK_PHDANE.MappedKeys.Add(pK_PHDANEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PHDANEUc).Add(pK_PHDANE); + pHDaneTable.UniqueConstraints.Add("PK_PHDANE", pK_PHDANE); + relationalModel.Tables.Add(("PHDane", null), pHDaneTable); + var pHDaneTableMapping = new TableMapping(pHDane, pHDaneTable, true); + pHDaneTable.AddTypeMapping(pHDaneTableMapping, false); + tableMappings86.Add(pHDaneTableMapping); + RelationalModel.CreateColumnMapping(pHIdColumn0, pHDane.FindProperty("PHId")!, pHDaneTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn5, pHDane.FindProperty("Znaczenie")!, pHDaneTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn3, pHDane.FindProperty("Tekst")!, pHDaneTableMapping); + + var pHOdbDane = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PHOdbDane")!; + + var defaultTableMappings87 = new List>(); + pHOdbDane.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings87); + var blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PHOdbDane", null, relationalModel); + var kontrIdColumnBase14 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase.Columns.Add("KontrId", kontrIdColumnBase14); + var pHIdColumnBase1 = new ColumnBase("PHId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase.Columns.Add("PHId", pHIdColumnBase1); + var tekstColumnBase4 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase.Columns.Add("Tekst", tekstColumnBase4); + var znaczenieColumnBase6 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase.Columns.Add("Znaczenie", znaczenieColumnBase6); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PHOdbDane", blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase); + var blinkBackofficeServicesPcmDbEntitiesPHOdbDaneMappingBase = new TableMappingBase(pHOdbDane, blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPHOdbDaneTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPHOdbDaneMappingBase, false); + defaultTableMappings87.Add(blinkBackofficeServicesPcmDbEntitiesPHOdbDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase14, pHOdbDane.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesPHOdbDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pHIdColumnBase1, pHOdbDane.FindProperty("PHId")!, blinkBackofficeServicesPcmDbEntitiesPHOdbDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase6, pHOdbDane.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesPHOdbDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase4, pHOdbDane.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesPHOdbDaneMappingBase); + + var tableMappings87 = new List(); + pHOdbDane.SetRuntimeAnnotation("Relational:TableMappings", tableMappings87); + var pHOdbDaneTable = new Table("PHOdbDane", null, relationalModel); + var pHIdColumn1 = new Column("PHId", "numeric(9,0)", pHOdbDaneTable); + pHOdbDaneTable.Columns.Add("PHId", pHIdColumn1); + var kontrIdColumn14 = new Column("KontrId", "numeric(9,0)", pHOdbDaneTable); + pHOdbDaneTable.Columns.Add("KontrId", kontrIdColumn14); + var znaczenieColumn6 = new Column("Znaczenie", "smallint", pHOdbDaneTable); + pHOdbDaneTable.Columns.Add("Znaczenie", znaczenieColumn6); + var tekstColumn4 = new Column("Tekst", "varchar(255)", pHOdbDaneTable); + pHOdbDaneTable.Columns.Add("Tekst", tekstColumn4); + var pK_PHODBDANE = new UniqueConstraint("PK_PHODBDANE", pHOdbDaneTable, new[] { pHIdColumn1, kontrIdColumn14, znaczenieColumn6 }); + pHOdbDaneTable.PrimaryKey = pK_PHODBDANE; + var pK_PHODBDANEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbDane", + new[] { "PHId", "KontrId", "Znaczenie" }); + pK_PHODBDANE.MappedKeys.Add(pK_PHODBDANEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PHODBDANEUc).Add(pK_PHODBDANE); + pHOdbDaneTable.UniqueConstraints.Add("PK_PHODBDANE", pK_PHODBDANE); + relationalModel.Tables.Add(("PHOdbDane", null), pHOdbDaneTable); + var pHOdbDaneTableMapping = new TableMapping(pHOdbDane, pHOdbDaneTable, true); + pHOdbDaneTable.AddTypeMapping(pHOdbDaneTableMapping, false); + tableMappings87.Add(pHOdbDaneTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn14, pHOdbDane.FindProperty("KontrId")!, pHOdbDaneTableMapping); + RelationalModel.CreateColumnMapping(pHIdColumn1, pHOdbDane.FindProperty("PHId")!, pHOdbDaneTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn6, pHOdbDane.FindProperty("Znaczenie")!, pHOdbDaneTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn4, pHOdbDane.FindProperty("Tekst")!, pHOdbDaneTableMapping); + + var pHOdbiorca = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca")!; + + var defaultTableMappings88 = new List>(); + pHOdbiorca.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings88); + var blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", null, relationalModel); + var kontrIdColumnBase15 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase.Columns.Add("KontrId", kontrIdColumnBase15); + var pHIdColumnBase2 = new ColumnBase("PHId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase.Columns.Add("PHId", pHIdColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase); + var blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaMappingBase = new TableMappingBase(pHOdbiorca, blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaMappingBase, false); + defaultTableMappings88.Add(blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase15, pHOdbiorca.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pHIdColumnBase2, pHOdbiorca.FindProperty("PHId")!, blinkBackofficeServicesPcmDbEntitiesPHOdbiorcaMappingBase); + + var tableMappings88 = new List(); + pHOdbiorca.SetRuntimeAnnotation("Relational:TableMappings", tableMappings88); + var pHOdbiorcaTable = new Table("PHOdbiorca", null, relationalModel); + var pHIdColumn2 = new Column("PHId", "numeric(9,0)", pHOdbiorcaTable); + pHOdbiorcaTable.Columns.Add("PHId", pHIdColumn2); + var kontrIdColumn15 = new Column("KontrId", "numeric(9,0)", pHOdbiorcaTable); + pHOdbiorcaTable.Columns.Add("KontrId", kontrIdColumn15); + var pK_PHODBIORCA = new UniqueConstraint("PK_PHODBIORCA", pHOdbiorcaTable, new[] { pHIdColumn2, kontrIdColumn15 }); + pHOdbiorcaTable.PrimaryKey = pK_PHODBIORCA; + var pK_PHODBIORCAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", + new[] { "PHId", "KontrId" }); + pK_PHODBIORCA.MappedKeys.Add(pK_PHODBIORCAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PHODBIORCAUc).Add(pK_PHODBIORCA); + pHOdbiorcaTable.UniqueConstraints.Add("PK_PHODBIORCA", pK_PHODBIORCA); + var idx_PHOdbKth = new TableIndex( + "idx_PHOdbKth", pHOdbiorcaTable, new[] { kontrIdColumn15 }, false); + var idx_PHOdbKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", + "idx_PHOdbKth"); + idx_PHOdbKth.MappedIndexes.Add(idx_PHOdbKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_PHOdbKthIx).Add(idx_PHOdbKth); + pHOdbiorcaTable.Indexes.Add("idx_PHOdbKth", idx_PHOdbKth); + relationalModel.Tables.Add(("PHOdbiorca", null), pHOdbiorcaTable); + var pHOdbiorcaTableMapping = new TableMapping(pHOdbiorca, pHOdbiorcaTable, true); + pHOdbiorcaTable.AddTypeMapping(pHOdbiorcaTableMapping, false); + tableMappings88.Add(pHOdbiorcaTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn15, pHOdbiorca.FindProperty("KontrId")!, pHOdbiorcaTableMapping); + RelationalModel.CreateColumnMapping(pHIdColumn2, pHOdbiorca.FindProperty("PHId")!, pHOdbiorcaTableMapping); + + var pHRozliczenie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie")!; + + var defaultTableMappings89 = new List>(); + pHRozliczenie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings89); + var blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie", null, relationalModel); + var dokIdColumnBase7 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase); + blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase.Columns.Add("DokId", dokIdColumnBase7); + var kwotaColumnBase2 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase); + blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase.Columns.Add("Kwota", kwotaColumnBase2); + var pHIdColumnBase3 = new ColumnBase("PHId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase); + blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase.Columns.Add("PHId", pHIdColumnBase3); + var rozliczonoColumnBase = new ColumnBase("Rozliczono", "datetime", blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase.Columns.Add("Rozliczono", rozliczonoColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie", blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase); + var blinkBackofficeServicesPcmDbEntitiesPHRozliczenieMappingBase = new TableMappingBase(pHRozliczenie, blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPHRozliczenieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPHRozliczenieMappingBase, false); + defaultTableMappings89.Add(blinkBackofficeServicesPcmDbEntitiesPHRozliczenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase7, pHRozliczenie.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesPHRozliczenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pHIdColumnBase3, pHRozliczenie.FindProperty("PHId")!, blinkBackofficeServicesPcmDbEntitiesPHRozliczenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase2, pHRozliczenie.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesPHRozliczenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczonoColumnBase, pHRozliczenie.FindProperty("Rozliczono")!, blinkBackofficeServicesPcmDbEntitiesPHRozliczenieMappingBase); + + var tableMappings89 = new List(); + pHRozliczenie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings89); + var pHRozliczenieTable = new Table("PHRozliczenie", null, relationalModel); + var dokIdColumn7 = new Column("DokId", "numeric(9,0)", pHRozliczenieTable); + pHRozliczenieTable.Columns.Add("DokId", dokIdColumn7); + var pHIdColumn3 = new Column("PHId", "numeric(9,0)", pHRozliczenieTable); + pHRozliczenieTable.Columns.Add("PHId", pHIdColumn3); + var kwotaColumn2 = new Column("Kwota", "decimal(15,4)", pHRozliczenieTable); + pHRozliczenieTable.Columns.Add("Kwota", kwotaColumn2); + var rozliczonoColumn = new Column("Rozliczono", "datetime", pHRozliczenieTable) + { + IsNullable = true + }; + pHRozliczenieTable.Columns.Add("Rozliczono", rozliczonoColumn); + var pK_PHROZLICZENIE = new UniqueConstraint("PK_PHROZLICZENIE", pHRozliczenieTable, new[] { dokIdColumn7, pHIdColumn3 }); + pHRozliczenieTable.PrimaryKey = pK_PHROZLICZENIE; + var pK_PHROZLICZENIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie", + new[] { "DokId", "PHId" }); + pK_PHROZLICZENIE.MappedKeys.Add(pK_PHROZLICZENIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PHROZLICZENIEUc).Add(pK_PHROZLICZENIE); + pHRozliczenieTable.UniqueConstraints.Add("PK_PHROZLICZENIE", pK_PHROZLICZENIE); + var idx_PHRozPH = new TableIndex( + "idx_PHRozPH", pHRozliczenieTable, new[] { pHIdColumn3 }, false); + var idx_PHRozPHIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie", + "idx_PHRozPH"); + idx_PHRozPH.MappedIndexes.Add(idx_PHRozPHIx); + RelationalModel.GetOrCreateTableIndexes(idx_PHRozPHIx).Add(idx_PHRozPH); + pHRozliczenieTable.Indexes.Add("idx_PHRozPH", idx_PHRozPH); + relationalModel.Tables.Add(("PHRozliczenie", null), pHRozliczenieTable); + var pHRozliczenieTableMapping = new TableMapping(pHRozliczenie, pHRozliczenieTable, true); + pHRozliczenieTable.AddTypeMapping(pHRozliczenieTableMapping, false); + tableMappings89.Add(pHRozliczenieTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn7, pHRozliczenie.FindProperty("DokId")!, pHRozliczenieTableMapping); + RelationalModel.CreateColumnMapping(pHIdColumn3, pHRozliczenie.FindProperty("PHId")!, pHRozliczenieTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn2, pHRozliczenie.FindProperty("Kwota")!, pHRozliczenieTableMapping); + RelationalModel.CreateColumnMapping(rozliczonoColumn, pHRozliczenie.FindProperty("Rozliczono")!, pHRozliczenieTableMapping); + + var panel = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Panel")!; + + var defaultTableMappings90 = new List>(); + panel.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings90); + var blinkBackofficeServicesPcmDbEntitiesPanelTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Panel", null, relationalModel); + var aktywnyColumnBase16 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("Aktywny", aktywnyColumnBase16); + var centrPanelIdColumnBase = new ColumnBase("CentrPanelId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("CentrPanelId", centrPanelIdColumnBase); + var hColumnBase = new ColumnBase("H", "smallint", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("H", hColumnBase); + var lColumnBase = new ColumnBase("L", "smallint", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("L", lColumnBase); + var nazwaColumnBase28 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("Nazwa", nazwaColumnBase28); + var panelIdColumnBase = new ColumnBase("PanelId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("PanelId", panelIdColumnBase); + var param1ColumnBase1 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("Param1", param1ColumnBase1); + var rodzajColumnBase1 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("Rodzaj", rodzajColumnBase1); + var tColumnBase = new ColumnBase("T", "smallint", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("T", tColumnBase); + var typAplikacjiColumnBase = new ColumnBase("TypAplikacji", "smallint", blinkBackofficeServicesPcmDbEntitiesPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("TypAplikacji", typAplikacjiColumnBase); + var uzIdColumnBase2 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("UzId", uzIdColumnBase2); + var uzNSIdColumnBase = new ColumnBase("UzNSId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("UzNSId", uzNSIdColumnBase); + var wColumnBase = new ColumnBase("W", "smallint", blinkBackofficeServicesPcmDbEntitiesPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("W", wColumnBase); + var zmianaColumnBase19 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.Columns.Add("Zmiana", zmianaColumnBase19); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Panel", blinkBackofficeServicesPcmDbEntitiesPanelTableBase); + var blinkBackofficeServicesPcmDbEntitiesPanelMappingBase = new TableMappingBase(panel, blinkBackofficeServicesPcmDbEntitiesPanelTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPanelTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPanelMappingBase, false); + defaultTableMappings90.Add(blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)panelIdColumnBase, panel.FindProperty("PanelId")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase16, panel.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrPanelIdColumnBase, panel.FindProperty("CentrPanelId")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hColumnBase, panel.FindProperty("H")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lColumnBase, panel.FindProperty("L")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase28, panel.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase1, panel.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase1, panel.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tColumnBase, panel.FindProperty("T")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typAplikacjiColumnBase, panel.FindProperty("TypAplikacji")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase2, panel.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzNSIdColumnBase, panel.FindProperty("UzNSId")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wColumnBase, panel.FindProperty("W")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase19, panel.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesPanelMappingBase); + + var tableMappings90 = new List(); + panel.SetRuntimeAnnotation("Relational:TableMappings", tableMappings90); + var panelTable = new Table("Panel", null, relationalModel); + var panelIdColumn = new Column("PanelId", "numeric(9,0)", panelTable); + panelTable.Columns.Add("PanelId", panelIdColumn); + var aktywnyColumn16 = new Column("Aktywny", "smallint", panelTable); + panelTable.Columns.Add("Aktywny", aktywnyColumn16); + var centrPanelIdColumn = new Column("CentrPanelId", "numeric(9,0)", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("CentrPanelId", centrPanelIdColumn); + var hColumn = new Column("H", "smallint", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("H", hColumn); + var lColumn = new Column("L", "smallint", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("L", lColumn); + var nazwaColumn28 = new Column("Nazwa", "varchar(255)", panelTable); + panelTable.Columns.Add("Nazwa", nazwaColumn28); + var param1Column1 = new Column("Param1", "int", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("Param1", param1Column1); + var rodzajColumn1 = new Column("Rodzaj", "smallint", panelTable); + panelTable.Columns.Add("Rodzaj", rodzajColumn1); + var tColumn = new Column("T", "smallint", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("T", tColumn); + var typAplikacjiColumn = new Column("TypAplikacji", "smallint", panelTable); + panelTable.Columns.Add("TypAplikacji", typAplikacjiColumn); + var uzIdColumn2 = new Column("UzId", "numeric(9,0)", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("UzId", uzIdColumn2); + var uzNSIdColumn = new Column("UzNSId", "numeric(9,0)", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("UzNSId", uzNSIdColumn); + var wColumn = new Column("W", "smallint", panelTable) + { + IsNullable = true + }; + panelTable.Columns.Add("W", wColumn); + var zmianaColumn19 = new Column("Zmiana", "datetime", panelTable); + panelTable.Columns.Add("Zmiana", zmianaColumn19); + var pK_PANEL = new UniqueConstraint("PK_PANEL", panelTable, new[] { panelIdColumn }); + panelTable.PrimaryKey = pK_PANEL; + var pK_PANELUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + new[] { "PanelId" }); + pK_PANEL.MappedKeys.Add(pK_PANELUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PANELUc).Add(pK_PANEL); + panelTable.UniqueConstraints.Add("PK_PANEL", pK_PANEL); + var iX_Panel_UzId = new TableIndex( + "IX_Panel_UzId", panelTable, new[] { uzIdColumn2 }, false); + var iX_Panel_UzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + new[] { "UzId" }); + iX_Panel_UzId.MappedIndexes.Add(iX_Panel_UzIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Panel_UzIdIx).Add(iX_Panel_UzId); + panelTable.Indexes.Add("IX_Panel_UzId", iX_Panel_UzId); + var iX_Panel_UzNSId = new TableIndex( + "IX_Panel_UzNSId", panelTable, new[] { uzNSIdColumn }, false); + var iX_Panel_UzNSIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + new[] { "UzNSId" }); + iX_Panel_UzNSId.MappedIndexes.Add(iX_Panel_UzNSIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Panel_UzNSIdIx).Add(iX_Panel_UzNSId); + panelTable.Indexes.Add("IX_Panel_UzNSId", iX_Panel_UzNSId); + relationalModel.Tables.Add(("Panel", null), panelTable); + var panelTableMapping = new TableMapping(panel, panelTable, true); + panelTable.AddTypeMapping(panelTableMapping, false); + tableMappings90.Add(panelTableMapping); + RelationalModel.CreateColumnMapping(panelIdColumn, panel.FindProperty("PanelId")!, panelTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn16, panel.FindProperty("Aktywny")!, panelTableMapping); + RelationalModel.CreateColumnMapping(centrPanelIdColumn, panel.FindProperty("CentrPanelId")!, panelTableMapping); + RelationalModel.CreateColumnMapping(hColumn, panel.FindProperty("H")!, panelTableMapping); + RelationalModel.CreateColumnMapping(lColumn, panel.FindProperty("L")!, panelTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn28, panel.FindProperty("Nazwa")!, panelTableMapping); + RelationalModel.CreateColumnMapping(param1Column1, panel.FindProperty("Param1")!, panelTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn1, panel.FindProperty("Rodzaj")!, panelTableMapping); + RelationalModel.CreateColumnMapping(tColumn, panel.FindProperty("T")!, panelTableMapping); + RelationalModel.CreateColumnMapping(typAplikacjiColumn, panel.FindProperty("TypAplikacji")!, panelTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn2, panel.FindProperty("UzId")!, panelTableMapping); + RelationalModel.CreateColumnMapping(uzNSIdColumn, panel.FindProperty("UzNSId")!, panelTableMapping); + RelationalModel.CreateColumnMapping(wColumn, panel.FindProperty("W")!, panelTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn19, panel.FindProperty("Zmiana")!, panelTableMapping); + + var panelParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PanelParam")!; + + var defaultTableMappings91 = new List>(); + panelParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings91); + var blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PanelParam", null, relationalModel); + var panelIdColumnBase0 = new ColumnBase("PanelId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase.Columns.Add("PanelId", panelIdColumnBase0); + var parNazwaColumnBase2 = new ColumnBase("ParNazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase.Columns.Add("ParNazwa", parNazwaColumnBase2); + var parWartoscColumnBase2 = new ColumnBase("ParWartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase.Columns.Add("ParWartosc", parWartoscColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PanelParam", blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesPanelParamMappingBase = new TableMappingBase(panelParam, blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPanelParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPanelParamMappingBase, false); + defaultTableMappings91.Add(blinkBackofficeServicesPcmDbEntitiesPanelParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)panelIdColumnBase0, panelParam.FindProperty("PanelId")!, blinkBackofficeServicesPcmDbEntitiesPanelParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase2, panelParam.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesPanelParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parWartoscColumnBase2, panelParam.FindProperty("ParWartosc")!, blinkBackofficeServicesPcmDbEntitiesPanelParamMappingBase); + + var tableMappings91 = new List(); + panelParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings91); + var panelParamTable = new Table("PanelParam", null, relationalModel); + var panelIdColumn0 = new Column("PanelId", "numeric(9,0)", panelParamTable); + panelParamTable.Columns.Add("PanelId", panelIdColumn0); + var parNazwaColumn2 = new Column("ParNazwa", "varchar(40)", panelParamTable); + panelParamTable.Columns.Add("ParNazwa", parNazwaColumn2); + var parWartoscColumn2 = new Column("ParWartosc", "varchar(255)", panelParamTable); + panelParamTable.Columns.Add("ParWartosc", parWartoscColumn2); + var pK_PANELPARAM = new UniqueConstraint("PK_PANELPARAM", panelParamTable, new[] { panelIdColumn0, parNazwaColumn2 }); + panelParamTable.PrimaryKey = pK_PANELPARAM; + var pK_PANELPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PanelParam", + new[] { "PanelId", "ParNazwa" }); + pK_PANELPARAM.MappedKeys.Add(pK_PANELPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PANELPARAMUc).Add(pK_PANELPARAM); + panelParamTable.UniqueConstraints.Add("PK_PANELPARAM", pK_PANELPARAM); + relationalModel.Tables.Add(("PanelParam", null), panelParamTable); + var panelParamTableMapping = new TableMapping(panelParam, panelParamTable, true); + panelParamTable.AddTypeMapping(panelParamTableMapping, false); + tableMappings91.Add(panelParamTableMapping); + RelationalModel.CreateColumnMapping(panelIdColumn0, panelParam.FindProperty("PanelId")!, panelParamTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn2, panelParam.FindProperty("ParNazwa")!, panelParamTableMapping); + RelationalModel.CreateColumnMapping(parWartoscColumn2, panelParam.FindProperty("ParWartosc")!, panelParamTableMapping); + + var parBon = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ParBon")!; + + var defaultTableMappings92 = new List>(); + parBon.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings92); + var blinkBackofficeServicesPcmDbEntitiesParBonTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ParBon", null, relationalModel); + var kolejnoscColumnBase9 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesParBonTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase9); + var kwotaColumnBase3 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesParBonTableBase.Columns.Add("Kwota", kwotaColumnBase3); + var numerColumnBase3 = new ColumnBase("Numer", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesParBonTableBase.Columns.Add("Numer", numerColumnBase3); + var parIdColumnBase1 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesParBonTableBase.Columns.Add("ParId", parIdColumnBase1); + var typColumnBase9 = new ColumnBase("Typ", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesParBonTableBase.Columns.Add("Typ", typColumnBase9); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ParBon", blinkBackofficeServicesPcmDbEntitiesParBonTableBase); + var blinkBackofficeServicesPcmDbEntitiesParBonMappingBase = new TableMappingBase(parBon, blinkBackofficeServicesPcmDbEntitiesParBonTableBase, true); + blinkBackofficeServicesPcmDbEntitiesParBonTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesParBonMappingBase, false); + defaultTableMappings92.Add(blinkBackofficeServicesPcmDbEntitiesParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase9, parBon.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase1, parBon.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase3, parBon.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase3, parBon.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase9, parBon.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesParBonMappingBase); + + var tableMappings92 = new List(); + parBon.SetRuntimeAnnotation("Relational:TableMappings", tableMappings92); + var parBonTable = new Table("ParBon", null, relationalModel); + var parIdColumn1 = new Column("ParId", "numeric(9,0)", parBonTable); + parBonTable.Columns.Add("ParId", parIdColumn1); + var kolejnoscColumn9 = new Column("Kolejnosc", "smallint", parBonTable); + parBonTable.Columns.Add("Kolejnosc", kolejnoscColumn9); + var kwotaColumn3 = new Column("Kwota", "decimal(15,4)", parBonTable); + parBonTable.Columns.Add("Kwota", kwotaColumn3); + var numerColumn3 = new Column("Numer", "varchar(20)", parBonTable); + parBonTable.Columns.Add("Numer", numerColumn3); + var typColumn9 = new Column("Typ", "varchar(10)", parBonTable); + parBonTable.Columns.Add("Typ", typColumn9); + var pK_PARBON = new UniqueConstraint("PK_PARBON", parBonTable, new[] { parIdColumn1, kolejnoscColumn9 }); + parBonTable.PrimaryKey = pK_PARBON; + var pK_PARBONUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParBon", + new[] { "ParId", "Kolejnosc" }); + pK_PARBON.MappedKeys.Add(pK_PARBONUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PARBONUc).Add(pK_PARBON); + parBonTable.UniqueConstraints.Add("PK_PARBON", pK_PARBON); + relationalModel.Tables.Add(("ParBon", null), parBonTable); + var parBonTableMapping = new TableMapping(parBon, parBonTable, true); + parBonTable.AddTypeMapping(parBonTableMapping, false); + tableMappings92.Add(parBonTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn9, parBon.FindProperty("Kolejnosc")!, parBonTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn1, parBon.FindProperty("ParId")!, parBonTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn3, parBon.FindProperty("Kwota")!, parBonTableMapping); + RelationalModel.CreateColumnMapping(numerColumn3, parBon.FindProperty("Numer")!, parBonTableMapping); + RelationalModel.CreateColumnMapping(typColumn9, parBon.FindProperty("Typ")!, parBonTableMapping); + + var parPunkty = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ParPunkty")!; + + var defaultTableMappings93 = new List>(); + parPunkty.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings93); + var blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ParPunkty", null, relationalModel); + var kiedyColumnBase1 = new ColumnBase("Kiedy", "datetime", blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase.Columns.Add("Kiedy", kiedyColumnBase1); + var kwotaColumnBase4 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase.Columns.Add("Kwota", kwotaColumnBase4); + var parIdColumnBase2 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase.Columns.Add("ParId", parIdColumnBase2); + var typColumnBase10 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase.Columns.Add("Typ", typColumnBase10); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ParPunkty", blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase); + var blinkBackofficeServicesPcmDbEntitiesParPunktyMappingBase = new TableMappingBase(parPunkty, blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesParPunktyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesParPunktyMappingBase, false); + defaultTableMappings93.Add(blinkBackofficeServicesPcmDbEntitiesParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase2, parPunkty.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase10, parPunkty.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase1, parPunkty.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase4, parPunkty.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesParPunktyMappingBase); + + var tableMappings93 = new List(); + parPunkty.SetRuntimeAnnotation("Relational:TableMappings", tableMappings93); + var parPunktyTable = new Table("ParPunkty", null, relationalModel); + var parIdColumn2 = new Column("ParId", "numeric(9,0)", parPunktyTable); + parPunktyTable.Columns.Add("ParId", parIdColumn2); + var typColumn10 = new Column("Typ", "smallint", parPunktyTable); + parPunktyTable.Columns.Add("Typ", typColumn10); + var kiedyColumn1 = new Column("Kiedy", "datetime", parPunktyTable); + parPunktyTable.Columns.Add("Kiedy", kiedyColumn1); + var kwotaColumn4 = new Column("Kwota", "decimal(15,4)", parPunktyTable); + parPunktyTable.Columns.Add("Kwota", kwotaColumn4); + var pK_PARPUNKTY = new UniqueConstraint("PK_PARPUNKTY", parPunktyTable, new[] { parIdColumn2, typColumn10 }); + parPunktyTable.PrimaryKey = pK_PARPUNKTY; + var pK_PARPUNKTYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParPunkty", + new[] { "ParId", "Typ" }); + pK_PARPUNKTY.MappedKeys.Add(pK_PARPUNKTYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PARPUNKTYUc).Add(pK_PARPUNKTY); + parPunktyTable.UniqueConstraints.Add("PK_PARPUNKTY", pK_PARPUNKTY); + relationalModel.Tables.Add(("ParPunkty", null), parPunktyTable); + var parPunktyTableMapping = new TableMapping(parPunkty, parPunktyTable, true); + parPunktyTable.AddTypeMapping(parPunktyTableMapping, false); + tableMappings93.Add(parPunktyTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn2, parPunkty.FindProperty("ParId")!, parPunktyTableMapping); + RelationalModel.CreateColumnMapping(typColumn10, parPunkty.FindProperty("Typ")!, parPunktyTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn1, parPunkty.FindProperty("Kiedy")!, parPunktyTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn4, parPunkty.FindProperty("Kwota")!, parPunktyTableMapping); + + var parWaluta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ParWaluta")!; + + var defaultTableMappings94 = new List>(); + parWaluta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings94); + var blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ParWaluta", null, relationalModel); + var kursColumnBase3 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase.Columns.Add("Kurs", kursColumnBase3); + var parIdColumnBase3 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase.Columns.Add("ParId", parIdColumnBase3); + var parKwotaColumnBase = new ColumnBase("ParKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase.Columns.Add("ParKwota", parKwotaColumnBase); + var walIdColumnBase6 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase.Columns.Add("WalId", walIdColumnBase6); + var walKwotaColumnBase0 = new ColumnBase("WalKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase.Columns.Add("WalKwota", walKwotaColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ParWaluta", blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase); + var blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase = new TableMappingBase(parWaluta, blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesParWalutaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase, false); + defaultTableMappings94.Add(blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase3, parWaluta.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase6, parWaluta.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase3, parWaluta.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parKwotaColumnBase, parWaluta.FindProperty("ParKwota")!, blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walKwotaColumnBase0, parWaluta.FindProperty("WalKwota")!, blinkBackofficeServicesPcmDbEntitiesParWalutaMappingBase); + + var tableMappings94 = new List(); + parWaluta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings94); + var parWalutaTable = new Table("ParWaluta", null, relationalModel); + var parIdColumn3 = new Column("ParId", "numeric(9,0)", parWalutaTable); + parWalutaTable.Columns.Add("ParId", parIdColumn3); + var walIdColumn6 = new Column("WalId", "numeric(9,0)", parWalutaTable); + parWalutaTable.Columns.Add("WalId", walIdColumn6); + var kursColumn3 = new Column("Kurs", "decimal(15,4)", parWalutaTable); + parWalutaTable.Columns.Add("Kurs", kursColumn3); + var parKwotaColumn = new Column("ParKwota", "decimal(15,4)", parWalutaTable); + parWalutaTable.Columns.Add("ParKwota", parKwotaColumn); + var walKwotaColumn0 = new Column("WalKwota", "decimal(15,4)", parWalutaTable); + parWalutaTable.Columns.Add("WalKwota", walKwotaColumn0); + var pK_PARWALUTA = new UniqueConstraint("PK_PARWALUTA", parWalutaTable, new[] { parIdColumn3, walIdColumn6 }); + parWalutaTable.PrimaryKey = pK_PARWALUTA; + var pK_PARWALUTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWaluta", + new[] { "ParId", "WalId" }); + pK_PARWALUTA.MappedKeys.Add(pK_PARWALUTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PARWALUTAUc).Add(pK_PARWALUTA); + parWalutaTable.UniqueConstraints.Add("PK_PARWALUTA", pK_PARWALUTA); + var idx_WalPar = new TableIndex( + "idx_WalPar", parWalutaTable, new[] { walIdColumn6 }, false); + var idx_WalParIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWaluta", + "idx_WalPar"); + idx_WalPar.MappedIndexes.Add(idx_WalParIx); + RelationalModel.GetOrCreateTableIndexes(idx_WalParIx).Add(idx_WalPar); + parWalutaTable.Indexes.Add("idx_WalPar", idx_WalPar); + relationalModel.Tables.Add(("ParWaluta", null), parWalutaTable); + var parWalutaTableMapping = new TableMapping(parWaluta, parWalutaTable, true); + parWalutaTable.AddTypeMapping(parWalutaTableMapping, false); + tableMappings94.Add(parWalutaTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn3, parWaluta.FindProperty("ParId")!, parWalutaTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn6, parWaluta.FindProperty("WalId")!, parWalutaTableMapping); + RelationalModel.CreateColumnMapping(kursColumn3, parWaluta.FindProperty("Kurs")!, parWalutaTableMapping); + RelationalModel.CreateColumnMapping(parKwotaColumn, parWaluta.FindProperty("ParKwota")!, parWalutaTableMapping); + RelationalModel.CreateColumnMapping(walKwotaColumn0, parWaluta.FindProperty("WalKwota")!, parWalutaTableMapping); + + var parWartosc = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ParWartosc")!; + + var defaultTableMappings95 = new List>(); + parWartosc.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings95); + var blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ParWartosc", null, relationalModel); + var kolejnoscListyColumnBase = new ColumnBase("KolejnoscListy", "int", blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase.Columns.Add("KolejnoscListy", kolejnoscListyColumnBase); + var parIdColumnBase4 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase.Columns.Add("ParId", parIdColumnBase4); + var tekstColumnBase5 = new ColumnBase("Tekst", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase.Columns.Add("Tekst", tekstColumnBase5); + var wartoscColumnBase1 = new ColumnBase("Wartosc", "int", blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase.Columns.Add("Wartosc", wartoscColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ParWartosc", blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase); + var blinkBackofficeServicesPcmDbEntitiesParWartoscMappingBase = new TableMappingBase(parWartosc, blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase, true); + blinkBackofficeServicesPcmDbEntitiesParWartoscTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesParWartoscMappingBase, false); + defaultTableMappings95.Add(blinkBackofficeServicesPcmDbEntitiesParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase4, parWartosc.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase1, parWartosc.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscListyColumnBase, parWartosc.FindProperty("KolejnoscListy")!, blinkBackofficeServicesPcmDbEntitiesParWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase5, parWartosc.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesParWartoscMappingBase); + + var tableMappings95 = new List(); + parWartosc.SetRuntimeAnnotation("Relational:TableMappings", tableMappings95); + var parWartoscTable = new Table("ParWartosc", null, relationalModel); + var parIdColumn4 = new Column("ParId", "numeric(9,0)", parWartoscTable); + parWartoscTable.Columns.Add("ParId", parIdColumn4); + var wartoscColumn1 = new Column("Wartosc", "int", parWartoscTable); + parWartoscTable.Columns.Add("Wartosc", wartoscColumn1); + var kolejnoscListyColumn = new Column("KolejnoscListy", "int", parWartoscTable); + parWartoscTable.Columns.Add("KolejnoscListy", kolejnoscListyColumn); + var tekstColumn5 = new Column("Tekst", "varchar(40)", parWartoscTable); + parWartoscTable.Columns.Add("Tekst", tekstColumn5); + var pK_PARWARTOSC = new UniqueConstraint("PK_PARWARTOSC", parWartoscTable, new[] { parIdColumn4, wartoscColumn1 }); + parWartoscTable.PrimaryKey = pK_PARWARTOSC; + var pK_PARWARTOSCUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWartosc", + new[] { "ParId", "Wartosc" }); + pK_PARWARTOSC.MappedKeys.Add(pK_PARWARTOSCUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PARWARTOSCUc).Add(pK_PARWARTOSC); + parWartoscTable.UniqueConstraints.Add("PK_PARWARTOSC", pK_PARWARTOSC); + relationalModel.Tables.Add(("ParWartosc", null), parWartoscTable); + var parWartoscTableMapping = new TableMapping(parWartosc, parWartoscTable, true); + parWartoscTable.AddTypeMapping(parWartoscTableMapping, false); + tableMappings95.Add(parWartoscTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn4, parWartosc.FindProperty("ParId")!, parWartoscTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn1, parWartosc.FindProperty("Wartosc")!, parWartoscTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscListyColumn, parWartosc.FindProperty("KolejnoscListy")!, parWartoscTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn5, parWartosc.FindProperty("Tekst")!, parWartoscTableMapping); + + var parWiseBase = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase")!; + + var defaultTableMappings96 = new List>(); + parWiseBase.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings96); + var blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase", null, relationalModel); + var kodGrupyColumnBase = new ColumnBase("KodGrupy", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase.Columns.Add("KodGrupy", kodGrupyColumnBase); + var kolWGrupieColumnBase = new ColumnBase("KolWGrupie", "smallint", blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase.Columns.Add("KolWGrupie", kolWGrupieColumnBase); + var nazwaColumnBase29 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase.Columns.Add("Nazwa", nazwaColumnBase29); + var opcjeColumnBase1 = new ColumnBase("Opcje", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase.Columns.Add("Opcje", opcjeColumnBase1); + var parIdColumnBase5 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase.Columns.Add("ParId", parIdColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase", blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase); + var blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase = new TableMappingBase(parWiseBase, blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase, true); + blinkBackofficeServicesPcmDbEntitiesParWiseBaseTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase, false); + defaultTableMappings96.Add(blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase5, parWiseBase.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodGrupyColumnBase, parWiseBase.FindProperty("KodGrupy")!, blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolWGrupieColumnBase, parWiseBase.FindProperty("KolWGrupie")!, blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase29, parWiseBase.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjeColumnBase1, parWiseBase.FindProperty("Opcje")!, blinkBackofficeServicesPcmDbEntitiesParWiseBaseMappingBase); + + var tableMappings96 = new List(); + parWiseBase.SetRuntimeAnnotation("Relational:TableMappings", tableMappings96); + var parWiseBaseTable = new Table("ParWiseBase", null, relationalModel); + var parIdColumn5 = new Column("ParId", "numeric(9,0)", parWiseBaseTable); + parWiseBaseTable.Columns.Add("ParId", parIdColumn5); + var kodGrupyColumn = new Column("KodGrupy", "varchar(255)", parWiseBaseTable); + parWiseBaseTable.Columns.Add("KodGrupy", kodGrupyColumn); + var kolWGrupieColumn = new Column("KolWGrupie", "smallint", parWiseBaseTable) + { + IsNullable = true + }; + parWiseBaseTable.Columns.Add("KolWGrupie", kolWGrupieColumn); + var nazwaColumn29 = new Column("Nazwa", "varchar(255)", parWiseBaseTable); + parWiseBaseTable.Columns.Add("Nazwa", nazwaColumn29); + var opcjeColumn1 = new Column("Opcje", "varchar(255)", parWiseBaseTable); + parWiseBaseTable.Columns.Add("Opcje", opcjeColumn1); + var pK_ParWiseBase = new UniqueConstraint("PK_ParWiseBase", parWiseBaseTable, new[] { parIdColumn5 }); + parWiseBaseTable.PrimaryKey = pK_ParWiseBase; + var pK_ParWiseBaseUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase", + new[] { "ParId" }); + pK_ParWiseBase.MappedKeys.Add(pK_ParWiseBaseUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ParWiseBaseUc).Add(pK_ParWiseBase); + parWiseBaseTable.UniqueConstraints.Add("PK_ParWiseBase", pK_ParWiseBase); + var idx_ParWB_GrupaINazwa = new TableIndex( + "idx_ParWB_GrupaINazwa", parWiseBaseTable, new[] { kodGrupyColumn, nazwaColumn29 }, false); + var idx_ParWB_GrupaINazwaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase", + "idx_ParWB_GrupaINazwa"); + idx_ParWB_GrupaINazwa.MappedIndexes.Add(idx_ParWB_GrupaINazwaIx); + RelationalModel.GetOrCreateTableIndexes(idx_ParWB_GrupaINazwaIx).Add(idx_ParWB_GrupaINazwa); + parWiseBaseTable.Indexes.Add("idx_ParWB_GrupaINazwa", idx_ParWB_GrupaINazwa); + relationalModel.Tables.Add(("ParWiseBase", null), parWiseBaseTable); + var parWiseBaseTableMapping = new TableMapping(parWiseBase, parWiseBaseTable, true); + parWiseBaseTable.AddTypeMapping(parWiseBaseTableMapping, false); + tableMappings96.Add(parWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn5, parWiseBase.FindProperty("ParId")!, parWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(kodGrupyColumn, parWiseBase.FindProperty("KodGrupy")!, parWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(kolWGrupieColumn, parWiseBase.FindProperty("KolWGrupie")!, parWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn29, parWiseBase.FindProperty("Nazwa")!, parWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(opcjeColumn1, parWiseBase.FindProperty("Opcje")!, parWiseBaseTableMapping); + + var paragon = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Paragon")!; + + var defaultTableMappings97 = new List>(); + paragon.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings97); + var blinkBackofficeServicesPcmDbEntitiesParagonTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Paragon", null, relationalModel); + var aktywnyColumnBase17 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Aktywny", aktywnyColumnBase17); + var bonyColumnBase = new ColumnBase("Bony", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Bony", bonyColumnBase); + var bruttoColumnBase = new ColumnBase("Brutto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Brutto", bruttoColumnBase); + var cechyParColumnBase = new ColumnBase("CechyPar", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("CechyPar", cechyParColumnBase); + var czekColumnBase = new ColumnBase("Czek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Czek", czekColumnBase); + var dataCzasColumnBase0 = new ColumnBase("DataCzas", "datetime", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("DataCzas", dataCzasColumnBase0); + var dodFPlatColumnBase = new ColumnBase("DodFPlat", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("DodFPlat", dodFPlatColumnBase); + var eksportFKColumnBase0 = new ColumnBase("EksportFK", "smallint", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("EksportFK", eksportFKColumnBase0); + var gotowkaColumnBase = new ColumnBase("Gotowka", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Gotowka", gotowkaColumnBase); + var grupyGTUColumnBase = new ColumnBase("GrupyGTU", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("GrupyGTU", grupyGTUColumnBase); + var iloscPozColumnBase = new ColumnBase("IloscPoz", "int", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("IloscPoz", iloscPozColumnBase); + var inneFPlatColumnBase = new ColumnBase("InneFPlat", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("InneFPlat", inneFPlatColumnBase); + var kartaColumnBase = new ColumnBase("Karta", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Karta", kartaColumnBase); + var kasaIdColumnBase5 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("KasaId", kasaIdColumnBase5); + var kasjerColumnBase = new ColumnBase("Kasjer", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Kasjer", kasjerColumnBase); + var kodKartyColumnBase1 = new ColumnBase("KodKarty", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("KodKarty", kodKartyColumnBase1); + var kursColumnBase4 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Kurs", kursColumnBase4); + var nIPColumnBase0 = new ColumnBase("NIP", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("NIP", nIPColumnBase0); + var opakWydColumnBase = new ColumnBase("OpakWyd", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("OpakWyd", opakWydColumnBase); + var opakZwrColumnBase = new ColumnBase("OpakZwr", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("OpakZwr", opakZwrColumnBase); + var parIdColumnBase6 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("ParId", parIdColumnBase6); + var podmiotPowiazanyColumnBase = new ColumnBase("PodmiotPowiazany", "smallint", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("PodmiotPowiazany", podmiotPowiazanyColumnBase); + var przelewColumnBase = new ColumnBase("Przelew", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Przelew", przelewColumnBase); + var rabatColumnBase = new ColumnBase("Rabat", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Rabat", rabatColumnBase); + var typParColumnBase = new ColumnBase("TypPar", "smallint", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("TypPar", typParColumnBase); + var walIdColumnBase7 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("WalId", walIdColumnBase7); + var walutyColumnBase = new ColumnBase("Waluty", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Waluty", walutyColumnBase); + var zmianaColumnBase20 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("Zmiana", zmianaColumnBase20); + var zmianaPktColumnBase0 = new ColumnBase("ZmianaPkt", "datetime", blinkBackofficeServicesPcmDbEntitiesParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.Columns.Add("ZmianaPkt", zmianaPktColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Paragon", blinkBackofficeServicesPcmDbEntitiesParagonTableBase); + var blinkBackofficeServicesPcmDbEntitiesParagonMappingBase = new TableMappingBase(paragon, blinkBackofficeServicesPcmDbEntitiesParagonTableBase, true); + blinkBackofficeServicesPcmDbEntitiesParagonTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesParagonMappingBase, false); + defaultTableMappings97.Add(blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase6, paragon.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase17, paragon.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bonyColumnBase, paragon.FindProperty("Bony")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bruttoColumnBase, paragon.FindProperty("Brutto")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cechyParColumnBase, paragon.FindProperty("CechyPar")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czekColumnBase, paragon.FindProperty("Czek")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasColumnBase0, paragon.FindProperty("DataCzas")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodFPlatColumnBase, paragon.FindProperty("DodFPlat")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)eksportFKColumnBase0, paragon.FindProperty("EksportFK")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)gotowkaColumnBase, paragon.FindProperty("Gotowka")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupyGTUColumnBase, paragon.FindProperty("GrupyGTU")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscPozColumnBase, paragon.FindProperty("IloscPoz")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)inneFPlatColumnBase, paragon.FindProperty("InneFPlat")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kartaColumnBase, paragon.FindProperty("Karta")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase5, paragon.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasjerColumnBase, paragon.FindProperty("Kasjer")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKartyColumnBase1, paragon.FindProperty("KodKarty")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase4, paragon.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nIPColumnBase0, paragon.FindProperty("NIP")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opakWydColumnBase, paragon.FindProperty("OpakWyd")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opakZwrColumnBase, paragon.FindProperty("OpakZwr")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podmiotPowiazanyColumnBase, paragon.FindProperty("PodmiotPowiazany")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przelewColumnBase, paragon.FindProperty("Przelew")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatColumnBase, paragon.FindProperty("Rabat")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typParColumnBase, paragon.FindProperty("TypPar")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase7, paragon.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walutyColumnBase, paragon.FindProperty("Waluty")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase20, paragon.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaPktColumnBase0, paragon.FindProperty("ZmianaPkt")!, blinkBackofficeServicesPcmDbEntitiesParagonMappingBase); + + var tableMappings97 = new List(); + paragon.SetRuntimeAnnotation("Relational:TableMappings", tableMappings97); + var paragonTable = new Table("Paragon", null, relationalModel); + var parIdColumn6 = new Column("ParId", "numeric(9,0)", paragonTable); + paragonTable.Columns.Add("ParId", parIdColumn6); + var aktywnyColumn17 = new Column("Aktywny", "smallint", paragonTable); + paragonTable.Columns.Add("Aktywny", aktywnyColumn17); + var bonyColumn = new Column("Bony", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("Bony", bonyColumn); + var bruttoColumn = new Column("Brutto", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("Brutto", bruttoColumn); + var cechyParColumn = new Column("CechyPar", "varchar(40)", paragonTable); + paragonTable.Columns.Add("CechyPar", cechyParColumn); + var czekColumn = new Column("Czek", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("Czek", czekColumn); + var dataCzasColumn0 = new Column("DataCzas", "datetime", paragonTable); + paragonTable.Columns.Add("DataCzas", dataCzasColumn0); + var dodFPlatColumn = new Column("DodFPlat", "decimal(15,4)", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("DodFPlat", dodFPlatColumn); + var eksportFKColumn0 = new Column("EksportFK", "smallint", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("EksportFK", eksportFKColumn0); + var gotowkaColumn = new Column("Gotowka", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("Gotowka", gotowkaColumn); + var grupyGTUColumn = new Column("GrupyGTU", "varchar(255)", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("GrupyGTU", grupyGTUColumn); + var iloscPozColumn = new Column("IloscPoz", "int", paragonTable); + paragonTable.Columns.Add("IloscPoz", iloscPozColumn); + var inneFPlatColumn = new Column("InneFPlat", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("InneFPlat", inneFPlatColumn); + var kartaColumn = new Column("Karta", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("Karta", kartaColumn); + var kasaIdColumn5 = new Column("KasaId", "numeric(9,0)", paragonTable); + paragonTable.Columns.Add("KasaId", kasaIdColumn5); + var kasjerColumn = new Column("Kasjer", "varchar(40)", paragonTable); + paragonTable.Columns.Add("Kasjer", kasjerColumn); + var kodKartyColumn1 = new Column("KodKarty", "varchar(20)", paragonTable); + paragonTable.Columns.Add("KodKarty", kodKartyColumn1); + var kursColumn4 = new Column("Kurs", "decimal(15,4)", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("Kurs", kursColumn4); + var nIPColumn0 = new Column("NIP", "varchar(40)", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("NIP", nIPColumn0); + var opakWydColumn = new Column("OpakWyd", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("OpakWyd", opakWydColumn); + var opakZwrColumn = new Column("OpakZwr", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("OpakZwr", opakZwrColumn); + var podmiotPowiazanyColumn = new Column("PodmiotPowiazany", "smallint", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("PodmiotPowiazany", podmiotPowiazanyColumn); + var przelewColumn = new Column("Przelew", "decimal(15,4)", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("Przelew", przelewColumn); + var rabatColumn = new Column("Rabat", "decimal(15,4)", paragonTable); + paragonTable.Columns.Add("Rabat", rabatColumn); + var typParColumn = new Column("TypPar", "smallint", paragonTable); + paragonTable.Columns.Add("TypPar", typParColumn); + var walIdColumn7 = new Column("WalId", "numeric(9,0)", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("WalId", walIdColumn7); + var walutyColumn = new Column("Waluty", "decimal(15,4)", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("Waluty", walutyColumn); + var zmianaColumn20 = new Column("Zmiana", "datetime", paragonTable); + paragonTable.Columns.Add("Zmiana", zmianaColumn20); + var zmianaPktColumn0 = new Column("ZmianaPkt", "datetime", paragonTable) + { + IsNullable = true + }; + paragonTable.Columns.Add("ZmianaPkt", zmianaPktColumn0); + var pK_PARAGON = new UniqueConstraint("PK_PARAGON", paragonTable, new[] { parIdColumn6 }); + paragonTable.PrimaryKey = pK_PARAGON; + var pK_PARAGONUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "ParId" }); + pK_PARAGON.MappedKeys.Add(pK_PARAGONUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PARAGONUc).Add(pK_PARAGON); + paragonTable.UniqueConstraints.Add("PK_PARAGON", pK_PARAGON); + var idx_ParDataCzas = new TableIndex( + "idx_ParDataCzas", paragonTable, new[] { dataCzasColumn0 }, false); + var idx_ParDataCzasIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + "idx_ParDataCzas"); + idx_ParDataCzas.MappedIndexes.Add(idx_ParDataCzasIx); + RelationalModel.GetOrCreateTableIndexes(idx_ParDataCzasIx).Add(idx_ParDataCzas); + paragonTable.Indexes.Add("idx_ParDataCzas", idx_ParDataCzas); + var idx_ParKasjer = new TableIndex( + "idx_ParKasjer", paragonTable, new[] { kasjerColumn }, false); + var idx_ParKasjerIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + "idx_ParKasjer"); + idx_ParKasjer.MappedIndexes.Add(idx_ParKasjerIx); + RelationalModel.GetOrCreateTableIndexes(idx_ParKasjerIx).Add(idx_ParKasjer); + paragonTable.Indexes.Add("idx_ParKasjer", idx_ParKasjer); + var idx_ParWal = new TableIndex( + "idx_ParWal", paragonTable, new[] { walIdColumn7 }, false); + var idx_ParWalIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + "idx_ParWal"); + idx_ParWal.MappedIndexes.Add(idx_ParWalIx); + RelationalModel.GetOrCreateTableIndexes(idx_ParWalIx).Add(idx_ParWal); + paragonTable.Indexes.Add("idx_ParWal", idx_ParWal); + var idx_ParZmiana = new TableIndex( + "idx_ParZmiana", paragonTable, new[] { zmianaColumn20 }, false); + var idx_ParZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + "idx_ParZmiana"); + idx_ParZmiana.MappedIndexes.Add(idx_ParZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_ParZmianaIx).Add(idx_ParZmiana); + paragonTable.Indexes.Add("idx_ParZmiana", idx_ParZmiana); + var idx_ParZmianaPkt = new TableIndex( + "idx_ParZmianaPkt", paragonTable, new[] { zmianaPktColumn0 }, false); + var idx_ParZmianaPktIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + "idx_ParZmianaPkt"); + idx_ParZmianaPkt.MappedIndexes.Add(idx_ParZmianaPktIx); + RelationalModel.GetOrCreateTableIndexes(idx_ParZmianaPktIx).Add(idx_ParZmianaPkt); + paragonTable.Indexes.Add("idx_ParZmianaPkt", idx_ParZmianaPkt); + var iX_Paragon_KasaId = new TableIndex( + "IX_Paragon_KasaId", paragonTable, new[] { kasaIdColumn5 }, false); + var iX_Paragon_KasaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "KasaId" }); + iX_Paragon_KasaId.MappedIndexes.Add(iX_Paragon_KasaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Paragon_KasaIdIx).Add(iX_Paragon_KasaId); + paragonTable.Indexes.Add("IX_Paragon_KasaId", iX_Paragon_KasaId); + relationalModel.Tables.Add(("Paragon", null), paragonTable); + var paragonTableMapping = new TableMapping(paragon, paragonTable, true); + paragonTable.AddTypeMapping(paragonTableMapping, false); + tableMappings97.Add(paragonTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn6, paragon.FindProperty("ParId")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn17, paragon.FindProperty("Aktywny")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(bonyColumn, paragon.FindProperty("Bony")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(bruttoColumn, paragon.FindProperty("Brutto")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(cechyParColumn, paragon.FindProperty("CechyPar")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(czekColumn, paragon.FindProperty("Czek")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(dataCzasColumn0, paragon.FindProperty("DataCzas")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(dodFPlatColumn, paragon.FindProperty("DodFPlat")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(eksportFKColumn0, paragon.FindProperty("EksportFK")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(gotowkaColumn, paragon.FindProperty("Gotowka")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(grupyGTUColumn, paragon.FindProperty("GrupyGTU")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(iloscPozColumn, paragon.FindProperty("IloscPoz")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(inneFPlatColumn, paragon.FindProperty("InneFPlat")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(kartaColumn, paragon.FindProperty("Karta")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn5, paragon.FindProperty("KasaId")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(kasjerColumn, paragon.FindProperty("Kasjer")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(kodKartyColumn1, paragon.FindProperty("KodKarty")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(kursColumn4, paragon.FindProperty("Kurs")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(nIPColumn0, paragon.FindProperty("NIP")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(opakWydColumn, paragon.FindProperty("OpakWyd")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(opakZwrColumn, paragon.FindProperty("OpakZwr")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(podmiotPowiazanyColumn, paragon.FindProperty("PodmiotPowiazany")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(przelewColumn, paragon.FindProperty("Przelew")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(rabatColumn, paragon.FindProperty("Rabat")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(typParColumn, paragon.FindProperty("TypPar")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn7, paragon.FindProperty("WalId")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(walutyColumn, paragon.FindProperty("Waluty")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn20, paragon.FindProperty("Zmiana")!, paragonTableMapping); + RelationalModel.CreateColumnMapping(zmianaPktColumn0, paragon.FindProperty("ZmianaPkt")!, paragonTableMapping); + + var parametr = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Parametr")!; + + var defaultTableMappings98 = new List>(); + parametr.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings98); + var blinkBackofficeServicesPcmDbEntitiesParametrTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Parametr", null, relationalModel); + var centrParIdColumnBase = new ColumnBase("CentrParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParametrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesParametrTableBase.Columns.Add("CentrParId", centrParIdColumnBase); + var nazwaColumnBase30 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesParametrTableBase); + blinkBackofficeServicesPcmDbEntitiesParametrTableBase.Columns.Add("Nazwa", nazwaColumnBase30); + var parIdColumnBase7 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesParametrTableBase); + blinkBackofficeServicesPcmDbEntitiesParametrTableBase.Columns.Add("ParId", parIdColumnBase7); + var typParColumnBase0 = new ColumnBase("TypPar", "smallint", blinkBackofficeServicesPcmDbEntitiesParametrTableBase); + blinkBackofficeServicesPcmDbEntitiesParametrTableBase.Columns.Add("TypPar", typParColumnBase0); + var wartMaxColumnBase = new ColumnBase("WartMax", "int", blinkBackofficeServicesPcmDbEntitiesParametrTableBase); + blinkBackofficeServicesPcmDbEntitiesParametrTableBase.Columns.Add("WartMax", wartMaxColumnBase); + var wartMinColumnBase = new ColumnBase("WartMin", "int", blinkBackofficeServicesPcmDbEntitiesParametrTableBase); + blinkBackofficeServicesPcmDbEntitiesParametrTableBase.Columns.Add("WartMin", wartMinColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Parametr", blinkBackofficeServicesPcmDbEntitiesParametrTableBase); + var blinkBackofficeServicesPcmDbEntitiesParametrMappingBase = new TableMappingBase(parametr, blinkBackofficeServicesPcmDbEntitiesParametrTableBase, true); + blinkBackofficeServicesPcmDbEntitiesParametrTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesParametrMappingBase, false); + defaultTableMappings98.Add(blinkBackofficeServicesPcmDbEntitiesParametrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase7, parametr.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesParametrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrParIdColumnBase, parametr.FindProperty("CentrParId")!, blinkBackofficeServicesPcmDbEntitiesParametrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase30, parametr.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesParametrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typParColumnBase0, parametr.FindProperty("TypPar")!, blinkBackofficeServicesPcmDbEntitiesParametrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartMaxColumnBase, parametr.FindProperty("WartMax")!, blinkBackofficeServicesPcmDbEntitiesParametrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartMinColumnBase, parametr.FindProperty("WartMin")!, blinkBackofficeServicesPcmDbEntitiesParametrMappingBase); + + var tableMappings98 = new List(); + parametr.SetRuntimeAnnotation("Relational:TableMappings", tableMappings98); + var parametrTable = new Table("Parametr", null, relationalModel); + var parIdColumn7 = new Column("ParId", "numeric(9,0)", parametrTable); + parametrTable.Columns.Add("ParId", parIdColumn7); + var centrParIdColumn = new Column("CentrParId", "numeric(9,0)", parametrTable) + { + IsNullable = true + }; + parametrTable.Columns.Add("CentrParId", centrParIdColumn); + var nazwaColumn30 = new Column("Nazwa", "varchar(255)", parametrTable); + parametrTable.Columns.Add("Nazwa", nazwaColumn30); + var typParColumn0 = new Column("TypPar", "smallint", parametrTable); + parametrTable.Columns.Add("TypPar", typParColumn0); + var wartMaxColumn = new Column("WartMax", "int", parametrTable); + parametrTable.Columns.Add("WartMax", wartMaxColumn); + var wartMinColumn = new Column("WartMin", "int", parametrTable); + parametrTable.Columns.Add("WartMin", wartMinColumn); + var pK_PARAMETR = new UniqueConstraint("PK_PARAMETR", parametrTable, new[] { parIdColumn7 }); + parametrTable.PrimaryKey = pK_PARAMETR; + var pK_PARAMETRUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Parametr", + new[] { "ParId" }); + pK_PARAMETR.MappedKeys.Add(pK_PARAMETRUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PARAMETRUc).Add(pK_PARAMETR); + parametrTable.UniqueConstraints.Add("PK_PARAMETR", pK_PARAMETR); + var idx_CentrParId = new TableIndex( + "idx_CentrParId", parametrTable, new[] { centrParIdColumn }, false); + var idx_CentrParIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Parametr", + "idx_CentrParId"); + idx_CentrParId.MappedIndexes.Add(idx_CentrParIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrParIdIx).Add(idx_CentrParId); + parametrTable.Indexes.Add("idx_CentrParId", idx_CentrParId); + relationalModel.Tables.Add(("Parametr", null), parametrTable); + var parametrTableMapping = new TableMapping(parametr, parametrTable, true); + parametrTable.AddTypeMapping(parametrTableMapping, false); + tableMappings98.Add(parametrTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn7, parametr.FindProperty("ParId")!, parametrTableMapping); + RelationalModel.CreateColumnMapping(centrParIdColumn, parametr.FindProperty("CentrParId")!, parametrTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn30, parametr.FindProperty("Nazwa")!, parametrTableMapping); + RelationalModel.CreateColumnMapping(typParColumn0, parametr.FindProperty("TypPar")!, parametrTableMapping); + RelationalModel.CreateColumnMapping(wartMaxColumn, parametr.FindProperty("WartMax")!, parametrTableMapping); + RelationalModel.CreateColumnMapping(wartMinColumn, parametr.FindProperty("WartMin")!, parametrTableMapping); + + var partia = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Partia")!; + + var defaultTableMappings99 = new List>(); + partia.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings99); + var blinkBackofficeServicesPcmDbEntitiesPartiaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Partia", null, relationalModel); + var cecha1ColumnBase = new ColumnBase("Cecha1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("Cecha1", cecha1ColumnBase); + var cecha2ColumnBase = new ColumnBase("Cecha2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("Cecha2", cecha2ColumnBase); + var dataWaznColumnBase = new ColumnBase("DataWazn", "datetime", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("DataWazn", dataWaznColumnBase); + var dokIdColumnBase8 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("DokId", dokIdColumnBase8); + var kolejnoscColumnBase10 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase10); + var pozostaloColumnBase = new ColumnBase("Pozostalo", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("Pozostalo", pozostaloColumnBase); + var towIdColumnBase10 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("TowId", towIdColumnBase10); + var typPartiiColumnBase = new ColumnBase("TypPartii", "smallint", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.Columns.Add("TypPartii", typPartiiColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Partia", blinkBackofficeServicesPcmDbEntitiesPartiaTableBase); + var blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase = new TableMappingBase(partia, blinkBackofficeServicesPcmDbEntitiesPartiaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPartiaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase, false); + defaultTableMappings99.Add(blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase8, partia.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase10, partia.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cecha1ColumnBase, partia.FindProperty("Cecha1")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cecha2ColumnBase, partia.FindProperty("Cecha2")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataWaznColumnBase, partia.FindProperty("DataWazn")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pozostaloColumnBase, partia.FindProperty("Pozostalo")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase10, partia.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typPartiiColumnBase, partia.FindProperty("TypPartii")!, blinkBackofficeServicesPcmDbEntitiesPartiaMappingBase); + + var tableMappings99 = new List(); + partia.SetRuntimeAnnotation("Relational:TableMappings", tableMappings99); + var partiaTable = new Table("Partia", null, relationalModel); + var dokIdColumn8 = new Column("DokId", "numeric(9,0)", partiaTable); + partiaTable.Columns.Add("DokId", dokIdColumn8); + var kolejnoscColumn10 = new Column("Kolejnosc", "int", partiaTable); + partiaTable.Columns.Add("Kolejnosc", kolejnoscColumn10); + var cecha1Column = new Column("Cecha1", "varchar(40)", partiaTable) + { + IsNullable = true + }; + partiaTable.Columns.Add("Cecha1", cecha1Column); + var cecha2Column = new Column("Cecha2", "varchar(40)", partiaTable) + { + IsNullable = true + }; + partiaTable.Columns.Add("Cecha2", cecha2Column); + var dataWaznColumn = new Column("DataWazn", "datetime", partiaTable) + { + IsNullable = true + }; + partiaTable.Columns.Add("DataWazn", dataWaznColumn); + var pozostaloColumn = new Column("Pozostalo", "decimal(15,4)", partiaTable); + partiaTable.Columns.Add("Pozostalo", pozostaloColumn); + var towIdColumn10 = new Column("TowId", "numeric(9,0)", partiaTable); + partiaTable.Columns.Add("TowId", towIdColumn10); + var typPartiiColumn = new Column("TypPartii", "smallint", partiaTable); + partiaTable.Columns.Add("TypPartii", typPartiiColumn); + var pK_PARTIA = new UniqueConstraint("PK_PARTIA", partiaTable, new[] { dokIdColumn8, kolejnoscColumn10 }); + partiaTable.PrimaryKey = pK_PARTIA; + var pK_PARTIAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Partia", + new[] { "DokId", "Kolejnosc" }); + pK_PARTIA.MappedKeys.Add(pK_PARTIAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PARTIAUc).Add(pK_PARTIA); + partiaTable.UniqueConstraints.Add("PK_PARTIA", pK_PARTIA); + var idx_PrtTypTowIle = new TableIndex( + "idx_PrtTypTowIle", partiaTable, new[] { typPartiiColumn, towIdColumn10, pozostaloColumn }, false); + var idx_PrtTypTowIleIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Partia", + "idx_PrtTypTowIle"); + idx_PrtTypTowIle.MappedIndexes.Add(idx_PrtTypTowIleIx); + RelationalModel.GetOrCreateTableIndexes(idx_PrtTypTowIleIx).Add(idx_PrtTypTowIle); + partiaTable.Indexes.Add("idx_PrtTypTowIle", idx_PrtTypTowIle); + var iX_Partia_TowId = new TableIndex( + "IX_Partia_TowId", partiaTable, new[] { towIdColumn10 }, false); + var iX_Partia_TowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Partia", + new[] { "TowId" }); + iX_Partia_TowId.MappedIndexes.Add(iX_Partia_TowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Partia_TowIdIx).Add(iX_Partia_TowId); + partiaTable.Indexes.Add("IX_Partia_TowId", iX_Partia_TowId); + relationalModel.Tables.Add(("Partia", null), partiaTable); + var partiaTableMapping = new TableMapping(partia, partiaTable, true); + partiaTable.AddTypeMapping(partiaTableMapping, false); + tableMappings99.Add(partiaTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn8, partia.FindProperty("DokId")!, partiaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn10, partia.FindProperty("Kolejnosc")!, partiaTableMapping); + RelationalModel.CreateColumnMapping(cecha1Column, partia.FindProperty("Cecha1")!, partiaTableMapping); + RelationalModel.CreateColumnMapping(cecha2Column, partia.FindProperty("Cecha2")!, partiaTableMapping); + RelationalModel.CreateColumnMapping(dataWaznColumn, partia.FindProperty("DataWazn")!, partiaTableMapping); + RelationalModel.CreateColumnMapping(pozostaloColumn, partia.FindProperty("Pozostalo")!, partiaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn10, partia.FindProperty("TowId")!, partiaTableMapping); + RelationalModel.CreateColumnMapping(typPartiiColumn, partia.FindProperty("TypPartii")!, partiaTableMapping); + + var pcfUser = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcfUser")!; + + var defaultTableMappings100 = new List>(); + pcfUser.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings100); + var blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcfUser", null, relationalModel); + var accessProfileColumnBase = new ColumnBase("AccessProfile", "int", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("AccessProfile", accessProfileColumnBase); + var activeColumnBase = new ColumnBase("Active", "smallint", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("Active", activeColumnBase); + var blockedColumnBase = new ColumnBase("Blocked", "smallint", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("Blocked", blockedColumnBase); + var eMailColumnBase0 = new ColumnBase("EMail", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("EMail", eMailColumnBase0); + var firstNameColumnBase = new ColumnBase("FirstName", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("FirstName", firstNameColumnBase); + var flagsColumnBase = new ColumnBase("Flags", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("Flags", flagsColumnBase); + var identColumnBase = new ColumnBase("Ident", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("Ident", identColumnBase); + var lastNameColumnBase = new ColumnBase("LastName", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("LastName", lastNameColumnBase); + var passwordHashColumnBase = new ColumnBase("PasswordHash", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("PasswordHash", passwordHashColumnBase); + var pcfCustomerIdColumnBase = new ColumnBase("PcfCustomerId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("PcfCustomerId", pcfCustomerIdColumnBase); + var pcfLoyaltyCustomerIdColumnBase = new ColumnBase("PcfLoyaltyCustomerId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("PcfLoyaltyCustomerId", pcfLoyaltyCustomerIdColumnBase); + var pcfPStationIdColumnBase = new ColumnBase("PcfPStationId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("PcfPStationId", pcfPStationIdColumnBase); + var pcfUserIdColumnBase = new ColumnBase("PcfUserId", "int", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("PcfUserId", pcfUserIdColumnBase); + var validFromColumnBase = new ColumnBase("ValidFrom", "datetime", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("ValidFrom", validFromColumnBase); + var validToColumnBase = new ColumnBase("ValidTo", "datetime", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.Columns.Add("ValidTo", validToColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcfUser", blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase = new TableMappingBase(pcfUser, blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcfUserTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase, false); + defaultTableMappings100.Add(blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcfUserIdColumnBase, pcfUser.FindProperty("PcfUserId")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)accessProfileColumnBase, pcfUser.FindProperty("AccessProfile")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)activeColumnBase, pcfUser.FindProperty("Active")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blockedColumnBase, pcfUser.FindProperty("Blocked")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)eMailColumnBase0, pcfUser.FindProperty("EMail")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)firstNameColumnBase, pcfUser.FindProperty("FirstName")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)flagsColumnBase, pcfUser.FindProperty("Flags")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)identColumnBase, pcfUser.FindProperty("Ident")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lastNameColumnBase, pcfUser.FindProperty("LastName")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)passwordHashColumnBase, pcfUser.FindProperty("PasswordHash")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcfCustomerIdColumnBase, pcfUser.FindProperty("PcfCustomerId")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcfLoyaltyCustomerIdColumnBase, pcfUser.FindProperty("PcfLoyaltyCustomerId")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcfPStationIdColumnBase, pcfUser.FindProperty("PcfPStationId")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)validFromColumnBase, pcfUser.FindProperty("ValidFrom")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)validToColumnBase, pcfUser.FindProperty("ValidTo")!, blinkBackofficeServicesPcmDbEntitiesPcfUserMappingBase); + + var tableMappings100 = new List(); + pcfUser.SetRuntimeAnnotation("Relational:TableMappings", tableMappings100); + var pcfUserTable = new Table("PcfUser", null, relationalModel); + var pcfUserIdColumn = new Column("PcfUserId", "int", pcfUserTable); + pcfUserTable.Columns.Add("PcfUserId", pcfUserIdColumn); + var accessProfileColumn = new Column("AccessProfile", "int", pcfUserTable); + pcfUserTable.Columns.Add("AccessProfile", accessProfileColumn); + var activeColumn = new Column("Active", "smallint", pcfUserTable); + pcfUserTable.Columns.Add("Active", activeColumn); + var blockedColumn = new Column("Blocked", "smallint", pcfUserTable); + pcfUserTable.Columns.Add("Blocked", blockedColumn); + var eMailColumn0 = new Column("EMail", "varchar(64)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("EMail", eMailColumn0); + var firstNameColumn = new Column("FirstName", "varchar(32)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("FirstName", firstNameColumn); + var flagsColumn = new Column("Flags", "varchar(64)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("Flags", flagsColumn); + var identColumn = new Column("Ident", "varchar(32)", pcfUserTable); + pcfUserTable.Columns.Add("Ident", identColumn); + var lastNameColumn = new Column("LastName", "varchar(64)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("LastName", lastNameColumn); + var passwordHashColumn = new Column("PasswordHash", "varchar(32)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("PasswordHash", passwordHashColumn); + var pcfCustomerIdColumn = new Column("PcfCustomerId", "numeric(9,0)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("PcfCustomerId", pcfCustomerIdColumn); + var pcfLoyaltyCustomerIdColumn = new Column("PcfLoyaltyCustomerId", "numeric(9,0)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("PcfLoyaltyCustomerId", pcfLoyaltyCustomerIdColumn); + var pcfPStationIdColumn = new Column("PcfPStationId", "numeric(9,0)", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("PcfPStationId", pcfPStationIdColumn); + var validFromColumn = new Column("ValidFrom", "datetime", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("ValidFrom", validFromColumn); + var validToColumn = new Column("ValidTo", "datetime", pcfUserTable) + { + IsNullable = true + }; + pcfUserTable.Columns.Add("ValidTo", validToColumn); + var pK_PCFUSER = new UniqueConstraint("PK_PCFUSER", pcfUserTable, new[] { pcfUserIdColumn }); + pcfUserTable.PrimaryKey = pK_PCFUSER; + var pK_PCFUSERUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfUserId" }); + pK_PCFUSER.MappedKeys.Add(pK_PCFUSERUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PCFUSERUc).Add(pK_PCFUSER); + pcfUserTable.UniqueConstraints.Add("PK_PCFUSER", pK_PCFUSER); + var iX_PcfUser_PcfCustomerId = new TableIndex( + "IX_PcfUser_PcfCustomerId", pcfUserTable, new[] { pcfCustomerIdColumn }, false); + var iX_PcfUser_PcfCustomerIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfCustomerId" }); + iX_PcfUser_PcfCustomerId.MappedIndexes.Add(iX_PcfUser_PcfCustomerIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PcfUser_PcfCustomerIdIx).Add(iX_PcfUser_PcfCustomerId); + pcfUserTable.Indexes.Add("IX_PcfUser_PcfCustomerId", iX_PcfUser_PcfCustomerId); + var iX_PcfUser_PcfLoyaltyCustomerId = new TableIndex( + "IX_PcfUser_PcfLoyaltyCustomerId", pcfUserTable, new[] { pcfLoyaltyCustomerIdColumn }, false); + var iX_PcfUser_PcfLoyaltyCustomerIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfLoyaltyCustomerId" }); + iX_PcfUser_PcfLoyaltyCustomerId.MappedIndexes.Add(iX_PcfUser_PcfLoyaltyCustomerIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PcfUser_PcfLoyaltyCustomerIdIx).Add(iX_PcfUser_PcfLoyaltyCustomerId); + pcfUserTable.Indexes.Add("IX_PcfUser_PcfLoyaltyCustomerId", iX_PcfUser_PcfLoyaltyCustomerId); + var iX_PcfUser_PcfPStationId = new TableIndex( + "IX_PcfUser_PcfPStationId", pcfUserTable, new[] { pcfPStationIdColumn }, false); + var iX_PcfUser_PcfPStationIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfPStationId" }); + iX_PcfUser_PcfPStationId.MappedIndexes.Add(iX_PcfUser_PcfPStationIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PcfUser_PcfPStationIdIx).Add(iX_PcfUser_PcfPStationId); + pcfUserTable.Indexes.Add("IX_PcfUser_PcfPStationId", iX_PcfUser_PcfPStationId); + var ixIdent = new TableIndex( + "IxIdent", pcfUserTable, new[] { identColumn }, false); + var ixIdentIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + "IxIdent"); + ixIdent.MappedIndexes.Add(ixIdentIx); + RelationalModel.GetOrCreateTableIndexes(ixIdentIx).Add(ixIdent); + pcfUserTable.Indexes.Add("IxIdent", ixIdent); + relationalModel.Tables.Add(("PcfUser", null), pcfUserTable); + var pcfUserTableMapping = new TableMapping(pcfUser, pcfUserTable, true); + pcfUserTable.AddTypeMapping(pcfUserTableMapping, false); + tableMappings100.Add(pcfUserTableMapping); + RelationalModel.CreateColumnMapping(pcfUserIdColumn, pcfUser.FindProperty("PcfUserId")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(accessProfileColumn, pcfUser.FindProperty("AccessProfile")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(activeColumn, pcfUser.FindProperty("Active")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(blockedColumn, pcfUser.FindProperty("Blocked")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(eMailColumn0, pcfUser.FindProperty("EMail")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(firstNameColumn, pcfUser.FindProperty("FirstName")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(flagsColumn, pcfUser.FindProperty("Flags")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(identColumn, pcfUser.FindProperty("Ident")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(lastNameColumn, pcfUser.FindProperty("LastName")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(passwordHashColumn, pcfUser.FindProperty("PasswordHash")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(pcfCustomerIdColumn, pcfUser.FindProperty("PcfCustomerId")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(pcfLoyaltyCustomerIdColumn, pcfUser.FindProperty("PcfLoyaltyCustomerId")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(pcfPStationIdColumn, pcfUser.FindProperty("PcfPStationId")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(validFromColumn, pcfUser.FindProperty("ValidFrom")!, pcfUserTableMapping); + RelationalModel.CreateColumnMapping(validToColumn, pcfUser.FindProperty("ValidTo")!, pcfUserTableMapping); + + var pcfUserSklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep")!; + + var defaultTableMappings101 = new List>(); + pcfUserSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings101); + var blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep", null, relationalModel); + var parametrColumnBase = new ColumnBase("Parametr", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase.Columns.Add("Parametr", parametrColumnBase); + var pcfUserIdColumnBase0 = new ColumnBase("PcfUserId", "int", blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase.Columns.Add("PcfUserId", pcfUserIdColumnBase0); + var sklepIdColumnBase = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase.Columns.Add("SklepId", sklepIdColumnBase); + var znaczenieColumnBase7 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase.Columns.Add("Znaczenie", znaczenieColumnBase7); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep", blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcfUserSklepMappingBase = new TableMappingBase(pcfUserSklep, blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcfUserSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcfUserSklepMappingBase, false); + defaultTableMappings101.Add(blinkBackofficeServicesPcmDbEntitiesPcfUserSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcfUserIdColumnBase0, pcfUserSklep.FindProperty("PcfUserId")!, blinkBackofficeServicesPcmDbEntitiesPcfUserSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase, pcfUserSklep.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesPcfUserSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase7, pcfUserSklep.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesPcfUserSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parametrColumnBase, pcfUserSklep.FindProperty("Parametr")!, blinkBackofficeServicesPcmDbEntitiesPcfUserSklepMappingBase); + + var tableMappings101 = new List(); + pcfUserSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings101); + var pcfUserSklepTable = new Table("PcfUserSklep", null, relationalModel); + var pcfUserIdColumn0 = new Column("PcfUserId", "int", pcfUserSklepTable); + pcfUserSklepTable.Columns.Add("PcfUserId", pcfUserIdColumn0); + var sklepIdColumn = new Column("SklepId", "numeric(9,0)", pcfUserSklepTable); + pcfUserSklepTable.Columns.Add("SklepId", sklepIdColumn); + var znaczenieColumn7 = new Column("Znaczenie", "smallint", pcfUserSklepTable); + pcfUserSklepTable.Columns.Add("Znaczenie", znaczenieColumn7); + var parametrColumn = new Column("Parametr", "varchar(255)", pcfUserSklepTable) + { + IsNullable = true + }; + pcfUserSklepTable.Columns.Add("Parametr", parametrColumn); + var pK_PcfUserSklepZnaczenie = new UniqueConstraint("PK_PcfUserSklepZnaczenie", pcfUserSklepTable, new[] { pcfUserIdColumn0, sklepIdColumn, znaczenieColumn7 }); + pcfUserSklepTable.PrimaryKey = pK_PcfUserSklepZnaczenie; + var pK_PcfUserSklepZnaczenieUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep", + new[] { "PcfUserId", "SklepId", "Znaczenie" }); + pK_PcfUserSklepZnaczenie.MappedKeys.Add(pK_PcfUserSklepZnaczenieUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PcfUserSklepZnaczenieUc).Add(pK_PcfUserSklepZnaczenie); + pcfUserSklepTable.UniqueConstraints.Add("PK_PcfUserSklepZnaczenie", pK_PcfUserSklepZnaczenie); + var iX_PcfUserSklep_SklepId = new TableIndex( + "IX_PcfUserSklep_SklepId", pcfUserSklepTable, new[] { sklepIdColumn }, false); + var iX_PcfUserSklep_SklepIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep", + new[] { "SklepId" }); + iX_PcfUserSklep_SklepId.MappedIndexes.Add(iX_PcfUserSklep_SklepIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PcfUserSklep_SklepIdIx).Add(iX_PcfUserSklep_SklepId); + pcfUserSklepTable.Indexes.Add("IX_PcfUserSklep_SklepId", iX_PcfUserSklep_SklepId); + relationalModel.Tables.Add(("PcfUserSklep", null), pcfUserSklepTable); + var pcfUserSklepTableMapping = new TableMapping(pcfUserSklep, pcfUserSklepTable, true); + pcfUserSklepTable.AddTypeMapping(pcfUserSklepTableMapping, false); + tableMappings101.Add(pcfUserSklepTableMapping); + RelationalModel.CreateColumnMapping(pcfUserIdColumn0, pcfUserSklep.FindProperty("PcfUserId")!, pcfUserSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn, pcfUserSklep.FindProperty("SklepId")!, pcfUserSklepTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn7, pcfUserSklep.FindProperty("Znaczenie")!, pcfUserSklepTableMapping); + RelationalModel.CreateColumnMapping(parametrColumn, pcfUserSklep.FindProperty("Parametr")!, pcfUserSklepTableMapping); + + var pcpPos = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcpPos")!; + + var defaultTableMappings102 = new List>(); + pcpPos.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings102); + var blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcpPos", null, relationalModel); + var activeColumnBase0 = new ColumnBase("Active", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("Active", activeColumnBase0); + var createdColumnBase = new ColumnBase("Created", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("Created", createdColumnBase); + var fiscalUniqueNoDflColumnBase = new ColumnBase("FiscalUniqueNoDfl", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("FiscalUniqueNoDfl", fiscalUniqueNoDflColumnBase); + var pcpPosIdColumnBase = new ColumnBase("PcpPosId", "int", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("PcpPosId", pcpPosIdColumnBase); + var pcpShopIdColumnBase = new ColumnBase("PcpShopId", "int", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("PcpShopId", pcpShopIdColumnBase); + var posCodeColumnBase = new ColumnBase("PosCode", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("PosCode", posCodeColumnBase); + var posNameColumnBase = new ColumnBase("PosName", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("PosName", posNameColumnBase); + var posNoColumnBase = new ColumnBase("PosNo", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("PosNo", posNoColumnBase); + var updatedColumnBase = new ColumnBase("Updated", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.Columns.Add("Updated", updatedColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcpPos", blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase = new TableMappingBase(pcpPos, blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcpPosTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase, false); + defaultTableMappings102.Add(blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpPosIdColumnBase, pcpPos.FindProperty("PcpPosId")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)activeColumnBase0, pcpPos.FindProperty("Active")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)createdColumnBase, pcpPos.FindProperty("Created")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)fiscalUniqueNoDflColumnBase, pcpPos.FindProperty("FiscalUniqueNoDfl")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpShopIdColumnBase, pcpPos.FindProperty("PcpShopId")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posCodeColumnBase, pcpPos.FindProperty("PosCode")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posNameColumnBase, pcpPos.FindProperty("PosName")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posNoColumnBase, pcpPos.FindProperty("PosNo")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)updatedColumnBase, pcpPos.FindProperty("Updated")!, blinkBackofficeServicesPcmDbEntitiesPcpPosMappingBase); + + var tableMappings102 = new List(); + pcpPos.SetRuntimeAnnotation("Relational:TableMappings", tableMappings102); + var pcpPosTable = new Table("PcpPos", null, relationalModel); + var pcpPosIdColumn = new Column("PcpPosId", "int", pcpPosTable); + pcpPosTable.Columns.Add("PcpPosId", pcpPosIdColumn); + var activeColumn0 = new Column("Active", "smallint", pcpPosTable); + pcpPosTable.Columns.Add("Active", activeColumn0); + var createdColumn = new Column("Created", "datetime", pcpPosTable); + pcpPosTable.Columns.Add("Created", createdColumn); + var fiscalUniqueNoDflColumn = new Column("FiscalUniqueNoDfl", "varchar(64)", pcpPosTable) + { + IsNullable = true + }; + pcpPosTable.Columns.Add("FiscalUniqueNoDfl", fiscalUniqueNoDflColumn); + var pcpShopIdColumn = new Column("PcpShopId", "int", pcpPosTable); + pcpPosTable.Columns.Add("PcpShopId", pcpShopIdColumn); + var posCodeColumn = new Column("PosCode", "varchar(64)", pcpPosTable) + { + IsNullable = true + }; + pcpPosTable.Columns.Add("PosCode", posCodeColumn); + var posNameColumn = new Column("PosName", "varchar(64)", pcpPosTable) + { + IsNullable = true + }; + pcpPosTable.Columns.Add("PosName", posNameColumn); + var posNoColumn = new Column("PosNo", "smallint", pcpPosTable); + pcpPosTable.Columns.Add("PosNo", posNoColumn); + var updatedColumn = new Column("Updated", "datetime", pcpPosTable); + pcpPosTable.Columns.Add("Updated", updatedColumn); + var pK_PcpPos = new UniqueConstraint("PK_PcpPos", pcpPosTable, new[] { pcpPosIdColumn }); + pcpPosTable.PrimaryKey = pK_PcpPos; + var pK_PcpPosUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpPos", + new[] { "PcpPosId" }); + pK_PcpPos.MappedKeys.Add(pK_PcpPosUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PcpPosUc).Add(pK_PcpPos); + pcpPosTable.UniqueConstraints.Add("PK_PcpPos", pK_PcpPos); + var ixPcpPosPcpShopId = new TableIndex( + "IxPcpPosPcpShopId", pcpPosTable, new[] { pcpShopIdColumn }, false); + var ixPcpPosPcpShopIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpPos", + "IxPcpPosPcpShopId"); + ixPcpPosPcpShopId.MappedIndexes.Add(ixPcpPosPcpShopIdIx); + RelationalModel.GetOrCreateTableIndexes(ixPcpPosPcpShopIdIx).Add(ixPcpPosPcpShopId); + pcpPosTable.Indexes.Add("IxPcpPosPcpShopId", ixPcpPosPcpShopId); + relationalModel.Tables.Add(("PcpPos", null), pcpPosTable); + var pcpPosTableMapping = new TableMapping(pcpPos, pcpPosTable, true); + pcpPosTable.AddTypeMapping(pcpPosTableMapping, false); + tableMappings102.Add(pcpPosTableMapping); + RelationalModel.CreateColumnMapping(pcpPosIdColumn, pcpPos.FindProperty("PcpPosId")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(activeColumn0, pcpPos.FindProperty("Active")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(createdColumn, pcpPos.FindProperty("Created")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(fiscalUniqueNoDflColumn, pcpPos.FindProperty("FiscalUniqueNoDfl")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(pcpShopIdColumn, pcpPos.FindProperty("PcpShopId")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(posCodeColumn, pcpPos.FindProperty("PosCode")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(posNameColumn, pcpPos.FindProperty("PosName")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(posNoColumn, pcpPos.FindProperty("PosNo")!, pcpPosTableMapping); + RelationalModel.CreateColumnMapping(updatedColumn, pcpPos.FindProperty("Updated")!, pcpPosTableMapping); + + var pcpReceipt = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt")!; + + var defaultTableMappings103 = new List>(); + pcpReceipt.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings103); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", null, relationalModel); + var cashierColumnBase = new ColumnBase("Cashier", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("Cashier", cashierColumnBase); + var createdColumnBase0 = new ColumnBase("Created", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("Created", createdColumnBase0); + var customerCodeColumnBase = new ColumnBase("CustomerCode", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("CustomerCode", customerCodeColumnBase); + var customerNipColumnBase = new ColumnBase("CustomerNip", "varchar(16)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("CustomerNip", customerNipColumnBase); + var docNoColumnBase = new ColumnBase("DocNo", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("DocNo", docNoColumnBase); + var fiscalUniqueNoColumnBase = new ColumnBase("FiscalUniqueNo", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("FiscalUniqueNo", fiscalUniqueNoColumnBase); + var kontrIdColumnBase16 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("KontrId", kontrIdColumnBase16); + var operationDateTimeColumnBase = new ColumnBase("OperationDateTime", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("OperationDateTime", operationDateTimeColumnBase); + var pcpPosIdColumnBase0 = new ColumnBase("PcpPosId", "int", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("PcpPosId", pcpPosIdColumnBase0); + var pcpReceiptIdColumnBase = new ColumnBase("PcpReceiptId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("PcpReceiptId", pcpReceiptIdColumnBase); + var posCodeColumnBase0 = new ColumnBase("PosCode", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("PosCode", posCodeColumnBase0); + var posNoColumnBase0 = new ColumnBase("PosNo", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("PosNo", posNoColumnBase0); + var printerNumberColumnBase = new ColumnBase("PrinterNumber", "int", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("PrinterNumber", printerNumberColumnBase); + var receiptSysNoColumnBase = new ColumnBase("ReceiptSysNo", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("ReceiptSysNo", receiptSysNoColumnBase); + var shopNoColumnBase = new ColumnBase("ShopNo", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("ShopNo", shopNoColumnBase); + var totalBruttoColumnBase = new ColumnBase("TotalBrutto", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("TotalBrutto", totalBruttoColumnBase); + var totalDiscountColumnBase = new ColumnBase("TotalDiscount", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("TotalDiscount", totalDiscountColumnBase); + var totalNettoColumnBase = new ColumnBase("TotalNetto", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("TotalNetto", totalNettoColumnBase); + var transUUIDColumnBase = new ColumnBase("TransUUID", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("TransUUID", transUUIDColumnBase); + var updatedColumnBase0 = new ColumnBase("Updated", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.Columns.Add("Updated", updatedColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase = new TableMappingBase(pcpReceipt, blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase, false); + defaultTableMappings103.Add(blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpReceiptIdColumnBase, pcpReceipt.FindProperty("PcpReceiptId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cashierColumnBase, pcpReceipt.FindProperty("Cashier")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)createdColumnBase0, pcpReceipt.FindProperty("Created")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)customerCodeColumnBase, pcpReceipt.FindProperty("CustomerCode")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)customerNipColumnBase, pcpReceipt.FindProperty("CustomerNip")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)docNoColumnBase, pcpReceipt.FindProperty("DocNo")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)fiscalUniqueNoColumnBase, pcpReceipt.FindProperty("FiscalUniqueNo")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase16, pcpReceipt.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)operationDateTimeColumnBase, pcpReceipt.FindProperty("OperationDateTime")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpPosIdColumnBase0, pcpReceipt.FindProperty("PcpPosId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posCodeColumnBase0, pcpReceipt.FindProperty("PosCode")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posNoColumnBase0, pcpReceipt.FindProperty("PosNo")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)printerNumberColumnBase, pcpReceipt.FindProperty("PrinterNumber")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)receiptSysNoColumnBase, pcpReceipt.FindProperty("ReceiptSysNo")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNoColumnBase, pcpReceipt.FindProperty("ShopNo")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalBruttoColumnBase, pcpReceipt.FindProperty("TotalBrutto")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalDiscountColumnBase, pcpReceipt.FindProperty("TotalDiscount")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalNettoColumnBase, pcpReceipt.FindProperty("TotalNetto")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)transUUIDColumnBase, pcpReceipt.FindProperty("TransUUID")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)updatedColumnBase0, pcpReceipt.FindProperty("Updated")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptMappingBase); + + var tableMappings103 = new List(); + pcpReceipt.SetRuntimeAnnotation("Relational:TableMappings", tableMappings103); + var pcpReceiptTable = new Table("PcpReceipt", null, relationalModel); + var pcpReceiptIdColumn = new Column("PcpReceiptId", "numeric(9,0)", pcpReceiptTable); + pcpReceiptTable.Columns.Add("PcpReceiptId", pcpReceiptIdColumn); + var cashierColumn = new Column("Cashier", "varchar(64)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("Cashier", cashierColumn); + var createdColumn0 = new Column("Created", "datetime", pcpReceiptTable); + pcpReceiptTable.Columns.Add("Created", createdColumn0); + var customerCodeColumn = new Column("CustomerCode", "varchar(64)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("CustomerCode", customerCodeColumn); + var customerNipColumn = new Column("CustomerNip", "varchar(16)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("CustomerNip", customerNipColumn); + var docNoColumn = new Column("DocNo", "varchar(64)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("DocNo", docNoColumn); + var fiscalUniqueNoColumn = new Column("FiscalUniqueNo", "varchar(64)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("FiscalUniqueNo", fiscalUniqueNoColumn); + var kontrIdColumn16 = new Column("KontrId", "numeric(9,0)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("KontrId", kontrIdColumn16); + var operationDateTimeColumn = new Column("OperationDateTime", "datetime", pcpReceiptTable); + pcpReceiptTable.Columns.Add("OperationDateTime", operationDateTimeColumn); + var pcpPosIdColumn0 = new Column("PcpPosId", "int", pcpReceiptTable); + pcpReceiptTable.Columns.Add("PcpPosId", pcpPosIdColumn0); + var posCodeColumn0 = new Column("PosCode", "varchar(64)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("PosCode", posCodeColumn0); + var posNoColumn0 = new Column("PosNo", "smallint", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("PosNo", posNoColumn0); + var printerNumberColumn = new Column("PrinterNumber", "int", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("PrinterNumber", printerNumberColumn); + var receiptSysNoColumn = new Column("ReceiptSysNo", "varchar(32)", pcpReceiptTable); + pcpReceiptTable.Columns.Add("ReceiptSysNo", receiptSysNoColumn); + var shopNoColumn = new Column("ShopNo", "smallint", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("ShopNo", shopNoColumn); + var totalBruttoColumn = new Column("TotalBrutto", "decimal(14,2)", pcpReceiptTable); + pcpReceiptTable.Columns.Add("TotalBrutto", totalBruttoColumn); + var totalDiscountColumn = new Column("TotalDiscount", "decimal(14,2)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("TotalDiscount", totalDiscountColumn); + var totalNettoColumn = new Column("TotalNetto", "decimal(14,2)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("TotalNetto", totalNettoColumn); + var transUUIDColumn = new Column("TransUUID", "varchar(64)", pcpReceiptTable) + { + IsNullable = true + }; + pcpReceiptTable.Columns.Add("TransUUID", transUUIDColumn); + var updatedColumn0 = new Column("Updated", "datetime", pcpReceiptTable); + pcpReceiptTable.Columns.Add("Updated", updatedColumn0); + var pK_PcpReceipt = new UniqueConstraint("PK_PcpReceipt", pcpReceiptTable, new[] { pcpReceiptIdColumn }); + pcpReceiptTable.PrimaryKey = pK_PcpReceipt; + var pK_PcpReceiptUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + new[] { "PcpReceiptId" }); + pK_PcpReceipt.MappedKeys.Add(pK_PcpReceiptUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PcpReceiptUc).Add(pK_PcpReceipt); + pcpReceiptTable.UniqueConstraints.Add("PK_PcpReceipt", pK_PcpReceipt); + var ixPcpReceiptCustomerCode = new TableIndex( + "IxPcpReceiptCustomerCode", pcpReceiptTable, new[] { customerCodeColumn }, false); + var ixPcpReceiptCustomerCodeIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + "IxPcpReceiptCustomerCode"); + ixPcpReceiptCustomerCode.MappedIndexes.Add(ixPcpReceiptCustomerCodeIx); + RelationalModel.GetOrCreateTableIndexes(ixPcpReceiptCustomerCodeIx).Add(ixPcpReceiptCustomerCode); + pcpReceiptTable.Indexes.Add("IxPcpReceiptCustomerCode", ixPcpReceiptCustomerCode); + var ixPcpReceiptKontrId = new TableIndex( + "IxPcpReceiptKontrId", pcpReceiptTable, new[] { kontrIdColumn16 }, false); + var ixPcpReceiptKontrIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + "IxPcpReceiptKontrId"); + ixPcpReceiptKontrId.MappedIndexes.Add(ixPcpReceiptKontrIdIx); + RelationalModel.GetOrCreateTableIndexes(ixPcpReceiptKontrIdIx).Add(ixPcpReceiptKontrId); + pcpReceiptTable.Indexes.Add("IxPcpReceiptKontrId", ixPcpReceiptKontrId); + var ixPcpReceiptPcpPosId = new TableIndex( + "IxPcpReceiptPcpPosId", pcpReceiptTable, new[] { pcpPosIdColumn0 }, false); + var ixPcpReceiptPcpPosIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + "IxPcpReceiptPcpPosId"); + ixPcpReceiptPcpPosId.MappedIndexes.Add(ixPcpReceiptPcpPosIdIx); + RelationalModel.GetOrCreateTableIndexes(ixPcpReceiptPcpPosIdIx).Add(ixPcpReceiptPcpPosId); + pcpReceiptTable.Indexes.Add("IxPcpReceiptPcpPosId", ixPcpReceiptPcpPosId); + relationalModel.Tables.Add(("PcpReceipt", null), pcpReceiptTable); + var pcpReceiptTableMapping = new TableMapping(pcpReceipt, pcpReceiptTable, true); + pcpReceiptTable.AddTypeMapping(pcpReceiptTableMapping, false); + tableMappings103.Add(pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(pcpReceiptIdColumn, pcpReceipt.FindProperty("PcpReceiptId")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(cashierColumn, pcpReceipt.FindProperty("Cashier")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(createdColumn0, pcpReceipt.FindProperty("Created")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(customerCodeColumn, pcpReceipt.FindProperty("CustomerCode")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(customerNipColumn, pcpReceipt.FindProperty("CustomerNip")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(docNoColumn, pcpReceipt.FindProperty("DocNo")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(fiscalUniqueNoColumn, pcpReceipt.FindProperty("FiscalUniqueNo")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn16, pcpReceipt.FindProperty("KontrId")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(operationDateTimeColumn, pcpReceipt.FindProperty("OperationDateTime")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(pcpPosIdColumn0, pcpReceipt.FindProperty("PcpPosId")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(posCodeColumn0, pcpReceipt.FindProperty("PosCode")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(posNoColumn0, pcpReceipt.FindProperty("PosNo")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(printerNumberColumn, pcpReceipt.FindProperty("PrinterNumber")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(receiptSysNoColumn, pcpReceipt.FindProperty("ReceiptSysNo")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(shopNoColumn, pcpReceipt.FindProperty("ShopNo")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(totalBruttoColumn, pcpReceipt.FindProperty("TotalBrutto")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(totalDiscountColumn, pcpReceipt.FindProperty("TotalDiscount")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(totalNettoColumn, pcpReceipt.FindProperty("TotalNetto")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(transUUIDColumn, pcpReceipt.FindProperty("TransUUID")!, pcpReceiptTableMapping); + RelationalModel.CreateColumnMapping(updatedColumn0, pcpReceipt.FindProperty("Updated")!, pcpReceiptTableMapping); + + var pcpReceiptItem = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptItem")!; + + var defaultTableMappings104 = new List>(); + pcpReceiptItem.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings104); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptItem", null, relationalModel); + var barcodeColumnBase = new ColumnBase("Barcode", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("Barcode", barcodeColumnBase); + var discountTypeColumnBase = new ColumnBase("DiscountType", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("DiscountType", discountTypeColumnBase); + var discountValueColumnBase = new ColumnBase("DiscountValue", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("DiscountValue", discountValueColumnBase); + var isReturnColumnBase = new ColumnBase("IsReturn", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("IsReturn", isReturnColumnBase); + var pcpReceiptIdColumnBase0 = new ColumnBase("PcpReceiptId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("PcpReceiptId", pcpReceiptIdColumnBase0); + var pcpReceiptItemIdColumnBase = new ColumnBase("PcpReceiptItemId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("PcpReceiptItemId", pcpReceiptItemIdColumnBase); + var priceColumnBase = new ColumnBase("Price", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("Price", priceColumnBase); + var productNameColumnBase = new ColumnBase("ProductName", "varchar(128)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("ProductName", productNameColumnBase); + var productTypeColumnBase = new ColumnBase("ProductType", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("ProductType", productTypeColumnBase); + var quantityColumnBase = new ColumnBase("Quantity", "decimal(14,4)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("Quantity", quantityColumnBase); + var totalBruttoColumnBase0 = new ColumnBase("TotalBrutto", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("TotalBrutto", totalBruttoColumnBase0); + var totalDiscountColumnBase0 = new ColumnBase("TotalDiscount", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("TotalDiscount", totalDiscountColumnBase0); + var totalNettoColumnBase0 = new ColumnBase("TotalNetto", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("TotalNetto", totalNettoColumnBase0); + var vatCharColumnBase = new ColumnBase("VatChar", "varchar(1)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("VatChar", vatCharColumnBase); + var vatRateColumnBase = new ColumnBase("VatRate", "decimal(6,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.Columns.Add("VatRate", vatRateColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptItem", blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase = new TableMappingBase(pcpReceiptItem, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase, false); + defaultTableMappings104.Add(blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpReceiptItemIdColumnBase, pcpReceiptItem.FindProperty("PcpReceiptItemId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)barcodeColumnBase, pcpReceiptItem.FindProperty("Barcode")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)discountTypeColumnBase, pcpReceiptItem.FindProperty("DiscountType")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)discountValueColumnBase, pcpReceiptItem.FindProperty("DiscountValue")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)isReturnColumnBase, pcpReceiptItem.FindProperty("IsReturn")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpReceiptIdColumnBase0, pcpReceiptItem.FindProperty("PcpReceiptId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)priceColumnBase, pcpReceiptItem.FindProperty("Price")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)productNameColumnBase, pcpReceiptItem.FindProperty("ProductName")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)productTypeColumnBase, pcpReceiptItem.FindProperty("ProductType")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)quantityColumnBase, pcpReceiptItem.FindProperty("Quantity")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalBruttoColumnBase0, pcpReceiptItem.FindProperty("TotalBrutto")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalDiscountColumnBase0, pcpReceiptItem.FindProperty("TotalDiscount")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalNettoColumnBase0, pcpReceiptItem.FindProperty("TotalNetto")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)vatCharColumnBase, pcpReceiptItem.FindProperty("VatChar")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)vatRateColumnBase, pcpReceiptItem.FindProperty("VatRate")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptItemMappingBase); + + var tableMappings104 = new List(); + pcpReceiptItem.SetRuntimeAnnotation("Relational:TableMappings", tableMappings104); + var pcpReceiptItemTable = new Table("PcpReceiptItem", null, relationalModel); + var pcpReceiptItemIdColumn = new Column("PcpReceiptItemId", "numeric(9,0)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("PcpReceiptItemId", pcpReceiptItemIdColumn); + var barcodeColumn = new Column("Barcode", "varchar(64)", pcpReceiptItemTable) + { + IsNullable = true + }; + pcpReceiptItemTable.Columns.Add("Barcode", barcodeColumn); + var discountTypeColumn = new Column("DiscountType", "smallint", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("DiscountType", discountTypeColumn); + var discountValueColumn = new Column("DiscountValue", "decimal(14,2)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("DiscountValue", discountValueColumn); + var isReturnColumn = new Column("IsReturn", "smallint", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("IsReturn", isReturnColumn); + var pcpReceiptIdColumn0 = new Column("PcpReceiptId", "numeric(9,0)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("PcpReceiptId", pcpReceiptIdColumn0); + var priceColumn = new Column("Price", "decimal(14,2)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("Price", priceColumn); + var productNameColumn = new Column("ProductName", "varchar(128)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("ProductName", productNameColumn); + var productTypeColumn = new Column("ProductType", "smallint", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("ProductType", productTypeColumn); + var quantityColumn = new Column("Quantity", "decimal(14,4)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("Quantity", quantityColumn); + var totalBruttoColumn0 = new Column("TotalBrutto", "decimal(14,2)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("TotalBrutto", totalBruttoColumn0); + var totalDiscountColumn0 = new Column("TotalDiscount", "decimal(14,2)", pcpReceiptItemTable); + pcpReceiptItemTable.Columns.Add("TotalDiscount", totalDiscountColumn0); + var totalNettoColumn0 = new Column("TotalNetto", "decimal(14,2)", pcpReceiptItemTable) + { + IsNullable = true + }; + pcpReceiptItemTable.Columns.Add("TotalNetto", totalNettoColumn0); + var vatCharColumn = new Column("VatChar", "varchar(1)", pcpReceiptItemTable) + { + IsNullable = true + }; + pcpReceiptItemTable.Columns.Add("VatChar", vatCharColumn); + var vatRateColumn = new Column("VatRate", "decimal(6,2)", pcpReceiptItemTable) + { + IsNullable = true + }; + pcpReceiptItemTable.Columns.Add("VatRate", vatRateColumn); + var pK_PcpReceiptItem = new UniqueConstraint("PK_PcpReceiptItem", pcpReceiptItemTable, new[] { pcpReceiptItemIdColumn }); + pcpReceiptItemTable.PrimaryKey = pK_PcpReceiptItem; + var pK_PcpReceiptItemUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptItem", + new[] { "PcpReceiptItemId" }); + pK_PcpReceiptItem.MappedKeys.Add(pK_PcpReceiptItemUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PcpReceiptItemUc).Add(pK_PcpReceiptItem); + pcpReceiptItemTable.UniqueConstraints.Add("PK_PcpReceiptItem", pK_PcpReceiptItem); + var ixPcpReceiptItemPcpReceiptId = new TableIndex( + "IxPcpReceiptItemPcpReceiptId", pcpReceiptItemTable, new[] { pcpReceiptIdColumn0 }, false); + var ixPcpReceiptItemPcpReceiptIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptItem", + "IxPcpReceiptItemPcpReceiptId"); + ixPcpReceiptItemPcpReceiptId.MappedIndexes.Add(ixPcpReceiptItemPcpReceiptIdIx); + RelationalModel.GetOrCreateTableIndexes(ixPcpReceiptItemPcpReceiptIdIx).Add(ixPcpReceiptItemPcpReceiptId); + pcpReceiptItemTable.Indexes.Add("IxPcpReceiptItemPcpReceiptId", ixPcpReceiptItemPcpReceiptId); + relationalModel.Tables.Add(("PcpReceiptItem", null), pcpReceiptItemTable); + var pcpReceiptItemTableMapping = new TableMapping(pcpReceiptItem, pcpReceiptItemTable, true); + pcpReceiptItemTable.AddTypeMapping(pcpReceiptItemTableMapping, false); + tableMappings104.Add(pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(pcpReceiptItemIdColumn, pcpReceiptItem.FindProperty("PcpReceiptItemId")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(barcodeColumn, pcpReceiptItem.FindProperty("Barcode")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(discountTypeColumn, pcpReceiptItem.FindProperty("DiscountType")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(discountValueColumn, pcpReceiptItem.FindProperty("DiscountValue")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(isReturnColumn, pcpReceiptItem.FindProperty("IsReturn")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(pcpReceiptIdColumn0, pcpReceiptItem.FindProperty("PcpReceiptId")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(priceColumn, pcpReceiptItem.FindProperty("Price")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(productNameColumn, pcpReceiptItem.FindProperty("ProductName")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(productTypeColumn, pcpReceiptItem.FindProperty("ProductType")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(quantityColumn, pcpReceiptItem.FindProperty("Quantity")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(totalBruttoColumn0, pcpReceiptItem.FindProperty("TotalBrutto")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(totalDiscountColumn0, pcpReceiptItem.FindProperty("TotalDiscount")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(totalNettoColumn0, pcpReceiptItem.FindProperty("TotalNetto")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(vatCharColumn, pcpReceiptItem.FindProperty("VatChar")!, pcpReceiptItemTableMapping); + RelationalModel.CreateColumnMapping(vatRateColumn, pcpReceiptItem.FindProperty("VatRate")!, pcpReceiptItemTableMapping); + + var pcpReceiptPayment = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptPayment")!; + + var defaultTableMappings105 = new List>(); + pcpReceiptPayment.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings105); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptPayment", null, relationalModel); + var changeInCurrencyColumnBase = new ColumnBase("ChangeInCurrency", "decimal(14,4)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("ChangeInCurrency", changeInCurrencyColumnBase); + var changeRefColumnBase = new ColumnBase("ChangeRef", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("ChangeRef", changeRefColumnBase); + var currencyColumnBase = new ColumnBase("Currency", "varchar(8)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("Currency", currencyColumnBase); + var paymentFormColumnBase = new ColumnBase("PaymentForm", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("PaymentForm", paymentFormColumnBase); + var pcpReceiptIdColumnBase1 = new ColumnBase("PcpReceiptId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("PcpReceiptId", pcpReceiptIdColumnBase1); + var pcpReceiptPaymentIdColumnBase = new ColumnBase("PcpReceiptPaymentId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("PcpReceiptPaymentId", pcpReceiptPaymentIdColumnBase); + var valueInCurrencyColumnBase = new ColumnBase("ValueInCurrency", "decimal(14,4)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("ValueInCurrency", valueInCurrencyColumnBase); + var valueRefColumnBase = new ColumnBase("ValueRef", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.Columns.Add("ValueRef", valueRefColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptPayment", blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase = new TableMappingBase(pcpReceiptPayment, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase, false); + defaultTableMappings105.Add(blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpReceiptPaymentIdColumnBase, pcpReceiptPayment.FindProperty("PcpReceiptPaymentId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)changeInCurrencyColumnBase, pcpReceiptPayment.FindProperty("ChangeInCurrency")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)changeRefColumnBase, pcpReceiptPayment.FindProperty("ChangeRef")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)currencyColumnBase, pcpReceiptPayment.FindProperty("Currency")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paymentFormColumnBase, pcpReceiptPayment.FindProperty("PaymentForm")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpReceiptIdColumnBase1, pcpReceiptPayment.FindProperty("PcpReceiptId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valueInCurrencyColumnBase, pcpReceiptPayment.FindProperty("ValueInCurrency")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)valueRefColumnBase, pcpReceiptPayment.FindProperty("ValueRef")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptPaymentMappingBase); + + var tableMappings105 = new List(); + pcpReceiptPayment.SetRuntimeAnnotation("Relational:TableMappings", tableMappings105); + var pcpReceiptPaymentTable = new Table("PcpReceiptPayment", null, relationalModel); + var pcpReceiptPaymentIdColumn = new Column("PcpReceiptPaymentId", "numeric(9,0)", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("PcpReceiptPaymentId", pcpReceiptPaymentIdColumn); + var changeInCurrencyColumn = new Column("ChangeInCurrency", "decimal(14,4)", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("ChangeInCurrency", changeInCurrencyColumn); + var changeRefColumn = new Column("ChangeRef", "decimal(14,2)", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("ChangeRef", changeRefColumn); + var currencyColumn = new Column("Currency", "varchar(8)", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("Currency", currencyColumn); + var paymentFormColumn = new Column("PaymentForm", "smallint", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("PaymentForm", paymentFormColumn); + var pcpReceiptIdColumn1 = new Column("PcpReceiptId", "numeric(9,0)", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("PcpReceiptId", pcpReceiptIdColumn1); + var valueInCurrencyColumn = new Column("ValueInCurrency", "decimal(14,4)", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("ValueInCurrency", valueInCurrencyColumn); + var valueRefColumn = new Column("ValueRef", "decimal(14,2)", pcpReceiptPaymentTable); + pcpReceiptPaymentTable.Columns.Add("ValueRef", valueRefColumn); + var pK_PcpReceiptPayment = new UniqueConstraint("PK_PcpReceiptPayment", pcpReceiptPaymentTable, new[] { pcpReceiptPaymentIdColumn }); + pcpReceiptPaymentTable.PrimaryKey = pK_PcpReceiptPayment; + var pK_PcpReceiptPaymentUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptPayment", + new[] { "PcpReceiptPaymentId" }); + pK_PcpReceiptPayment.MappedKeys.Add(pK_PcpReceiptPaymentUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PcpReceiptPaymentUc).Add(pK_PcpReceiptPayment); + pcpReceiptPaymentTable.UniqueConstraints.Add("PK_PcpReceiptPayment", pK_PcpReceiptPayment); + var ixPcpReceiptPaymentPcpReceiptId = new TableIndex( + "IxPcpReceiptPaymentPcpReceiptId", pcpReceiptPaymentTable, new[] { pcpReceiptIdColumn1 }, false); + var ixPcpReceiptPaymentPcpReceiptIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptPayment", + "IxPcpReceiptPaymentPcpReceiptId"); + ixPcpReceiptPaymentPcpReceiptId.MappedIndexes.Add(ixPcpReceiptPaymentPcpReceiptIdIx); + RelationalModel.GetOrCreateTableIndexes(ixPcpReceiptPaymentPcpReceiptIdIx).Add(ixPcpReceiptPaymentPcpReceiptId); + pcpReceiptPaymentTable.Indexes.Add("IxPcpReceiptPaymentPcpReceiptId", ixPcpReceiptPaymentPcpReceiptId); + relationalModel.Tables.Add(("PcpReceiptPayment", null), pcpReceiptPaymentTable); + var pcpReceiptPaymentTableMapping = new TableMapping(pcpReceiptPayment, pcpReceiptPaymentTable, true); + pcpReceiptPaymentTable.AddTypeMapping(pcpReceiptPaymentTableMapping, false); + tableMappings105.Add(pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(pcpReceiptPaymentIdColumn, pcpReceiptPayment.FindProperty("PcpReceiptPaymentId")!, pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(changeInCurrencyColumn, pcpReceiptPayment.FindProperty("ChangeInCurrency")!, pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(changeRefColumn, pcpReceiptPayment.FindProperty("ChangeRef")!, pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(currencyColumn, pcpReceiptPayment.FindProperty("Currency")!, pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(paymentFormColumn, pcpReceiptPayment.FindProperty("PaymentForm")!, pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(pcpReceiptIdColumn1, pcpReceiptPayment.FindProperty("PcpReceiptId")!, pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(valueInCurrencyColumn, pcpReceiptPayment.FindProperty("ValueInCurrency")!, pcpReceiptPaymentTableMapping); + RelationalModel.CreateColumnMapping(valueRefColumn, pcpReceiptPayment.FindProperty("ValueRef")!, pcpReceiptPaymentTableMapping); + + var pcpReceiptVat = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptVat")!; + + var defaultTableMappings106 = new List>(); + pcpReceiptVat.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings106); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptVat", null, relationalModel); + var pcpReceiptIdColumnBase2 = new ColumnBase("PcpReceiptId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase.Columns.Add("PcpReceiptId", pcpReceiptIdColumnBase2); + var pcpReceiptVatIdColumnBase = new ColumnBase("PcpReceiptVatId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase.Columns.Add("PcpReceiptVatId", pcpReceiptVatIdColumnBase); + var totalBruttoColumnBase1 = new ColumnBase("TotalBrutto", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase.Columns.Add("TotalBrutto", totalBruttoColumnBase1); + var totalVatColumnBase = new ColumnBase("TotalVat", "decimal(14,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase.Columns.Add("TotalVat", totalVatColumnBase); + var vatCharColumnBase0 = new ColumnBase("VatChar", "varchar(1)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase.Columns.Add("VatChar", vatCharColumnBase0); + var vatRateColumnBase0 = new ColumnBase("VatRate", "decimal(6,2)", blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase.Columns.Add("VatRate", vatRateColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptVat", blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase = new TableMappingBase(pcpReceiptVat, blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase, false); + defaultTableMappings106.Add(blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpReceiptVatIdColumnBase, pcpReceiptVat.FindProperty("PcpReceiptVatId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpReceiptIdColumnBase2, pcpReceiptVat.FindProperty("PcpReceiptId")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalBruttoColumnBase1, pcpReceiptVat.FindProperty("TotalBrutto")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)totalVatColumnBase, pcpReceiptVat.FindProperty("TotalVat")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)vatCharColumnBase0, pcpReceiptVat.FindProperty("VatChar")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)vatRateColumnBase0, pcpReceiptVat.FindProperty("VatRate")!, blinkBackofficeServicesPcmDbEntitiesPcpReceiptVatMappingBase); + + var tableMappings106 = new List(); + pcpReceiptVat.SetRuntimeAnnotation("Relational:TableMappings", tableMappings106); + var pcpReceiptVatTable = new Table("PcpReceiptVat", null, relationalModel); + var pcpReceiptVatIdColumn = new Column("PcpReceiptVatId", "numeric(9,0)", pcpReceiptVatTable); + pcpReceiptVatTable.Columns.Add("PcpReceiptVatId", pcpReceiptVatIdColumn); + var pcpReceiptIdColumn2 = new Column("PcpReceiptId", "numeric(9,0)", pcpReceiptVatTable); + pcpReceiptVatTable.Columns.Add("PcpReceiptId", pcpReceiptIdColumn2); + var totalBruttoColumn1 = new Column("TotalBrutto", "decimal(14,2)", pcpReceiptVatTable); + pcpReceiptVatTable.Columns.Add("TotalBrutto", totalBruttoColumn1); + var totalVatColumn = new Column("TotalVat", "decimal(14,2)", pcpReceiptVatTable); + pcpReceiptVatTable.Columns.Add("TotalVat", totalVatColumn); + var vatCharColumn0 = new Column("VatChar", "varchar(1)", pcpReceiptVatTable); + pcpReceiptVatTable.Columns.Add("VatChar", vatCharColumn0); + var vatRateColumn0 = new Column("VatRate", "decimal(6,2)", pcpReceiptVatTable); + pcpReceiptVatTable.Columns.Add("VatRate", vatRateColumn0); + var pK_PcpReceiptVat = new UniqueConstraint("PK_PcpReceiptVat", pcpReceiptVatTable, new[] { pcpReceiptVatIdColumn }); + pcpReceiptVatTable.PrimaryKey = pK_PcpReceiptVat; + var pK_PcpReceiptVatUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptVat", + new[] { "PcpReceiptVatId" }); + pK_PcpReceiptVat.MappedKeys.Add(pK_PcpReceiptVatUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PcpReceiptVatUc).Add(pK_PcpReceiptVat); + pcpReceiptVatTable.UniqueConstraints.Add("PK_PcpReceiptVat", pK_PcpReceiptVat); + var iX_PcpReceiptVat_PcpReceiptId = new TableIndex( + "IX_PcpReceiptVat_PcpReceiptId", pcpReceiptVatTable, new[] { pcpReceiptIdColumn2 }, false); + var iX_PcpReceiptVat_PcpReceiptIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptVat", + new[] { "PcpReceiptId" }); + iX_PcpReceiptVat_PcpReceiptId.MappedIndexes.Add(iX_PcpReceiptVat_PcpReceiptIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PcpReceiptVat_PcpReceiptIdIx).Add(iX_PcpReceiptVat_PcpReceiptId); + pcpReceiptVatTable.Indexes.Add("IX_PcpReceiptVat_PcpReceiptId", iX_PcpReceiptVat_PcpReceiptId); + relationalModel.Tables.Add(("PcpReceiptVat", null), pcpReceiptVatTable); + var pcpReceiptVatTableMapping = new TableMapping(pcpReceiptVat, pcpReceiptVatTable, true); + pcpReceiptVatTable.AddTypeMapping(pcpReceiptVatTableMapping, false); + tableMappings106.Add(pcpReceiptVatTableMapping); + RelationalModel.CreateColumnMapping(pcpReceiptVatIdColumn, pcpReceiptVat.FindProperty("PcpReceiptVatId")!, pcpReceiptVatTableMapping); + RelationalModel.CreateColumnMapping(pcpReceiptIdColumn2, pcpReceiptVat.FindProperty("PcpReceiptId")!, pcpReceiptVatTableMapping); + RelationalModel.CreateColumnMapping(totalBruttoColumn1, pcpReceiptVat.FindProperty("TotalBrutto")!, pcpReceiptVatTableMapping); + RelationalModel.CreateColumnMapping(totalVatColumn, pcpReceiptVat.FindProperty("TotalVat")!, pcpReceiptVatTableMapping); + RelationalModel.CreateColumnMapping(vatCharColumn0, pcpReceiptVat.FindProperty("VatChar")!, pcpReceiptVatTableMapping); + RelationalModel.CreateColumnMapping(vatRateColumn0, pcpReceiptVat.FindProperty("VatRate")!, pcpReceiptVatTableMapping); + + var pcpShop = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PcpShop")!; + + var defaultTableMappings107 = new List>(); + pcpShop.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings107); + var blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PcpShop", null, relationalModel); + var activeColumnBase1 = new ColumnBase("Active", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("Active", activeColumnBase1); + var createdColumnBase1 = new ColumnBase("Created", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("Created", createdColumnBase1); + var pcpShopIdColumnBase0 = new ColumnBase("PcpShopId", "int", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("PcpShopId", pcpShopIdColumnBase0); + var shopAddrOnReceipt0ColumnBase = new ColumnBase("ShopAddrOnReceipt0", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopAddrOnReceipt0", shopAddrOnReceipt0ColumnBase); + var shopAddrOnReceipt1ColumnBase = new ColumnBase("ShopAddrOnReceipt1", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopAddrOnReceipt1", shopAddrOnReceipt1ColumnBase); + var shopAddrOnReceipt2ColumnBase = new ColumnBase("ShopAddrOnReceipt2", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopAddrOnReceipt2", shopAddrOnReceipt2ColumnBase); + var shopAddrOnReceipt3ColumnBase = new ColumnBase("ShopAddrOnReceipt3", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopAddrOnReceipt3", shopAddrOnReceipt3ColumnBase); + var shopLicenseKeyColumnBase = new ColumnBase("ShopLicenseKey", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopLicenseKey", shopLicenseKeyColumnBase); + var shopLicenseValidFromColumnBase = new ColumnBase("ShopLicenseValidFrom", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopLicenseValidFrom", shopLicenseValidFromColumnBase); + var shopLicenseValidToColumnBase = new ColumnBase("ShopLicenseValidTo", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopLicenseValidTo", shopLicenseValidToColumnBase); + var shopNameColumnBase = new ColumnBase("ShopName", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopName", shopNameColumnBase); + var shopNameOnReceipt0ColumnBase = new ColumnBase("ShopNameOnReceipt0", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopNameOnReceipt0", shopNameOnReceipt0ColumnBase); + var shopNameOnReceipt1ColumnBase = new ColumnBase("ShopNameOnReceipt1", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopNameOnReceipt1", shopNameOnReceipt1ColumnBase); + var shopNameOnReceipt2ColumnBase = new ColumnBase("ShopNameOnReceipt2", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopNameOnReceipt2", shopNameOnReceipt2ColumnBase); + var shopNameOnReceipt3ColumnBase = new ColumnBase("ShopNameOnReceipt3", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopNameOnReceipt3", shopNameOnReceipt3ColumnBase); + var shopNipColumnBase = new ColumnBase("ShopNip", "varchar(16)", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopNip", shopNipColumnBase); + var shopNoColumnBase0 = new ColumnBase("ShopNo", "smallint", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("ShopNo", shopNoColumnBase0); + var updatedColumnBase1 = new ColumnBase("Updated", "datetime", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.Columns.Add("Updated", updatedColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PcpShop", blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase); + var blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase = new TableMappingBase(pcpShop, blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPcpShopTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase, false); + defaultTableMappings107.Add(blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcpShopIdColumnBase0, pcpShop.FindProperty("PcpShopId")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)activeColumnBase1, pcpShop.FindProperty("Active")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)createdColumnBase1, pcpShop.FindProperty("Created")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopAddrOnReceipt0ColumnBase, pcpShop.FindProperty("ShopAddrOnReceipt0")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopAddrOnReceipt1ColumnBase, pcpShop.FindProperty("ShopAddrOnReceipt1")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopAddrOnReceipt2ColumnBase, pcpShop.FindProperty("ShopAddrOnReceipt2")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopAddrOnReceipt3ColumnBase, pcpShop.FindProperty("ShopAddrOnReceipt3")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopLicenseKeyColumnBase, pcpShop.FindProperty("ShopLicenseKey")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopLicenseValidFromColumnBase, pcpShop.FindProperty("ShopLicenseValidFrom")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopLicenseValidToColumnBase, pcpShop.FindProperty("ShopLicenseValidTo")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNameColumnBase, pcpShop.FindProperty("ShopName")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNameOnReceipt0ColumnBase, pcpShop.FindProperty("ShopNameOnReceipt0")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNameOnReceipt1ColumnBase, pcpShop.FindProperty("ShopNameOnReceipt1")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNameOnReceipt2ColumnBase, pcpShop.FindProperty("ShopNameOnReceipt2")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNameOnReceipt3ColumnBase, pcpShop.FindProperty("ShopNameOnReceipt3")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNipColumnBase, pcpShop.FindProperty("ShopNip")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNoColumnBase0, pcpShop.FindProperty("ShopNo")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)updatedColumnBase1, pcpShop.FindProperty("Updated")!, blinkBackofficeServicesPcmDbEntitiesPcpShopMappingBase); + + var tableMappings107 = new List(); + pcpShop.SetRuntimeAnnotation("Relational:TableMappings", tableMappings107); + var pcpShopTable = new Table("PcpShop", null, relationalModel); + var pcpShopIdColumn0 = new Column("PcpShopId", "int", pcpShopTable); + pcpShopTable.Columns.Add("PcpShopId", pcpShopIdColumn0); + var activeColumn1 = new Column("Active", "smallint", pcpShopTable); + pcpShopTable.Columns.Add("Active", activeColumn1); + var createdColumn1 = new Column("Created", "datetime", pcpShopTable); + pcpShopTable.Columns.Add("Created", createdColumn1); + var shopAddrOnReceipt0Column = new Column("ShopAddrOnReceipt0", "varchar(64)", pcpShopTable); + pcpShopTable.Columns.Add("ShopAddrOnReceipt0", shopAddrOnReceipt0Column); + var shopAddrOnReceipt1Column = new Column("ShopAddrOnReceipt1", "varchar(64)", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopAddrOnReceipt1", shopAddrOnReceipt1Column); + var shopAddrOnReceipt2Column = new Column("ShopAddrOnReceipt2", "varchar(64)", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopAddrOnReceipt2", shopAddrOnReceipt2Column); + var shopAddrOnReceipt3Column = new Column("ShopAddrOnReceipt3", "varchar(64)", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopAddrOnReceipt3", shopAddrOnReceipt3Column); + var shopLicenseKeyColumn = new Column("ShopLicenseKey", "varchar(64)", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopLicenseKey", shopLicenseKeyColumn); + var shopLicenseValidFromColumn = new Column("ShopLicenseValidFrom", "datetime", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopLicenseValidFrom", shopLicenseValidFromColumn); + var shopLicenseValidToColumn = new Column("ShopLicenseValidTo", "datetime", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopLicenseValidTo", shopLicenseValidToColumn); + var shopNameColumn = new Column("ShopName", "varchar(64)", pcpShopTable); + pcpShopTable.Columns.Add("ShopName", shopNameColumn); + var shopNameOnReceipt0Column = new Column("ShopNameOnReceipt0", "varchar(64)", pcpShopTable); + pcpShopTable.Columns.Add("ShopNameOnReceipt0", shopNameOnReceipt0Column); + var shopNameOnReceipt1Column = new Column("ShopNameOnReceipt1", "varchar(64)", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopNameOnReceipt1", shopNameOnReceipt1Column); + var shopNameOnReceipt2Column = new Column("ShopNameOnReceipt2", "varchar(64)", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopNameOnReceipt2", shopNameOnReceipt2Column); + var shopNameOnReceipt3Column = new Column("ShopNameOnReceipt3", "varchar(64)", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopNameOnReceipt3", shopNameOnReceipt3Column); + var shopNipColumn = new Column("ShopNip", "varchar(16)", pcpShopTable); + pcpShopTable.Columns.Add("ShopNip", shopNipColumn); + var shopNoColumn0 = new Column("ShopNo", "smallint", pcpShopTable) + { + IsNullable = true + }; + pcpShopTable.Columns.Add("ShopNo", shopNoColumn0); + var updatedColumn1 = new Column("Updated", "datetime", pcpShopTable); + pcpShopTable.Columns.Add("Updated", updatedColumn1); + var pK_PcpShop = new UniqueConstraint("PK_PcpShop", pcpShopTable, new[] { pcpShopIdColumn0 }); + pcpShopTable.PrimaryKey = pK_PcpShop; + var pK_PcpShopUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpShop", + new[] { "PcpShopId" }); + pK_PcpShop.MappedKeys.Add(pK_PcpShopUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PcpShopUc).Add(pK_PcpShop); + pcpShopTable.UniqueConstraints.Add("PK_PcpShop", pK_PcpShop); + relationalModel.Tables.Add(("PcpShop", null), pcpShopTable); + var pcpShopTableMapping = new TableMapping(pcpShop, pcpShopTable, true); + pcpShopTable.AddTypeMapping(pcpShopTableMapping, false); + tableMappings107.Add(pcpShopTableMapping); + RelationalModel.CreateColumnMapping(pcpShopIdColumn0, pcpShop.FindProperty("PcpShopId")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(activeColumn1, pcpShop.FindProperty("Active")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(createdColumn1, pcpShop.FindProperty("Created")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopAddrOnReceipt0Column, pcpShop.FindProperty("ShopAddrOnReceipt0")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopAddrOnReceipt1Column, pcpShop.FindProperty("ShopAddrOnReceipt1")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopAddrOnReceipt2Column, pcpShop.FindProperty("ShopAddrOnReceipt2")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopAddrOnReceipt3Column, pcpShop.FindProperty("ShopAddrOnReceipt3")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopLicenseKeyColumn, pcpShop.FindProperty("ShopLicenseKey")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopLicenseValidFromColumn, pcpShop.FindProperty("ShopLicenseValidFrom")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopLicenseValidToColumn, pcpShop.FindProperty("ShopLicenseValidTo")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopNameColumn, pcpShop.FindProperty("ShopName")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopNameOnReceipt0Column, pcpShop.FindProperty("ShopNameOnReceipt0")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopNameOnReceipt1Column, pcpShop.FindProperty("ShopNameOnReceipt1")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopNameOnReceipt2Column, pcpShop.FindProperty("ShopNameOnReceipt2")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopNameOnReceipt3Column, pcpShop.FindProperty("ShopNameOnReceipt3")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopNipColumn, pcpShop.FindProperty("ShopNip")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(shopNoColumn0, pcpShop.FindProperty("ShopNo")!, pcpShopTableMapping); + RelationalModel.CreateColumnMapping(updatedColumn1, pcpShop.FindProperty("Updated")!, pcpShopTableMapping); + + var polParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PolParam")!; + + var defaultTableMappings108 = new List>(); + polParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings108); + var blinkBackofficeServicesPcmDbEntitiesPolParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PolParam", null, relationalModel); + var parGrupaColumnBase0 = new ColumnBase("ParGrupa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesPolParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPolParamTableBase.Columns.Add("ParGrupa", parGrupaColumnBase0); + var parNazwaColumnBase3 = new ColumnBase("ParNazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesPolParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPolParamTableBase.Columns.Add("ParNazwa", parNazwaColumnBase3); + var parWartoscColumnBase3 = new ColumnBase("ParWartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPolParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPolParamTableBase.Columns.Add("ParWartosc", parWartoscColumnBase3); + var polIdColumnBase0 = new ColumnBase("PolId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPolParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPolParamTableBase.Columns.Add("PolId", polIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PolParam", blinkBackofficeServicesPcmDbEntitiesPolParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesPolParamMappingBase = new TableMappingBase(polParam, blinkBackofficeServicesPcmDbEntitiesPolParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPolParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPolParamMappingBase, false); + defaultTableMappings108.Add(blinkBackofficeServicesPcmDbEntitiesPolParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parGrupaColumnBase0, polParam.FindProperty("ParGrupa")!, blinkBackofficeServicesPcmDbEntitiesPolParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase3, polParam.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesPolParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)polIdColumnBase0, polParam.FindProperty("PolId")!, blinkBackofficeServicesPcmDbEntitiesPolParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parWartoscColumnBase3, polParam.FindProperty("ParWartosc")!, blinkBackofficeServicesPcmDbEntitiesPolParamMappingBase); + + var tableMappings108 = new List(); + polParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings108); + var polParamTable = new Table("PolParam", null, relationalModel); + var polIdColumn0 = new Column("PolId", "numeric(9,0)", polParamTable); + polParamTable.Columns.Add("PolId", polIdColumn0); + var parGrupaColumn0 = new Column("ParGrupa", "varchar(40)", polParamTable); + polParamTable.Columns.Add("ParGrupa", parGrupaColumn0); + var parNazwaColumn3 = new Column("ParNazwa", "varchar(40)", polParamTable); + polParamTable.Columns.Add("ParNazwa", parNazwaColumn3); + var parWartoscColumn3 = new Column("ParWartosc", "varchar(255)", polParamTable); + polParamTable.Columns.Add("ParWartosc", parWartoscColumn3); + var pK_POLPARAM = new UniqueConstraint("PK_POLPARAM", polParamTable, new[] { polIdColumn0, parGrupaColumn0, parNazwaColumn3 }); + polParamTable.PrimaryKey = pK_POLPARAM; + var pK_POLPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PolParam", + new[] { "PolId", "ParGrupa", "ParNazwa" }); + pK_POLPARAM.MappedKeys.Add(pK_POLPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POLPARAMUc).Add(pK_POLPARAM); + polParamTable.UniqueConstraints.Add("PK_POLPARAM", pK_POLPARAM); + relationalModel.Tables.Add(("PolParam", null), polParamTable); + var polParamTableMapping = new TableMapping(polParam, polParamTable, true); + polParamTable.AddTypeMapping(polParamTableMapping, false); + tableMappings108.Add(polParamTableMapping); + RelationalModel.CreateColumnMapping(parGrupaColumn0, polParam.FindProperty("ParGrupa")!, polParamTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn3, polParam.FindProperty("ParNazwa")!, polParamTableMapping); + RelationalModel.CreateColumnMapping(polIdColumn0, polParam.FindProperty("PolId")!, polParamTableMapping); + RelationalModel.CreateColumnMapping(parWartoscColumn3, polParam.FindProperty("ParWartosc")!, polParamTableMapping); + + var polityka = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Polityka")!; + + var defaultTableMappings109 = new List>(); + polityka.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings109); + var blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Polityka", null, relationalModel); + var aktywnyColumnBase18 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase); + blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase.Columns.Add("Aktywny", aktywnyColumnBase18); + var centrPolIdColumnBase = new ColumnBase("CentrPolId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase.Columns.Add("CentrPolId", centrPolIdColumnBase); + var nazwaColumnBase31 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase); + blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase.Columns.Add("Nazwa", nazwaColumnBase31); + var polIdColumnBase1 = new ColumnBase("PolId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase); + blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase.Columns.Add("PolId", polIdColumnBase1); + var zastosowanieColumnBase0 = new ColumnBase("Zastosowanie", "smallint", blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase); + blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase.Columns.Add("Zastosowanie", zastosowanieColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Polityka", blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase); + var blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase = new TableMappingBase(polityka, blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPolitykaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase, false); + defaultTableMappings109.Add(blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)polIdColumnBase1, polityka.FindProperty("PolId")!, blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase18, polityka.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrPolIdColumnBase, polityka.FindProperty("CentrPolId")!, blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase31, polityka.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zastosowanieColumnBase0, polityka.FindProperty("Zastosowanie")!, blinkBackofficeServicesPcmDbEntitiesPolitykaMappingBase); + + var tableMappings109 = new List(); + polityka.SetRuntimeAnnotation("Relational:TableMappings", tableMappings109); + var politykaTable = new Table("Polityka", null, relationalModel); + var polIdColumn1 = new Column("PolId", "numeric(9,0)", politykaTable); + politykaTable.Columns.Add("PolId", polIdColumn1); + var aktywnyColumn18 = new Column("Aktywny", "smallint", politykaTable); + politykaTable.Columns.Add("Aktywny", aktywnyColumn18); + var centrPolIdColumn = new Column("CentrPolId", "numeric(9,0)", politykaTable) + { + IsNullable = true + }; + politykaTable.Columns.Add("CentrPolId", centrPolIdColumn); + var nazwaColumn31 = new Column("Nazwa", "varchar(40)", politykaTable); + politykaTable.Columns.Add("Nazwa", nazwaColumn31); + var zastosowanieColumn0 = new Column("Zastosowanie", "smallint", politykaTable); + politykaTable.Columns.Add("Zastosowanie", zastosowanieColumn0); + var pK_POLITYKA = new UniqueConstraint("PK_POLITYKA", politykaTable, new[] { polIdColumn1 }); + politykaTable.PrimaryKey = pK_POLITYKA; + var pK_POLITYKAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Polityka", + new[] { "PolId" }); + pK_POLITYKA.MappedKeys.Add(pK_POLITYKAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POLITYKAUc).Add(pK_POLITYKA); + politykaTable.UniqueConstraints.Add("PK_POLITYKA", pK_POLITYKA); + var idx_CentrPolId = new TableIndex( + "idx_CentrPolId", politykaTable, new[] { centrPolIdColumn }, false); + var idx_CentrPolIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Polityka", + "idx_CentrPolId"); + idx_CentrPolId.MappedIndexes.Add(idx_CentrPolIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrPolIdIx).Add(idx_CentrPolId); + politykaTable.Indexes.Add("idx_CentrPolId", idx_CentrPolId); + relationalModel.Tables.Add(("Polityka", null), politykaTable); + var politykaTableMapping = new TableMapping(polityka, politykaTable, true); + politykaTable.AddTypeMapping(politykaTableMapping, false); + tableMappings109.Add(politykaTableMapping); + RelationalModel.CreateColumnMapping(polIdColumn1, polityka.FindProperty("PolId")!, politykaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn18, polityka.FindProperty("Aktywny")!, politykaTableMapping); + RelationalModel.CreateColumnMapping(centrPolIdColumn, polityka.FindProperty("CentrPolId")!, politykaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn31, polityka.FindProperty("Nazwa")!, politykaTableMapping); + RelationalModel.CreateColumnMapping(zastosowanieColumn0, polityka.FindProperty("Zastosowanie")!, politykaTableMapping); + + var powKontLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj")!; + + var defaultTableMappings110 = new List>(); + powKontLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings110); + var blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj", null, relationalModel); + var noweKontoIdColumnBase = new ColumnBase("NoweKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase); + blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase.Columns.Add("NoweKontoId", noweKontoIdColumnBase); + var rodzajPowColumnBase = new ColumnBase("RodzajPow", "smallint", blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase); + blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase.Columns.Add("RodzajPow", rodzajPowColumnBase); + var stareKontoIdColumnBase = new ColumnBase("StareKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase); + blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase.Columns.Add("StareKontoId", stareKontoIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj", blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowKontLojMappingBase = new TableMappingBase(powKontLoj, blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowKontLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowKontLojMappingBase, false); + defaultTableMappings110.Add(blinkBackofficeServicesPcmDbEntitiesPowKontLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)noweKontoIdColumnBase, powKontLoj.FindProperty("NoweKontoId")!, blinkBackofficeServicesPcmDbEntitiesPowKontLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajPowColumnBase, powKontLoj.FindProperty("RodzajPow")!, blinkBackofficeServicesPcmDbEntitiesPowKontLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stareKontoIdColumnBase, powKontLoj.FindProperty("StareKontoId")!, blinkBackofficeServicesPcmDbEntitiesPowKontLojMappingBase); + + var tableMappings110 = new List(); + powKontLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings110); + var powKontLojTable = new Table("PowKontLoj", null, relationalModel); + var noweKontoIdColumn = new Column("NoweKontoId", "numeric(9,0)", powKontLojTable); + powKontLojTable.Columns.Add("NoweKontoId", noweKontoIdColumn); + var rodzajPowColumn = new Column("RodzajPow", "smallint", powKontLojTable); + powKontLojTable.Columns.Add("RodzajPow", rodzajPowColumn); + var stareKontoIdColumn = new Column("StareKontoId", "numeric(9,0)", powKontLojTable); + powKontLojTable.Columns.Add("StareKontoId", stareKontoIdColumn); + var pK_POWKONTLOJ = new UniqueConstraint("PK_POWKONTLOJ", powKontLojTable, new[] { noweKontoIdColumn, rodzajPowColumn }); + powKontLojTable.PrimaryKey = pK_POWKONTLOJ; + var pK_POWKONTLOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj", + new[] { "NoweKontoId", "RodzajPow" }); + pK_POWKONTLOJ.MappedKeys.Add(pK_POWKONTLOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POWKONTLOJUc).Add(pK_POWKONTLOJ); + powKontLojTable.UniqueConstraints.Add("PK_POWKONTLOJ", pK_POWKONTLOJ); + var idx_PowStareKLoj = new TableIndex( + "idx_PowStareKLoj", powKontLojTable, new[] { stareKontoIdColumn }, false); + var idx_PowStareKLojIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj", + "idx_PowStareKLoj"); + idx_PowStareKLoj.MappedIndexes.Add(idx_PowStareKLojIx); + RelationalModel.GetOrCreateTableIndexes(idx_PowStareKLojIx).Add(idx_PowStareKLoj); + powKontLojTable.Indexes.Add("idx_PowStareKLoj", idx_PowStareKLoj); + relationalModel.Tables.Add(("PowKontLoj", null), powKontLojTable); + var powKontLojTableMapping = new TableMapping(powKontLoj, powKontLojTable, true); + powKontLojTable.AddTypeMapping(powKontLojTableMapping, false); + tableMappings110.Add(powKontLojTableMapping); + RelationalModel.CreateColumnMapping(noweKontoIdColumn, powKontLoj.FindProperty("NoweKontoId")!, powKontLojTableMapping); + RelationalModel.CreateColumnMapping(rodzajPowColumn, powKontLoj.FindProperty("RodzajPow")!, powKontLojTableMapping); + RelationalModel.CreateColumnMapping(stareKontoIdColumn, powKontLoj.FindProperty("StareKontoId")!, powKontLojTableMapping); + + var powiadomienie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie")!; + + var defaultTableMappings111 = new List>(); + powiadomienie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings111); + var blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie", null, relationalModel); + var adresatColumnBase = new ColumnBase("Adresat", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Adresat", adresatColumnBase); + var aktywnyColumnBase19 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Aktywny", aktywnyColumnBase19); + var kategoriaColumnBase0 = new ColumnBase("Kategoria", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Kategoria", kategoriaColumnBase0); + var nadawcaColumnBase0 = new ColumnBase("Nadawca", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Nadawca", nadawcaColumnBase0); + var naglowekColumnBase = new ColumnBase("Naglowek", "varchar(128)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Naglowek", naglowekColumnBase); + var posNoColumnBase1 = new ColumnBase("PosNo", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("PosNo", posNoColumnBase1); + var powiadomienieIdColumnBase = new ColumnBase("PowiadomienieId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("PowiadomienieId", powiadomienieIdColumnBase); + var shopNoColumnBase1 = new ColumnBase("ShopNo", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("ShopNo", shopNoColumnBase1); + var statusColumnBase3 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Status", statusColumnBase3); + var trescColumnBase = new ColumnBase("Tresc", "varchar(2048)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Tresc", trescColumnBase); + var typColumnBase11 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Typ", typColumnBase11); + var utworzonoColumnBase = new ColumnBase("Utworzono", "datetime", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Utworzono", utworzonoColumnBase); + var zmianaColumnBase21 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.Columns.Add("Zmiana", zmianaColumnBase21); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie", blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase = new TableMappingBase(powiadomienie, blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase, false); + defaultTableMappings111.Add(blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powiadomienieIdColumnBase, powiadomienie.FindProperty("PowiadomienieId")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)adresatColumnBase, powiadomienie.FindProperty("Adresat")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase19, powiadomienie.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kategoriaColumnBase0, powiadomienie.FindProperty("Kategoria")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nadawcaColumnBase0, powiadomienie.FindProperty("Nadawca")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)naglowekColumnBase, powiadomienie.FindProperty("Naglowek")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posNoColumnBase1, powiadomienie.FindProperty("PosNo")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNoColumnBase1, powiadomienie.FindProperty("ShopNo")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase3, powiadomienie.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)trescColumnBase, powiadomienie.FindProperty("Tresc")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase11, powiadomienie.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonoColumnBase, powiadomienie.FindProperty("Utworzono")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase21, powiadomienie.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieMappingBase); + + var tableMappings111 = new List(); + powiadomienie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings111); + var powiadomienieTable = new Table("Powiadomienie", null, relationalModel); + var powiadomienieIdColumn = new Column("PowiadomienieId", "numeric(9,0)", powiadomienieTable); + powiadomienieTable.Columns.Add("PowiadomienieId", powiadomienieIdColumn); + var adresatColumn = new Column("Adresat", "varchar(64)", powiadomienieTable) + { + IsNullable = true + }; + powiadomienieTable.Columns.Add("Adresat", adresatColumn); + var aktywnyColumn19 = new Column("Aktywny", "smallint", powiadomienieTable); + powiadomienieTable.Columns.Add("Aktywny", aktywnyColumn19); + var kategoriaColumn0 = new Column("Kategoria", "smallint", powiadomienieTable); + powiadomienieTable.Columns.Add("Kategoria", kategoriaColumn0); + var nadawcaColumn0 = new Column("Nadawca", "varchar(64)", powiadomienieTable) + { + IsNullable = true + }; + powiadomienieTable.Columns.Add("Nadawca", nadawcaColumn0); + var naglowekColumn = new Column("Naglowek", "varchar(128)", powiadomienieTable) + { + IsNullable = true + }; + powiadomienieTable.Columns.Add("Naglowek", naglowekColumn); + var posNoColumn1 = new Column("PosNo", "varchar(32)", powiadomienieTable) + { + IsNullable = true + }; + powiadomienieTable.Columns.Add("PosNo", posNoColumn1); + var shopNoColumn1 = new Column("ShopNo", "varchar(32)", powiadomienieTable) + { + IsNullable = true + }; + powiadomienieTable.Columns.Add("ShopNo", shopNoColumn1); + var statusColumn3 = new Column("Status", "smallint", powiadomienieTable); + powiadomienieTable.Columns.Add("Status", statusColumn3); + var trescColumn = new Column("Tresc", "varchar(2048)", powiadomienieTable) + { + IsNullable = true + }; + powiadomienieTable.Columns.Add("Tresc", trescColumn); + var typColumn11 = new Column("Typ", "smallint", powiadomienieTable); + powiadomienieTable.Columns.Add("Typ", typColumn11); + var utworzonoColumn = new Column("Utworzono", "datetime", powiadomienieTable); + powiadomienieTable.Columns.Add("Utworzono", utworzonoColumn); + var zmianaColumn21 = new Column("Zmiana", "datetime", powiadomienieTable); + powiadomienieTable.Columns.Add("Zmiana", zmianaColumn21); + var pK_POWIADOMIENIE = new UniqueConstraint("PK_POWIADOMIENIE", powiadomienieTable, new[] { powiadomienieIdColumn }); + powiadomienieTable.PrimaryKey = pK_POWIADOMIENIE; + var pK_POWIADOMIENIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie", + new[] { "PowiadomienieId" }); + pK_POWIADOMIENIE.MappedKeys.Add(pK_POWIADOMIENIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POWIADOMIENIEUc).Add(pK_POWIADOMIENIE); + powiadomienieTable.UniqueConstraints.Add("PK_POWIADOMIENIE", pK_POWIADOMIENIE); + var ixPowiadomienie_ShopNoPosNo = new TableIndex( + "IxPowiadomienie_ShopNoPosNo", powiadomienieTable, new[] { shopNoColumn1, posNoColumn1 }, false); + var ixPowiadomienie_ShopNoPosNoIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie", + "IxPowiadomienie_ShopNoPosNo"); + ixPowiadomienie_ShopNoPosNo.MappedIndexes.Add(ixPowiadomienie_ShopNoPosNoIx); + RelationalModel.GetOrCreateTableIndexes(ixPowiadomienie_ShopNoPosNoIx).Add(ixPowiadomienie_ShopNoPosNo); + powiadomienieTable.Indexes.Add("IxPowiadomienie_ShopNoPosNo", ixPowiadomienie_ShopNoPosNo); + var ixPowiadomienie_Status = new TableIndex( + "IxPowiadomienie_Status", powiadomienieTable, new[] { statusColumn3 }, false); + var ixPowiadomienie_StatusIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie", + "IxPowiadomienie_Status"); + ixPowiadomienie_Status.MappedIndexes.Add(ixPowiadomienie_StatusIx); + RelationalModel.GetOrCreateTableIndexes(ixPowiadomienie_StatusIx).Add(ixPowiadomienie_Status); + powiadomienieTable.Indexes.Add("IxPowiadomienie_Status", ixPowiadomienie_Status); + relationalModel.Tables.Add(("Powiadomienie", null), powiadomienieTable); + var powiadomienieTableMapping = new TableMapping(powiadomienie, powiadomienieTable, true); + powiadomienieTable.AddTypeMapping(powiadomienieTableMapping, false); + tableMappings111.Add(powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(powiadomienieIdColumn, powiadomienie.FindProperty("PowiadomienieId")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(adresatColumn, powiadomienie.FindProperty("Adresat")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn19, powiadomienie.FindProperty("Aktywny")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(kategoriaColumn0, powiadomienie.FindProperty("Kategoria")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(nadawcaColumn0, powiadomienie.FindProperty("Nadawca")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(naglowekColumn, powiadomienie.FindProperty("Naglowek")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(posNoColumn1, powiadomienie.FindProperty("PosNo")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(shopNoColumn1, powiadomienie.FindProperty("ShopNo")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(statusColumn3, powiadomienie.FindProperty("Status")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(trescColumn, powiadomienie.FindProperty("Tresc")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(typColumn11, powiadomienie.FindProperty("Typ")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(utworzonoColumn, powiadomienie.FindProperty("Utworzono")!, powiadomienieTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn21, powiadomienie.FindProperty("Zmiana")!, powiadomienieTableMapping); + + var powiadomienieParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PowiadomienieParam")!; + + var defaultTableMappings112 = new List>(); + powiadomienieParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings112); + var blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PowiadomienieParam", null, relationalModel); + var kolejnoscColumnBase11 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase11); + var param1ColumnBase2 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase.Columns.Add("Param1", param1ColumnBase2); + var param2ColumnBase0 = new ColumnBase("Param2", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase.Columns.Add("Param2", param2ColumnBase0); + var powiadomienieIdColumnBase0 = new ColumnBase("PowiadomienieId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase.Columns.Add("PowiadomienieId", powiadomienieIdColumnBase0); + var znaczenieColumnBase8 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase.Columns.Add("Znaczenie", znaczenieColumnBase8); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PowiadomienieParam", blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase = new TableMappingBase(powiadomienieParam, blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase, false); + defaultTableMappings112.Add(blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase11, powiadomienieParam.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powiadomienieIdColumnBase0, powiadomienieParam.FindProperty("PowiadomienieId")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase8, powiadomienieParam.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase2, powiadomienieParam.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase0, powiadomienieParam.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesPowiadomienieParamMappingBase); + + var tableMappings112 = new List(); + powiadomienieParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings112); + var powiadomienieParamTable = new Table("PowiadomienieParam", null, relationalModel); + var powiadomienieIdColumn0 = new Column("PowiadomienieId", "numeric(9,0)", powiadomienieParamTable); + powiadomienieParamTable.Columns.Add("PowiadomienieId", powiadomienieIdColumn0); + var znaczenieColumn8 = new Column("Znaczenie", "smallint", powiadomienieParamTable); + powiadomienieParamTable.Columns.Add("Znaczenie", znaczenieColumn8); + var kolejnoscColumn11 = new Column("Kolejnosc", "int", powiadomienieParamTable); + powiadomienieParamTable.Columns.Add("Kolejnosc", kolejnoscColumn11); + var param1Column2 = new Column("Param1", "int", powiadomienieParamTable) + { + IsNullable = true + }; + powiadomienieParamTable.Columns.Add("Param1", param1Column2); + var param2Column0 = new Column("Param2", "varchar(255)", powiadomienieParamTable) + { + IsNullable = true + }; + powiadomienieParamTable.Columns.Add("Param2", param2Column0); + var pK_POWIADOMIENIEPARAM = new UniqueConstraint("PK_POWIADOMIENIEPARAM", powiadomienieParamTable, new[] { powiadomienieIdColumn0, znaczenieColumn8, kolejnoscColumn11 }); + powiadomienieParamTable.PrimaryKey = pK_POWIADOMIENIEPARAM; + var pK_POWIADOMIENIEPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiadomienieParam", + new[] { "PowiadomienieId", "Znaczenie", "Kolejnosc" }); + pK_POWIADOMIENIEPARAM.MappedKeys.Add(pK_POWIADOMIENIEPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POWIADOMIENIEPARAMUc).Add(pK_POWIADOMIENIEPARAM); + powiadomienieParamTable.UniqueConstraints.Add("PK_POWIADOMIENIEPARAM", pK_POWIADOMIENIEPARAM); + relationalModel.Tables.Add(("PowiadomienieParam", null), powiadomienieParamTable); + var powiadomienieParamTableMapping = new TableMapping(powiadomienieParam, powiadomienieParamTable, true); + powiadomienieParamTable.AddTypeMapping(powiadomienieParamTableMapping, false); + tableMappings112.Add(powiadomienieParamTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn11, powiadomienieParam.FindProperty("Kolejnosc")!, powiadomienieParamTableMapping); + RelationalModel.CreateColumnMapping(powiadomienieIdColumn0, powiadomienieParam.FindProperty("PowiadomienieId")!, powiadomienieParamTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn8, powiadomienieParam.FindProperty("Znaczenie")!, powiadomienieParamTableMapping); + RelationalModel.CreateColumnMapping(param1Column2, powiadomienieParam.FindProperty("Param1")!, powiadomienieParamTableMapping); + RelationalModel.CreateColumnMapping(param2Column0, powiadomienieParam.FindProperty("Param2")!, powiadomienieParamTableMapping); + + var powiazanie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Powiazanie")!; + + var defaultTableMappings113 = new List>(); + powiazanie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings113); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Powiazanie", null, relationalModel); + var ileWOpakColumnBase = new ColumnBase("IleWOpak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase.Columns.Add("IleWOpak", ileWOpakColumnBase); + var opakIdColumnBase = new ColumnBase("OpakId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase.Columns.Add("OpakId", opakIdColumnBase); + var tandemColumnBase = new ColumnBase("Tandem", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase.Columns.Add("Tandem", tandemColumnBase); + var towIdColumnBase11 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase.Columns.Add("TowId", towIdColumnBase11); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Powiazanie", blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieMappingBase = new TableMappingBase(powiazanie, blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowiazanieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowiazanieMappingBase, false); + defaultTableMappings113.Add(blinkBackofficeServicesPcmDbEntitiesPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase11, powiazanie.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWOpakColumnBase, powiazanie.FindProperty("IleWOpak")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opakIdColumnBase, powiazanie.FindProperty("OpakId")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tandemColumnBase, powiazanie.FindProperty("Tandem")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieMappingBase); + + var tableMappings113 = new List(); + powiazanie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings113); + var powiazanieTable = new Table("Powiazanie", null, relationalModel); + var towIdColumn11 = new Column("TowId", "numeric(9,0)", powiazanieTable); + powiazanieTable.Columns.Add("TowId", towIdColumn11); + var ileWOpakColumn = new Column("IleWOpak", "decimal(15,4)", powiazanieTable); + powiazanieTable.Columns.Add("IleWOpak", ileWOpakColumn); + var opakIdColumn = new Column("OpakId", "numeric(9,0)", powiazanieTable); + powiazanieTable.Columns.Add("OpakId", opakIdColumn); + var tandemColumn = new Column("Tandem", "smallint", powiazanieTable); + powiazanieTable.Columns.Add("Tandem", tandemColumn); + var pK_POWIAZANIE = new UniqueConstraint("PK_POWIAZANIE", powiazanieTable, new[] { towIdColumn11 }); + powiazanieTable.PrimaryKey = pK_POWIAZANIE; + var pK_POWIAZANIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Powiazanie", + new[] { "TowId" }); + pK_POWIAZANIE.MappedKeys.Add(pK_POWIAZANIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POWIAZANIEUc).Add(pK_POWIAZANIE); + powiazanieTable.UniqueConstraints.Add("PK_POWIAZANIE", pK_POWIAZANIE); + var idx_OpakId = new TableIndex( + "idx_OpakId", powiazanieTable, new[] { opakIdColumn }, false); + var idx_OpakIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Powiazanie", + "idx_OpakId"); + idx_OpakId.MappedIndexes.Add(idx_OpakIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_OpakIdIx).Add(idx_OpakId); + powiazanieTable.Indexes.Add("idx_OpakId", idx_OpakId); + relationalModel.Tables.Add(("Powiazanie", null), powiazanieTable); + var powiazanieTableMapping = new TableMapping(powiazanie, powiazanieTable, true); + powiazanieTable.AddTypeMapping(powiazanieTableMapping, false); + tableMappings113.Add(powiazanieTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn11, powiazanie.FindProperty("TowId")!, powiazanieTableMapping); + RelationalModel.CreateColumnMapping(ileWOpakColumn, powiazanie.FindProperty("IleWOpak")!, powiazanieTableMapping); + RelationalModel.CreateColumnMapping(opakIdColumn, powiazanie.FindProperty("OpakId")!, powiazanieTableMapping); + RelationalModel.CreateColumnMapping(tandemColumn, powiazanie.FindProperty("Tandem")!, powiazanieTableMapping); + + var powiazanieProm = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieProm")!; + + var defaultTableMappings114 = new List>(); + powiazanieProm.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings114); + var blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieProm", null, relationalModel); + var grupaIdColumnBase0 = new ColumnBase("GrupaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase.Columns.Add("GrupaId", grupaIdColumnBase0); + var promIdColumnBase = new ColumnBase("PromId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase.Columns.Add("PromId", promIdColumnBase); + var rodzajColumnBase2 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase.Columns.Add("Rodzaj", rodzajColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieProm", blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowiazaniePromMappingBase = new TableMappingBase(powiazanieProm, blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowiazaniePromTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowiazaniePromMappingBase, false); + defaultTableMappings114.Add(blinkBackofficeServicesPcmDbEntitiesPowiazaniePromMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupaIdColumnBase0, powiazanieProm.FindProperty("GrupaId")!, blinkBackofficeServicesPcmDbEntitiesPowiazaniePromMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)promIdColumnBase, powiazanieProm.FindProperty("PromId")!, blinkBackofficeServicesPcmDbEntitiesPowiazaniePromMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase2, powiazanieProm.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesPowiazaniePromMappingBase); + + var tableMappings114 = new List(); + powiazanieProm.SetRuntimeAnnotation("Relational:TableMappings", tableMappings114); + var powiazaniePromTable = new Table("PowiazanieProm", null, relationalModel); + var promIdColumn = new Column("PromId", "numeric(9,0)", powiazaniePromTable); + powiazaniePromTable.Columns.Add("PromId", promIdColumn); + var grupaIdColumn0 = new Column("GrupaId", "numeric(9,0)", powiazaniePromTable); + powiazaniePromTable.Columns.Add("GrupaId", grupaIdColumn0); + var rodzajColumn2 = new Column("Rodzaj", "smallint", powiazaniePromTable); + powiazaniePromTable.Columns.Add("Rodzaj", rodzajColumn2); + var pK_PowiazanieProm = new UniqueConstraint("PK_PowiazanieProm", powiazaniePromTable, new[] { promIdColumn, grupaIdColumn0, rodzajColumn2 }); + powiazaniePromTable.PrimaryKey = pK_PowiazanieProm; + var pK_PowiazaniePromUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieProm", + new[] { "PromId", "GrupaId", "Rodzaj" }); + pK_PowiazanieProm.MappedKeys.Add(pK_PowiazaniePromUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PowiazaniePromUc).Add(pK_PowiazanieProm); + powiazaniePromTable.UniqueConstraints.Add("PK_PowiazanieProm", pK_PowiazanieProm); + var iX_PowiazanieProm_GrupaId = new TableIndex( + "IX_PowiazanieProm_GrupaId", powiazaniePromTable, new[] { grupaIdColumn0 }, false); + var iX_PowiazanieProm_GrupaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieProm", + new[] { "GrupaId" }); + iX_PowiazanieProm_GrupaId.MappedIndexes.Add(iX_PowiazanieProm_GrupaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PowiazanieProm_GrupaIdIx).Add(iX_PowiazanieProm_GrupaId); + powiazaniePromTable.Indexes.Add("IX_PowiazanieProm_GrupaId", iX_PowiazanieProm_GrupaId); + relationalModel.Tables.Add(("PowiazanieProm", null), powiazaniePromTable); + var powiazaniePromTableMapping = new TableMapping(powiazanieProm, powiazaniePromTable, true); + powiazaniePromTable.AddTypeMapping(powiazaniePromTableMapping, false); + tableMappings114.Add(powiazaniePromTableMapping); + RelationalModel.CreateColumnMapping(grupaIdColumn0, powiazanieProm.FindProperty("GrupaId")!, powiazaniePromTableMapping); + RelationalModel.CreateColumnMapping(promIdColumn, powiazanieProm.FindProperty("PromId")!, powiazaniePromTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn2, powiazanieProm.FindProperty("Rodzaj")!, powiazaniePromTableMapping); + + var powiazanieSklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieSklep")!; + + var defaultTableMappings115 = new List>(); + powiazanieSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings115); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieSklep", null, relationalModel); + var aktywnyColumnBase20 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase.Columns.Add("Aktywny", aktywnyColumnBase20); + var idColumnBase1 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase.Columns.Add("Id", idColumnBase1); + var sklepIdColumnBase0 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase.Columns.Add("SklepId", sklepIdColumnBase0); + var typColumnBase12 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase.Columns.Add("Typ", typColumnBase12); + var zmianaColumnBase22 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase.Columns.Add("Zmiana", zmianaColumnBase22); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieSklep", blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase = new TableMappingBase(powiazanieSklep, blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase, false); + defaultTableMappings115.Add(blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase1, powiazanieSklep.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase0, powiazanieSklep.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase12, powiazanieSklep.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase20, powiazanieSklep.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase22, powiazanieSklep.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieSklepMappingBase); + + var tableMappings115 = new List(); + powiazanieSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings115); + var powiazanieSklepTable = new Table("PowiazanieSklep", null, relationalModel); + var sklepIdColumn0 = new Column("SklepId", "numeric(9,0)", powiazanieSklepTable); + powiazanieSklepTable.Columns.Add("SklepId", sklepIdColumn0); + var idColumn1 = new Column("Id", "numeric(9,0)", powiazanieSklepTable); + powiazanieSklepTable.Columns.Add("Id", idColumn1); + var typColumn12 = new Column("Typ", "smallint", powiazanieSklepTable); + powiazanieSklepTable.Columns.Add("Typ", typColumn12); + var aktywnyColumn20 = new Column("Aktywny", "smallint", powiazanieSklepTable) + { + IsNullable = true + }; + powiazanieSklepTable.Columns.Add("Aktywny", aktywnyColumn20); + var zmianaColumn22 = new Column("Zmiana", "datetime", powiazanieSklepTable) + { + IsNullable = true + }; + powiazanieSklepTable.Columns.Add("Zmiana", zmianaColumn22); + var pK_POWIAZANIE_SKLEP = new UniqueConstraint("PK_POWIAZANIE_SKLEP", powiazanieSklepTable, new[] { sklepIdColumn0, idColumn1, typColumn12 }); + powiazanieSklepTable.PrimaryKey = pK_POWIAZANIE_SKLEP; + var pK_POWIAZANIE_SKLEPUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieSklep", + new[] { "SklepId", "Id", "Typ" }); + pK_POWIAZANIE_SKLEP.MappedKeys.Add(pK_POWIAZANIE_SKLEPUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POWIAZANIE_SKLEPUc).Add(pK_POWIAZANIE_SKLEP); + powiazanieSklepTable.UniqueConstraints.Add("PK_POWIAZANIE_SKLEP", pK_POWIAZANIE_SKLEP); + var powiazanieSklepTyp = new TableIndex( + "PowiazanieSklepTyp", powiazanieSklepTable, new[] { typColumn12 }, false); + var powiazanieSklepTypIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieSklep", + "PowiazanieSklepTyp"); + powiazanieSklepTyp.MappedIndexes.Add(powiazanieSklepTypIx); + RelationalModel.GetOrCreateTableIndexes(powiazanieSklepTypIx).Add(powiazanieSklepTyp); + powiazanieSklepTable.Indexes.Add("PowiazanieSklepTyp", powiazanieSklepTyp); + relationalModel.Tables.Add(("PowiazanieSklep", null), powiazanieSklepTable); + var powiazanieSklepTableMapping = new TableMapping(powiazanieSklep, powiazanieSklepTable, true); + powiazanieSklepTable.AddTypeMapping(powiazanieSklepTableMapping, false); + tableMappings115.Add(powiazanieSklepTableMapping); + RelationalModel.CreateColumnMapping(idColumn1, powiazanieSklep.FindProperty("Id")!, powiazanieSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn0, powiazanieSklep.FindProperty("SklepId")!, powiazanieSklepTableMapping); + RelationalModel.CreateColumnMapping(typColumn12, powiazanieSklep.FindProperty("Typ")!, powiazanieSklepTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn20, powiazanieSklep.FindProperty("Aktywny")!, powiazanieSklepTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn22, powiazanieSklep.FindProperty("Zmiana")!, powiazanieSklepTableMapping); + + var powiazanieUz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUz")!; + + var defaultTableMappings116 = new List>(); + powiazanieUz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings116); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUz", null, relationalModel); + var idColumnBase2 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase.Columns.Add("Id", idColumnBase2); + var rodzajPowColumnBase0 = new ColumnBase("RodzajPow", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase.Columns.Add("RodzajPow", rodzajPowColumnBase0); + var uzIdColumnBase3 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase.Columns.Add("UzId", uzIdColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUz", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieUzMappingBase = new TableMappingBase(powiazanieUz, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowiazanieUzMappingBase, false); + defaultTableMappings116.Add(blinkBackofficeServicesPcmDbEntitiesPowiazanieUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase2, powiazanieUz.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajPowColumnBase0, powiazanieUz.FindProperty("RodzajPow")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase3, powiazanieUz.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzMappingBase); + + var tableMappings116 = new List(); + powiazanieUz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings116); + var powiazanieUzTable = new Table("PowiazanieUz", null, relationalModel); + var uzIdColumn3 = new Column("UzId", "numeric(9,0)", powiazanieUzTable); + powiazanieUzTable.Columns.Add("UzId", uzIdColumn3); + var rodzajPowColumn0 = new Column("RodzajPow", "smallint", powiazanieUzTable); + powiazanieUzTable.Columns.Add("RodzajPow", rodzajPowColumn0); + var idColumn2 = new Column("Id", "numeric(9,0)", powiazanieUzTable); + powiazanieUzTable.Columns.Add("Id", idColumn2); + var pK_POWIAZANIEUZ = new UniqueConstraint("PK_POWIAZANIEUZ", powiazanieUzTable, new[] { uzIdColumn3, rodzajPowColumn0, idColumn2 }); + powiazanieUzTable.PrimaryKey = pK_POWIAZANIEUZ; + var pK_POWIAZANIEUZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUz", + new[] { "UzId", "RodzajPow", "Id" }); + pK_POWIAZANIEUZ.MappedKeys.Add(pK_POWIAZANIEUZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POWIAZANIEUZUc).Add(pK_POWIAZANIEUZ); + powiazanieUzTable.UniqueConstraints.Add("PK_POWIAZANIEUZ", pK_POWIAZANIEUZ); + relationalModel.Tables.Add(("PowiazanieUz", null), powiazanieUzTable); + var powiazanieUzTableMapping = new TableMapping(powiazanieUz, powiazanieUzTable, true); + powiazanieUzTable.AddTypeMapping(powiazanieUzTableMapping, false); + tableMappings116.Add(powiazanieUzTableMapping); + RelationalModel.CreateColumnMapping(idColumn2, powiazanieUz.FindProperty("Id")!, powiazanieUzTableMapping); + RelationalModel.CreateColumnMapping(rodzajPowColumn0, powiazanieUz.FindProperty("RodzajPow")!, powiazanieUzTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn3, powiazanieUz.FindProperty("UzId")!, powiazanieUzTableMapping); + + var powiazanieUzNaSklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUzNaSklep")!; + + var defaultTableMappings117 = new List>(); + powiazanieUzNaSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings117); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUzNaSklep", null, relationalModel); + var idColumnBase3 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase.Columns.Add("Id", idColumnBase3); + var rodzajPowColumnBase1 = new ColumnBase("RodzajPow", "smallint", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase.Columns.Add("RodzajPow", rodzajPowColumnBase1); + var uzNSIdColumnBase0 = new ColumnBase("UzNSId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase.Columns.Add("UzNSId", uzNSIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUzNaSklep", blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepMappingBase = new TableMappingBase(powiazanieUzNaSklep, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepMappingBase, false); + defaultTableMappings117.Add(blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase3, powiazanieUzNaSklep.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajPowColumnBase1, powiazanieUzNaSklep.FindProperty("RodzajPow")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzNSIdColumnBase0, powiazanieUzNaSklep.FindProperty("UzNSId")!, blinkBackofficeServicesPcmDbEntitiesPowiazanieUzNaSklepMappingBase); + + var tableMappings117 = new List(); + powiazanieUzNaSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings117); + var powiazanieUzNaSklepTable = new Table("PowiazanieUzNaSklep", null, relationalModel); + var uzNSIdColumn0 = new Column("UzNSId", "numeric(9,0)", powiazanieUzNaSklepTable); + powiazanieUzNaSklepTable.Columns.Add("UzNSId", uzNSIdColumn0); + var rodzajPowColumn1 = new Column("RodzajPow", "smallint", powiazanieUzNaSklepTable); + powiazanieUzNaSklepTable.Columns.Add("RodzajPow", rodzajPowColumn1); + var idColumn3 = new Column("Id", "numeric(9,0)", powiazanieUzNaSklepTable); + powiazanieUzNaSklepTable.Columns.Add("Id", idColumn3); + var pK_POWIAZANIEUZNASKLEP = new UniqueConstraint("PK_POWIAZANIEUZNASKLEP", powiazanieUzNaSklepTable, new[] { uzNSIdColumn0, rodzajPowColumn1, idColumn3 }); + powiazanieUzNaSklepTable.PrimaryKey = pK_POWIAZANIEUZNASKLEP; + var pK_POWIAZANIEUZNASKLEPUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUzNaSklep", + new[] { "UzNSId", "RodzajPow", "Id" }); + pK_POWIAZANIEUZNASKLEP.MappedKeys.Add(pK_POWIAZANIEUZNASKLEPUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POWIAZANIEUZNASKLEPUc).Add(pK_POWIAZANIEUZNASKLEP); + powiazanieUzNaSklepTable.UniqueConstraints.Add("PK_POWIAZANIEUZNASKLEP", pK_POWIAZANIEUZNASKLEP); + relationalModel.Tables.Add(("PowiazanieUzNaSklep", null), powiazanieUzNaSklepTable); + var powiazanieUzNaSklepTableMapping = new TableMapping(powiazanieUzNaSklep, powiazanieUzNaSklepTable, true); + powiazanieUzNaSklepTable.AddTypeMapping(powiazanieUzNaSklepTableMapping, false); + tableMappings117.Add(powiazanieUzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(idColumn3, powiazanieUzNaSklep.FindProperty("Id")!, powiazanieUzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(rodzajPowColumn1, powiazanieUzNaSklep.FindProperty("RodzajPow")!, powiazanieUzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(uzNSIdColumn0, powiazanieUzNaSklep.FindProperty("UzNSId")!, powiazanieUzNaSklepTableMapping); + + var pozAkcyza = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza")!; + + var defaultTableMappings118 = new List>(); + pozAkcyza.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings118); + var blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza", null, relationalModel); + var dokIdColumnBase9 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase.Columns.Add("DokId", dokIdColumnBase9); + var grAkcIdColumnBase0 = new ColumnBase("GrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase.Columns.Add("GrAkcId", grAkcIdColumnBase0); + var kolejnoscColumnBase12 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase12); + var wartoscColumnBase2 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase.Columns.Add("Wartosc", wartoscColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza", blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase); + var blinkBackofficeServicesPcmDbEntitiesPozAkcyzaMappingBase = new TableMappingBase(pozAkcyza, blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPozAkcyzaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPozAkcyzaMappingBase, false); + defaultTableMappings118.Add(blinkBackofficeServicesPcmDbEntitiesPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase9, pozAkcyza.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grAkcIdColumnBase0, pozAkcyza.FindProperty("GrAkcId")!, blinkBackofficeServicesPcmDbEntitiesPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase12, pozAkcyza.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase2, pozAkcyza.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesPozAkcyzaMappingBase); + + var tableMappings118 = new List(); + pozAkcyza.SetRuntimeAnnotation("Relational:TableMappings", tableMappings118); + var pozAkcyzaTable = new Table("PozAkcyza", null, relationalModel); + var dokIdColumn9 = new Column("DokId", "numeric(9,0)", pozAkcyzaTable); + pozAkcyzaTable.Columns.Add("DokId", dokIdColumn9); + var kolejnoscColumn12 = new Column("Kolejnosc", "int", pozAkcyzaTable); + pozAkcyzaTable.Columns.Add("Kolejnosc", kolejnoscColumn12); + var grAkcIdColumn0 = new Column("GrAkcId", "numeric(9,0)", pozAkcyzaTable); + pozAkcyzaTable.Columns.Add("GrAkcId", grAkcIdColumn0); + var wartoscColumn2 = new Column("Wartosc", "decimal(15,4)", pozAkcyzaTable); + pozAkcyzaTable.Columns.Add("Wartosc", wartoscColumn2); + var pK_POZAKCYZA = new UniqueConstraint("PK_POZAKCYZA", pozAkcyzaTable, new[] { dokIdColumn9, kolejnoscColumn12, grAkcIdColumn0 }); + pozAkcyzaTable.PrimaryKey = pK_POZAKCYZA; + var pK_POZAKCYZAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza", + new[] { "DokId", "Kolejnosc", "GrAkcId" }); + pK_POZAKCYZA.MappedKeys.Add(pK_POZAKCYZAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POZAKCYZAUc).Add(pK_POZAKCYZA); + pozAkcyzaTable.UniqueConstraints.Add("PK_POZAKCYZA", pK_POZAKCYZA); + var idx_PozAkcGr = new TableIndex( + "idx_PozAkcGr", pozAkcyzaTable, new[] { grAkcIdColumn0 }, false); + var idx_PozAkcGrIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza", + "idx_PozAkcGr"); + idx_PozAkcGr.MappedIndexes.Add(idx_PozAkcGrIx); + RelationalModel.GetOrCreateTableIndexes(idx_PozAkcGrIx).Add(idx_PozAkcGr); + pozAkcyzaTable.Indexes.Add("idx_PozAkcGr", idx_PozAkcGr); + relationalModel.Tables.Add(("PozAkcyza", null), pozAkcyzaTable); + var pozAkcyzaTableMapping = new TableMapping(pozAkcyza, pozAkcyzaTable, true); + pozAkcyzaTable.AddTypeMapping(pozAkcyzaTableMapping, false); + tableMappings118.Add(pozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn9, pozAkcyza.FindProperty("DokId")!, pozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(grAkcIdColumn0, pozAkcyza.FindProperty("GrAkcId")!, pozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn12, pozAkcyza.FindProperty("Kolejnosc")!, pozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn2, pozAkcyza.FindProperty("Wartosc")!, pozAkcyzaTableMapping); + + var pozCennikDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PozCennikDok")!; + + var defaultTableMappings119 = new List>(); + pozCennikDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings119); + var blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PozCennikDok", null, relationalModel); + var doKiedyPrzyjecieColumnBase = new ColumnBase("DoKiedyPrzyjecie", "datetime", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("DoKiedyPrzyjecie", doKiedyPrzyjecieColumnBase); + var dokIdColumnBase10 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("DokId", dokIdColumnBase10); + var przydzialColumnBase = new ColumnBase("Przydzial", "smallint", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("Przydzial", przydzialColumnBase); + var rodzajColumnBase3 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("Rodzaj", rodzajColumnBase3); + var sklepIdColumnBase1 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("SklepId", sklepIdColumnBase1); + var statusZamColumnBase = new ColumnBase("StatusZam", "smallint", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("StatusZam", statusZamColumnBase); + var towIdColumnBase12 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("TowId", towIdColumnBase12); + var zmDoKiedyPrzyjecieColumnBase = new ColumnBase("ZmDoKiedyPrzyjecie", "smallint", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("ZmDoKiedyPrzyjecie", zmDoKiedyPrzyjecieColumnBase); + var zmPrzydzialColumnBase = new ColumnBase("ZmPrzydzial", "smallint", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("ZmPrzydzial", zmPrzydzialColumnBase); + var zmStatusZamColumnBase = new ColumnBase("ZmStatusZam", "smallint", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.Columns.Add("ZmStatusZam", zmStatusZamColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PozCennikDok", blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase = new TableMappingBase(pozCennikDok, blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPozCennikDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase, false); + defaultTableMappings119.Add(blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase10, pozCennikDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase1, pozCennikDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase12, pozCennikDok.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)doKiedyPrzyjecieColumnBase, pozCennikDok.FindProperty("DoKiedyPrzyjecie")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przydzialColumnBase, pozCennikDok.FindProperty("Przydzial")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase3, pozCennikDok.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusZamColumnBase, pozCennikDok.FindProperty("StatusZam")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmDoKiedyPrzyjecieColumnBase, pozCennikDok.FindProperty("ZmDoKiedyPrzyjecie")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmPrzydzialColumnBase, pozCennikDok.FindProperty("ZmPrzydzial")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmStatusZamColumnBase, pozCennikDok.FindProperty("ZmStatusZam")!, blinkBackofficeServicesPcmDbEntitiesPozCennikDokMappingBase); + + var tableMappings119 = new List(); + pozCennikDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings119); + var pozCennikDokTable = new Table("PozCennikDok", null, relationalModel); + var dokIdColumn10 = new Column("DokId", "numeric(9,0)", pozCennikDokTable); + pozCennikDokTable.Columns.Add("DokId", dokIdColumn10); + var towIdColumn12 = new Column("TowId", "numeric(9,0)", pozCennikDokTable); + pozCennikDokTable.Columns.Add("TowId", towIdColumn12); + var sklepIdColumn1 = new Column("SklepId", "numeric(9,0)", pozCennikDokTable); + pozCennikDokTable.Columns.Add("SklepId", sklepIdColumn1); + var doKiedyPrzyjecieColumn = new Column("DoKiedyPrzyjecie", "datetime", pozCennikDokTable) + { + IsNullable = true + }; + pozCennikDokTable.Columns.Add("DoKiedyPrzyjecie", doKiedyPrzyjecieColumn); + var przydzialColumn = new Column("Przydzial", "smallint", pozCennikDokTable) + { + IsNullable = true + }; + pozCennikDokTable.Columns.Add("Przydzial", przydzialColumn); + var rodzajColumn3 = new Column("Rodzaj", "smallint", pozCennikDokTable) + { + IsNullable = true + }; + pozCennikDokTable.Columns.Add("Rodzaj", rodzajColumn3); + var statusZamColumn = new Column("StatusZam", "smallint", pozCennikDokTable) + { + IsNullable = true + }; + pozCennikDokTable.Columns.Add("StatusZam", statusZamColumn); + var zmDoKiedyPrzyjecieColumn = new Column("ZmDoKiedyPrzyjecie", "smallint", pozCennikDokTable) + { + IsNullable = true + }; + pozCennikDokTable.Columns.Add("ZmDoKiedyPrzyjecie", zmDoKiedyPrzyjecieColumn); + var zmPrzydzialColumn = new Column("ZmPrzydzial", "smallint", pozCennikDokTable) + { + IsNullable = true + }; + pozCennikDokTable.Columns.Add("ZmPrzydzial", zmPrzydzialColumn); + var zmStatusZamColumn = new Column("ZmStatusZam", "smallint", pozCennikDokTable) + { + IsNullable = true + }; + pozCennikDokTable.Columns.Add("ZmStatusZam", zmStatusZamColumn); + var pK_POZCENNIKDOK = new UniqueConstraint("PK_POZCENNIKDOK", pozCennikDokTable, new[] { dokIdColumn10, towIdColumn12, sklepIdColumn1 }); + pozCennikDokTable.PrimaryKey = pK_POZCENNIKDOK; + var pK_POZCENNIKDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozCennikDok", + new[] { "DokId", "TowId", "SklepId" }); + pK_POZCENNIKDOK.MappedKeys.Add(pK_POZCENNIKDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POZCENNIKDOKUc).Add(pK_POZCENNIKDOK); + pozCennikDokTable.UniqueConstraints.Add("PK_POZCENNIKDOK", pK_POZCENNIKDOK); + var iX_PozCennikDok_SklepId = new TableIndex( + "IX_PozCennikDok_SklepId", pozCennikDokTable, new[] { sklepIdColumn1 }, false); + var iX_PozCennikDok_SklepIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozCennikDok", + new[] { "SklepId" }); + iX_PozCennikDok_SklepId.MappedIndexes.Add(iX_PozCennikDok_SklepIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PozCennikDok_SklepIdIx).Add(iX_PozCennikDok_SklepId); + pozCennikDokTable.Indexes.Add("IX_PozCennikDok_SklepId", iX_PozCennikDok_SklepId); + relationalModel.Tables.Add(("PozCennikDok", null), pozCennikDokTable); + var pozCennikDokTableMapping = new TableMapping(pozCennikDok, pozCennikDokTable, true); + pozCennikDokTable.AddTypeMapping(pozCennikDokTableMapping, false); + tableMappings119.Add(pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn10, pozCennikDok.FindProperty("DokId")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn1, pozCennikDok.FindProperty("SklepId")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn12, pozCennikDok.FindProperty("TowId")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(doKiedyPrzyjecieColumn, pozCennikDok.FindProperty("DoKiedyPrzyjecie")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(przydzialColumn, pozCennikDok.FindProperty("Przydzial")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn3, pozCennikDok.FindProperty("Rodzaj")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(statusZamColumn, pozCennikDok.FindProperty("StatusZam")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(zmDoKiedyPrzyjecieColumn, pozCennikDok.FindProperty("ZmDoKiedyPrzyjecie")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(zmPrzydzialColumn, pozCennikDok.FindProperty("ZmPrzydzial")!, pozCennikDokTableMapping); + RelationalModel.CreateColumnMapping(zmStatusZamColumn, pozCennikDok.FindProperty("ZmStatusZam")!, pozCennikDokTableMapping); + + var pozDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PozDok")!; + + var defaultTableMappings120 = new List>(); + pozDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings120); + var blinkBackofficeServicesPcmDbEntitiesPozDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PozDok", null, relationalModel); + var cenaDetColumnBase0 = new ColumnBase("CenaDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("CenaDet", cenaDetColumnBase0); + var cenaDomyslnaColumnBase = new ColumnBase("CenaDomyslna", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("CenaDomyslna", cenaDomyslnaColumnBase); + var cenaMagColumnBase0 = new ColumnBase("CenaMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("CenaMag", cenaMagColumnBase0); + var cenaPoRabColumnBase = new ColumnBase("CenaPoRab", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("CenaPoRab", cenaPoRabColumnBase); + var cenaPrzedRabColumnBase = new ColumnBase("CenaPrzedRab", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("CenaPrzedRab", cenaPrzedRabColumnBase); + var dokIdColumnBase11 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("DokId", dokIdColumnBase11); + var ileWZgrzewceColumnBase0 = new ColumnBase("IleWZgrzewce", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("IleWZgrzewce", ileWZgrzewceColumnBase0); + var iloscMinusColumnBase = new ColumnBase("IloscMinus", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("IloscMinus", iloscMinusColumnBase); + var iloscPlusColumnBase = new ColumnBase("IloscPlus", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("IloscPlus", iloscPlusColumnBase); + var kolejnoscColumnBase13 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase13); + var metodaColumnBase = new ColumnBase("Metoda", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("Metoda", metodaColumnBase); + var nettoColumnBase0 = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("Netto", nettoColumnBase0); + var nrPozycjiColumnBase = new ColumnBase("NrPozycji", "int", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("NrPozycji", nrPozycjiColumnBase); + var podatekColumnBase0 = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("Podatek", podatekColumnBase0); + var poziomCenColumnBase3 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("PoziomCen", poziomCenColumnBase3); + var rabatProcColumnBase0 = new ColumnBase("RabatProc", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("RabatProc", rabatProcColumnBase0); + var stawkaColumnBase3 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("Stawka", stawkaColumnBase3); + var stawkaDodColumnBase = new ColumnBase("StawkaDod", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("StawkaDod", stawkaDodColumnBase); + var towIdColumnBase13 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("TowId", towIdColumnBase13); + var typPozColumnBase = new ColumnBase("TypPoz", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("TypPoz", typPozColumnBase); + var typTowaruColumnBase1 = new ColumnBase("TypTowaru", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("TypTowaru", typTowaruColumnBase1); + var wartoscColumnBase3 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.Columns.Add("Wartosc", wartoscColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PozDok", blinkBackofficeServicesPcmDbEntitiesPozDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase = new TableMappingBase(pozDok, blinkBackofficeServicesPcmDbEntitiesPozDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPozDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase, false); + defaultTableMappings120.Add(blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase11, pozDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase13, pozDok.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDetColumnBase0, pozDok.FindProperty("CenaDet")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDomyslnaColumnBase, pozDok.FindProperty("CenaDomyslna")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaMagColumnBase0, pozDok.FindProperty("CenaMag")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaPoRabColumnBase, pozDok.FindProperty("CenaPoRab")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaPrzedRabColumnBase, pozDok.FindProperty("CenaPrzedRab")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWZgrzewceColumnBase0, pozDok.FindProperty("IleWZgrzewce")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscMinusColumnBase, pozDok.FindProperty("IloscMinus")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscPlusColumnBase, pozDok.FindProperty("IloscPlus")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)metodaColumnBase, pozDok.FindProperty("Metoda")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase0, pozDok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrPozycjiColumnBase, pozDok.FindProperty("NrPozycji")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase0, pozDok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase3, pozDok.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatProcColumnBase0, pozDok.FindProperty("RabatProc")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase3, pozDok.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaDodColumnBase, pozDok.FindProperty("StawkaDod")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase13, pozDok.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typPozColumnBase, pozDok.FindProperty("TypPoz")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typTowaruColumnBase1, pozDok.FindProperty("TypTowaru")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase3, pozDok.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesPozDokMappingBase); + + var tableMappings120 = new List(); + pozDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings120); + var pozDokTable = new Table("PozDok", null, relationalModel); + var dokIdColumn11 = new Column("DokId", "numeric(9,0)", pozDokTable); + pozDokTable.Columns.Add("DokId", dokIdColumn11); + var kolejnoscColumn13 = new Column("Kolejnosc", "int", pozDokTable); + pozDokTable.Columns.Add("Kolejnosc", kolejnoscColumn13); + var cenaDetColumn0 = new Column("CenaDet", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("CenaDet", cenaDetColumn0); + var cenaDomyslnaColumn = new Column("CenaDomyslna", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("CenaDomyslna", cenaDomyslnaColumn); + var cenaMagColumn0 = new Column("CenaMag", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("CenaMag", cenaMagColumn0); + var cenaPoRabColumn = new Column("CenaPoRab", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("CenaPoRab", cenaPoRabColumn); + var cenaPrzedRabColumn = new Column("CenaPrzedRab", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("CenaPrzedRab", cenaPrzedRabColumn); + var ileWZgrzewceColumn0 = new Column("IleWZgrzewce", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("IleWZgrzewce", ileWZgrzewceColumn0); + var iloscMinusColumn = new Column("IloscMinus", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("IloscMinus", iloscMinusColumn); + var iloscPlusColumn = new Column("IloscPlus", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("IloscPlus", iloscPlusColumn); + var metodaColumn = new Column("Metoda", "smallint", pozDokTable); + pozDokTable.Columns.Add("Metoda", metodaColumn); + var nettoColumn0 = new Column("Netto", "decimal(15,4)", pozDokTable) + { + IsNullable = true + }; + pozDokTable.Columns.Add("Netto", nettoColumn0); + var nrPozycjiColumn = new Column("NrPozycji", "int", pozDokTable); + pozDokTable.Columns.Add("NrPozycji", nrPozycjiColumn); + var podatekColumn0 = new Column("Podatek", "decimal(15,4)", pozDokTable) + { + IsNullable = true + }; + pozDokTable.Columns.Add("Podatek", podatekColumn0); + var poziomCenColumn3 = new Column("PoziomCen", "smallint", pozDokTable); + pozDokTable.Columns.Add("PoziomCen", poziomCenColumn3); + var rabatProcColumn0 = new Column("RabatProc", "decimal(10,4)", pozDokTable); + pozDokTable.Columns.Add("RabatProc", rabatProcColumn0); + var stawkaColumn3 = new Column("Stawka", "smallint", pozDokTable); + pozDokTable.Columns.Add("Stawka", stawkaColumn3); + var stawkaDodColumn = new Column("StawkaDod", "smallint", pozDokTable) + { + IsNullable = true + }; + pozDokTable.Columns.Add("StawkaDod", stawkaDodColumn); + var towIdColumn13 = new Column("TowId", "numeric(9,0)", pozDokTable); + pozDokTable.Columns.Add("TowId", towIdColumn13); + var typPozColumn = new Column("TypPoz", "smallint", pozDokTable); + pozDokTable.Columns.Add("TypPoz", typPozColumn); + var typTowaruColumn1 = new Column("TypTowaru", "smallint", pozDokTable); + pozDokTable.Columns.Add("TypTowaru", typTowaruColumn1); + var wartoscColumn3 = new Column("Wartosc", "decimal(15,4)", pozDokTable); + pozDokTable.Columns.Add("Wartosc", wartoscColumn3); + var pK_POZDOK = new UniqueConstraint("PK_POZDOK", pozDokTable, new[] { dokIdColumn11, kolejnoscColumn13 }); + pozDokTable.PrimaryKey = pK_POZDOK; + var pK_POZDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + pK_POZDOK.MappedKeys.Add(pK_POZDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POZDOKUc).Add(pK_POZDOK); + pozDokTable.UniqueConstraints.Add("PK_POZDOK", pK_POZDOK); + var idx_PozDokDokIdNrPozycji = new TableIndex( + "idx_PozDokDokIdNrPozycji", pozDokTable, new[] { dokIdColumn11, nrPozycjiColumn }, false); + var idx_PozDokDokIdNrPozycjiIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + "idx_PozDokDokIdNrPozycji"); + idx_PozDokDokIdNrPozycji.MappedIndexes.Add(idx_PozDokDokIdNrPozycjiIx); + RelationalModel.GetOrCreateTableIndexes(idx_PozDokDokIdNrPozycjiIx).Add(idx_PozDokDokIdNrPozycji); + pozDokTable.Indexes.Add("idx_PozDokDokIdNrPozycji", idx_PozDokDokIdNrPozycji); + var idx_PozDokTowId = new TableIndex( + "idx_PozDokTowId", pozDokTable, new[] { towIdColumn13 }, false); + var idx_PozDokTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + "idx_PozDokTowId"); + idx_PozDokTowId.MappedIndexes.Add(idx_PozDokTowIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_PozDokTowIdIx).Add(idx_PozDokTowId); + pozDokTable.Indexes.Add("idx_PozDokTowId", idx_PozDokTowId); + relationalModel.Tables.Add(("PozDok", null), pozDokTable); + var pozDokTableMapping = new TableMapping(pozDok, pozDokTable, true); + pozDokTable.AddTypeMapping(pozDokTableMapping, false); + tableMappings120.Add(pozDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn11, pozDok.FindProperty("DokId")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn13, pozDok.FindProperty("Kolejnosc")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaDetColumn0, pozDok.FindProperty("CenaDet")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaDomyslnaColumn, pozDok.FindProperty("CenaDomyslna")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaMagColumn0, pozDok.FindProperty("CenaMag")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaPoRabColumn, pozDok.FindProperty("CenaPoRab")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaPrzedRabColumn, pozDok.FindProperty("CenaPrzedRab")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(ileWZgrzewceColumn0, pozDok.FindProperty("IleWZgrzewce")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(iloscMinusColumn, pozDok.FindProperty("IloscMinus")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(iloscPlusColumn, pozDok.FindProperty("IloscPlus")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(metodaColumn, pozDok.FindProperty("Metoda")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn0, pozDok.FindProperty("Netto")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(nrPozycjiColumn, pozDok.FindProperty("NrPozycji")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn0, pozDok.FindProperty("Podatek")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn3, pozDok.FindProperty("PoziomCen")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(rabatProcColumn0, pozDok.FindProperty("RabatProc")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn3, pozDok.FindProperty("Stawka")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaDodColumn, pozDok.FindProperty("StawkaDod")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn13, pozDok.FindProperty("TowId")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(typPozColumn, pozDok.FindProperty("TypPoz")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(typTowaruColumn1, pozDok.FindProperty("TypTowaru")!, pozDokTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn3, pozDok.FindProperty("Wartosc")!, pozDokTableMapping); + + var pozDokWBufPowiazanie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PozDokWBufPowiazanie")!; + + var defaultTableMappings121 = new List>(); + pozDokWBufPowiazanie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings121); + var blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PozDokWBufPowiazanie", null, relationalModel); + var dokIdColumnBase12 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase.Columns.Add("DokId", dokIdColumnBase12); + var idColumnBase4 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase.Columns.Add("Id", idColumnBase4); + var jakiePowColumnBase0 = new ColumnBase("JakiePow", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase.Columns.Add("JakiePow", jakiePowColumnBase0); + var kolejnoscColumnBase14 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase14); + var ktorePowColumnBase0 = new ColumnBase("KtorePow", "smallint", blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase.Columns.Add("KtorePow", ktorePowColumnBase0); + var paramColumnBase0 = new ColumnBase("Param", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase.Columns.Add("Param", paramColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PozDokWBufPowiazanie", blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase); + var blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase = new TableMappingBase(pozDokWBufPowiazanie, blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase, false); + defaultTableMappings121.Add(blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase12, pozDokWBufPowiazanie.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jakiePowColumnBase0, pozDokWBufPowiazanie.FindProperty("JakiePow")!, blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase14, pozDokWBufPowiazanie.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ktorePowColumnBase0, pozDokWBufPowiazanie.FindProperty("KtorePow")!, blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase4, pozDokWBufPowiazanie.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramColumnBase0, pozDokWBufPowiazanie.FindProperty("Param")!, blinkBackofficeServicesPcmDbEntitiesPozDokWBufPowiazanieMappingBase); + + var tableMappings121 = new List(); + pozDokWBufPowiazanie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings121); + var pozDokWBufPowiazanieTable = new Table("PozDokWBufPowiazanie", null, relationalModel); + var dokIdColumn12 = new Column("DokId", "numeric(9,0)", pozDokWBufPowiazanieTable); + pozDokWBufPowiazanieTable.Columns.Add("DokId", dokIdColumn12); + var kolejnoscColumn14 = new Column("Kolejnosc", "int", pozDokWBufPowiazanieTable); + pozDokWBufPowiazanieTable.Columns.Add("Kolejnosc", kolejnoscColumn14); + var jakiePowColumn0 = new Column("JakiePow", "smallint", pozDokWBufPowiazanieTable); + pozDokWBufPowiazanieTable.Columns.Add("JakiePow", jakiePowColumn0); + var ktorePowColumn0 = new Column("KtorePow", "smallint", pozDokWBufPowiazanieTable); + pozDokWBufPowiazanieTable.Columns.Add("KtorePow", ktorePowColumn0); + var idColumn4 = new Column("Id", "numeric(9,0)", pozDokWBufPowiazanieTable) + { + IsNullable = true + }; + pozDokWBufPowiazanieTable.Columns.Add("Id", idColumn4); + var paramColumn0 = new Column("Param", "varchar(255)", pozDokWBufPowiazanieTable) + { + IsNullable = true + }; + pozDokWBufPowiazanieTable.Columns.Add("Param", paramColumn0); + var pK_POZDOKWBUFPOWIAZANIE = new UniqueConstraint("PK_POZDOKWBUFPOWIAZANIE", pozDokWBufPowiazanieTable, new[] { dokIdColumn12, kolejnoscColumn14, jakiePowColumn0, ktorePowColumn0 }); + pozDokWBufPowiazanieTable.PrimaryKey = pK_POZDOKWBUFPOWIAZANIE; + var pK_POZDOKWBUFPOWIAZANIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDokWBufPowiazanie", + new[] { "DokId", "Kolejnosc", "JakiePow", "KtorePow" }); + pK_POZDOKWBUFPOWIAZANIE.MappedKeys.Add(pK_POZDOKWBUFPOWIAZANIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POZDOKWBUFPOWIAZANIEUc).Add(pK_POZDOKWBUFPOWIAZANIE); + pozDokWBufPowiazanieTable.UniqueConstraints.Add("PK_POZDOKWBUFPOWIAZANIE", pK_POZDOKWBUFPOWIAZANIE); + var idx_PozDokWBufId = new TableIndex( + "idx_PozDokWBufId", pozDokWBufPowiazanieTable, new[] { idColumn4 }, false); + var idx_PozDokWBufIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDokWBufPowiazanie", + "idx_PozDokWBufId"); + idx_PozDokWBufId.MappedIndexes.Add(idx_PozDokWBufIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_PozDokWBufIdIx).Add(idx_PozDokWBufId); + pozDokWBufPowiazanieTable.Indexes.Add("idx_PozDokWBufId", idx_PozDokWBufId); + relationalModel.Tables.Add(("PozDokWBufPowiazanie", null), pozDokWBufPowiazanieTable); + var pozDokWBufPowiazanieTableMapping = new TableMapping(pozDokWBufPowiazanie, pozDokWBufPowiazanieTable, true); + pozDokWBufPowiazanieTable.AddTypeMapping(pozDokWBufPowiazanieTableMapping, false); + tableMappings121.Add(pozDokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn12, pozDokWBufPowiazanie.FindProperty("DokId")!, pozDokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(jakiePowColumn0, pozDokWBufPowiazanie.FindProperty("JakiePow")!, pozDokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn14, pozDokWBufPowiazanie.FindProperty("Kolejnosc")!, pozDokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(ktorePowColumn0, pozDokWBufPowiazanie.FindProperty("KtorePow")!, pozDokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(idColumn4, pozDokWBufPowiazanie.FindProperty("Id")!, pozDokWBufPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(paramColumn0, pozDokWBufPowiazanie.FindProperty("Param")!, pozDokWBufPowiazanieTableMapping); + + var pozPar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PozPar")!; + + var defaultTableMappings122 = new List>(); + pozPar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings122); + var blinkBackofficeServicesPcmDbEntitiesPozParTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PozPar", null, relationalModel); + var grupaGTUColumnBase = new ColumnBase("GrupaGTU", "varchar(4)", blinkBackofficeServicesPcmDbEntitiesPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("GrupaGTU", grupaGTUColumnBase); + var iloscColumnBase0 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("Ilosc", iloscColumnBase0); + var kodColumnBase8 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("Kod", kodColumnBase8); + var kolejnoscColumnBase15 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase15); + var parIdColumnBase8 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("ParId", parIdColumnBase8); + var rabatKwotColumnBase = new ColumnBase("RabatKwot", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("RabatKwot", rabatKwotColumnBase); + var stawkaColumnBase4 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("Stawka", stawkaColumnBase4); + var towIdColumnBase14 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("TowId", towIdColumnBase14); + var typPozParColumnBase = new ColumnBase("TypPozPar", "smallint", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("TypPozPar", typPozParColumnBase); + var wartoscBruttoColumnBase = new ColumnBase("WartoscBrutto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.Columns.Add("WartoscBrutto", wartoscBruttoColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PozPar", blinkBackofficeServicesPcmDbEntitiesPozParTableBase); + var blinkBackofficeServicesPcmDbEntitiesPozParMappingBase = new TableMappingBase(pozPar, blinkBackofficeServicesPcmDbEntitiesPozParTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPozParTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPozParMappingBase, false); + defaultTableMappings122.Add(blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase15, pozPar.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase8, pozPar.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupaGTUColumnBase, pozPar.FindProperty("GrupaGTU")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase0, pozPar.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase8, pozPar.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatKwotColumnBase, pozPar.FindProperty("RabatKwot")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase4, pozPar.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase14, pozPar.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typPozParColumnBase, pozPar.FindProperty("TypPozPar")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscBruttoColumnBase, pozPar.FindProperty("WartoscBrutto")!, blinkBackofficeServicesPcmDbEntitiesPozParMappingBase); + + var tableMappings122 = new List(); + pozPar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings122); + var pozParTable = new Table("PozPar", null, relationalModel); + var parIdColumn8 = new Column("ParId", "numeric(9,0)", pozParTable); + pozParTable.Columns.Add("ParId", parIdColumn8); + var kolejnoscColumn15 = new Column("Kolejnosc", "int", pozParTable); + pozParTable.Columns.Add("Kolejnosc", kolejnoscColumn15); + var grupaGTUColumn = new Column("GrupaGTU", "varchar(4)", pozParTable) + { + IsNullable = true + }; + pozParTable.Columns.Add("GrupaGTU", grupaGTUColumn); + var iloscColumn0 = new Column("Ilosc", "decimal(15,4)", pozParTable); + pozParTable.Columns.Add("Ilosc", iloscColumn0); + var kodColumn8 = new Column("Kod", "varchar(20)", pozParTable) + { + IsNullable = true + }; + pozParTable.Columns.Add("Kod", kodColumn8); + var rabatKwotColumn = new Column("RabatKwot", "decimal(15,4)", pozParTable); + pozParTable.Columns.Add("RabatKwot", rabatKwotColumn); + var stawkaColumn4 = new Column("Stawka", "smallint", pozParTable); + pozParTable.Columns.Add("Stawka", stawkaColumn4); + var towIdColumn14 = new Column("TowId", "numeric(9,0)", pozParTable); + pozParTable.Columns.Add("TowId", towIdColumn14); + var typPozParColumn = new Column("TypPozPar", "smallint", pozParTable); + pozParTable.Columns.Add("TypPozPar", typPozParColumn); + var wartoscBruttoColumn = new Column("WartoscBrutto", "decimal(15,4)", pozParTable); + pozParTable.Columns.Add("WartoscBrutto", wartoscBruttoColumn); + var pK_POZPAR = new UniqueConstraint("PK_POZPAR", pozParTable, new[] { parIdColumn8, kolejnoscColumn15 }); + pozParTable.PrimaryKey = pK_POZPAR; + var pK_POZPARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + new[] { "ParId", "Kolejnosc" }); + pK_POZPAR.MappedKeys.Add(pK_POZPARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POZPARUc).Add(pK_POZPAR); + pozParTable.UniqueConstraints.Add("PK_POZPAR", pK_POZPAR); + var idx_PozParTowId = new TableIndex( + "idx_PozParTowId", pozParTable, new[] { towIdColumn14 }, false); + var idx_PozParTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + "idx_PozParTowId"); + idx_PozParTowId.MappedIndexes.Add(idx_PozParTowIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_PozParTowIdIx).Add(idx_PozParTowId); + pozParTable.Indexes.Add("idx_PozParTowId", idx_PozParTowId); + relationalModel.Tables.Add(("PozPar", null), pozParTable); + var pozParTableMapping = new TableMapping(pozPar, pozParTable, true); + pozParTable.AddTypeMapping(pozParTableMapping, false); + tableMappings122.Add(pozParTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn15, pozPar.FindProperty("Kolejnosc")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn8, pozPar.FindProperty("ParId")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(grupaGTUColumn, pozPar.FindProperty("GrupaGTU")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn0, pozPar.FindProperty("Ilosc")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(kodColumn8, pozPar.FindProperty("Kod")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(rabatKwotColumn, pozPar.FindProperty("RabatKwot")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn4, pozPar.FindProperty("Stawka")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn14, pozPar.FindProperty("TowId")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(typPozParColumn, pozPar.FindProperty("TypPozPar")!, pozParTableMapping); + RelationalModel.CreateColumnMapping(wartoscBruttoColumn, pozPar.FindProperty("WartoscBrutto")!, pozParTableMapping); + + var pozParSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PozParSzczeg")!; + + var defaultTableMappings123 = new List>(); + pozParSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings123); + var blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PozParSzczeg", null, relationalModel); + var dodInfoColumnBase = new ColumnBase("DodInfo", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase.Columns.Add("DodInfo", dodInfoColumnBase); + var kolejnoscColumnBase16 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase16); + var parIdColumnBase9 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase.Columns.Add("ParId", parIdColumnBase9); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PozParSzczeg", blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesPozParSzczegMappingBase = new TableMappingBase(pozParSzczeg, blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPozParSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPozParSzczegMappingBase, false); + defaultTableMappings123.Add(blinkBackofficeServicesPcmDbEntitiesPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase16, pozParSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase9, pozParSzczeg.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodInfoColumnBase, pozParSzczeg.FindProperty("DodInfo")!, blinkBackofficeServicesPcmDbEntitiesPozParSzczegMappingBase); + + var tableMappings123 = new List(); + pozParSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings123); + var pozParSzczegTable = new Table("PozParSzczeg", null, relationalModel); + var parIdColumn9 = new Column("ParId", "numeric(9,0)", pozParSzczegTable); + pozParSzczegTable.Columns.Add("ParId", parIdColumn9); + var kolejnoscColumn16 = new Column("Kolejnosc", "int", pozParSzczegTable); + pozParSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn16); + var dodInfoColumn = new Column("DodInfo", "varchar(40)", pozParSzczegTable); + pozParSzczegTable.Columns.Add("DodInfo", dodInfoColumn); + var pK_POZPARSZCZEG = new UniqueConstraint("PK_POZPARSZCZEG", pozParSzczegTable, new[] { parIdColumn9, kolejnoscColumn16 }); + pozParSzczegTable.PrimaryKey = pK_POZPARSZCZEG; + var pK_POZPARSZCZEGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozParSzczeg", + new[] { "ParId", "Kolejnosc" }); + pK_POZPARSZCZEG.MappedKeys.Add(pK_POZPARSZCZEGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POZPARSZCZEGUc).Add(pK_POZPARSZCZEG); + pozParSzczegTable.UniqueConstraints.Add("PK_POZPARSZCZEG", pK_POZPARSZCZEG); + relationalModel.Tables.Add(("PozParSzczeg", null), pozParSzczegTable); + var pozParSzczegTableMapping = new TableMapping(pozParSzczeg, pozParSzczegTable, true); + pozParSzczegTable.AddTypeMapping(pozParSzczegTableMapping, false); + tableMappings123.Add(pozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn16, pozParSzczeg.FindProperty("Kolejnosc")!, pozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn9, pozParSzczeg.FindProperty("ParId")!, pozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(dodInfoColumn, pozParSzczeg.FindProperty("DodInfo")!, pozParSzczegTableMapping); + + var pozWz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PozWz")!; + + var defaultTableMappings124 = new List>(); + pozWz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings124); + var blinkBackofficeServicesPcmDbEntitiesPozWzTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PozWz", null, relationalModel); + var iloscMinusColumnBase0 = new ColumnBase("IloscMinus", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozWzTableBase); + blinkBackofficeServicesPcmDbEntitiesPozWzTableBase.Columns.Add("IloscMinus", iloscMinusColumnBase0); + var iloscPlusColumnBase0 = new ColumnBase("IloscPlus", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPozWzTableBase); + blinkBackofficeServicesPcmDbEntitiesPozWzTableBase.Columns.Add("IloscPlus", iloscPlusColumnBase0); + var kolejnoscColumnBase17 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesPozWzTableBase); + blinkBackofficeServicesPcmDbEntitiesPozWzTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase17); + var towIdColumnBase15 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozWzTableBase); + blinkBackofficeServicesPcmDbEntitiesPozWzTableBase.Columns.Add("TowId", towIdColumnBase15); + var wzIdColumnBase = new ColumnBase("WzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPozWzTableBase); + blinkBackofficeServicesPcmDbEntitiesPozWzTableBase.Columns.Add("WzId", wzIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PozWz", blinkBackofficeServicesPcmDbEntitiesPozWzTableBase); + var blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase = new TableMappingBase(pozWz, blinkBackofficeServicesPcmDbEntitiesPozWzTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPozWzTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase, false); + defaultTableMappings124.Add(blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase17, pozWz.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wzIdColumnBase, pozWz.FindProperty("WzId")!, blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscMinusColumnBase0, pozWz.FindProperty("IloscMinus")!, blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscPlusColumnBase0, pozWz.FindProperty("IloscPlus")!, blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase15, pozWz.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesPozWzMappingBase); + + var tableMappings124 = new List(); + pozWz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings124); + var pozWzTable = new Table("PozWz", null, relationalModel); + var wzIdColumn = new Column("WzId", "numeric(9,0)", pozWzTable); + pozWzTable.Columns.Add("WzId", wzIdColumn); + var kolejnoscColumn17 = new Column("Kolejnosc", "int", pozWzTable); + pozWzTable.Columns.Add("Kolejnosc", kolejnoscColumn17); + var iloscMinusColumn0 = new Column("IloscMinus", "decimal(15,4)", pozWzTable); + pozWzTable.Columns.Add("IloscMinus", iloscMinusColumn0); + var iloscPlusColumn0 = new Column("IloscPlus", "decimal(15,4)", pozWzTable); + pozWzTable.Columns.Add("IloscPlus", iloscPlusColumn0); + var towIdColumn15 = new Column("TowId", "numeric(9,0)", pozWzTable); + pozWzTable.Columns.Add("TowId", towIdColumn15); + var pK_POZWZ = new UniqueConstraint("PK_POZWZ", pozWzTable, new[] { wzIdColumn, kolejnoscColumn17 }); + pozWzTable.PrimaryKey = pK_POZWZ; + var pK_POZWZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozWz", + new[] { "WzId", "Kolejnosc" }); + pK_POZWZ.MappedKeys.Add(pK_POZWZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POZWZUc).Add(pK_POZWZ); + pozWzTable.UniqueConstraints.Add("PK_POZWZ", pK_POZWZ); + var iX_PozWz_TowId = new TableIndex( + "IX_PozWz_TowId", pozWzTable, new[] { towIdColumn15 }, false); + var iX_PozWz_TowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozWz", + new[] { "TowId" }); + iX_PozWz_TowId.MappedIndexes.Add(iX_PozWz_TowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PozWz_TowIdIx).Add(iX_PozWz_TowId); + pozWzTable.Indexes.Add("IX_PozWz_TowId", iX_PozWz_TowId); + relationalModel.Tables.Add(("PozWz", null), pozWzTable); + var pozWzTableMapping = new TableMapping(pozWz, pozWzTable, true); + pozWzTable.AddTypeMapping(pozWzTableMapping, false); + tableMappings124.Add(pozWzTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn17, pozWz.FindProperty("Kolejnosc")!, pozWzTableMapping); + RelationalModel.CreateColumnMapping(wzIdColumn, pozWz.FindProperty("WzId")!, pozWzTableMapping); + RelationalModel.CreateColumnMapping(iloscMinusColumn0, pozWz.FindProperty("IloscMinus")!, pozWzTableMapping); + RelationalModel.CreateColumnMapping(iloscPlusColumn0, pozWz.FindProperty("IloscPlus")!, pozWzTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn15, pozWz.FindProperty("TowId")!, pozWzTableMapping); + + var profil = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Profil")!; + + var defaultTableMappings125 = new List>(); + profil.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings125); + var blinkBackofficeServicesPcmDbEntitiesProfilTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Profil", null, relationalModel); + var aktywnyColumnBase21 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesProfilTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesProfilTableBase.Columns.Add("Aktywny", aktywnyColumnBase21); + var nazwaColumnBase32 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesProfilTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilTableBase.Columns.Add("Nazwa", nazwaColumnBase32); + var profilIdColumnBase = new ColumnBase("ProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesProfilTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilTableBase.Columns.Add("ProfilId", profilIdColumnBase); + var typColumnBase13 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesProfilTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilTableBase.Columns.Add("Typ", typColumnBase13); + var utworzonyColumnBase = new ColumnBase("Utworzony", "datetime", blinkBackofficeServicesPcmDbEntitiesProfilTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesProfilTableBase.Columns.Add("Utworzony", utworzonyColumnBase); + var zmianaColumnBase23 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesProfilTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesProfilTableBase.Columns.Add("Zmiana", zmianaColumnBase23); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Profil", blinkBackofficeServicesPcmDbEntitiesProfilTableBase); + var blinkBackofficeServicesPcmDbEntitiesProfilMappingBase = new TableMappingBase(profil, blinkBackofficeServicesPcmDbEntitiesProfilTableBase, true); + blinkBackofficeServicesPcmDbEntitiesProfilTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesProfilMappingBase, false); + defaultTableMappings125.Add(blinkBackofficeServicesPcmDbEntitiesProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)profilIdColumnBase, profil.FindProperty("ProfilId")!, blinkBackofficeServicesPcmDbEntitiesProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase21, profil.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase32, profil.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase13, profil.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonyColumnBase, profil.FindProperty("Utworzony")!, blinkBackofficeServicesPcmDbEntitiesProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase23, profil.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesProfilMappingBase); + + var tableMappings125 = new List(); + profil.SetRuntimeAnnotation("Relational:TableMappings", tableMappings125); + var profilTable = new Table("Profil", null, relationalModel); + var profilIdColumn = new Column("ProfilId", "numeric(9,0)", profilTable); + profilTable.Columns.Add("ProfilId", profilIdColumn); + var aktywnyColumn21 = new Column("Aktywny", "smallint", profilTable) + { + IsNullable = true + }; + profilTable.Columns.Add("Aktywny", aktywnyColumn21); + var nazwaColumn32 = new Column("Nazwa", "varchar(40)", profilTable); + profilTable.Columns.Add("Nazwa", nazwaColumn32); + var typColumn13 = new Column("Typ", "smallint", profilTable); + profilTable.Columns.Add("Typ", typColumn13); + var utworzonyColumn = new Column("Utworzony", "datetime", profilTable) + { + IsNullable = true + }; + profilTable.Columns.Add("Utworzony", utworzonyColumn); + var zmianaColumn23 = new Column("Zmiana", "datetime", profilTable) + { + IsNullable = true + }; + profilTable.Columns.Add("Zmiana", zmianaColumn23); + var pK_PROFIL = new UniqueConstraint("PK_PROFIL", profilTable, new[] { profilIdColumn }); + profilTable.PrimaryKey = pK_PROFIL; + var pK_PROFILUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Profil", + new[] { "ProfilId" }); + pK_PROFIL.MappedKeys.Add(pK_PROFILUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PROFILUc).Add(pK_PROFIL); + profilTable.UniqueConstraints.Add("PK_PROFIL", pK_PROFIL); + relationalModel.Tables.Add(("Profil", null), profilTable); + var profilTableMapping = new TableMapping(profil, profilTable, true); + profilTable.AddTypeMapping(profilTableMapping, false); + tableMappings125.Add(profilTableMapping); + RelationalModel.CreateColumnMapping(profilIdColumn, profil.FindProperty("ProfilId")!, profilTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn21, profil.FindProperty("Aktywny")!, profilTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn32, profil.FindProperty("Nazwa")!, profilTableMapping); + RelationalModel.CreateColumnMapping(typColumn13, profil.FindProperty("Typ")!, profilTableMapping); + RelationalModel.CreateColumnMapping(utworzonyColumn, profil.FindProperty("Utworzony")!, profilTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn23, profil.FindProperty("Zmiana")!, profilTableMapping); + + var profilKasa = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa")!; + + var defaultTableMappings126 = new List>(); + profilKasa.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings126); + var blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa", null, relationalModel); + var kasaIdColumnBase6 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase.Columns.Add("KasaId", kasaIdColumnBase6); + var profilIdColumnBase0 = new ColumnBase("ProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase.Columns.Add("ProfilId", profilIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa", blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase); + var blinkBackofficeServicesPcmDbEntitiesProfilKasaMappingBase = new TableMappingBase(profilKasa, blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesProfilKasaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesProfilKasaMappingBase, false); + defaultTableMappings126.Add(blinkBackofficeServicesPcmDbEntitiesProfilKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)profilIdColumnBase0, profilKasa.FindProperty("ProfilId")!, blinkBackofficeServicesPcmDbEntitiesProfilKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase6, profilKasa.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesProfilKasaMappingBase); + + var tableMappings126 = new List(); + profilKasa.SetRuntimeAnnotation("Relational:TableMappings", tableMappings126); + var profilKasaTable = new Table("ProfilKasa", null, relationalModel); + var profilIdColumn0 = new Column("ProfilId", "numeric(9,0)", profilKasaTable); + profilKasaTable.Columns.Add("ProfilId", profilIdColumn0); + var kasaIdColumn6 = new Column("KasaId", "numeric(9,0)", profilKasaTable); + profilKasaTable.Columns.Add("KasaId", kasaIdColumn6); + var pK_PROFKAS = new UniqueConstraint("PK_PROFKAS", profilKasaTable, new[] { profilIdColumn0 }); + profilKasaTable.PrimaryKey = pK_PROFKAS; + var pK_PROFKASUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa", + new[] { "ProfilId" }); + pK_PROFKAS.MappedKeys.Add(pK_PROFKASUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PROFKASUc).Add(pK_PROFKAS); + profilKasaTable.UniqueConstraints.Add("PK_PROFKAS", pK_PROFKAS); + var iX_ProfilKasa_KasaId = new TableIndex( + "IX_ProfilKasa_KasaId", profilKasaTable, new[] { kasaIdColumn6 }, false); + var iX_ProfilKasa_KasaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa", + new[] { "KasaId" }); + iX_ProfilKasa_KasaId.MappedIndexes.Add(iX_ProfilKasa_KasaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_ProfilKasa_KasaIdIx).Add(iX_ProfilKasa_KasaId); + profilKasaTable.Indexes.Add("IX_ProfilKasa_KasaId", iX_ProfilKasa_KasaId); + relationalModel.Tables.Add(("ProfilKasa", null), profilKasaTable); + var profilKasaTableMapping = new TableMapping(profilKasa, profilKasaTable, true); + profilKasaTable.AddTypeMapping(profilKasaTableMapping, false); + tableMappings126.Add(profilKasaTableMapping); + RelationalModel.CreateColumnMapping(profilIdColumn0, profilKasa.FindProperty("ProfilId")!, profilKasaTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn6, profilKasa.FindProperty("KasaId")!, profilKasaTableMapping); + + var profilKonfig = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ProfilKonfig")!; + + var defaultTableMappings127 = new List>(); + profilKonfig.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings127); + var blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ProfilKonfig", null, relationalModel); + var kolejnyColumnBase = new ColumnBase("Kolejny", "smallint", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.Columns.Add("Kolejny", kolejnyColumnBase); + var parGrupaColumnBase1 = new ColumnBase("ParGrupa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.Columns.Add("ParGrupa", parGrupaColumnBase1); + var parNazwaColumnBase4 = new ColumnBase("ParNazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.Columns.Add("ParNazwa", parNazwaColumnBase4); + var profilIdColumnBase1 = new ColumnBase("ProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.Columns.Add("ProfilId", profilIdColumnBase1); + var utworzonyColumnBase0 = new ColumnBase("Utworzony", "datetime", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.Columns.Add("Utworzony", utworzonyColumnBase0); + var wartoscColumnBase4 = new ColumnBase("Wartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.Columns.Add("Wartosc", wartoscColumnBase4); + var zmianaColumnBase24 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.Columns.Add("Zmiana", zmianaColumnBase24); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ProfilKonfig", blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase); + var blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase = new TableMappingBase(profilKonfig, blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase, true); + blinkBackofficeServicesPcmDbEntitiesProfilKonfigTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase, false); + defaultTableMappings127.Add(blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyColumnBase, profilKonfig.FindProperty("Kolejny")!, blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parGrupaColumnBase1, profilKonfig.FindProperty("ParGrupa")!, blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase4, profilKonfig.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)profilIdColumnBase1, profilKonfig.FindProperty("ProfilId")!, blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonyColumnBase0, profilKonfig.FindProperty("Utworzony")!, blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase4, profilKonfig.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase24, profilKonfig.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesProfilKonfigMappingBase); + + var tableMappings127 = new List(); + profilKonfig.SetRuntimeAnnotation("Relational:TableMappings", tableMappings127); + var profilKonfigTable = new Table("ProfilKonfig", null, relationalModel); + var profilIdColumn1 = new Column("ProfilId", "numeric(9,0)", profilKonfigTable); + profilKonfigTable.Columns.Add("ProfilId", profilIdColumn1); + var parGrupaColumn1 = new Column("ParGrupa", "varchar(255)", profilKonfigTable); + profilKonfigTable.Columns.Add("ParGrupa", parGrupaColumn1); + var parNazwaColumn4 = new Column("ParNazwa", "varchar(255)", profilKonfigTable); + profilKonfigTable.Columns.Add("ParNazwa", parNazwaColumn4); + var kolejnyColumn = new Column("Kolejny", "smallint", profilKonfigTable); + profilKonfigTable.Columns.Add("Kolejny", kolejnyColumn); + var utworzonyColumn0 = new Column("Utworzony", "datetime", profilKonfigTable) + { + IsNullable = true + }; + profilKonfigTable.Columns.Add("Utworzony", utworzonyColumn0); + var wartoscColumn4 = new Column("Wartosc", "varchar(255)", profilKonfigTable) + { + IsNullable = true + }; + profilKonfigTable.Columns.Add("Wartosc", wartoscColumn4); + var zmianaColumn24 = new Column("Zmiana", "datetime", profilKonfigTable) + { + IsNullable = true + }; + profilKonfigTable.Columns.Add("Zmiana", zmianaColumn24); + var pK_PROFIL_KONFIG = new UniqueConstraint("PK_PROFIL_KONFIG", profilKonfigTable, new[] { profilIdColumn1, parGrupaColumn1, parNazwaColumn4, kolejnyColumn }); + profilKonfigTable.PrimaryKey = pK_PROFIL_KONFIG; + var pK_PROFIL_KONFIGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKonfig", + new[] { "ProfilId", "ParGrupa", "ParNazwa", "Kolejny" }); + pK_PROFIL_KONFIG.MappedKeys.Add(pK_PROFIL_KONFIGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PROFIL_KONFIGUc).Add(pK_PROFIL_KONFIG); + profilKonfigTable.UniqueConstraints.Add("PK_PROFIL_KONFIG", pK_PROFIL_KONFIG); + relationalModel.Tables.Add(("ProfilKonfig", null), profilKonfigTable); + var profilKonfigTableMapping = new TableMapping(profilKonfig, profilKonfigTable, true); + profilKonfigTable.AddTypeMapping(profilKonfigTableMapping, false); + tableMappings127.Add(profilKonfigTableMapping); + RelationalModel.CreateColumnMapping(kolejnyColumn, profilKonfig.FindProperty("Kolejny")!, profilKonfigTableMapping); + RelationalModel.CreateColumnMapping(parGrupaColumn1, profilKonfig.FindProperty("ParGrupa")!, profilKonfigTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn4, profilKonfig.FindProperty("ParNazwa")!, profilKonfigTableMapping); + RelationalModel.CreateColumnMapping(profilIdColumn1, profilKonfig.FindProperty("ProfilId")!, profilKonfigTableMapping); + RelationalModel.CreateColumnMapping(utworzonyColumn0, profilKonfig.FindProperty("Utworzony")!, profilKonfigTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn4, profilKonfig.FindProperty("Wartosc")!, profilKonfigTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn24, profilKonfig.FindProperty("Zmiana")!, profilKonfigTableMapping); + + var prtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.PrtMag")!; + + var defaultTableMappings128 = new List>(); + prtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings128); + var blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.PrtMag", null, relationalModel); + var cenaSpDetColumnBase = new ColumnBase("CenaSpDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("CenaSpDet", cenaSpDetColumnBase); + var cenaZakColumnBase0 = new ColumnBase("CenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("CenaZak", cenaZakColumnBase0); + var dataColumnBase3 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("Data", dataColumnBase3); + var dataWaznColumnBase0 = new ColumnBase("DataWazn", "datetime", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("DataWazn", dataWaznColumnBase0); + var dostarczonoColumnBase = new ColumnBase("Dostarczono", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("Dostarczono", dostarczonoColumnBase); + var kolejnyWDniuColumnBase0 = new ColumnBase("KolejnyWDniu", "int", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("KolejnyWDniu", kolejnyWDniuColumnBase0); + var kontrIdColumnBase17 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("KontrId", kontrIdColumnBase17); + var magIdColumnBase7 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("MagId", magIdColumnBase7); + var nrDostawyColumnBase = new ColumnBase("NrDostawy", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("NrDostawy", nrDostawyColumnBase); + var nrPartiiColumnBase = new ColumnBase("NrPartii", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("NrPartii", nrPartiiColumnBase); + var nrPozycjiColumnBase0 = new ColumnBase("NrPozycji", "int", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("NrPozycji", nrPozycjiColumnBase0); + var pMIdColumnBase = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase); + var pozostaloColumnBase0 = new ColumnBase("Pozostalo", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("Pozostalo", pozostaloColumnBase0); + var rezerwacjaColumnBase = new ColumnBase("Rezerwacja", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("Rezerwacja", rezerwacjaColumnBase); + var statusColumnBase4 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("Status", statusColumnBase4); + var stawkaColumnBase5 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("Stawka", stawkaColumnBase5); + var towIdColumnBase16 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("TowId", towIdColumnBase16); + var zmianaColumnBase25 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("Zmiana", zmianaColumnBase25); + var zmianaIstotnaColumnBase = new ColumnBase("ZmianaIstotna", "datetime", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.Columns.Add("ZmianaIstotna", zmianaIstotnaColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.PrtMag", blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase = new TableMappingBase(prtMag, blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase, false); + defaultTableMappings128.Add(blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase, prtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase16, prtMag.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaSpDetColumnBase, prtMag.FindProperty("CenaSpDet")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakColumnBase0, prtMag.FindProperty("CenaZak")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase3, prtMag.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataWaznColumnBase0, prtMag.FindProperty("DataWazn")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dostarczonoColumnBase, prtMag.FindProperty("Dostarczono")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyWDniuColumnBase0, prtMag.FindProperty("KolejnyWDniu")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase17, prtMag.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase7, prtMag.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDostawyColumnBase, prtMag.FindProperty("NrDostawy")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrPartiiColumnBase, prtMag.FindProperty("NrPartii")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrPozycjiColumnBase0, prtMag.FindProperty("NrPozycji")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pozostaloColumnBase0, prtMag.FindProperty("Pozostalo")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwacjaColumnBase, prtMag.FindProperty("Rezerwacja")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase4, prtMag.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase5, prtMag.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase25, prtMag.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaIstotnaColumnBase, prtMag.FindProperty("ZmianaIstotna")!, blinkBackofficeServicesPcmDbEntitiesPrtMagMappingBase); + + var tableMappings128 = new List(); + prtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings128); + var prtMagTable = new Table("PrtMag", null, relationalModel); + var towIdColumn16 = new Column("TowId", "numeric(9,0)", prtMagTable); + prtMagTable.Columns.Add("TowId", towIdColumn16); + var pMIdColumn = new Column("PMId", "numeric(9,0)", prtMagTable); + prtMagTable.Columns.Add("PMId", pMIdColumn); + var cenaSpDetColumn = new Column("CenaSpDet", "decimal(15,4)", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("CenaSpDet", cenaSpDetColumn); + var cenaZakColumn0 = new Column("CenaZak", "decimal(15,4)", prtMagTable); + prtMagTable.Columns.Add("CenaZak", cenaZakColumn0); + var dataColumn3 = new Column("Data", "datetime", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("Data", dataColumn3); + var dataWaznColumn0 = new Column("DataWazn", "datetime", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("DataWazn", dataWaznColumn0); + var dostarczonoColumn = new Column("Dostarczono", "decimal(15,4)", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("Dostarczono", dostarczonoColumn); + var kolejnyWDniuColumn0 = new Column("KolejnyWDniu", "int", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("KolejnyWDniu", kolejnyWDniuColumn0); + var kontrIdColumn17 = new Column("KontrId", "numeric(9,0)", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("KontrId", kontrIdColumn17); + var magIdColumn7 = new Column("MagId", "numeric(9,0)", prtMagTable); + prtMagTable.Columns.Add("MagId", magIdColumn7); + var nrDostawyColumn = new Column("NrDostawy", "varchar(60)", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("NrDostawy", nrDostawyColumn); + var nrPartiiColumn = new Column("NrPartii", "varchar(60)", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("NrPartii", nrPartiiColumn); + var nrPozycjiColumn0 = new Column("NrPozycji", "int", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("NrPozycji", nrPozycjiColumn0); + var pozostaloColumn0 = new Column("Pozostalo", "decimal(15,4)", prtMagTable); + prtMagTable.Columns.Add("Pozostalo", pozostaloColumn0); + var rezerwacjaColumn = new Column("Rezerwacja", "decimal(15,4)", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("Rezerwacja", rezerwacjaColumn); + var statusColumn4 = new Column("Status", "smallint", prtMagTable); + prtMagTable.Columns.Add("Status", statusColumn4); + var stawkaColumn5 = new Column("Stawka", "smallint", prtMagTable); + prtMagTable.Columns.Add("Stawka", stawkaColumn5); + var zmianaColumn25 = new Column("Zmiana", "datetime", prtMagTable); + prtMagTable.Columns.Add("Zmiana", zmianaColumn25); + var zmianaIstotnaColumn = new Column("ZmianaIstotna", "datetime", prtMagTable) + { + IsNullable = true + }; + prtMagTable.Columns.Add("ZmianaIstotna", zmianaIstotnaColumn); + var pK_PRTMAG = new UniqueConstraint("PK_PRTMAG", prtMagTable, new[] { towIdColumn16, pMIdColumn }); + prtMagTable.PrimaryKey = pK_PRTMAG; + var pK_PRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + new[] { "TowId", "PMId" }); + pK_PRTMAG.MappedKeys.Add(pK_PRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PRTMAGUc).Add(pK_PRTMAG); + prtMagTable.UniqueConstraints.Add("PK_PRTMAG", pK_PRTMAG); + var idx_PrtMagFifo = new TableIndex( + "idx_PrtMagFifo", prtMagTable, new[] { towIdColumn16, magIdColumn7, dataColumn3, kolejnyWDniuColumn0, pMIdColumn }, false); + var idx_PrtMagFifoIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + "idx_PrtMagFifo"); + idx_PrtMagFifo.MappedIndexes.Add(idx_PrtMagFifoIx); + RelationalModel.GetOrCreateTableIndexes(idx_PrtMagFifoIx).Add(idx_PrtMagFifo); + prtMagTable.Indexes.Add("idx_PrtMagFifo", idx_PrtMagFifo); + var idx_PrtMagNrPrt = new TableIndex( + "idx_PrtMagNrPrt", prtMagTable, new[] { nrPartiiColumn, towIdColumn16, pMIdColumn }, false); + var idx_PrtMagNrPrtIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + "idx_PrtMagNrPrt"); + idx_PrtMagNrPrt.MappedIndexes.Add(idx_PrtMagNrPrtIx); + RelationalModel.GetOrCreateTableIndexes(idx_PrtMagNrPrtIx).Add(idx_PrtMagNrPrt); + prtMagTable.Indexes.Add("idx_PrtMagNrPrt", idx_PrtMagNrPrt); + var idx_PrtMagZmn = new TableIndex( + "idx_PrtMagZmn", prtMagTable, new[] { zmianaColumn25 }, false); + var idx_PrtMagZmnIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + "idx_PrtMagZmn"); + idx_PrtMagZmn.MappedIndexes.Add(idx_PrtMagZmnIx); + RelationalModel.GetOrCreateTableIndexes(idx_PrtMagZmnIx).Add(idx_PrtMagZmn); + prtMagTable.Indexes.Add("idx_PrtMagZmn", idx_PrtMagZmn); + var iX_PrtMag_MagId = new TableIndex( + "IX_PrtMag_MagId", prtMagTable, new[] { magIdColumn7 }, false); + var iX_PrtMag_MagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + new[] { "MagId" }); + iX_PrtMag_MagId.MappedIndexes.Add(iX_PrtMag_MagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_PrtMag_MagIdIx).Add(iX_PrtMag_MagId); + prtMagTable.Indexes.Add("IX_PrtMag_MagId", iX_PrtMag_MagId); + relationalModel.Tables.Add(("PrtMag", null), prtMagTable); + var prtMagTableMapping = new TableMapping(prtMag, prtMagTable, true); + prtMagTable.AddTypeMapping(prtMagTableMapping, false); + tableMappings128.Add(prtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn, prtMag.FindProperty("PMId")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn16, prtMag.FindProperty("TowId")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(cenaSpDetColumn, prtMag.FindProperty("CenaSpDet")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(cenaZakColumn0, prtMag.FindProperty("CenaZak")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(dataColumn3, prtMag.FindProperty("Data")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(dataWaznColumn0, prtMag.FindProperty("DataWazn")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(dostarczonoColumn, prtMag.FindProperty("Dostarczono")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(kolejnyWDniuColumn0, prtMag.FindProperty("KolejnyWDniu")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn17, prtMag.FindProperty("KontrId")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn7, prtMag.FindProperty("MagId")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(nrDostawyColumn, prtMag.FindProperty("NrDostawy")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(nrPartiiColumn, prtMag.FindProperty("NrPartii")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(nrPozycjiColumn0, prtMag.FindProperty("NrPozycji")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(pozostaloColumn0, prtMag.FindProperty("Pozostalo")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(rezerwacjaColumn, prtMag.FindProperty("Rezerwacja")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(statusColumn4, prtMag.FindProperty("Status")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn5, prtMag.FindProperty("Stawka")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn25, prtMag.FindProperty("Zmiana")!, prtMagTableMapping); + RelationalModel.CreateColumnMapping(zmianaIstotnaColumn, prtMag.FindProperty("ZmianaIstotna")!, prtMagTableMapping); + + var rapWartPocz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RapWartPocz")!; + + var defaultTableMappings129 = new List>(); + rapWartPocz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings129); + var blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RapWartPocz", null, relationalModel); + var aktywnyColumnBase22 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Aktywny", aktywnyColumnBase22); + var dataColumnBase4 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Data", dataColumnBase4); + var param1ColumnBase3 = new ColumnBase("Param1", "smallint", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Param1", param1ColumnBase3); + var param2ColumnBase1 = new ColumnBase("Param2", "smallint", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Param2", param2ColumnBase1); + var param3ColumnBase0 = new ColumnBase("Param3", "smallint", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Param3", param3ColumnBase0); + var paramTxtColumnBase = new ColumnBase("ParamTxt", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("ParamTxt", paramTxtColumnBase); + var rWPIdColumnBase = new ColumnBase("RWPId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("RWPId", rWPIdColumnBase); + var typRapColumnBase = new ColumnBase("TypRap", "smallint", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("TypRap", typRapColumnBase); + var wersjaColumnBase1 = new ColumnBase("Wersja", "smallint", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Wersja", wersjaColumnBase1); + var wykonanoColumnBase = new ColumnBase("Wykonano", "datetime", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Wykonano", wykonanoColumnBase); + var zmianaColumnBase26 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.Columns.Add("Zmiana", zmianaColumnBase26); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RapWartPocz", blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase); + var blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase = new TableMappingBase(rapWartPocz, blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase, false); + defaultTableMappings129.Add(blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rWPIdColumnBase, rapWartPocz.FindProperty("RWPId")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase22, rapWartPocz.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase4, rapWartPocz.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase3, rapWartPocz.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase1, rapWartPocz.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase0, rapWartPocz.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramTxtColumnBase, rapWartPocz.FindProperty("ParamTxt")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typRapColumnBase, rapWartPocz.FindProperty("TypRap")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase1, rapWartPocz.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wykonanoColumnBase, rapWartPocz.FindProperty("Wykonano")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase26, rapWartPocz.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczMappingBase); + + var tableMappings129 = new List(); + rapWartPocz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings129); + var rapWartPoczTable = new Table("RapWartPocz", null, relationalModel); + var rWPIdColumn = new Column("RWPId", "numeric(9,0)", rapWartPoczTable); + rapWartPoczTable.Columns.Add("RWPId", rWPIdColumn); + var aktywnyColumn22 = new Column("Aktywny", "smallint", rapWartPoczTable); + rapWartPoczTable.Columns.Add("Aktywny", aktywnyColumn22); + var dataColumn4 = new Column("Data", "datetime", rapWartPoczTable); + rapWartPoczTable.Columns.Add("Data", dataColumn4); + var param1Column3 = new Column("Param1", "smallint", rapWartPoczTable) + { + IsNullable = true + }; + rapWartPoczTable.Columns.Add("Param1", param1Column3); + var param2Column1 = new Column("Param2", "smallint", rapWartPoczTable) + { + IsNullable = true + }; + rapWartPoczTable.Columns.Add("Param2", param2Column1); + var param3Column0 = new Column("Param3", "smallint", rapWartPoczTable) + { + IsNullable = true + }; + rapWartPoczTable.Columns.Add("Param3", param3Column0); + var paramTxtColumn = new Column("ParamTxt", "varchar(120)", rapWartPoczTable) + { + IsNullable = true + }; + rapWartPoczTable.Columns.Add("ParamTxt", paramTxtColumn); + var typRapColumn = new Column("TypRap", "smallint", rapWartPoczTable); + rapWartPoczTable.Columns.Add("TypRap", typRapColumn); + var wersjaColumn1 = new Column("Wersja", "smallint", rapWartPoczTable) + { + IsNullable = true + }; + rapWartPoczTable.Columns.Add("Wersja", wersjaColumn1); + var wykonanoColumn = new Column("Wykonano", "datetime", rapWartPoczTable); + rapWartPoczTable.Columns.Add("Wykonano", wykonanoColumn); + var zmianaColumn26 = new Column("Zmiana", "datetime", rapWartPoczTable); + rapWartPoczTable.Columns.Add("Zmiana", zmianaColumn26); + var pK_RAPWARTPOCZ = new UniqueConstraint("PK_RAPWARTPOCZ", rapWartPoczTable, new[] { rWPIdColumn }); + rapWartPoczTable.PrimaryKey = pK_RAPWARTPOCZ; + var pK_RAPWARTPOCZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPocz", + new[] { "RWPId" }); + pK_RAPWARTPOCZ.MappedKeys.Add(pK_RAPWARTPOCZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_RAPWARTPOCZUc).Add(pK_RAPWARTPOCZ); + rapWartPoczTable.UniqueConstraints.Add("PK_RAPWARTPOCZ", pK_RAPWARTPOCZ); + var idx_RWP_TypRapData = new TableIndex( + "idx_RWP_TypRapData", rapWartPoczTable, new[] { typRapColumn, dataColumn4 }, false); + var idx_RWP_TypRapDataIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPocz", + "idx_RWP_TypRapData"); + idx_RWP_TypRapData.MappedIndexes.Add(idx_RWP_TypRapDataIx); + RelationalModel.GetOrCreateTableIndexes(idx_RWP_TypRapDataIx).Add(idx_RWP_TypRapData); + rapWartPoczTable.Indexes.Add("idx_RWP_TypRapData", idx_RWP_TypRapData); + relationalModel.Tables.Add(("RapWartPocz", null), rapWartPoczTable); + var rapWartPoczTableMapping = new TableMapping(rapWartPocz, rapWartPoczTable, true); + rapWartPoczTable.AddTypeMapping(rapWartPoczTableMapping, false); + tableMappings129.Add(rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(rWPIdColumn, rapWartPocz.FindProperty("RWPId")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn22, rapWartPocz.FindProperty("Aktywny")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(dataColumn4, rapWartPocz.FindProperty("Data")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(param1Column3, rapWartPocz.FindProperty("Param1")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(param2Column1, rapWartPocz.FindProperty("Param2")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(param3Column0, rapWartPocz.FindProperty("Param3")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(paramTxtColumn, rapWartPocz.FindProperty("ParamTxt")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(typRapColumn, rapWartPocz.FindProperty("TypRap")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn1, rapWartPocz.FindProperty("Wersja")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(wykonanoColumn, rapWartPocz.FindProperty("Wykonano")!, rapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn26, rapWartPocz.FindProperty("Zmiana")!, rapWartPoczTableMapping); + + var rapWartPoczDane = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane")!; + + var defaultTableMappings130 = new List>(); + rapWartPoczDane.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings130); + var blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane", null, relationalModel); + var magIdColumnBase8 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase.Columns.Add("MagId", magIdColumnBase8); + var numerColumnBase4 = new ColumnBase("Numer", "smallint", blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase.Columns.Add("Numer", numerColumnBase4); + var rWPIdColumnBase0 = new ColumnBase("RWPId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase.Columns.Add("RWPId", rWPIdColumnBase0); + var typColumnBase14 = new ColumnBase("Typ", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase.Columns.Add("Typ", typColumnBase14); + var wartoscColumnBase5 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase.Columns.Add("Wartosc", wartoscColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane", blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase); + var blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase = new TableMappingBase(rapWartPoczDane, blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase, false); + defaultTableMappings130.Add(blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase8, rapWartPoczDane.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase4, rapWartPoczDane.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rWPIdColumnBase0, rapWartPoczDane.FindProperty("RWPId")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase14, rapWartPoczDane.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase5, rapWartPoczDane.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesRapWartPoczDaneMappingBase); + + var tableMappings130 = new List(); + rapWartPoczDane.SetRuntimeAnnotation("Relational:TableMappings", tableMappings130); + var rapWartPoczDaneTable = new Table("RapWartPoczDane", null, relationalModel); + var rWPIdColumn0 = new Column("RWPId", "numeric(9,0)", rapWartPoczDaneTable); + rapWartPoczDaneTable.Columns.Add("RWPId", rWPIdColumn0); + var magIdColumn8 = new Column("MagId", "numeric(9,0)", rapWartPoczDaneTable); + rapWartPoczDaneTable.Columns.Add("MagId", magIdColumn8); + var typColumn14 = new Column("Typ", "numeric(9,0)", rapWartPoczDaneTable); + rapWartPoczDaneTable.Columns.Add("Typ", typColumn14); + var numerColumn4 = new Column("Numer", "smallint", rapWartPoczDaneTable); + rapWartPoczDaneTable.Columns.Add("Numer", numerColumn4); + var wartoscColumn5 = new Column("Wartosc", "decimal(15,4)", rapWartPoczDaneTable); + rapWartPoczDaneTable.Columns.Add("Wartosc", wartoscColumn5); + var pK_RAPWARTPOCZDANE = new UniqueConstraint("PK_RAPWARTPOCZDANE", rapWartPoczDaneTable, new[] { rWPIdColumn0, magIdColumn8, typColumn14, numerColumn4 }); + rapWartPoczDaneTable.PrimaryKey = pK_RAPWARTPOCZDANE; + var pK_RAPWARTPOCZDANEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane", + new[] { "RWPId", "MagId", "Typ", "Numer" }); + pK_RAPWARTPOCZDANE.MappedKeys.Add(pK_RAPWARTPOCZDANEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_RAPWARTPOCZDANEUc).Add(pK_RAPWARTPOCZDANE); + rapWartPoczDaneTable.UniqueConstraints.Add("PK_RAPWARTPOCZDANE", pK_RAPWARTPOCZDANE); + var iX_RapWartPoczDane_MagId = new TableIndex( + "IX_RapWartPoczDane_MagId", rapWartPoczDaneTable, new[] { magIdColumn8 }, false); + var iX_RapWartPoczDane_MagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane", + new[] { "MagId" }); + iX_RapWartPoczDane_MagId.MappedIndexes.Add(iX_RapWartPoczDane_MagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RapWartPoczDane_MagIdIx).Add(iX_RapWartPoczDane_MagId); + rapWartPoczDaneTable.Indexes.Add("IX_RapWartPoczDane_MagId", iX_RapWartPoczDane_MagId); + relationalModel.Tables.Add(("RapWartPoczDane", null), rapWartPoczDaneTable); + var rapWartPoczDaneTableMapping = new TableMapping(rapWartPoczDane, rapWartPoczDaneTable, true); + rapWartPoczDaneTable.AddTypeMapping(rapWartPoczDaneTableMapping, false); + tableMappings130.Add(rapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn8, rapWartPoczDane.FindProperty("MagId")!, rapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(numerColumn4, rapWartPoczDane.FindProperty("Numer")!, rapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(rWPIdColumn0, rapWartPoczDane.FindProperty("RWPId")!, rapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(typColumn14, rapWartPoczDane.FindProperty("Typ")!, rapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn5, rapWartPoczDane.FindProperty("Wartosc")!, rapWartPoczDaneTableMapping); + + var regula = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Regula")!; + + var defaultTableMappings131 = new List>(); + regula.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings131); + var blinkBackofficeServicesPcmDbEntitiesRegulaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Regula", null, relationalModel); + var aktywnyColumnBase23 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Aktywny", aktywnyColumnBase23); + var centrRegulaIdColumnBase = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase); + var dataCzasDoColumnBase = new ColumnBase("DataCzasDo", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("DataCzasDo", dataCzasDoColumnBase); + var dataCzasOdColumnBase = new ColumnBase("DataCzasOd", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("DataCzasOd", dataCzasOdColumnBase); + var int1ColumnBase = new ColumnBase("Int1", "int", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Int1", int1ColumnBase); + var int2ColumnBase = new ColumnBase("Int2", "int", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Int2", int2ColumnBase); + var int3ColumnBase = new ColumnBase("Int3", "int", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Int3", int3ColumnBase); + var int4ColumnBase = new ColumnBase("Int4", "int", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Int4", int4ColumnBase); + var nazwaColumnBase33 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Nazwa", nazwaColumnBase33); + var number1ColumnBase = new ColumnBase("Number1", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Number1", number1ColumnBase); + var number2ColumnBase = new ColumnBase("Number2", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Number2", number2ColumnBase); + var number3ColumnBase = new ColumnBase("Number3", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Number3", number3ColumnBase); + var number4ColumnBase = new ColumnBase("Number4", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Number4", number4ColumnBase); + var priorytetColumnBase = new ColumnBase("Priorytet", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Priorytet", priorytetColumnBase); + var regulaIdColumnBase = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("RegulaId", regulaIdColumnBase); + var str1ColumnBase = new ColumnBase("Str1", "varchar(128)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Str1", str1ColumnBase); + var str2ColumnBase = new ColumnBase("Str2", "varchar(128)", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Str2", str2ColumnBase); + var typColumnBase15 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Typ", typColumnBase15); + var typKartyColumnBase0 = new ColumnBase("TypKarty", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("TypKarty", typKartyColumnBase0); + var usunietoColumnBase = new ColumnBase("Usunieto", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Usunieto", usunietoColumnBase); + var utworzonoColumnBase0 = new ColumnBase("Utworzono", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Utworzono", utworzonoColumnBase0); + var zmianaColumnBase27 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.Columns.Add("Zmiana", zmianaColumnBase27); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Regula", blinkBackofficeServicesPcmDbEntitiesRegulaTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase = new TableMappingBase(regula, blinkBackofficeServicesPcmDbEntitiesRegulaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase, false); + defaultTableMappings131.Add(blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase, regula.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase23, regula.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase, regula.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasDoColumnBase, regula.FindProperty("DataCzasDo")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasOdColumnBase, regula.FindProperty("DataCzasOd")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int1ColumnBase, regula.FindProperty("Int1")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int2ColumnBase, regula.FindProperty("Int2")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int3ColumnBase, regula.FindProperty("Int3")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int4ColumnBase, regula.FindProperty("Int4")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase33, regula.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number1ColumnBase, regula.FindProperty("Number1")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number2ColumnBase, regula.FindProperty("Number2")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number3ColumnBase, regula.FindProperty("Number3")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number4ColumnBase, regula.FindProperty("Number4")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)priorytetColumnBase, regula.FindProperty("Priorytet")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)str1ColumnBase, regula.FindProperty("Str1")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)str2ColumnBase, regula.FindProperty("Str2")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase15, regula.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKartyColumnBase0, regula.FindProperty("TypKarty")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)usunietoColumnBase, regula.FindProperty("Usunieto")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonoColumnBase0, regula.FindProperty("Utworzono")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase27, regula.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesRegulaMappingBase); + + var tableMappings131 = new List(); + regula.SetRuntimeAnnotation("Relational:TableMappings", tableMappings131); + var regulaTable = new Table("Regula", null, relationalModel); + var regulaIdColumn = new Column("RegulaId", "numeric(9,0)", regulaTable); + regulaTable.Columns.Add("RegulaId", regulaIdColumn); + var aktywnyColumn23 = new Column("Aktywny", "smallint", regulaTable); + regulaTable.Columns.Add("Aktywny", aktywnyColumn23); + var centrRegulaIdColumn = new Column("CentrRegulaId", "numeric(9,0)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn); + var dataCzasDoColumn = new Column("DataCzasDo", "datetime", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("DataCzasDo", dataCzasDoColumn); + var dataCzasOdColumn = new Column("DataCzasOd", "datetime", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("DataCzasOd", dataCzasOdColumn); + var int1Column = new Column("Int1", "int", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Int1", int1Column); + var int2Column = new Column("Int2", "int", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Int2", int2Column); + var int3Column = new Column("Int3", "int", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Int3", int3Column); + var int4Column = new Column("Int4", "int", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Int4", int4Column); + var nazwaColumn33 = new Column("Nazwa", "varchar(40)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Nazwa", nazwaColumn33); + var number1Column = new Column("Number1", "numeric(16,4)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Number1", number1Column); + var number2Column = new Column("Number2", "numeric(16,4)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Number2", number2Column); + var number3Column = new Column("Number3", "numeric(16,4)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Number3", number3Column); + var number4Column = new Column("Number4", "numeric(16,4)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Number4", number4Column); + var priorytetColumn = new Column("Priorytet", "smallint", regulaTable); + regulaTable.Columns.Add("Priorytet", priorytetColumn); + var str1Column = new Column("Str1", "varchar(128)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Str1", str1Column); + var str2Column = new Column("Str2", "varchar(128)", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Str2", str2Column); + var typColumn15 = new Column("Typ", "smallint", regulaTable); + regulaTable.Columns.Add("Typ", typColumn15); + var typKartyColumn0 = new Column("TypKarty", "smallint", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("TypKarty", typKartyColumn0); + var usunietoColumn = new Column("Usunieto", "datetime", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Usunieto", usunietoColumn); + var utworzonoColumn0 = new Column("Utworzono", "datetime", regulaTable) + { + IsNullable = true + }; + regulaTable.Columns.Add("Utworzono", utworzonoColumn0); + var zmianaColumn27 = new Column("Zmiana", "datetime", regulaTable); + regulaTable.Columns.Add("Zmiana", zmianaColumn27); + var pK_REGULA = new UniqueConstraint("PK_REGULA", regulaTable, new[] { regulaIdColumn }); + regulaTable.PrimaryKey = pK_REGULA; + var pK_REGULAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + pK_REGULA.MappedKeys.Add(pK_REGULAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAUc).Add(pK_REGULA); + regulaTable.UniqueConstraints.Add("PK_REGULA", pK_REGULA); + relationalModel.Tables.Add(("Regula", null), regulaTable); + var regulaTableMapping = new TableMapping(regula, regulaTable, true); + regulaTable.AddTypeMapping(regulaTableMapping, false); + tableMappings131.Add(regulaTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn, regula.FindProperty("RegulaId")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn23, regula.FindProperty("Aktywny")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn, regula.FindProperty("CentrRegulaId")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(dataCzasDoColumn, regula.FindProperty("DataCzasDo")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(dataCzasOdColumn, regula.FindProperty("DataCzasOd")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(int1Column, regula.FindProperty("Int1")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(int2Column, regula.FindProperty("Int2")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(int3Column, regula.FindProperty("Int3")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(int4Column, regula.FindProperty("Int4")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn33, regula.FindProperty("Nazwa")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(number1Column, regula.FindProperty("Number1")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(number2Column, regula.FindProperty("Number2")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(number3Column, regula.FindProperty("Number3")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(number4Column, regula.FindProperty("Number4")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(priorytetColumn, regula.FindProperty("Priorytet")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(str1Column, regula.FindProperty("Str1")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(str2Column, regula.FindProperty("Str2")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(typColumn15, regula.FindProperty("Typ")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(typKartyColumn0, regula.FindProperty("TypKarty")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(usunietoColumn, regula.FindProperty("Usunieto")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(utworzonoColumn0, regula.FindProperty("Utworzono")!, regulaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn27, regula.FindProperty("Zmiana")!, regulaTableMapping); + + var regulaAsort = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort")!; + + var defaultTableMappings132 = new List>(); + regulaAsort.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings132); + var blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort", null, relationalModel); + var asIdColumnBase1 = new ColumnBase("AsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase.Columns.Add("AsId", asIdColumnBase1); + var regulaIdColumnBase0 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase.Columns.Add("RegulaId", regulaIdColumnBase0); + var znaczenieColumnBase9 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase.Columns.Add("Znaczenie", znaczenieColumnBase9); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort", blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaAsortMappingBase = new TableMappingBase(regulaAsort, blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaAsortTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaAsortMappingBase, false); + defaultTableMappings132.Add(blinkBackofficeServicesPcmDbEntitiesRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asIdColumnBase1, regulaAsort.FindProperty("AsId")!, blinkBackofficeServicesPcmDbEntitiesRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase0, regulaAsort.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase9, regulaAsort.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRegulaAsortMappingBase); + + var tableMappings132 = new List(); + regulaAsort.SetRuntimeAnnotation("Relational:TableMappings", tableMappings132); + var regulaAsortTable = new Table("RegulaAsort", null, relationalModel); + var regulaIdColumn0 = new Column("RegulaId", "numeric(9,0)", regulaAsortTable); + regulaAsortTable.Columns.Add("RegulaId", regulaIdColumn0); + var asIdColumn1 = new Column("AsId", "numeric(9,0)", regulaAsortTable); + regulaAsortTable.Columns.Add("AsId", asIdColumn1); + var znaczenieColumn9 = new Column("Znaczenie", "smallint", regulaAsortTable); + regulaAsortTable.Columns.Add("Znaczenie", znaczenieColumn9); + var pK_REGULAASORT = new UniqueConstraint("PK_REGULAASORT", regulaAsortTable, new[] { regulaIdColumn0, asIdColumn1, znaczenieColumn9 }); + regulaAsortTable.PrimaryKey = pK_REGULAASORT; + var pK_REGULAASORTUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort", + new[] { "RegulaId", "AsId", "Znaczenie" }); + pK_REGULAASORT.MappedKeys.Add(pK_REGULAASORTUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAASORTUc).Add(pK_REGULAASORT); + regulaAsortTable.UniqueConstraints.Add("PK_REGULAASORT", pK_REGULAASORT); + var iX_RegulaAsort_AsId = new TableIndex( + "IX_RegulaAsort_AsId", regulaAsortTable, new[] { asIdColumn1 }, false); + var iX_RegulaAsort_AsIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort", + new[] { "AsId" }); + iX_RegulaAsort_AsId.MappedIndexes.Add(iX_RegulaAsort_AsIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaAsort_AsIdIx).Add(iX_RegulaAsort_AsId); + regulaAsortTable.Indexes.Add("IX_RegulaAsort_AsId", iX_RegulaAsort_AsId); + relationalModel.Tables.Add(("RegulaAsort", null), regulaAsortTable); + var regulaAsortTableMapping = new TableMapping(regulaAsort, regulaAsortTable, true); + regulaAsortTable.AddTypeMapping(regulaAsortTableMapping, false); + tableMappings132.Add(regulaAsortTableMapping); + RelationalModel.CreateColumnMapping(asIdColumn1, regulaAsort.FindProperty("AsId")!, regulaAsortTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn0, regulaAsort.FindProperty("RegulaId")!, regulaAsortTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn9, regulaAsort.FindProperty("Znaczenie")!, regulaAsortTableMapping); + + var regulaDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaDok")!; + + var defaultTableMappings133 = new List>(); + regulaDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings133); + var blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", null, relationalModel); + var dokIdColumnBase13 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("DokId", dokIdColumnBase13); + var kolejnoscColumnBase18 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase18); + var kontoIdColumnBase1 = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("KontoId", kontoIdColumnBase1); + var opcjaColumnBase = new ColumnBase("Opcja", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("Opcja", opcjaColumnBase); + var opcja2ColumnBase0 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("Opcja2", opcja2ColumnBase0); + var regulaIdColumnBase1 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("RegulaId", regulaIdColumnBase1); + var tekstColumnBase6 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("Tekst", tekstColumnBase6); + var typRegulyColumnBase = new ColumnBase("TypReguly", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("TypReguly", typRegulyColumnBase); + var wartoscColumnBase6 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("Wartosc", wartoscColumnBase6); + var wartosc2ColumnBase = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase); + var wartosc3ColumnBase = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase = new TableMappingBase(regulaDok, blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase, false); + defaultTableMappings133.Add(blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase13, regulaDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase18, regulaDok.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase1, regulaDok.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase1, regulaDok.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaColumnBase, regulaDok.FindProperty("Opcja")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase0, regulaDok.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase6, regulaDok.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typRegulyColumnBase, regulaDok.FindProperty("TypReguly")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase6, regulaDok.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase, regulaDok.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase, regulaDok.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokMappingBase); + + var tableMappings133 = new List(); + regulaDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings133); + var regulaDokTable = new Table("RegulaDok", null, relationalModel); + var dokIdColumn13 = new Column("DokId", "numeric(9,0)", regulaDokTable); + regulaDokTable.Columns.Add("DokId", dokIdColumn13); + var regulaIdColumn1 = new Column("RegulaId", "numeric(9,0)", regulaDokTable); + regulaDokTable.Columns.Add("RegulaId", regulaIdColumn1); + var kolejnoscColumn18 = new Column("Kolejnosc", "int", regulaDokTable); + regulaDokTable.Columns.Add("Kolejnosc", kolejnoscColumn18); + var kontoIdColumn1 = new Column("KontoId", "numeric(9,0)", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("KontoId", kontoIdColumn1); + var opcjaColumn = new Column("Opcja", "smallint", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("Opcja", opcjaColumn); + var opcja2Column0 = new Column("Opcja2", "smallint", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("Opcja2", opcja2Column0); + var tekstColumn6 = new Column("Tekst", "varchar(255)", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("Tekst", tekstColumn6); + var typRegulyColumn = new Column("TypReguly", "smallint", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("TypReguly", typRegulyColumn); + var wartoscColumn6 = new Column("Wartosc", "decimal(15,4)", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("Wartosc", wartoscColumn6); + var wartosc2Column = new Column("Wartosc2", "decimal(15,4)", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("Wartosc2", wartosc2Column); + var wartosc3Column = new Column("Wartosc3", "decimal(15,4)", regulaDokTable) + { + IsNullable = true + }; + regulaDokTable.Columns.Add("Wartosc3", wartosc3Column); + var pK_REGULADOK = new UniqueConstraint("PK_REGULADOK", regulaDokTable, new[] { dokIdColumn13, regulaIdColumn1, kolejnoscColumn18 }); + regulaDokTable.PrimaryKey = pK_REGULADOK; + var pK_REGULADOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + new[] { "DokId", "RegulaId", "Kolejnosc" }); + pK_REGULADOK.MappedKeys.Add(pK_REGULADOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULADOKUc).Add(pK_REGULADOK); + regulaDokTable.UniqueConstraints.Add("PK_REGULADOK", pK_REGULADOK); + var iX_RegulaDok_KontoId = new TableIndex( + "IX_RegulaDok_KontoId", regulaDokTable, new[] { kontoIdColumn1 }, false); + var iX_RegulaDok_KontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + new[] { "KontoId" }); + iX_RegulaDok_KontoId.MappedIndexes.Add(iX_RegulaDok_KontoIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaDok_KontoIdIx).Add(iX_RegulaDok_KontoId); + regulaDokTable.Indexes.Add("IX_RegulaDok_KontoId", iX_RegulaDok_KontoId); + var iX_RegulaDok_RegulaId = new TableIndex( + "IX_RegulaDok_RegulaId", regulaDokTable, new[] { regulaIdColumn1 }, false); + var iX_RegulaDok_RegulaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + new[] { "RegulaId" }); + iX_RegulaDok_RegulaId.MappedIndexes.Add(iX_RegulaDok_RegulaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaDok_RegulaIdIx).Add(iX_RegulaDok_RegulaId); + regulaDokTable.Indexes.Add("IX_RegulaDok_RegulaId", iX_RegulaDok_RegulaId); + relationalModel.Tables.Add(("RegulaDok", null), regulaDokTable); + var regulaDokTableMapping = new TableMapping(regulaDok, regulaDokTable, true); + regulaDokTable.AddTypeMapping(regulaDokTableMapping, false); + tableMappings133.Add(regulaDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn13, regulaDok.FindProperty("DokId")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn18, regulaDok.FindProperty("Kolejnosc")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn1, regulaDok.FindProperty("RegulaId")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn1, regulaDok.FindProperty("KontoId")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(opcjaColumn, regulaDok.FindProperty("Opcja")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column0, regulaDok.FindProperty("Opcja2")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn6, regulaDok.FindProperty("Tekst")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(typRegulyColumn, regulaDok.FindProperty("TypReguly")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn6, regulaDok.FindProperty("Wartosc")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column, regulaDok.FindProperty("Wartosc2")!, regulaDokTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column, regulaDok.FindProperty("Wartosc3")!, regulaDokTableMapping); + + var regulaDokSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaDokSzczeg")!; + + var defaultTableMappings134 = new List>(); + regulaDokSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings134); + var blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaDokSzczeg", null, relationalModel); + var dokIdColumnBase14 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.Columns.Add("DokId", dokIdColumnBase14); + var kolejnoscColumnBase19 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase19); + var param1ColumnBase4 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.Columns.Add("Param1", param1ColumnBase4); + var param2ColumnBase2 = new ColumnBase("Param2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.Columns.Add("Param2", param2ColumnBase2); + var param3ColumnBase1 = new ColumnBase("Param3", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.Columns.Add("Param3", param3ColumnBase1); + var regulaIdColumnBase2 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.Columns.Add("RegulaId", regulaIdColumnBase2); + var znaczenieColumnBase10 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.Columns.Add("Znaczenie", znaczenieColumnBase10); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaDokSzczeg", blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase = new TableMappingBase(regulaDokSzczeg, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase, false); + defaultTableMappings134.Add(blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase14, regulaDokSzczeg.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase19, regulaDokSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase2, regulaDokSzczeg.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase10, regulaDokSzczeg.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase4, regulaDokSzczeg.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase2, regulaDokSzczeg.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase1, regulaDokSzczeg.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesRegulaDokSzczegMappingBase); + + var tableMappings134 = new List(); + regulaDokSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings134); + var regulaDokSzczegTable = new Table("RegulaDokSzczeg", null, relationalModel); + var dokIdColumn14 = new Column("DokId", "numeric(9,0)", regulaDokSzczegTable); + regulaDokSzczegTable.Columns.Add("DokId", dokIdColumn14); + var regulaIdColumn2 = new Column("RegulaId", "numeric(9,0)", regulaDokSzczegTable); + regulaDokSzczegTable.Columns.Add("RegulaId", regulaIdColumn2); + var kolejnoscColumn19 = new Column("Kolejnosc", "int", regulaDokSzczegTable); + regulaDokSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn19); + var znaczenieColumn10 = new Column("Znaczenie", "smallint", regulaDokSzczegTable); + regulaDokSzczegTable.Columns.Add("Znaczenie", znaczenieColumn10); + var param1Column4 = new Column("Param1", "int", regulaDokSzczegTable); + regulaDokSzczegTable.Columns.Add("Param1", param1Column4); + var param2Column2 = new Column("Param2", "decimal(15,4)", regulaDokSzczegTable); + regulaDokSzczegTable.Columns.Add("Param2", param2Column2); + var param3Column1 = new Column("Param3", "varchar(255)", regulaDokSzczegTable); + regulaDokSzczegTable.Columns.Add("Param3", param3Column1); + var pK_REGULADOKSZCZEG = new UniqueConstraint("PK_REGULADOKSZCZEG", regulaDokSzczegTable, new[] { dokIdColumn14, regulaIdColumn2, kolejnoscColumn19, znaczenieColumn10 }); + regulaDokSzczegTable.PrimaryKey = pK_REGULADOKSZCZEG; + var pK_REGULADOKSZCZEGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDokSzczeg", + new[] { "DokId", "RegulaId", "Kolejnosc", "Znaczenie" }); + pK_REGULADOKSZCZEG.MappedKeys.Add(pK_REGULADOKSZCZEGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULADOKSZCZEGUc).Add(pK_REGULADOKSZCZEG); + regulaDokSzczegTable.UniqueConstraints.Add("PK_REGULADOKSZCZEG", pK_REGULADOKSZCZEG); + relationalModel.Tables.Add(("RegulaDokSzczeg", null), regulaDokSzczegTable); + var regulaDokSzczegTableMapping = new TableMapping(regulaDokSzczeg, regulaDokSzczegTable, true); + regulaDokSzczegTable.AddTypeMapping(regulaDokSzczegTableMapping, false); + tableMappings134.Add(regulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn14, regulaDokSzczeg.FindProperty("DokId")!, regulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn19, regulaDokSzczeg.FindProperty("Kolejnosc")!, regulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn2, regulaDokSzczeg.FindProperty("RegulaId")!, regulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn10, regulaDokSzczeg.FindProperty("Znaczenie")!, regulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(param1Column4, regulaDokSzczeg.FindProperty("Param1")!, regulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(param2Column2, regulaDokSzczeg.FindProperty("Param2")!, regulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(param3Column1, regulaDokSzczeg.FindProperty("Param3")!, regulaDokSzczegTableMapping); + + var regulaKod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaKod")!; + + var defaultTableMappings135 = new List>(); + regulaKod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings135); + var blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaKod", null, relationalModel); + var cenaColumnBase0 = new ColumnBase("Cena", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("Cena", cenaColumnBase0); + var iloscColumnBase1 = new ColumnBase("Ilosc", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("Ilosc", iloscColumnBase1); + var informacjaColumnBase = new ColumnBase("Informacja", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("Informacja", informacjaColumnBase); + var kodColumnBase9 = new ColumnBase("Kod", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("Kod", kodColumnBase9); + var nazwaTowaruColumnBase = new ColumnBase("NazwaTowaru", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("NazwaTowaru", nazwaTowaruColumnBase); + var parametrColumnBase0 = new ColumnBase("Parametr", "int", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("Parametr", parametrColumnBase0); + var regulaIdColumnBase3 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("RegulaId", regulaIdColumnBase3); + var znaczenieColumnBase11 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.Columns.Add("Znaczenie", znaczenieColumnBase11); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaKod", blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase = new TableMappingBase(regulaKod, blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaKodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase, false); + defaultTableMappings135.Add(blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase9, regulaKod.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase3, regulaKod.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase11, regulaKod.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase0, regulaKod.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase1, regulaKod.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)informacjaColumnBase, regulaKod.FindProperty("Informacja")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaTowaruColumnBase, regulaKod.FindProperty("NazwaTowaru")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parametrColumnBase0, regulaKod.FindProperty("Parametr")!, blinkBackofficeServicesPcmDbEntitiesRegulaKodMappingBase); + + var tableMappings135 = new List(); + regulaKod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings135); + var regulaKodTable = new Table("RegulaKod", null, relationalModel); + var regulaIdColumn3 = new Column("RegulaId", "numeric(9,0)", regulaKodTable); + regulaKodTable.Columns.Add("RegulaId", regulaIdColumn3); + var kodColumn9 = new Column("Kod", "varchar(40)", regulaKodTable); + regulaKodTable.Columns.Add("Kod", kodColumn9); + var znaczenieColumn11 = new Column("Znaczenie", "smallint", regulaKodTable); + regulaKodTable.Columns.Add("Znaczenie", znaczenieColumn11); + var cenaColumn0 = new Column("Cena", "numeric(16,4)", regulaKodTable) + { + IsNullable = true + }; + regulaKodTable.Columns.Add("Cena", cenaColumn0); + var iloscColumn1 = new Column("Ilosc", "numeric(16,4)", regulaKodTable) + { + IsNullable = true + }; + regulaKodTable.Columns.Add("Ilosc", iloscColumn1); + var informacjaColumn = new Column("Informacja", "varchar(40)", regulaKodTable) + { + IsNullable = true + }; + regulaKodTable.Columns.Add("Informacja", informacjaColumn); + var nazwaTowaruColumn = new Column("NazwaTowaru", "varchar(255)", regulaKodTable) + { + IsNullable = true + }; + regulaKodTable.Columns.Add("NazwaTowaru", nazwaTowaruColumn); + var parametrColumn0 = new Column("Parametr", "int", regulaKodTable) + { + IsNullable = true + }; + regulaKodTable.Columns.Add("Parametr", parametrColumn0); + var pK_RegulaKod = new UniqueConstraint("PK_RegulaKod", regulaKodTable, new[] { regulaIdColumn3, kodColumn9, znaczenieColumn11 }); + regulaKodTable.PrimaryKey = pK_RegulaKod; + var pK_RegulaKodUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaKod", + new[] { "RegulaId", "Kod", "Znaczenie" }); + pK_RegulaKod.MappedKeys.Add(pK_RegulaKodUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_RegulaKodUc).Add(pK_RegulaKod); + regulaKodTable.UniqueConstraints.Add("PK_RegulaKod", pK_RegulaKod); + relationalModel.Tables.Add(("RegulaKod", null), regulaKodTable); + var regulaKodTableMapping = new TableMapping(regulaKod, regulaKodTable, true); + regulaKodTable.AddTypeMapping(regulaKodTableMapping, false); + tableMappings135.Add(regulaKodTableMapping); + RelationalModel.CreateColumnMapping(kodColumn9, regulaKod.FindProperty("Kod")!, regulaKodTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn3, regulaKod.FindProperty("RegulaId")!, regulaKodTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn11, regulaKod.FindProperty("Znaczenie")!, regulaKodTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn0, regulaKod.FindProperty("Cena")!, regulaKodTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn1, regulaKod.FindProperty("Ilosc")!, regulaKodTableMapping); + RelationalModel.CreateColumnMapping(informacjaColumn, regulaKod.FindProperty("Informacja")!, regulaKodTableMapping); + RelationalModel.CreateColumnMapping(nazwaTowaruColumn, regulaKod.FindProperty("NazwaTowaru")!, regulaKodTableMapping); + RelationalModel.CreateColumnMapping(parametrColumn0, regulaKod.FindProperty("Parametr")!, regulaKodTableMapping); + + var regulaPar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaPar")!; + + var defaultTableMappings136 = new List>(); + regulaPar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings136); + var blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", null, relationalModel); + var kolejnoscColumnBase20 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase20); + var kontoIdColumnBase2 = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("KontoId", kontoIdColumnBase2); + var opcjaColumnBase0 = new ColumnBase("Opcja", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("Opcja", opcjaColumnBase0); + var opcja2ColumnBase1 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("Opcja2", opcja2ColumnBase1); + var parIdColumnBase10 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("ParId", parIdColumnBase10); + var regulaIdColumnBase4 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("RegulaId", regulaIdColumnBase4); + var tekstColumnBase7 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("Tekst", tekstColumnBase7); + var typRegulyColumnBase0 = new ColumnBase("TypReguly", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("TypReguly", typRegulyColumnBase0); + var wartoscColumnBase7 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("Wartosc", wartoscColumnBase7); + var wartosc2ColumnBase0 = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase0); + var wartosc3ColumnBase0 = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase = new TableMappingBase(regulaPar, blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaParTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase, false); + defaultTableMappings136.Add(blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase20, regulaPar.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase10, regulaPar.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase4, regulaPar.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase2, regulaPar.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaColumnBase0, regulaPar.FindProperty("Opcja")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase1, regulaPar.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase7, regulaPar.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typRegulyColumnBase0, regulaPar.FindProperty("TypReguly")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase7, regulaPar.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase0, regulaPar.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase0, regulaPar.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesRegulaParMappingBase); + + var tableMappings136 = new List(); + regulaPar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings136); + var regulaParTable = new Table("RegulaPar", null, relationalModel); + var parIdColumn10 = new Column("ParId", "numeric(9,0)", regulaParTable); + regulaParTable.Columns.Add("ParId", parIdColumn10); + var regulaIdColumn4 = new Column("RegulaId", "numeric(9,0)", regulaParTable); + regulaParTable.Columns.Add("RegulaId", regulaIdColumn4); + var kolejnoscColumn20 = new Column("Kolejnosc", "int", regulaParTable); + regulaParTable.Columns.Add("Kolejnosc", kolejnoscColumn20); + var kontoIdColumn2 = new Column("KontoId", "numeric(9,0)", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("KontoId", kontoIdColumn2); + var opcjaColumn0 = new Column("Opcja", "smallint", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("Opcja", opcjaColumn0); + var opcja2Column1 = new Column("Opcja2", "smallint", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("Opcja2", opcja2Column1); + var tekstColumn7 = new Column("Tekst", "varchar(255)", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("Tekst", tekstColumn7); + var typRegulyColumn0 = new Column("TypReguly", "smallint", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("TypReguly", typRegulyColumn0); + var wartoscColumn7 = new Column("Wartosc", "decimal(15,4)", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("Wartosc", wartoscColumn7); + var wartosc2Column0 = new Column("Wartosc2", "decimal(15,4)", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("Wartosc2", wartosc2Column0); + var wartosc3Column0 = new Column("Wartosc3", "decimal(15,4)", regulaParTable) + { + IsNullable = true + }; + regulaParTable.Columns.Add("Wartosc3", wartosc3Column0); + var pK_REGULAPAR = new UniqueConstraint("PK_REGULAPAR", regulaParTable, new[] { parIdColumn10, regulaIdColumn4, kolejnoscColumn20 }); + regulaParTable.PrimaryKey = pK_REGULAPAR; + var pK_REGULAPARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + new[] { "ParId", "RegulaId", "Kolejnosc" }); + pK_REGULAPAR.MappedKeys.Add(pK_REGULAPARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAPARUc).Add(pK_REGULAPAR); + regulaParTable.UniqueConstraints.Add("PK_REGULAPAR", pK_REGULAPAR); + var iX_RegulaPar_KontoId = new TableIndex( + "IX_RegulaPar_KontoId", regulaParTable, new[] { kontoIdColumn2 }, false); + var iX_RegulaPar_KontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + new[] { "KontoId" }); + iX_RegulaPar_KontoId.MappedIndexes.Add(iX_RegulaPar_KontoIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaPar_KontoIdIx).Add(iX_RegulaPar_KontoId); + regulaParTable.Indexes.Add("IX_RegulaPar_KontoId", iX_RegulaPar_KontoId); + var iX_RegulaPar_RegulaId = new TableIndex( + "IX_RegulaPar_RegulaId", regulaParTable, new[] { regulaIdColumn4 }, false); + var iX_RegulaPar_RegulaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + new[] { "RegulaId" }); + iX_RegulaPar_RegulaId.MappedIndexes.Add(iX_RegulaPar_RegulaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaPar_RegulaIdIx).Add(iX_RegulaPar_RegulaId); + regulaParTable.Indexes.Add("IX_RegulaPar_RegulaId", iX_RegulaPar_RegulaId); + relationalModel.Tables.Add(("RegulaPar", null), regulaParTable); + var regulaParTableMapping = new TableMapping(regulaPar, regulaParTable, true); + regulaParTable.AddTypeMapping(regulaParTableMapping, false); + tableMappings136.Add(regulaParTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn20, regulaPar.FindProperty("Kolejnosc")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn10, regulaPar.FindProperty("ParId")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn4, regulaPar.FindProperty("RegulaId")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn2, regulaPar.FindProperty("KontoId")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(opcjaColumn0, regulaPar.FindProperty("Opcja")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column1, regulaPar.FindProperty("Opcja2")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn7, regulaPar.FindProperty("Tekst")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(typRegulyColumn0, regulaPar.FindProperty("TypReguly")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn7, regulaPar.FindProperty("Wartosc")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column0, regulaPar.FindProperty("Wartosc2")!, regulaParTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column0, regulaPar.FindProperty("Wartosc3")!, regulaParTableMapping); + + var regulaParSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaParSzczeg")!; + + var defaultTableMappings137 = new List>(); + regulaParSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings137); + var blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaParSzczeg", null, relationalModel); + var kolejnoscColumnBase21 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase21); + var parIdColumnBase11 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.Columns.Add("ParId", parIdColumnBase11); + var param1ColumnBase5 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.Columns.Add("Param1", param1ColumnBase5); + var param2ColumnBase3 = new ColumnBase("Param2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.Columns.Add("Param2", param2ColumnBase3); + var param3ColumnBase2 = new ColumnBase("Param3", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.Columns.Add("Param3", param3ColumnBase2); + var regulaIdColumnBase5 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.Columns.Add("RegulaId", regulaIdColumnBase5); + var znaczenieColumnBase12 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.Columns.Add("Znaczenie", znaczenieColumnBase12); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaParSzczeg", blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase = new TableMappingBase(regulaParSzczeg, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase, false); + defaultTableMappings137.Add(blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase21, regulaParSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase11, regulaParSzczeg.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase5, regulaParSzczeg.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase12, regulaParSzczeg.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase5, regulaParSzczeg.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase3, regulaParSzczeg.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase2, regulaParSzczeg.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesRegulaParSzczegMappingBase); + + var tableMappings137 = new List(); + regulaParSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings137); + var regulaParSzczegTable = new Table("RegulaParSzczeg", null, relationalModel); + var parIdColumn11 = new Column("ParId", "numeric(9,0)", regulaParSzczegTable); + regulaParSzczegTable.Columns.Add("ParId", parIdColumn11); + var regulaIdColumn5 = new Column("RegulaId", "numeric(9,0)", regulaParSzczegTable); + regulaParSzczegTable.Columns.Add("RegulaId", regulaIdColumn5); + var kolejnoscColumn21 = new Column("Kolejnosc", "int", regulaParSzczegTable); + regulaParSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn21); + var znaczenieColumn12 = new Column("Znaczenie", "smallint", regulaParSzczegTable); + regulaParSzczegTable.Columns.Add("Znaczenie", znaczenieColumn12); + var param1Column5 = new Column("Param1", "int", regulaParSzczegTable); + regulaParSzczegTable.Columns.Add("Param1", param1Column5); + var param2Column3 = new Column("Param2", "decimal(15,4)", regulaParSzczegTable); + regulaParSzczegTable.Columns.Add("Param2", param2Column3); + var param3Column2 = new Column("Param3", "varchar(255)", regulaParSzczegTable); + regulaParSzczegTable.Columns.Add("Param3", param3Column2); + var pK_REGULAPARSZCZEG = new UniqueConstraint("PK_REGULAPARSZCZEG", regulaParSzczegTable, new[] { parIdColumn11, regulaIdColumn5, kolejnoscColumn21, znaczenieColumn12 }); + regulaParSzczegTable.PrimaryKey = pK_REGULAPARSZCZEG; + var pK_REGULAPARSZCZEGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaParSzczeg", + new[] { "ParId", "RegulaId", "Kolejnosc", "Znaczenie" }); + pK_REGULAPARSZCZEG.MappedKeys.Add(pK_REGULAPARSZCZEGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAPARSZCZEGUc).Add(pK_REGULAPARSZCZEG); + regulaParSzczegTable.UniqueConstraints.Add("PK_REGULAPARSZCZEG", pK_REGULAPARSZCZEG); + relationalModel.Tables.Add(("RegulaParSzczeg", null), regulaParSzczegTable); + var regulaParSzczegTableMapping = new TableMapping(regulaParSzczeg, regulaParSzczegTable, true); + regulaParSzczegTable.AddTypeMapping(regulaParSzczegTableMapping, false); + tableMappings137.Add(regulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn21, regulaParSzczeg.FindProperty("Kolejnosc")!, regulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn11, regulaParSzczeg.FindProperty("ParId")!, regulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn5, regulaParSzczeg.FindProperty("RegulaId")!, regulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn12, regulaParSzczeg.FindProperty("Znaczenie")!, regulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(param1Column5, regulaParSzczeg.FindProperty("Param1")!, regulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(param2Column3, regulaParSzczeg.FindProperty("Param2")!, regulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(param3Column2, regulaParSzczeg.FindProperty("Param3")!, regulaParSzczegTableMapping); + + var regulaParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaParam")!; + + var defaultTableMappings138 = new List>(); + regulaParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings138); + var blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaParam", null, relationalModel); + var param1ColumnBase6 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase.Columns.Add("Param1", param1ColumnBase6); + var param2ColumnBase4 = new ColumnBase("Param2", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase.Columns.Add("Param2", param2ColumnBase4); + var regulaIdColumnBase6 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase.Columns.Add("RegulaId", regulaIdColumnBase6); + var znaczenieColumnBase13 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase.Columns.Add("Znaczenie", znaczenieColumnBase13); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaParam", blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaParamMappingBase = new TableMappingBase(regulaParam, blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaParamMappingBase, false); + defaultTableMappings138.Add(blinkBackofficeServicesPcmDbEntitiesRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase6, regulaParam.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase13, regulaParam.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase6, regulaParam.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase4, regulaParam.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesRegulaParamMappingBase); + + var tableMappings138 = new List(); + regulaParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings138); + var regulaParamTable = new Table("RegulaParam", null, relationalModel); + var regulaIdColumn6 = new Column("RegulaId", "numeric(9,0)", regulaParamTable); + regulaParamTable.Columns.Add("RegulaId", regulaIdColumn6); + var znaczenieColumn13 = new Column("Znaczenie", "smallint", regulaParamTable); + regulaParamTable.Columns.Add("Znaczenie", znaczenieColumn13); + var param1Column6 = new Column("Param1", "int", regulaParamTable) + { + IsNullable = true + }; + regulaParamTable.Columns.Add("Param1", param1Column6); + var param2Column4 = new Column("Param2", "varchar(255)", regulaParamTable) + { + IsNullable = true + }; + regulaParamTable.Columns.Add("Param2", param2Column4); + var pK_REGULAPARAM = new UniqueConstraint("PK_REGULAPARAM", regulaParamTable, new[] { regulaIdColumn6, znaczenieColumn13 }); + regulaParamTable.PrimaryKey = pK_REGULAPARAM; + var pK_REGULAPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaParam", + new[] { "RegulaId", "Znaczenie" }); + pK_REGULAPARAM.MappedKeys.Add(pK_REGULAPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAPARAMUc).Add(pK_REGULAPARAM); + regulaParamTable.UniqueConstraints.Add("PK_REGULAPARAM", pK_REGULAPARAM); + relationalModel.Tables.Add(("RegulaParam", null), regulaParamTable); + var regulaParamTableMapping = new TableMapping(regulaParam, regulaParamTable, true); + regulaParamTable.AddTypeMapping(regulaParamTableMapping, false); + tableMappings138.Add(regulaParamTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn6, regulaParam.FindProperty("RegulaId")!, regulaParamTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn13, regulaParam.FindProperty("Znaczenie")!, regulaParamTableMapping); + RelationalModel.CreateColumnMapping(param1Column6, regulaParam.FindProperty("Param1")!, regulaParamTableMapping); + RelationalModel.CreateColumnMapping(param2Column4, regulaParam.FindProperty("Param2")!, regulaParamTableMapping); + + var regulaPozDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok")!; + + var defaultTableMappings139 = new List>(); + regulaPozDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings139); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok", null, relationalModel); + var dokIdColumnBase15 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase.Columns.Add("DokId", dokIdColumnBase15); + var kolejnoscColumnBase22 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase22); + var regulaIdColumnBase7 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase.Columns.Add("RegulaId", regulaIdColumnBase7); + var tekstColumnBase8 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase.Columns.Add("Tekst", tekstColumnBase8); + var typColumnBase16 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase.Columns.Add("Typ", typColumnBase16); + var wartoscColumnBase8 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase.Columns.Add("Wartosc", wartoscColumnBase8); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase = new TableMappingBase(regulaPozDok, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase, false); + defaultTableMappings139.Add(blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase15, regulaPozDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase22, regulaPozDok.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase7, regulaPozDok.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase16, regulaPozDok.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase8, regulaPozDok.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase8, regulaPozDok.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokMappingBase); + + var tableMappings139 = new List(); + regulaPozDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings139); + var regulaPozDokTable = new Table("RegulaPozDok", null, relationalModel); + var dokIdColumn15 = new Column("DokId", "numeric(9,0)", regulaPozDokTable); + regulaPozDokTable.Columns.Add("DokId", dokIdColumn15); + var kolejnoscColumn22 = new Column("Kolejnosc", "int", regulaPozDokTable); + regulaPozDokTable.Columns.Add("Kolejnosc", kolejnoscColumn22); + var regulaIdColumn7 = new Column("RegulaId", "numeric(9,0)", regulaPozDokTable); + regulaPozDokTable.Columns.Add("RegulaId", regulaIdColumn7); + var typColumn16 = new Column("Typ", "smallint", regulaPozDokTable); + regulaPozDokTable.Columns.Add("Typ", typColumn16); + var tekstColumn8 = new Column("Tekst", "varchar(255)", regulaPozDokTable) + { + IsNullable = true + }; + regulaPozDokTable.Columns.Add("Tekst", tekstColumn8); + var wartoscColumn8 = new Column("Wartosc", "decimal(15,4)", regulaPozDokTable) + { + IsNullable = true + }; + regulaPozDokTable.Columns.Add("Wartosc", wartoscColumn8); + var pK_REGULAPOZDOK = new UniqueConstraint("PK_REGULAPOZDOK", regulaPozDokTable, new[] { dokIdColumn15, kolejnoscColumn22, regulaIdColumn7, typColumn16 }); + regulaPozDokTable.PrimaryKey = pK_REGULAPOZDOK; + var pK_REGULAPOZDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok", + new[] { "DokId", "Kolejnosc", "RegulaId", "Typ" }); + pK_REGULAPOZDOK.MappedKeys.Add(pK_REGULAPOZDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAPOZDOKUc).Add(pK_REGULAPOZDOK); + regulaPozDokTable.UniqueConstraints.Add("PK_REGULAPOZDOK", pK_REGULAPOZDOK); + var iX_RegulaPozDok_RegulaId = new TableIndex( + "IX_RegulaPozDok_RegulaId", regulaPozDokTable, new[] { regulaIdColumn7 }, false); + var iX_RegulaPozDok_RegulaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok", + new[] { "RegulaId" }); + iX_RegulaPozDok_RegulaId.MappedIndexes.Add(iX_RegulaPozDok_RegulaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaPozDok_RegulaIdIx).Add(iX_RegulaPozDok_RegulaId); + regulaPozDokTable.Indexes.Add("IX_RegulaPozDok_RegulaId", iX_RegulaPozDok_RegulaId); + relationalModel.Tables.Add(("RegulaPozDok", null), regulaPozDokTable); + var regulaPozDokTableMapping = new TableMapping(regulaPozDok, regulaPozDokTable, true); + regulaPozDokTable.AddTypeMapping(regulaPozDokTableMapping, false); + tableMappings139.Add(regulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn15, regulaPozDok.FindProperty("DokId")!, regulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn22, regulaPozDok.FindProperty("Kolejnosc")!, regulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn7, regulaPozDok.FindProperty("RegulaId")!, regulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(typColumn16, regulaPozDok.FindProperty("Typ")!, regulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn8, regulaPozDok.FindProperty("Tekst")!, regulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn8, regulaPozDok.FindProperty("Wartosc")!, regulaPozDokTableMapping); + + var regulaPozDokSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg")!; + + var defaultTableMappings140 = new List>(); + regulaPozDokSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings140); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg", null, relationalModel); + var dokIdColumnBase16 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("DokId", dokIdColumnBase16); + var kolejnoscColumnBase23 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase23); + var kolejnoscRegulaDokColumnBase = new ColumnBase("KolejnoscRegulaDok", "int", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("KolejnoscRegulaDok", kolejnoscRegulaDokColumnBase); + var opcja1ColumnBase0 = new ColumnBase("Opcja1", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Opcja1", opcja1ColumnBase0); + var opcja2ColumnBase2 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Opcja2", opcja2ColumnBase2); + var regulaIdColumnBase8 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("RegulaId", regulaIdColumnBase8); + var tekstColumnBase9 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Tekst", tekstColumnBase9); + var typColumnBase17 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Typ", typColumnBase17); + var wartosc1ColumnBase = new ColumnBase("Wartosc1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Wartosc1", wartosc1ColumnBase); + var wartosc2ColumnBase1 = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase1); + var wartosc3ColumnBase1 = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase1); + var wartosc4ColumnBase = new ColumnBase("Wartosc4", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.Columns.Add("Wartosc4", wartosc4ColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg", blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase = new TableMappingBase(regulaPozDokSzczeg, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase, false); + defaultTableMappings140.Add(blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase16, regulaPozDokSzczeg.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase23, regulaPozDokSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscRegulaDokColumnBase, regulaPozDokSzczeg.FindProperty("KolejnoscRegulaDok")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase8, regulaPozDokSzczeg.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase17, regulaPozDokSzczeg.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja1ColumnBase0, regulaPozDokSzczeg.FindProperty("Opcja1")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase2, regulaPozDokSzczeg.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase9, regulaPozDokSzczeg.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc1ColumnBase, regulaPozDokSzczeg.FindProperty("Wartosc1")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase1, regulaPozDokSzczeg.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase1, regulaPozDokSzczeg.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc4ColumnBase, regulaPozDokSzczeg.FindProperty("Wartosc4")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozDokSzczegMappingBase); + + var tableMappings140 = new List(); + regulaPozDokSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings140); + var regulaPozDokSzczegTable = new Table("RegulaPozDokSzczeg", null, relationalModel); + var dokIdColumn16 = new Column("DokId", "numeric(9,0)", regulaPozDokSzczegTable); + regulaPozDokSzczegTable.Columns.Add("DokId", dokIdColumn16); + var kolejnoscColumn23 = new Column("Kolejnosc", "int", regulaPozDokSzczegTable); + regulaPozDokSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn23); + var regulaIdColumn8 = new Column("RegulaId", "numeric(9,0)", regulaPozDokSzczegTable); + regulaPozDokSzczegTable.Columns.Add("RegulaId", regulaIdColumn8); + var typColumn17 = new Column("Typ", "smallint", regulaPozDokSzczegTable); + regulaPozDokSzczegTable.Columns.Add("Typ", typColumn17); + var kolejnoscRegulaDokColumn = new Column("KolejnoscRegulaDok", "int", regulaPozDokSzczegTable); + regulaPozDokSzczegTable.Columns.Add("KolejnoscRegulaDok", kolejnoscRegulaDokColumn); + var opcja1Column0 = new Column("Opcja1", "smallint", regulaPozDokSzczegTable) + { + IsNullable = true + }; + regulaPozDokSzczegTable.Columns.Add("Opcja1", opcja1Column0); + var opcja2Column2 = new Column("Opcja2", "smallint", regulaPozDokSzczegTable) + { + IsNullable = true + }; + regulaPozDokSzczegTable.Columns.Add("Opcja2", opcja2Column2); + var tekstColumn9 = new Column("Tekst", "varchar(255)", regulaPozDokSzczegTable) + { + IsNullable = true + }; + regulaPozDokSzczegTable.Columns.Add("Tekst", tekstColumn9); + var wartosc1Column = new Column("Wartosc1", "decimal(15,4)", regulaPozDokSzczegTable) + { + IsNullable = true + }; + regulaPozDokSzczegTable.Columns.Add("Wartosc1", wartosc1Column); + var wartosc2Column1 = new Column("Wartosc2", "decimal(15,4)", regulaPozDokSzczegTable) + { + IsNullable = true + }; + regulaPozDokSzczegTable.Columns.Add("Wartosc2", wartosc2Column1); + var wartosc3Column1 = new Column("Wartosc3", "decimal(15,4)", regulaPozDokSzczegTable) + { + IsNullable = true + }; + regulaPozDokSzczegTable.Columns.Add("Wartosc3", wartosc3Column1); + var wartosc4Column = new Column("Wartosc4", "decimal(15,4)", regulaPozDokSzczegTable) + { + IsNullable = true + }; + regulaPozDokSzczegTable.Columns.Add("Wartosc4", wartosc4Column); + var pK_REGPOZDOKSZ = new UniqueConstraint("PK_REGPOZDOKSZ", regulaPozDokSzczegTable, new[] { dokIdColumn16, kolejnoscColumn23, regulaIdColumn8, typColumn17, kolejnoscRegulaDokColumn }); + regulaPozDokSzczegTable.PrimaryKey = pK_REGPOZDOKSZ; + var pK_REGPOZDOKSZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg", + new[] { "DokId", "Kolejnosc", "RegulaId", "Typ", "KolejnoscRegulaDok" }); + pK_REGPOZDOKSZ.MappedKeys.Add(pK_REGPOZDOKSZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGPOZDOKSZUc).Add(pK_REGPOZDOKSZ); + regulaPozDokSzczegTable.UniqueConstraints.Add("PK_REGPOZDOKSZ", pK_REGPOZDOKSZ); + var iX_RegulaPozDokSzczeg_RegulaId = new TableIndex( + "IX_RegulaPozDokSzczeg_RegulaId", regulaPozDokSzczegTable, new[] { regulaIdColumn8 }, false); + var iX_RegulaPozDokSzczeg_RegulaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg", + new[] { "RegulaId" }); + iX_RegulaPozDokSzczeg_RegulaId.MappedIndexes.Add(iX_RegulaPozDokSzczeg_RegulaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaPozDokSzczeg_RegulaIdIx).Add(iX_RegulaPozDokSzczeg_RegulaId); + regulaPozDokSzczegTable.Indexes.Add("IX_RegulaPozDokSzczeg_RegulaId", iX_RegulaPozDokSzczeg_RegulaId); + relationalModel.Tables.Add(("RegulaPozDokSzczeg", null), regulaPozDokSzczegTable); + var regulaPozDokSzczegTableMapping = new TableMapping(regulaPozDokSzczeg, regulaPozDokSzczegTable, true); + regulaPozDokSzczegTable.AddTypeMapping(regulaPozDokSzczegTableMapping, false); + tableMappings140.Add(regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn16, regulaPozDokSzczeg.FindProperty("DokId")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn23, regulaPozDokSzczeg.FindProperty("Kolejnosc")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscRegulaDokColumn, regulaPozDokSzczeg.FindProperty("KolejnoscRegulaDok")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn8, regulaPozDokSzczeg.FindProperty("RegulaId")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(typColumn17, regulaPozDokSzczeg.FindProperty("Typ")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja1Column0, regulaPozDokSzczeg.FindProperty("Opcja1")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column2, regulaPozDokSzczeg.FindProperty("Opcja2")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn9, regulaPozDokSzczeg.FindProperty("Tekst")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc1Column, regulaPozDokSzczeg.FindProperty("Wartosc1")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column1, regulaPozDokSzczeg.FindProperty("Wartosc2")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column1, regulaPozDokSzczeg.FindProperty("Wartosc3")!, regulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc4Column, regulaPozDokSzczeg.FindProperty("Wartosc4")!, regulaPozDokSzczegTableMapping); + + var regulaPozPar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar")!; + + var defaultTableMappings141 = new List>(); + regulaPozPar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings141); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar", null, relationalModel); + var kolejnoscColumnBase24 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase24); + var parIdColumnBase12 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase.Columns.Add("ParId", parIdColumnBase12); + var regulaIdColumnBase9 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase.Columns.Add("RegulaId", regulaIdColumnBase9); + var tekstColumnBase10 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase.Columns.Add("Tekst", tekstColumnBase10); + var typColumnBase18 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase.Columns.Add("Typ", typColumnBase18); + var wartoscColumnBase9 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase.Columns.Add("Wartosc", wartoscColumnBase9); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar", blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase = new TableMappingBase(regulaPozPar, blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase, false); + defaultTableMappings141.Add(blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase24, regulaPozPar.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase12, regulaPozPar.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase9, regulaPozPar.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase18, regulaPozPar.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase10, regulaPozPar.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase9, regulaPozPar.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParMappingBase); + + var tableMappings141 = new List(); + regulaPozPar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings141); + var regulaPozParTable = new Table("RegulaPozPar", null, relationalModel); + var parIdColumn12 = new Column("ParId", "numeric(9,0)", regulaPozParTable); + regulaPozParTable.Columns.Add("ParId", parIdColumn12); + var kolejnoscColumn24 = new Column("Kolejnosc", "int", regulaPozParTable); + regulaPozParTable.Columns.Add("Kolejnosc", kolejnoscColumn24); + var regulaIdColumn9 = new Column("RegulaId", "numeric(9,0)", regulaPozParTable); + regulaPozParTable.Columns.Add("RegulaId", regulaIdColumn9); + var typColumn18 = new Column("Typ", "smallint", regulaPozParTable); + regulaPozParTable.Columns.Add("Typ", typColumn18); + var tekstColumn10 = new Column("Tekst", "varchar(255)", regulaPozParTable) + { + IsNullable = true + }; + regulaPozParTable.Columns.Add("Tekst", tekstColumn10); + var wartoscColumn9 = new Column("Wartosc", "decimal(15,4)", regulaPozParTable) + { + IsNullable = true + }; + regulaPozParTable.Columns.Add("Wartosc", wartoscColumn9); + var pK_REGULAPOZPAR = new UniqueConstraint("PK_REGULAPOZPAR", regulaPozParTable, new[] { parIdColumn12, kolejnoscColumn24, regulaIdColumn9, typColumn18 }); + regulaPozParTable.PrimaryKey = pK_REGULAPOZPAR; + var pK_REGULAPOZPARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar", + new[] { "ParId", "Kolejnosc", "RegulaId", "Typ" }); + pK_REGULAPOZPAR.MappedKeys.Add(pK_REGULAPOZPARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAPOZPARUc).Add(pK_REGULAPOZPAR); + regulaPozParTable.UniqueConstraints.Add("PK_REGULAPOZPAR", pK_REGULAPOZPAR); + var iX_RegulaPozPar_RegulaId = new TableIndex( + "IX_RegulaPozPar_RegulaId", regulaPozParTable, new[] { regulaIdColumn9 }, false); + var iX_RegulaPozPar_RegulaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar", + new[] { "RegulaId" }); + iX_RegulaPozPar_RegulaId.MappedIndexes.Add(iX_RegulaPozPar_RegulaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaPozPar_RegulaIdIx).Add(iX_RegulaPozPar_RegulaId); + regulaPozParTable.Indexes.Add("IX_RegulaPozPar_RegulaId", iX_RegulaPozPar_RegulaId); + relationalModel.Tables.Add(("RegulaPozPar", null), regulaPozParTable); + var regulaPozParTableMapping = new TableMapping(regulaPozPar, regulaPozParTable, true); + regulaPozParTable.AddTypeMapping(regulaPozParTableMapping, false); + tableMappings141.Add(regulaPozParTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn24, regulaPozPar.FindProperty("Kolejnosc")!, regulaPozParTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn12, regulaPozPar.FindProperty("ParId")!, regulaPozParTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn9, regulaPozPar.FindProperty("RegulaId")!, regulaPozParTableMapping); + RelationalModel.CreateColumnMapping(typColumn18, regulaPozPar.FindProperty("Typ")!, regulaPozParTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn10, regulaPozPar.FindProperty("Tekst")!, regulaPozParTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn9, regulaPozPar.FindProperty("Wartosc")!, regulaPozParTableMapping); + + var regulaPozParSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg")!; + + var defaultTableMappings142 = new List>(); + regulaPozParSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings142); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg", null, relationalModel); + var kolejnoscColumnBase25 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase25); + var kolejnoscRegulaParColumnBase = new ColumnBase("KolejnoscRegulaPar", "int", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("KolejnoscRegulaPar", kolejnoscRegulaParColumnBase); + var opcja1ColumnBase1 = new ColumnBase("Opcja1", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Opcja1", opcja1ColumnBase1); + var opcja2ColumnBase3 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Opcja2", opcja2ColumnBase3); + var parIdColumnBase13 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("ParId", parIdColumnBase13); + var regulaIdColumnBase10 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("RegulaId", regulaIdColumnBase10); + var tekstColumnBase11 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Tekst", tekstColumnBase11); + var typColumnBase19 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Typ", typColumnBase19); + var wartosc1ColumnBase0 = new ColumnBase("Wartosc1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Wartosc1", wartosc1ColumnBase0); + var wartosc2ColumnBase2 = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase2); + var wartosc3ColumnBase2 = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase2); + var wartosc4ColumnBase0 = new ColumnBase("Wartosc4", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.Columns.Add("Wartosc4", wartosc4ColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg", blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase = new TableMappingBase(regulaPozParSzczeg, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase, false); + defaultTableMappings142.Add(blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase25, regulaPozParSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscRegulaParColumnBase, regulaPozParSzczeg.FindProperty("KolejnoscRegulaPar")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase13, regulaPozParSzczeg.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase10, regulaPozParSzczeg.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase19, regulaPozParSzczeg.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja1ColumnBase1, regulaPozParSzczeg.FindProperty("Opcja1")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase3, regulaPozParSzczeg.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase11, regulaPozParSzczeg.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc1ColumnBase0, regulaPozParSzczeg.FindProperty("Wartosc1")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase2, regulaPozParSzczeg.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase2, regulaPozParSzczeg.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc4ColumnBase0, regulaPozParSzczeg.FindProperty("Wartosc4")!, blinkBackofficeServicesPcmDbEntitiesRegulaPozParSzczegMappingBase); + + var tableMappings142 = new List(); + regulaPozParSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings142); + var regulaPozParSzczegTable = new Table("RegulaPozParSzczeg", null, relationalModel); + var parIdColumn13 = new Column("ParId", "numeric(9,0)", regulaPozParSzczegTable); + regulaPozParSzczegTable.Columns.Add("ParId", parIdColumn13); + var kolejnoscColumn25 = new Column("Kolejnosc", "int", regulaPozParSzczegTable); + regulaPozParSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn25); + var regulaIdColumn10 = new Column("RegulaId", "numeric(9,0)", regulaPozParSzczegTable); + regulaPozParSzczegTable.Columns.Add("RegulaId", regulaIdColumn10); + var typColumn19 = new Column("Typ", "smallint", regulaPozParSzczegTable); + regulaPozParSzczegTable.Columns.Add("Typ", typColumn19); + var kolejnoscRegulaParColumn = new Column("KolejnoscRegulaPar", "int", regulaPozParSzczegTable); + regulaPozParSzczegTable.Columns.Add("KolejnoscRegulaPar", kolejnoscRegulaParColumn); + var opcja1Column1 = new Column("Opcja1", "smallint", regulaPozParSzczegTable) + { + IsNullable = true + }; + regulaPozParSzczegTable.Columns.Add("Opcja1", opcja1Column1); + var opcja2Column3 = new Column("Opcja2", "smallint", regulaPozParSzczegTable) + { + IsNullable = true + }; + regulaPozParSzczegTable.Columns.Add("Opcja2", opcja2Column3); + var tekstColumn11 = new Column("Tekst", "varchar(255)", regulaPozParSzczegTable) + { + IsNullable = true + }; + regulaPozParSzczegTable.Columns.Add("Tekst", tekstColumn11); + var wartosc1Column0 = new Column("Wartosc1", "decimal(15,4)", regulaPozParSzczegTable) + { + IsNullable = true + }; + regulaPozParSzczegTable.Columns.Add("Wartosc1", wartosc1Column0); + var wartosc2Column2 = new Column("Wartosc2", "decimal(15,4)", regulaPozParSzczegTable) + { + IsNullable = true + }; + regulaPozParSzczegTable.Columns.Add("Wartosc2", wartosc2Column2); + var wartosc3Column2 = new Column("Wartosc3", "decimal(15,4)", regulaPozParSzczegTable) + { + IsNullable = true + }; + regulaPozParSzczegTable.Columns.Add("Wartosc3", wartosc3Column2); + var wartosc4Column0 = new Column("Wartosc4", "decimal(15,4)", regulaPozParSzczegTable) + { + IsNullable = true + }; + regulaPozParSzczegTable.Columns.Add("Wartosc4", wartosc4Column0); + var pK_REGPOZPARSZ = new UniqueConstraint("PK_REGPOZPARSZ", regulaPozParSzczegTable, new[] { parIdColumn13, kolejnoscColumn25, regulaIdColumn10, typColumn19, kolejnoscRegulaParColumn }); + regulaPozParSzczegTable.PrimaryKey = pK_REGPOZPARSZ; + var pK_REGPOZPARSZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg", + new[] { "ParId", "Kolejnosc", "RegulaId", "Typ", "KolejnoscRegulaPar" }); + pK_REGPOZPARSZ.MappedKeys.Add(pK_REGPOZPARSZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGPOZPARSZUc).Add(pK_REGPOZPARSZ); + regulaPozParSzczegTable.UniqueConstraints.Add("PK_REGPOZPARSZ", pK_REGPOZPARSZ); + var iX_RegulaPozParSzczeg_RegulaId = new TableIndex( + "IX_RegulaPozParSzczeg_RegulaId", regulaPozParSzczegTable, new[] { regulaIdColumn10 }, false); + var iX_RegulaPozParSzczeg_RegulaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg", + new[] { "RegulaId" }); + iX_RegulaPozParSzczeg_RegulaId.MappedIndexes.Add(iX_RegulaPozParSzczeg_RegulaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaPozParSzczeg_RegulaIdIx).Add(iX_RegulaPozParSzczeg_RegulaId); + regulaPozParSzczegTable.Indexes.Add("IX_RegulaPozParSzczeg_RegulaId", iX_RegulaPozParSzczeg_RegulaId); + relationalModel.Tables.Add(("RegulaPozParSzczeg", null), regulaPozParSzczegTable); + var regulaPozParSzczegTableMapping = new TableMapping(regulaPozParSzczeg, regulaPozParSzczegTable, true); + regulaPozParSzczegTable.AddTypeMapping(regulaPozParSzczegTableMapping, false); + tableMappings142.Add(regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn25, regulaPozParSzczeg.FindProperty("Kolejnosc")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscRegulaParColumn, regulaPozParSzczeg.FindProperty("KolejnoscRegulaPar")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn13, regulaPozParSzczeg.FindProperty("ParId")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn10, regulaPozParSzczeg.FindProperty("RegulaId")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(typColumn19, regulaPozParSzczeg.FindProperty("Typ")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja1Column1, regulaPozParSzczeg.FindProperty("Opcja1")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column3, regulaPozParSzczeg.FindProperty("Opcja2")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn11, regulaPozParSzczeg.FindProperty("Tekst")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc1Column0, regulaPozParSzczeg.FindProperty("Wartosc1")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column2, regulaPozParSzczeg.FindProperty("Wartosc2")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column2, regulaPozParSzczeg.FindProperty("Wartosc3")!, regulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc4Column0, regulaPozParSzczeg.FindProperty("Wartosc4")!, regulaPozParSzczegTableMapping); + + var regulaProg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaProg")!; + + var defaultTableMappings143 = new List>(); + regulaProg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings143); + var blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaProg", null, relationalModel); + var kolejnoscColumnBase26 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase26); + var progDoColumnBase = new ColumnBase("ProgDo", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase.Columns.Add("ProgDo", progDoColumnBase); + var progOdColumnBase = new ColumnBase("ProgOd", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase.Columns.Add("ProgOd", progOdColumnBase); + var regulaIdColumnBase11 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase.Columns.Add("RegulaId", regulaIdColumnBase11); + var wartosc1ColumnBase1 = new ColumnBase("Wartosc1", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase.Columns.Add("Wartosc1", wartosc1ColumnBase1); + var wartosc2ColumnBase3 = new ColumnBase("Wartosc2", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaProg", blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase = new TableMappingBase(regulaProg, blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaProgTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase, false); + defaultTableMappings143.Add(blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase26, regulaProg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase11, regulaProg.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)progDoColumnBase, regulaProg.FindProperty("ProgDo")!, blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)progOdColumnBase, regulaProg.FindProperty("ProgOd")!, blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc1ColumnBase1, regulaProg.FindProperty("Wartosc1")!, blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase3, regulaProg.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesRegulaProgMappingBase); + + var tableMappings143 = new List(); + regulaProg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings143); + var regulaProgTable = new Table("RegulaProg", null, relationalModel); + var regulaIdColumn11 = new Column("RegulaId", "numeric(9,0)", regulaProgTable); + regulaProgTable.Columns.Add("RegulaId", regulaIdColumn11); + var kolejnoscColumn26 = new Column("Kolejnosc", "smallint", regulaProgTable); + regulaProgTable.Columns.Add("Kolejnosc", kolejnoscColumn26); + var progDoColumn = new Column("ProgDo", "numeric(16,4)", regulaProgTable) + { + IsNullable = true + }; + regulaProgTable.Columns.Add("ProgDo", progDoColumn); + var progOdColumn = new Column("ProgOd", "numeric(16,4)", regulaProgTable) + { + IsNullable = true + }; + regulaProgTable.Columns.Add("ProgOd", progOdColumn); + var wartosc1Column1 = new Column("Wartosc1", "numeric(16,4)", regulaProgTable) + { + IsNullable = true + }; + regulaProgTable.Columns.Add("Wartosc1", wartosc1Column1); + var wartosc2Column3 = new Column("Wartosc2", "numeric(16,4)", regulaProgTable) + { + IsNullable = true + }; + regulaProgTable.Columns.Add("Wartosc2", wartosc2Column3); + var pK_REGULAPROG = new UniqueConstraint("PK_REGULAPROG", regulaProgTable, new[] { regulaIdColumn11, kolejnoscColumn26 }); + regulaProgTable.PrimaryKey = pK_REGULAPROG; + var pK_REGULAPROGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaProg", + new[] { "RegulaId", "Kolejnosc" }); + pK_REGULAPROG.MappedKeys.Add(pK_REGULAPROGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULAPROGUc).Add(pK_REGULAPROG); + regulaProgTable.UniqueConstraints.Add("PK_REGULAPROG", pK_REGULAPROG); + relationalModel.Tables.Add(("RegulaProg", null), regulaProgTable); + var regulaProgTableMapping = new TableMapping(regulaProg, regulaProgTable, true); + regulaProgTable.AddTypeMapping(regulaProgTableMapping, false); + tableMappings143.Add(regulaProgTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn26, regulaProg.FindProperty("Kolejnosc")!, regulaProgTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn11, regulaProg.FindProperty("RegulaId")!, regulaProgTableMapping); + RelationalModel.CreateColumnMapping(progDoColumn, regulaProg.FindProperty("ProgDo")!, regulaProgTableMapping); + RelationalModel.CreateColumnMapping(progOdColumn, regulaProg.FindProperty("ProgOd")!, regulaProgTableMapping); + RelationalModel.CreateColumnMapping(wartosc1Column1, regulaProg.FindProperty("Wartosc1")!, regulaProgTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column3, regulaProg.FindProperty("Wartosc2")!, regulaProgTableMapping); + + var regulaSklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep")!; + + var defaultTableMappings144 = new List>(); + regulaSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings144); + var blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep", null, relationalModel); + var aktywnyColumnBase24 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase.Columns.Add("Aktywny", aktywnyColumnBase24); + var regulaIdColumnBase12 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase.Columns.Add("RegulaId", regulaIdColumnBase12); + var sklepIdColumnBase2 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase.Columns.Add("SklepId", sklepIdColumnBase2); + var zmianaColumnBase28 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase.Columns.Add("Zmiana", zmianaColumnBase28); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep", blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaSklepMappingBase = new TableMappingBase(regulaSklep, blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaSklepMappingBase, false); + defaultTableMappings144.Add(blinkBackofficeServicesPcmDbEntitiesRegulaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase12, regulaSklep.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase2, regulaSklep.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase24, regulaSklep.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase28, regulaSklep.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepMappingBase); + + var tableMappings144 = new List(); + regulaSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings144); + var regulaSklepTable = new Table("RegulaSklep", null, relationalModel); + var regulaIdColumn12 = new Column("RegulaId", "numeric(9,0)", regulaSklepTable); + regulaSklepTable.Columns.Add("RegulaId", regulaIdColumn12); + var sklepIdColumn2 = new Column("SklepId", "numeric(9,0)", regulaSklepTable); + regulaSklepTable.Columns.Add("SklepId", sklepIdColumn2); + var aktywnyColumn24 = new Column("Aktywny", "smallint", regulaSklepTable); + regulaSklepTable.Columns.Add("Aktywny", aktywnyColumn24); + var zmianaColumn28 = new Column("Zmiana", "datetime", regulaSklepTable); + regulaSklepTable.Columns.Add("Zmiana", zmianaColumn28); + var pK_REGULASKLEP = new UniqueConstraint("PK_REGULASKLEP", regulaSklepTable, new[] { regulaIdColumn12, sklepIdColumn2 }); + regulaSklepTable.PrimaryKey = pK_REGULASKLEP; + var pK_REGULASKLEPUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep", + new[] { "RegulaId", "SklepId" }); + pK_REGULASKLEP.MappedKeys.Add(pK_REGULASKLEPUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULASKLEPUc).Add(pK_REGULASKLEP); + regulaSklepTable.UniqueConstraints.Add("PK_REGULASKLEP", pK_REGULASKLEP); + var iX_RegulaSklep_SklepId = new TableIndex( + "IX_RegulaSklep_SklepId", regulaSklepTable, new[] { sklepIdColumn2 }, false); + var iX_RegulaSklep_SklepIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep", + new[] { "SklepId" }); + iX_RegulaSklep_SklepId.MappedIndexes.Add(iX_RegulaSklep_SklepIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaSklep_SklepIdIx).Add(iX_RegulaSklep_SklepId); + regulaSklepTable.Indexes.Add("IX_RegulaSklep_SklepId", iX_RegulaSklep_SklepId); + relationalModel.Tables.Add(("RegulaSklep", null), regulaSklepTable); + var regulaSklepTableMapping = new TableMapping(regulaSklep, regulaSklepTable, true); + regulaSklepTable.AddTypeMapping(regulaSklepTableMapping, false); + tableMappings144.Add(regulaSklepTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn12, regulaSklep.FindProperty("RegulaId")!, regulaSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn2, regulaSklep.FindProperty("SklepId")!, regulaSklepTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn24, regulaSklep.FindProperty("Aktywny")!, regulaSklepTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn28, regulaSklep.FindProperty("Zmiana")!, regulaSklepTableMapping); + + var regulaSklepAuth = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth")!; + + var defaultTableMappings145 = new List>(); + regulaSklepAuth.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings145); + var blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", null, relationalModel); + var aktywnyColumnBase25 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase.Columns.Add("Aktywny", aktywnyColumnBase25); + var dataCzasAutoryzacjiColumnBase = new ColumnBase("DataCzasAutoryzacji", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase.Columns.Add("DataCzasAutoryzacji", dataCzasAutoryzacjiColumnBase); + var pcfUserIdColumnBase1 = new ColumnBase("PcfUserId", "int", blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase.Columns.Add("PcfUserId", pcfUserIdColumnBase1); + var regulaIdColumnBase13 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase.Columns.Add("RegulaId", regulaIdColumnBase13); + var sklepIdColumnBase3 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase.Columns.Add("SklepId", sklepIdColumnBase3); + var zmianaColumnBase29 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase.Columns.Add("Zmiana", zmianaColumnBase29); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase = new TableMappingBase(regulaSklepAuth, blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase, false); + defaultTableMappings145.Add(blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase13, regulaSklepAuth.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase3, regulaSklepAuth.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase25, regulaSklepAuth.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasAutoryzacjiColumnBase, regulaSklepAuth.FindProperty("DataCzasAutoryzacji")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pcfUserIdColumnBase1, regulaSklepAuth.FindProperty("PcfUserId")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase29, regulaSklepAuth.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesRegulaSklepAuthMappingBase); + + var tableMappings145 = new List(); + regulaSklepAuth.SetRuntimeAnnotation("Relational:TableMappings", tableMappings145); + var regulaSklepAuthTable = new Table("RegulaSklepAuth", null, relationalModel); + var regulaIdColumn13 = new Column("RegulaId", "numeric(9,0)", regulaSklepAuthTable); + regulaSklepAuthTable.Columns.Add("RegulaId", regulaIdColumn13); + var sklepIdColumn3 = new Column("SklepId", "numeric(9,0)", regulaSklepAuthTable); + regulaSklepAuthTable.Columns.Add("SklepId", sklepIdColumn3); + var aktywnyColumn25 = new Column("Aktywny", "smallint", regulaSklepAuthTable); + regulaSklepAuthTable.Columns.Add("Aktywny", aktywnyColumn25); + var dataCzasAutoryzacjiColumn = new Column("DataCzasAutoryzacji", "datetime", regulaSklepAuthTable); + regulaSklepAuthTable.Columns.Add("DataCzasAutoryzacji", dataCzasAutoryzacjiColumn); + var pcfUserIdColumn1 = new Column("PcfUserId", "int", regulaSklepAuthTable); + regulaSklepAuthTable.Columns.Add("PcfUserId", pcfUserIdColumn1); + var zmianaColumn29 = new Column("Zmiana", "datetime", regulaSklepAuthTable); + regulaSklepAuthTable.Columns.Add("Zmiana", zmianaColumn29); + var pK_RegulaSklepAuth = new UniqueConstraint("PK_RegulaSklepAuth", regulaSklepAuthTable, new[] { regulaIdColumn13, sklepIdColumn3 }); + regulaSklepAuthTable.PrimaryKey = pK_RegulaSklepAuth; + var pK_RegulaSklepAuthUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", + new[] { "RegulaId", "SklepId" }); + pK_RegulaSklepAuth.MappedKeys.Add(pK_RegulaSklepAuthUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_RegulaSklepAuthUc).Add(pK_RegulaSklepAuth); + regulaSklepAuthTable.UniqueConstraints.Add("PK_RegulaSklepAuth", pK_RegulaSklepAuth); + var iX_RegulaSklepAuth_PcfUserId = new TableIndex( + "IX_RegulaSklepAuth_PcfUserId", regulaSklepAuthTable, new[] { pcfUserIdColumn1 }, false); + var iX_RegulaSklepAuth_PcfUserIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", + new[] { "PcfUserId" }); + iX_RegulaSklepAuth_PcfUserId.MappedIndexes.Add(iX_RegulaSklepAuth_PcfUserIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaSklepAuth_PcfUserIdIx).Add(iX_RegulaSklepAuth_PcfUserId); + regulaSklepAuthTable.Indexes.Add("IX_RegulaSklepAuth_PcfUserId", iX_RegulaSklepAuth_PcfUserId); + var iX_RegulaSklepAuth_SklepId = new TableIndex( + "IX_RegulaSklepAuth_SklepId", regulaSklepAuthTable, new[] { sklepIdColumn3 }, false); + var iX_RegulaSklepAuth_SklepIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", + new[] { "SklepId" }); + iX_RegulaSklepAuth_SklepId.MappedIndexes.Add(iX_RegulaSklepAuth_SklepIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaSklepAuth_SklepIdIx).Add(iX_RegulaSklepAuth_SklepId); + regulaSklepAuthTable.Indexes.Add("IX_RegulaSklepAuth_SklepId", iX_RegulaSklepAuth_SklepId); + relationalModel.Tables.Add(("RegulaSklepAuth", null), regulaSklepAuthTable); + var regulaSklepAuthTableMapping = new TableMapping(regulaSklepAuth, regulaSklepAuthTable, true); + regulaSklepAuthTable.AddTypeMapping(regulaSklepAuthTableMapping, false); + tableMappings145.Add(regulaSklepAuthTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn13, regulaSklepAuth.FindProperty("RegulaId")!, regulaSklepAuthTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn3, regulaSklepAuth.FindProperty("SklepId")!, regulaSklepAuthTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn25, regulaSklepAuth.FindProperty("Aktywny")!, regulaSklepAuthTableMapping); + RelationalModel.CreateColumnMapping(dataCzasAutoryzacjiColumn, regulaSklepAuth.FindProperty("DataCzasAutoryzacji")!, regulaSklepAuthTableMapping); + RelationalModel.CreateColumnMapping(pcfUserIdColumn1, regulaSklepAuth.FindProperty("PcfUserId")!, regulaSklepAuthTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn29, regulaSklepAuth.FindProperty("Zmiana")!, regulaSklepAuthTableMapping); + + var regulaTekst = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaTekst")!; + + var defaultTableMappings146 = new List>(); + regulaTekst.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings146); + var blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaTekst", null, relationalModel); + var regulaIdColumnBase14 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase.Columns.Add("RegulaId", regulaIdColumnBase14); + var tekstColumnBase12 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase.Columns.Add("Tekst", tekstColumnBase12); + var znaczenieColumnBase14 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase.Columns.Add("Znaczenie", znaczenieColumnBase14); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaTekst", blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaTekstMappingBase = new TableMappingBase(regulaTekst, blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaTekstTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaTekstMappingBase, false); + defaultTableMappings146.Add(blinkBackofficeServicesPcmDbEntitiesRegulaTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase14, regulaTekst.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase14, regulaTekst.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRegulaTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase12, regulaTekst.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesRegulaTekstMappingBase); + + var tableMappings146 = new List(); + regulaTekst.SetRuntimeAnnotation("Relational:TableMappings", tableMappings146); + var regulaTekstTable = new Table("RegulaTekst", null, relationalModel); + var regulaIdColumn14 = new Column("RegulaId", "numeric(9,0)", regulaTekstTable); + regulaTekstTable.Columns.Add("RegulaId", regulaIdColumn14); + var znaczenieColumn14 = new Column("Znaczenie", "smallint", regulaTekstTable); + regulaTekstTable.Columns.Add("Znaczenie", znaczenieColumn14); + var tekstColumn12 = new Column("Tekst", "varchar(255)", regulaTekstTable); + regulaTekstTable.Columns.Add("Tekst", tekstColumn12); + var pK_RegulaTekst = new UniqueConstraint("PK_RegulaTekst", regulaTekstTable, new[] { regulaIdColumn14, znaczenieColumn14 }); + regulaTekstTable.PrimaryKey = pK_RegulaTekst; + var pK_RegulaTekstUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTekst", + new[] { "RegulaId", "Znaczenie" }); + pK_RegulaTekst.MappedKeys.Add(pK_RegulaTekstUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_RegulaTekstUc).Add(pK_RegulaTekst); + regulaTekstTable.UniqueConstraints.Add("PK_RegulaTekst", pK_RegulaTekst); + relationalModel.Tables.Add(("RegulaTekst", null), regulaTekstTable); + var regulaTekstTableMapping = new TableMapping(regulaTekst, regulaTekstTable, true); + regulaTekstTable.AddTypeMapping(regulaTekstTableMapping, false); + tableMappings146.Add(regulaTekstTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn14, regulaTekst.FindProperty("RegulaId")!, regulaTekstTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn14, regulaTekst.FindProperty("Znaczenie")!, regulaTekstTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn12, regulaTekst.FindProperty("Tekst")!, regulaTekstTableMapping); + + var regulaTowar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar")!; + + var defaultTableMappings147 = new List>(); + regulaTowar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings147); + var blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar", null, relationalModel); + var cenaColumnBase1 = new ColumnBase("Cena", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase.Columns.Add("Cena", cenaColumnBase1); + var iloscColumnBase2 = new ColumnBase("Ilosc", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase.Columns.Add("Ilosc", iloscColumnBase2); + var parametrColumnBase1 = new ColumnBase("Parametr", "int", blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase.Columns.Add("Parametr", parametrColumnBase1); + var regulaIdColumnBase15 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase.Columns.Add("RegulaId", regulaIdColumnBase15); + var towIdColumnBase17 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase.Columns.Add("TowId", towIdColumnBase17); + var znaczenieColumnBase15 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase.Columns.Add("Znaczenie", znaczenieColumnBase15); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar", blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase); + var blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase = new TableMappingBase(regulaTowar, blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRegulaTowarTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase, false); + defaultTableMappings147.Add(blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase15, regulaTowar.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase17, regulaTowar.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase15, regulaTowar.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase1, regulaTowar.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase2, regulaTowar.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parametrColumnBase1, regulaTowar.FindProperty("Parametr")!, blinkBackofficeServicesPcmDbEntitiesRegulaTowarMappingBase); + + var tableMappings147 = new List(); + regulaTowar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings147); + var regulaTowarTable = new Table("RegulaTowar", null, relationalModel); + var regulaIdColumn15 = new Column("RegulaId", "numeric(9,0)", regulaTowarTable); + regulaTowarTable.Columns.Add("RegulaId", regulaIdColumn15); + var towIdColumn17 = new Column("TowId", "numeric(9,0)", regulaTowarTable); + regulaTowarTable.Columns.Add("TowId", towIdColumn17); + var znaczenieColumn15 = new Column("Znaczenie", "smallint", regulaTowarTable); + regulaTowarTable.Columns.Add("Znaczenie", znaczenieColumn15); + var cenaColumn1 = new Column("Cena", "numeric(16,4)", regulaTowarTable) + { + IsNullable = true + }; + regulaTowarTable.Columns.Add("Cena", cenaColumn1); + var iloscColumn2 = new Column("Ilosc", "numeric(16,4)", regulaTowarTable) + { + IsNullable = true + }; + regulaTowarTable.Columns.Add("Ilosc", iloscColumn2); + var parametrColumn1 = new Column("Parametr", "int", regulaTowarTable) + { + IsNullable = true + }; + regulaTowarTable.Columns.Add("Parametr", parametrColumn1); + var pK_REGULATOWAR = new UniqueConstraint("PK_REGULATOWAR", regulaTowarTable, new[] { regulaIdColumn15, towIdColumn17, znaczenieColumn15 }); + regulaTowarTable.PrimaryKey = pK_REGULATOWAR; + var pK_REGULATOWARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar", + new[] { "RegulaId", "TowId", "Znaczenie" }); + pK_REGULATOWAR.MappedKeys.Add(pK_REGULATOWARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_REGULATOWARUc).Add(pK_REGULATOWAR); + regulaTowarTable.UniqueConstraints.Add("PK_REGULATOWAR", pK_REGULATOWAR); + var iX_RegulaTowar_TowId = new TableIndex( + "IX_RegulaTowar_TowId", regulaTowarTable, new[] { towIdColumn17 }, false); + var iX_RegulaTowar_TowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar", + new[] { "TowId" }); + iX_RegulaTowar_TowId.MappedIndexes.Add(iX_RegulaTowar_TowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_RegulaTowar_TowIdIx).Add(iX_RegulaTowar_TowId); + regulaTowarTable.Indexes.Add("IX_RegulaTowar_TowId", iX_RegulaTowar_TowId); + relationalModel.Tables.Add(("RegulaTowar", null), regulaTowarTable); + var regulaTowarTableMapping = new TableMapping(regulaTowar, regulaTowarTable, true); + regulaTowarTable.AddTypeMapping(regulaTowarTableMapping, false); + tableMappings147.Add(regulaTowarTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn15, regulaTowar.FindProperty("RegulaId")!, regulaTowarTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn17, regulaTowar.FindProperty("TowId")!, regulaTowarTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn15, regulaTowar.FindProperty("Znaczenie")!, regulaTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn1, regulaTowar.FindProperty("Cena")!, regulaTowarTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn2, regulaTowar.FindProperty("Ilosc")!, regulaTowarTableMapping); + RelationalModel.CreateColumnMapping(parametrColumn1, regulaTowar.FindProperty("Parametr")!, regulaTowarTableMapping); + + var rola = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Rola")!; + + var defaultTableMappings148 = new List>(); + rola.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings148); + var blinkBackofficeServicesPcmDbEntitiesRolaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Rola", null, relationalModel); + var aktywnaColumnBase0 = new ColumnBase("Aktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("Aktywna", aktywnaColumnBase0); + var centrRolaIdColumnBase = new ColumnBase("CentrRolaId", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("CentrRolaId", centrRolaIdColumnBase); + var domyslnaColumnBase = new ColumnBase("Domyslna", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("Domyslna", domyslnaColumnBase); + var nazwaColumnBase34 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("Nazwa", nazwaColumnBase34); + var priorytetColumnBase0 = new ColumnBase("Priorytet", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("Priorytet", priorytetColumnBase0); + var rolaIdColumnBase0 = new ColumnBase("RolaId", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("RolaId", rolaIdColumnBase0); + var typColumnBase20 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("Typ", typColumnBase20); + var uprawnieniaZRoliColumnBase = new ColumnBase("UprawnieniaZRoli", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("UprawnieniaZRoli", uprawnieniaZRoliColumnBase); + var zmianaColumnBase30 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.Columns.Add("Zmiana", zmianaColumnBase30); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Rola", blinkBackofficeServicesPcmDbEntitiesRolaTableBase); + var blinkBackofficeServicesPcmDbEntitiesRolaMappingBase = new TableMappingBase(rola, blinkBackofficeServicesPcmDbEntitiesRolaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRolaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRolaMappingBase, false); + defaultTableMappings148.Add(blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaIdColumnBase0, rola.FindProperty("RolaId")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnaColumnBase0, rola.FindProperty("Aktywna")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRolaIdColumnBase, rola.FindProperty("CentrRolaId")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslnaColumnBase, rola.FindProperty("Domyslna")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase34, rola.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)priorytetColumnBase0, rola.FindProperty("Priorytet")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase20, rola.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uprawnieniaZRoliColumnBase, rola.FindProperty("UprawnieniaZRoli")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase30, rola.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesRolaMappingBase); + + var tableMappings148 = new List(); + rola.SetRuntimeAnnotation("Relational:TableMappings", tableMappings148); + var rolaTable = new Table("Rola", null, relationalModel); + var rolaIdColumn0 = new Column("RolaId", "smallint", rolaTable); + rolaTable.Columns.Add("RolaId", rolaIdColumn0); + var aktywnaColumn0 = new Column("Aktywna", "smallint", rolaTable); + rolaTable.Columns.Add("Aktywna", aktywnaColumn0); + var centrRolaIdColumn = new Column("CentrRolaId", "smallint", rolaTable) + { + IsNullable = true + }; + rolaTable.Columns.Add("CentrRolaId", centrRolaIdColumn); + var domyslnaColumn = new Column("Domyslna", "smallint", rolaTable) + { + IsNullable = true + }; + rolaTable.Columns.Add("Domyslna", domyslnaColumn); + var nazwaColumn34 = new Column("Nazwa", "varchar(255)", rolaTable); + rolaTable.Columns.Add("Nazwa", nazwaColumn34); + var priorytetColumn0 = new Column("Priorytet", "smallint", rolaTable) + { + IsNullable = true + }; + rolaTable.Columns.Add("Priorytet", priorytetColumn0); + var typColumn20 = new Column("Typ", "smallint", rolaTable); + rolaTable.Columns.Add("Typ", typColumn20); + var uprawnieniaZRoliColumn = new Column("UprawnieniaZRoli", "smallint", rolaTable) + { + IsNullable = true + }; + rolaTable.Columns.Add("UprawnieniaZRoli", uprawnieniaZRoliColumn); + var zmianaColumn30 = new Column("Zmiana", "datetime", rolaTable); + rolaTable.Columns.Add("Zmiana", zmianaColumn30); + var pK_ROLA = new UniqueConstraint("PK_ROLA", rolaTable, new[] { rolaIdColumn0 }); + rolaTable.PrimaryKey = pK_ROLA; + var pK_ROLAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Rola", + new[] { "RolaId" }); + pK_ROLA.MappedKeys.Add(pK_ROLAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ROLAUc).Add(pK_ROLA); + rolaTable.UniqueConstraints.Add("PK_ROLA", pK_ROLA); + relationalModel.Tables.Add(("Rola", null), rolaTable); + var rolaTableMapping = new TableMapping(rola, rolaTable, true); + rolaTable.AddTypeMapping(rolaTableMapping, false); + tableMappings148.Add(rolaTableMapping); + RelationalModel.CreateColumnMapping(rolaIdColumn0, rola.FindProperty("RolaId")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(aktywnaColumn0, rola.FindProperty("Aktywna")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(centrRolaIdColumn, rola.FindProperty("CentrRolaId")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(domyslnaColumn, rola.FindProperty("Domyslna")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn34, rola.FindProperty("Nazwa")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(priorytetColumn0, rola.FindProperty("Priorytet")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(typColumn20, rola.FindProperty("Typ")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(uprawnieniaZRoliColumn, rola.FindProperty("UprawnieniaZRoli")!, rolaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn30, rola.FindProperty("Zmiana")!, rolaTableMapping); + + var rolaUprawnienie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RolaUprawnienie")!; + + var defaultTableMappings149 = new List>(); + rolaUprawnienie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings149); + var blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RolaUprawnienie", null, relationalModel); + var jestColumnBase = new ColumnBase("Jest", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase.Columns.Add("Jest", jestColumnBase); + var rodzajColumnBase4 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase.Columns.Add("Rodzaj", rodzajColumnBase4); + var rolaIdColumnBase1 = new ColumnBase("RolaId", "smallint", blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase.Columns.Add("RolaId", rolaIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RolaUprawnienie", blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase); + var blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieMappingBase = new TableMappingBase(rolaUprawnienie, blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieMappingBase, false); + defaultTableMappings149.Add(blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase4, rolaUprawnienie.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaIdColumnBase1, rolaUprawnienie.FindProperty("RolaId")!, blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jestColumnBase, rolaUprawnienie.FindProperty("Jest")!, blinkBackofficeServicesPcmDbEntitiesRolaUprawnienieMappingBase); + + var tableMappings149 = new List(); + rolaUprawnienie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings149); + var rolaUprawnienieTable = new Table("RolaUprawnienie", null, relationalModel); + var rolaIdColumn1 = new Column("RolaId", "smallint", rolaUprawnienieTable); + rolaUprawnienieTable.Columns.Add("RolaId", rolaIdColumn1); + var rodzajColumn4 = new Column("Rodzaj", "smallint", rolaUprawnienieTable); + rolaUprawnienieTable.Columns.Add("Rodzaj", rodzajColumn4); + var jestColumn = new Column("Jest", "smallint", rolaUprawnienieTable) + { + IsNullable = true + }; + rolaUprawnienieTable.Columns.Add("Jest", jestColumn); + var pK_ROLAUPR = new UniqueConstraint("PK_ROLAUPR", rolaUprawnienieTable, new[] { rolaIdColumn1, rodzajColumn4 }); + rolaUprawnienieTable.PrimaryKey = pK_ROLAUPR; + var pK_ROLAUPRUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RolaUprawnienie", + new[] { "RolaId", "Rodzaj" }); + pK_ROLAUPR.MappedKeys.Add(pK_ROLAUPRUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ROLAUPRUc).Add(pK_ROLAUPR); + rolaUprawnienieTable.UniqueConstraints.Add("PK_ROLAUPR", pK_ROLAUPR); + relationalModel.Tables.Add(("RolaUprawnienie", null), rolaUprawnienieTable); + var rolaUprawnienieTableMapping = new TableMapping(rolaUprawnienie, rolaUprawnienieTable, true); + rolaUprawnienieTable.AddTypeMapping(rolaUprawnienieTableMapping, false); + tableMappings149.Add(rolaUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn4, rolaUprawnienie.FindProperty("Rodzaj")!, rolaUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(rolaIdColumn1, rolaUprawnienie.FindProperty("RolaId")!, rolaUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(jestColumn, rolaUprawnienie.FindProperty("Jest")!, rolaUprawnienieTableMapping); + + var rozPrtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag")!; + + var defaultTableMappings150 = new List>(); + rozPrtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings150); + var blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", null, relationalModel); + var dokIdColumnBase17 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("DokId", dokIdColumnBase17); + var dzienColumnBase3 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("Dzien", dzienColumnBase3); + var iloscPrtColumnBase = new ColumnBase("IloscPrt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("IloscPrt", iloscPrtColumnBase); + var kolejnoscColumnBase27 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase27); + var pMIdColumnBase0 = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase0); + var towIdColumnBase18 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("TowId", towIdColumnBase18); + var zmianaColumnBase31 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("Zmiana", zmianaColumnBase31); + var znaczenieColumnBase16 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.Columns.Add("Znaczenie", znaczenieColumnBase16); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase = new TableMappingBase(rozPrtMag, blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRozPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase, false); + defaultTableMappings150.Add(blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase17, rozPrtMag.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase27, rozPrtMag.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase0, rozPrtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase18, rozPrtMag.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase16, rozPrtMag.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase3, rozPrtMag.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscPrtColumnBase, rozPrtMag.FindProperty("IloscPrt")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase31, rozPrtMag.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesRozPrtMagMappingBase); + + var tableMappings150 = new List(); + rozPrtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings150); + var rozPrtMagTable = new Table("RozPrtMag", null, relationalModel); + var towIdColumn18 = new Column("TowId", "numeric(9,0)", rozPrtMagTable); + rozPrtMagTable.Columns.Add("TowId", towIdColumn18); + var pMIdColumn0 = new Column("PMId", "numeric(9,0)", rozPrtMagTable); + rozPrtMagTable.Columns.Add("PMId", pMIdColumn0); + var znaczenieColumn16 = new Column("Znaczenie", "smallint", rozPrtMagTable); + rozPrtMagTable.Columns.Add("Znaczenie", znaczenieColumn16); + var dokIdColumn17 = new Column("DokId", "numeric(9,0)", rozPrtMagTable); + rozPrtMagTable.Columns.Add("DokId", dokIdColumn17); + var kolejnoscColumn27 = new Column("Kolejnosc", "int", rozPrtMagTable); + rozPrtMagTable.Columns.Add("Kolejnosc", kolejnoscColumn27); + var dzienColumn3 = new Column("Dzien", "datetime", rozPrtMagTable) + { + IsNullable = true + }; + rozPrtMagTable.Columns.Add("Dzien", dzienColumn3); + var iloscPrtColumn = new Column("IloscPrt", "decimal(15,4)", rozPrtMagTable) + { + IsNullable = true + }; + rozPrtMagTable.Columns.Add("IloscPrt", iloscPrtColumn); + var zmianaColumn31 = new Column("Zmiana", "datetime", rozPrtMagTable) + { + IsNullable = true + }; + rozPrtMagTable.Columns.Add("Zmiana", zmianaColumn31); + var pK_ROZPRTMAG = new UniqueConstraint("PK_ROZPRTMAG", rozPrtMagTable, new[] { towIdColumn18, pMIdColumn0, znaczenieColumn16, dokIdColumn17, kolejnoscColumn27 }); + rozPrtMagTable.PrimaryKey = pK_ROZPRTMAG; + var pK_ROZPRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", + new[] { "TowId", "PMId", "Znaczenie", "DokId", "Kolejnosc" }); + pK_ROZPRTMAG.MappedKeys.Add(pK_ROZPRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ROZPRTMAGUc).Add(pK_ROZPRTMAG); + rozPrtMagTable.UniqueConstraints.Add("PK_ROZPRTMAG", pK_ROZPRTMAG); + var idx_RozPrtMagDzien = new TableIndex( + "idx_RozPrtMagDzien", rozPrtMagTable, new[] { dzienColumn3 }, false); + var idx_RozPrtMagDzienIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", + "idx_RozPrtMagDzien"); + idx_RozPrtMagDzien.MappedIndexes.Add(idx_RozPrtMagDzienIx); + RelationalModel.GetOrCreateTableIndexes(idx_RozPrtMagDzienIx).Add(idx_RozPrtMagDzien); + rozPrtMagTable.Indexes.Add("idx_RozPrtMagDzien", idx_RozPrtMagDzien); + var idx_RozPrtMagPoz = new TableIndex( + "idx_RozPrtMagPoz", rozPrtMagTable, new[] { dokIdColumn17, kolejnoscColumn27, znaczenieColumn16, pMIdColumn0 }, false); + var idx_RozPrtMagPozIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", + "idx_RozPrtMagPoz"); + idx_RozPrtMagPoz.MappedIndexes.Add(idx_RozPrtMagPozIx); + RelationalModel.GetOrCreateTableIndexes(idx_RozPrtMagPozIx).Add(idx_RozPrtMagPoz); + rozPrtMagTable.Indexes.Add("idx_RozPrtMagPoz", idx_RozPrtMagPoz); + relationalModel.Tables.Add(("RozPrtMag", null), rozPrtMagTable); + var rozPrtMagTableMapping = new TableMapping(rozPrtMag, rozPrtMagTable, true); + rozPrtMagTable.AddTypeMapping(rozPrtMagTableMapping, false); + tableMappings150.Add(rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn17, rozPrtMag.FindProperty("DokId")!, rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn27, rozPrtMag.FindProperty("Kolejnosc")!, rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn0, rozPrtMag.FindProperty("PMId")!, rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn18, rozPrtMag.FindProperty("TowId")!, rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn16, rozPrtMag.FindProperty("Znaczenie")!, rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn3, rozPrtMag.FindProperty("Dzien")!, rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(iloscPrtColumn, rozPrtMag.FindProperty("IloscPrt")!, rozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn31, rozPrtMag.FindProperty("Zmiana")!, rozPrtMagTableMapping); + + var rozbicieDodDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RozbicieDodDok")!; + + var defaultTableMappings151 = new List>(); + rozbicieDodDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings151); + var blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RozbicieDodDok", null, relationalModel); + var dokIdColumnBase18 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("DokId", dokIdColumnBase18); + var nettoColumnBase1 = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("Netto", nettoColumnBase1); + var nettoDetColumnBase0 = new ColumnBase("NettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("NettoDet", nettoDetColumnBase0); + var nettoMagColumnBase0 = new ColumnBase("NettoMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("NettoMag", nettoMagColumnBase0); + var podatekColumnBase1 = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("Podatek", podatekColumnBase1); + var podatekDetColumnBase0 = new ColumnBase("PodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("PodatekDet", podatekDetColumnBase0); + var podatekMagColumnBase0 = new ColumnBase("PodatekMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("PodatekMag", podatekMagColumnBase0); + var stawkaColumnBase6 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("Stawka", stawkaColumnBase6); + var znaczenieColumnBase17 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.Columns.Add("Znaczenie", znaczenieColumnBase17); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RozbicieDodDok", blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase = new TableMappingBase(rozbicieDodDok, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase, false); + defaultTableMappings151.Add(blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase18, rozbicieDodDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase6, rozbicieDodDok.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase17, rozbicieDodDok.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase1, rozbicieDodDok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetColumnBase0, rozbicieDodDok.FindProperty("NettoDet")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagColumnBase0, rozbicieDodDok.FindProperty("NettoMag")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase1, rozbicieDodDok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetColumnBase0, rozbicieDodDok.FindProperty("PodatekDet")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagColumnBase0, rozbicieDodDok.FindProperty("PodatekMag")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDodDokMappingBase); + + var tableMappings151 = new List(); + rozbicieDodDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings151); + var rozbicieDodDokTable = new Table("RozbicieDodDok", null, relationalModel); + var dokIdColumn18 = new Column("DokId", "numeric(9,0)", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("DokId", dokIdColumn18); + var znaczenieColumn17 = new Column("Znaczenie", "smallint", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("Znaczenie", znaczenieColumn17); + var stawkaColumn6 = new Column("Stawka", "smallint", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("Stawka", stawkaColumn6); + var nettoColumn1 = new Column("Netto", "decimal(15,4)", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("Netto", nettoColumn1); + var nettoDetColumn0 = new Column("NettoDet", "decimal(15,4)", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("NettoDet", nettoDetColumn0); + var nettoMagColumn0 = new Column("NettoMag", "decimal(15,4)", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("NettoMag", nettoMagColumn0); + var podatekColumn1 = new Column("Podatek", "decimal(15,4)", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("Podatek", podatekColumn1); + var podatekDetColumn0 = new Column("PodatekDet", "decimal(15,4)", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("PodatekDet", podatekDetColumn0); + var podatekMagColumn0 = new Column("PodatekMag", "decimal(15,4)", rozbicieDodDokTable); + rozbicieDodDokTable.Columns.Add("PodatekMag", podatekMagColumn0); + var pK_ROZBDODDOK = new UniqueConstraint("PK_ROZBDODDOK", rozbicieDodDokTable, new[] { dokIdColumn18, znaczenieColumn17, stawkaColumn6 }); + rozbicieDodDokTable.PrimaryKey = pK_ROZBDODDOK; + var pK_ROZBDODDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozbicieDodDok", + new[] { "DokId", "Znaczenie", "Stawka" }); + pK_ROZBDODDOK.MappedKeys.Add(pK_ROZBDODDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ROZBDODDOKUc).Add(pK_ROZBDODDOK); + rozbicieDodDokTable.UniqueConstraints.Add("PK_ROZBDODDOK", pK_ROZBDODDOK); + relationalModel.Tables.Add(("RozbicieDodDok", null), rozbicieDodDokTable); + var rozbicieDodDokTableMapping = new TableMapping(rozbicieDodDok, rozbicieDodDokTable, true); + rozbicieDodDokTable.AddTypeMapping(rozbicieDodDokTableMapping, false); + tableMappings151.Add(rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn18, rozbicieDodDok.FindProperty("DokId")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn6, rozbicieDodDok.FindProperty("Stawka")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn17, rozbicieDodDok.FindProperty("Znaczenie")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn1, rozbicieDodDok.FindProperty("Netto")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetColumn0, rozbicieDodDok.FindProperty("NettoDet")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagColumn0, rozbicieDodDok.FindProperty("NettoMag")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn1, rozbicieDodDok.FindProperty("Podatek")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetColumn0, rozbicieDodDok.FindProperty("PodatekDet")!, rozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagColumn0, rozbicieDodDok.FindProperty("PodatekMag")!, rozbicieDodDokTableMapping); + + var rozbicieDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RozbicieDok")!; + + var defaultTableMappings152 = new List>(); + rozbicieDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings152); + var blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RozbicieDok", null, relationalModel); + var dokIdColumnBase19 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("DokId", dokIdColumnBase19); + var nettoColumnBase2 = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("Netto", nettoColumnBase2); + var nettoDetColumnBase1 = new ColumnBase("NettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("NettoDet", nettoDetColumnBase1); + var nettoMagColumnBase1 = new ColumnBase("NettoMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("NettoMag", nettoMagColumnBase1); + var podatekColumnBase2 = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("Podatek", podatekColumnBase2); + var podatekDetColumnBase1 = new ColumnBase("PodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("PodatekDet", podatekDetColumnBase1); + var podatekMagColumnBase1 = new ColumnBase("PodatekMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("PodatekMag", podatekMagColumnBase1); + var stawkaColumnBase7 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.Columns.Add("Stawka", stawkaColumnBase7); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RozbicieDok", blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase = new TableMappingBase(rozbicieDok, blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRozbicieDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase, false); + defaultTableMappings152.Add(blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase19, rozbicieDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase7, rozbicieDok.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase2, rozbicieDok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetColumnBase1, rozbicieDok.FindProperty("NettoDet")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagColumnBase1, rozbicieDok.FindProperty("NettoMag")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase2, rozbicieDok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetColumnBase1, rozbicieDok.FindProperty("PodatekDet")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagColumnBase1, rozbicieDok.FindProperty("PodatekMag")!, blinkBackofficeServicesPcmDbEntitiesRozbicieDokMappingBase); + + var tableMappings152 = new List(); + rozbicieDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings152); + var rozbicieDokTable = new Table("RozbicieDok", null, relationalModel); + var dokIdColumn19 = new Column("DokId", "numeric(9,0)", rozbicieDokTable); + rozbicieDokTable.Columns.Add("DokId", dokIdColumn19); + var stawkaColumn7 = new Column("Stawka", "smallint", rozbicieDokTable); + rozbicieDokTable.Columns.Add("Stawka", stawkaColumn7); + var nettoColumn2 = new Column("Netto", "decimal(15,4)", rozbicieDokTable); + rozbicieDokTable.Columns.Add("Netto", nettoColumn2); + var nettoDetColumn1 = new Column("NettoDet", "decimal(15,4)", rozbicieDokTable); + rozbicieDokTable.Columns.Add("NettoDet", nettoDetColumn1); + var nettoMagColumn1 = new Column("NettoMag", "decimal(15,4)", rozbicieDokTable) + { + IsNullable = true + }; + rozbicieDokTable.Columns.Add("NettoMag", nettoMagColumn1); + var podatekColumn2 = new Column("Podatek", "decimal(15,4)", rozbicieDokTable); + rozbicieDokTable.Columns.Add("Podatek", podatekColumn2); + var podatekDetColumn1 = new Column("PodatekDet", "decimal(15,4)", rozbicieDokTable); + rozbicieDokTable.Columns.Add("PodatekDet", podatekDetColumn1); + var podatekMagColumn1 = new Column("PodatekMag", "decimal(15,4)", rozbicieDokTable) + { + IsNullable = true + }; + rozbicieDokTable.Columns.Add("PodatekMag", podatekMagColumn1); + var pK_ROZBICIEDOK = new UniqueConstraint("PK_ROZBICIEDOK", rozbicieDokTable, new[] { dokIdColumn19, stawkaColumn7 }); + rozbicieDokTable.PrimaryKey = pK_ROZBICIEDOK; + var pK_ROZBICIEDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozbicieDok", + new[] { "DokId", "Stawka" }); + pK_ROZBICIEDOK.MappedKeys.Add(pK_ROZBICIEDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ROZBICIEDOKUc).Add(pK_ROZBICIEDOK); + rozbicieDokTable.UniqueConstraints.Add("PK_ROZBICIEDOK", pK_ROZBICIEDOK); + relationalModel.Tables.Add(("RozbicieDok", null), rozbicieDokTable); + var rozbicieDokTableMapping = new TableMapping(rozbicieDok, rozbicieDokTable, true); + rozbicieDokTable.AddTypeMapping(rozbicieDokTableMapping, false); + tableMappings152.Add(rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn19, rozbicieDok.FindProperty("DokId")!, rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn7, rozbicieDok.FindProperty("Stawka")!, rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn2, rozbicieDok.FindProperty("Netto")!, rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetColumn1, rozbicieDok.FindProperty("NettoDet")!, rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagColumn1, rozbicieDok.FindProperty("NettoMag")!, rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn2, rozbicieDok.FindProperty("Podatek")!, rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetColumn1, rozbicieDok.FindProperty("PodatekDet")!, rozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagColumn1, rozbicieDok.FindProperty("PodatekMag")!, rozbicieDokTableMapping); + + var rozlicza = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Rozlicza")!; + + var defaultTableMappings153 = new List>(); + rozlicza.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings153); + var blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Rozlicza", null, relationalModel); + var dokIdColumnBase20 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase.Columns.Add("DokId", dokIdColumnBase20); + var kolejnoscColumnBase28 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase28); + var rozliczanyDokIdColumnBase = new ColumnBase("RozliczanyDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase.Columns.Add("RozliczanyDokId", rozliczanyDokIdColumnBase); + var rozliczenieColumnBase = new ColumnBase("Rozliczenie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase.Columns.Add("Rozliczenie", rozliczenieColumnBase); + var rozliczeniePodatkuColumnBase = new ColumnBase("RozliczeniePodatku", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase.Columns.Add("RozliczeniePodatku", rozliczeniePodatkuColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Rozlicza", blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase); + var blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase = new TableMappingBase(rozlicza, blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRozliczaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase, false); + defaultTableMappings153.Add(blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase20, rozlicza.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase28, rozlicza.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczanyDokIdColumnBase, rozlicza.FindProperty("RozliczanyDokId")!, blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczenieColumnBase, rozlicza.FindProperty("Rozliczenie")!, blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczeniePodatkuColumnBase, rozlicza.FindProperty("RozliczeniePodatku")!, blinkBackofficeServicesPcmDbEntitiesRozliczaMappingBase); + + var tableMappings153 = new List(); + rozlicza.SetRuntimeAnnotation("Relational:TableMappings", tableMappings153); + var rozliczaTable = new Table("Rozlicza", null, relationalModel); + var dokIdColumn20 = new Column("DokId", "numeric(9,0)", rozliczaTable); + rozliczaTable.Columns.Add("DokId", dokIdColumn20); + var kolejnoscColumn28 = new Column("Kolejnosc", "int", rozliczaTable); + rozliczaTable.Columns.Add("Kolejnosc", kolejnoscColumn28); + var rozliczanyDokIdColumn = new Column("RozliczanyDokId", "numeric(9,0)", rozliczaTable); + rozliczaTable.Columns.Add("RozliczanyDokId", rozliczanyDokIdColumn); + var rozliczenieColumn = new Column("Rozliczenie", "decimal(15,4)", rozliczaTable); + rozliczaTable.Columns.Add("Rozliczenie", rozliczenieColumn); + var rozliczeniePodatkuColumn = new Column("RozliczeniePodatku", "decimal(15,4)", rozliczaTable) + { + IsNullable = true + }; + rozliczaTable.Columns.Add("RozliczeniePodatku", rozliczeniePodatkuColumn); + var pK_ROZLICZA = new UniqueConstraint("PK_ROZLICZA", rozliczaTable, new[] { dokIdColumn20, kolejnoscColumn28 }); + rozliczaTable.PrimaryKey = pK_ROZLICZA; + var pK_ROZLICZAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Rozlicza", + new[] { "DokId", "Kolejnosc" }); + pK_ROZLICZA.MappedKeys.Add(pK_ROZLICZAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ROZLICZAUc).Add(pK_ROZLICZA); + rozliczaTable.UniqueConstraints.Add("PK_ROZLICZA", pK_ROZLICZA); + var idx_RozliczanyDokId = new TableIndex( + "idx_RozliczanyDokId", rozliczaTable, new[] { rozliczanyDokIdColumn }, false); + var idx_RozliczanyDokIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Rozlicza", + "idx_RozliczanyDokId"); + idx_RozliczanyDokId.MappedIndexes.Add(idx_RozliczanyDokIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_RozliczanyDokIdIx).Add(idx_RozliczanyDokId); + rozliczaTable.Indexes.Add("idx_RozliczanyDokId", idx_RozliczanyDokId); + relationalModel.Tables.Add(("Rozlicza", null), rozliczaTable); + var rozliczaTableMapping = new TableMapping(rozlicza, rozliczaTable, true); + rozliczaTable.AddTypeMapping(rozliczaTableMapping, false); + tableMappings153.Add(rozliczaTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn20, rozlicza.FindProperty("DokId")!, rozliczaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn28, rozlicza.FindProperty("Kolejnosc")!, rozliczaTableMapping); + RelationalModel.CreateColumnMapping(rozliczanyDokIdColumn, rozlicza.FindProperty("RozliczanyDokId")!, rozliczaTableMapping); + RelationalModel.CreateColumnMapping(rozliczenieColumn, rozlicza.FindProperty("Rozliczenie")!, rozliczaTableMapping); + RelationalModel.CreateColumnMapping(rozliczeniePodatkuColumn, rozlicza.FindProperty("RozliczeniePodatku")!, rozliczaTableMapping); + + var rozliczeniePartii = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii")!; + + var defaultTableMappings154 = new List>(); + rozliczeniePartii.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings154); + var blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii", null, relationalModel); + var prtDokIdColumnBase = new ColumnBase("PrtDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase.Columns.Add("PrtDokId", prtDokIdColumnBase); + var prtKolejnoscColumnBase = new ColumnBase("PrtKolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase.Columns.Add("PrtKolejnosc", prtKolejnoscColumnBase); + var rozDokIdColumnBase = new ColumnBase("RozDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase.Columns.Add("RozDokId", rozDokIdColumnBase); + var rozKolejnoscColumnBase = new ColumnBase("RozKolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase.Columns.Add("RozKolejnosc", rozKolejnoscColumnBase); + var rozliczenieColumnBase0 = new ColumnBase("Rozliczenie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase.Columns.Add("Rozliczenie", rozliczenieColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii", blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase); + var blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase = new TableMappingBase(rozliczeniePartii, blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase, true); + blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase, false); + defaultTableMappings154.Add(blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prtDokIdColumnBase, rozliczeniePartii.FindProperty("PrtDokId")!, blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prtKolejnoscColumnBase, rozliczeniePartii.FindProperty("PrtKolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozDokIdColumnBase, rozliczeniePartii.FindProperty("RozDokId")!, blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozKolejnoscColumnBase, rozliczeniePartii.FindProperty("RozKolejnosc")!, blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczenieColumnBase0, rozliczeniePartii.FindProperty("Rozliczenie")!, blinkBackofficeServicesPcmDbEntitiesRozliczeniePartiiMappingBase); + + var tableMappings154 = new List(); + rozliczeniePartii.SetRuntimeAnnotation("Relational:TableMappings", tableMappings154); + var rozliczeniePartiiTable = new Table("RozliczeniePartii", null, relationalModel); + var rozDokIdColumn = new Column("RozDokId", "numeric(9,0)", rozliczeniePartiiTable); + rozliczeniePartiiTable.Columns.Add("RozDokId", rozDokIdColumn); + var rozKolejnoscColumn = new Column("RozKolejnosc", "int", rozliczeniePartiiTable); + rozliczeniePartiiTable.Columns.Add("RozKolejnosc", rozKolejnoscColumn); + var prtDokIdColumn = new Column("PrtDokId", "numeric(9,0)", rozliczeniePartiiTable); + rozliczeniePartiiTable.Columns.Add("PrtDokId", prtDokIdColumn); + var prtKolejnoscColumn = new Column("PrtKolejnosc", "int", rozliczeniePartiiTable); + rozliczeniePartiiTable.Columns.Add("PrtKolejnosc", prtKolejnoscColumn); + var rozliczenieColumn0 = new Column("Rozliczenie", "decimal(15,4)", rozliczeniePartiiTable); + rozliczeniePartiiTable.Columns.Add("Rozliczenie", rozliczenieColumn0); + var pK_ROZLICZENIEPARTII = new UniqueConstraint("PK_ROZLICZENIEPARTII", rozliczeniePartiiTable, new[] { rozDokIdColumn, rozKolejnoscColumn, prtDokIdColumn, prtKolejnoscColumn }); + rozliczeniePartiiTable.PrimaryKey = pK_ROZLICZENIEPARTII; + var pK_ROZLICZENIEPARTIIUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii", + new[] { "RozDokId", "RozKolejnosc", "PrtDokId", "PrtKolejnosc" }); + pK_ROZLICZENIEPARTII.MappedKeys.Add(pK_ROZLICZENIEPARTIIUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ROZLICZENIEPARTIIUc).Add(pK_ROZLICZENIEPARTII); + rozliczeniePartiiTable.UniqueConstraints.Add("PK_ROZLICZENIEPARTII", pK_ROZLICZENIEPARTII); + var idx_RozPrt = new TableIndex( + "idx_RozPrt", rozliczeniePartiiTable, new[] { prtDokIdColumn, prtKolejnoscColumn }, false); + var idx_RozPrtIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii", + "idx_RozPrt"); + idx_RozPrt.MappedIndexes.Add(idx_RozPrtIx); + RelationalModel.GetOrCreateTableIndexes(idx_RozPrtIx).Add(idx_RozPrt); + rozliczeniePartiiTable.Indexes.Add("idx_RozPrt", idx_RozPrt); + relationalModel.Tables.Add(("RozliczeniePartii", null), rozliczeniePartiiTable); + var rozliczeniePartiiTableMapping = new TableMapping(rozliczeniePartii, rozliczeniePartiiTable, true); + rozliczeniePartiiTable.AddTypeMapping(rozliczeniePartiiTableMapping, false); + tableMappings154.Add(rozliczeniePartiiTableMapping); + RelationalModel.CreateColumnMapping(prtDokIdColumn, rozliczeniePartii.FindProperty("PrtDokId")!, rozliczeniePartiiTableMapping); + RelationalModel.CreateColumnMapping(prtKolejnoscColumn, rozliczeniePartii.FindProperty("PrtKolejnosc")!, rozliczeniePartiiTableMapping); + RelationalModel.CreateColumnMapping(rozDokIdColumn, rozliczeniePartii.FindProperty("RozDokId")!, rozliczeniePartiiTableMapping); + RelationalModel.CreateColumnMapping(rozKolejnoscColumn, rozliczeniePartii.FindProperty("RozKolejnosc")!, rozliczeniePartiiTableMapping); + RelationalModel.CreateColumnMapping(rozliczenieColumn0, rozliczeniePartii.FindProperty("Rozliczenie")!, rozliczeniePartiiTableMapping); + + var sesja = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Sesja")!; + + var defaultTableMappings155 = new List>(); + sesja.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings155); + var blinkBackofficeServicesPcmDbEntitiesSesjaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Sesja", null, relationalModel); + var sesjaIdColumnBase0 = new ColumnBase("SesjaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSesjaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaTableBase.Columns.Add("SesjaId", sesjaIdColumnBase0); + var stanowiskoColumnBase0 = new ColumnBase("Stanowisko", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSesjaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaTableBase.Columns.Add("Stanowisko", stanowiskoColumnBase0); + var typAplikacjiColumnBase0 = new ColumnBase("TypAplikacji", "smallint", blinkBackofficeServicesPcmDbEntitiesSesjaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaTableBase.Columns.Add("TypAplikacji", typAplikacjiColumnBase0); + var uzIdColumnBase4 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSesjaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaTableBase.Columns.Add("UzId", uzIdColumnBase4); + var wersjaColumnBase2 = new ColumnBase("Wersja", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSesjaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaTableBase.Columns.Add("Wersja", wersjaColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Sesja", blinkBackofficeServicesPcmDbEntitiesSesjaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase = new TableMappingBase(sesja, blinkBackofficeServicesPcmDbEntitiesSesjaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSesjaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase, false); + defaultTableMappings155.Add(blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sesjaIdColumnBase0, sesja.FindProperty("SesjaId")!, blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanowiskoColumnBase0, sesja.FindProperty("Stanowisko")!, blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typAplikacjiColumnBase0, sesja.FindProperty("TypAplikacji")!, blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase4, sesja.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase2, sesja.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesSesjaMappingBase); + + var tableMappings155 = new List(); + sesja.SetRuntimeAnnotation("Relational:TableMappings", tableMappings155); + var sesjaTable = new Table("Sesja", null, relationalModel); + var sesjaIdColumn0 = new Column("SesjaId", "numeric(9,0)", sesjaTable); + sesjaTable.Columns.Add("SesjaId", sesjaIdColumn0); + var stanowiskoColumn0 = new Column("Stanowisko", "varchar(40)", sesjaTable); + sesjaTable.Columns.Add("Stanowisko", stanowiskoColumn0); + var typAplikacjiColumn0 = new Column("TypAplikacji", "smallint", sesjaTable); + sesjaTable.Columns.Add("TypAplikacji", typAplikacjiColumn0); + var uzIdColumn4 = new Column("UzId", "numeric(9,0)", sesjaTable); + sesjaTable.Columns.Add("UzId", uzIdColumn4); + var wersjaColumn2 = new Column("Wersja", "varchar(40)", sesjaTable); + sesjaTable.Columns.Add("Wersja", wersjaColumn2); + var pK_SESJA = new UniqueConstraint("PK_SESJA", sesjaTable, new[] { sesjaIdColumn0 }); + sesjaTable.PrimaryKey = pK_SESJA; + var pK_SESJAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sesja", + new[] { "SesjaId" }); + pK_SESJA.MappedKeys.Add(pK_SESJAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SESJAUc).Add(pK_SESJA); + sesjaTable.UniqueConstraints.Add("PK_SESJA", pK_SESJA); + var idx_SesjaUzId = new TableIndex( + "idx_SesjaUzId", sesjaTable, new[] { uzIdColumn4 }, false); + var idx_SesjaUzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sesja", + "idx_SesjaUzId"); + idx_SesjaUzId.MappedIndexes.Add(idx_SesjaUzIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SesjaUzIdIx).Add(idx_SesjaUzId); + sesjaTable.Indexes.Add("idx_SesjaUzId", idx_SesjaUzId); + relationalModel.Tables.Add(("Sesja", null), sesjaTable); + var sesjaTableMapping = new TableMapping(sesja, sesjaTable, true); + sesjaTable.AddTypeMapping(sesjaTableMapping, false); + tableMappings155.Add(sesjaTableMapping); + RelationalModel.CreateColumnMapping(sesjaIdColumn0, sesja.FindProperty("SesjaId")!, sesjaTableMapping); + RelationalModel.CreateColumnMapping(stanowiskoColumn0, sesja.FindProperty("Stanowisko")!, sesjaTableMapping); + RelationalModel.CreateColumnMapping(typAplikacjiColumn0, sesja.FindProperty("TypAplikacji")!, sesjaTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn4, sesja.FindProperty("UzId")!, sesjaTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn2, sesja.FindProperty("Wersja")!, sesjaTableMapping); + + var sesjaAktywna = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SesjaAktywna")!; + + var defaultTableMappings156 = new List>(); + sesjaAktywna.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings156); + var blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SesjaAktywna", null, relationalModel); + var aktywnoscColumnBase = new ColumnBase("Aktywnosc", "datetime", blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase.Columns.Add("Aktywnosc", aktywnoscColumnBase); + var idProcesuColumnBase = new ColumnBase("IdProcesu", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase.Columns.Add("IdProcesu", idProcesuColumnBase); + var sesjaIdColumnBase1 = new ColumnBase("SesjaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase.Columns.Add("SesjaId", sesjaIdColumnBase1); + var wylacznoscColumnBase = new ColumnBase("Wylacznosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase); + blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase.Columns.Add("Wylacznosc", wylacznoscColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SesjaAktywna", blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaMappingBase = new TableMappingBase(sesjaAktywna, blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaMappingBase, false); + defaultTableMappings156.Add(blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sesjaIdColumnBase1, sesjaAktywna.FindProperty("SesjaId")!, blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnoscColumnBase, sesjaAktywna.FindProperty("Aktywnosc")!, blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idProcesuColumnBase, sesjaAktywna.FindProperty("IdProcesu")!, blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wylacznoscColumnBase, sesjaAktywna.FindProperty("Wylacznosc")!, blinkBackofficeServicesPcmDbEntitiesSesjaAktywnaMappingBase); + + var tableMappings156 = new List(); + sesjaAktywna.SetRuntimeAnnotation("Relational:TableMappings", tableMappings156); + var sesjaAktywnaTable = new Table("SesjaAktywna", null, relationalModel); + var sesjaIdColumn1 = new Column("SesjaId", "numeric(9,0)", sesjaAktywnaTable); + sesjaAktywnaTable.Columns.Add("SesjaId", sesjaIdColumn1); + var aktywnoscColumn = new Column("Aktywnosc", "datetime", sesjaAktywnaTable); + sesjaAktywnaTable.Columns.Add("Aktywnosc", aktywnoscColumn); + var idProcesuColumn = new Column("IdProcesu", "varchar(20)", sesjaAktywnaTable) + { + IsNullable = true + }; + sesjaAktywnaTable.Columns.Add("IdProcesu", idProcesuColumn); + var wylacznoscColumn = new Column("Wylacznosc", "smallint", sesjaAktywnaTable); + sesjaAktywnaTable.Columns.Add("Wylacznosc", wylacznoscColumn); + var pK_SESJAAKTYWNA = new UniqueConstraint("PK_SESJAAKTYWNA", sesjaAktywnaTable, new[] { sesjaIdColumn1 }); + sesjaAktywnaTable.PrimaryKey = pK_SESJAAKTYWNA; + var pK_SESJAAKTYWNAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SesjaAktywna", + new[] { "SesjaId" }); + pK_SESJAAKTYWNA.MappedKeys.Add(pK_SESJAAKTYWNAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SESJAAKTYWNAUc).Add(pK_SESJAAKTYWNA); + sesjaAktywnaTable.UniqueConstraints.Add("PK_SESJAAKTYWNA", pK_SESJAAKTYWNA); + relationalModel.Tables.Add(("SesjaAktywna", null), sesjaAktywnaTable); + var sesjaAktywnaTableMapping = new TableMapping(sesjaAktywna, sesjaAktywnaTable, true); + sesjaAktywnaTable.AddTypeMapping(sesjaAktywnaTableMapping, false); + tableMappings156.Add(sesjaAktywnaTableMapping); + RelationalModel.CreateColumnMapping(sesjaIdColumn1, sesjaAktywna.FindProperty("SesjaId")!, sesjaAktywnaTableMapping); + RelationalModel.CreateColumnMapping(aktywnoscColumn, sesjaAktywna.FindProperty("Aktywnosc")!, sesjaAktywnaTableMapping); + RelationalModel.CreateColumnMapping(idProcesuColumn, sesjaAktywna.FindProperty("IdProcesu")!, sesjaAktywnaTableMapping); + RelationalModel.CreateColumnMapping(wylacznoscColumn, sesjaAktywna.FindProperty("Wylacznosc")!, sesjaAktywnaTableMapping); + + var skladnikDefinicjiKodu = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SkladnikDefinicjiKodu")!; + + var defaultTableMappings157 = new List>(); + skladnikDefinicjiKodu.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings157); + var blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SkladnikDefinicjiKodu", null, relationalModel); + var dKIdColumnBase0 = new ColumnBase("DKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase.Columns.Add("DKId", dKIdColumnBase0); + var dlugoscColumnBase = new ColumnBase("Dlugosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase.Columns.Add("Dlugosc", dlugoscColumnBase); + var kolejnoscColumnBase29 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase29); + var rodzajColumnBase5 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase.Columns.Add("Rodzaj", rodzajColumnBase5); + var tekstColumnBase13 = new ColumnBase("Tekst", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase.Columns.Add("Tekst", tekstColumnBase13); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SkladnikDefinicjiKodu", blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase); + var blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase = new TableMappingBase(skladnikDefinicjiKodu, blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase, false); + defaultTableMappings157.Add(blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dKIdColumnBase0, skladnikDefinicjiKodu.FindProperty("DKId")!, blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase29, skladnikDefinicjiKodu.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dlugoscColumnBase, skladnikDefinicjiKodu.FindProperty("Dlugosc")!, blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase5, skladnikDefinicjiKodu.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase13, skladnikDefinicjiKodu.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSkladnikDefinicjiKoduMappingBase); + + var tableMappings157 = new List(); + skladnikDefinicjiKodu.SetRuntimeAnnotation("Relational:TableMappings", tableMappings157); + var skladnikDefinicjiKoduTable = new Table("SkladnikDefinicjiKodu", null, relationalModel); + var dKIdColumn0 = new Column("DKId", "numeric(9,0)", skladnikDefinicjiKoduTable); + skladnikDefinicjiKoduTable.Columns.Add("DKId", dKIdColumn0); + var kolejnoscColumn29 = new Column("Kolejnosc", "smallint", skladnikDefinicjiKoduTable); + skladnikDefinicjiKoduTable.Columns.Add("Kolejnosc", kolejnoscColumn29); + var dlugoscColumn = new Column("Dlugosc", "smallint", skladnikDefinicjiKoduTable); + skladnikDefinicjiKoduTable.Columns.Add("Dlugosc", dlugoscColumn); + var rodzajColumn5 = new Column("Rodzaj", "smallint", skladnikDefinicjiKoduTable); + skladnikDefinicjiKoduTable.Columns.Add("Rodzaj", rodzajColumn5); + var tekstColumn13 = new Column("Tekst", "varchar(40)", skladnikDefinicjiKoduTable) + { + IsNullable = true + }; + skladnikDefinicjiKoduTable.Columns.Add("Tekst", tekstColumn13); + var pK_SKLDEFKODU = new UniqueConstraint("PK_SKLDEFKODU", skladnikDefinicjiKoduTable, new[] { dKIdColumn0, kolejnoscColumn29 }); + skladnikDefinicjiKoduTable.PrimaryKey = pK_SKLDEFKODU; + var pK_SKLDEFKODUUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikDefinicjiKodu", + new[] { "DKId", "Kolejnosc" }); + pK_SKLDEFKODU.MappedKeys.Add(pK_SKLDEFKODUUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLDEFKODUUc).Add(pK_SKLDEFKODU); + skladnikDefinicjiKoduTable.UniqueConstraints.Add("PK_SKLDEFKODU", pK_SKLDEFKODU); + relationalModel.Tables.Add(("SkladnikDefinicjiKodu", null), skladnikDefinicjiKoduTable); + var skladnikDefinicjiKoduTableMapping = new TableMapping(skladnikDefinicjiKodu, skladnikDefinicjiKoduTable, true); + skladnikDefinicjiKoduTable.AddTypeMapping(skladnikDefinicjiKoduTableMapping, false); + tableMappings157.Add(skladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(dKIdColumn0, skladnikDefinicjiKodu.FindProperty("DKId")!, skladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn29, skladnikDefinicjiKodu.FindProperty("Kolejnosc")!, skladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(dlugoscColumn, skladnikDefinicjiKodu.FindProperty("Dlugosc")!, skladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn5, skladnikDefinicjiKodu.FindProperty("Rodzaj")!, skladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn13, skladnikDefinicjiKodu.FindProperty("Tekst")!, skladnikDefinicjiKoduTableMapping); + + var skladnikWzorca = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca")!; + + var defaultTableMappings158 = new List>(); + skladnikWzorca.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings158); + var blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", null, relationalModel); + var aktywnyColumnBase26 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("Aktywny", aktywnyColumnBase26); + var cenaColumnBase2 = new ColumnBase("Cena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("Cena", cenaColumnBase2); + var centrSkWzIdColumnBase = new ColumnBase("CentrSkWzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("CentrSkWzId", centrSkWzIdColumnBase); + var czyDodatekColumnBase = new ColumnBase("CzyDodatek", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("CzyDodatek", czyDodatekColumnBase); + var iloscColumnBase3 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("Ilosc", iloscColumnBase3); + var kolejnoscColumnBase30 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase30); + var nazwaColumnBase35 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("Nazwa", nazwaColumnBase35); + var obowiazkowyColumnBase = new ColumnBase("Obowiazkowy", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("Obowiazkowy", obowiazkowyColumnBase); + var rozneCenyColumnBase = new ColumnBase("RozneCeny", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("RozneCeny", rozneCenyColumnBase); + var skWzIdColumnBase = new ColumnBase("SkWzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("SkWzId", skWzIdColumnBase); + var towIdWzorcaColumnBase = new ColumnBase("TowIdWzorca", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("TowIdWzorca", towIdWzorcaColumnBase); + var wyborWieluColumnBase = new ColumnBase("WyborWielu", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("WyborWielu", wyborWieluColumnBase); + var wyliczenieCenyColumnBase = new ColumnBase("WyliczenieCeny", "smallint", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("WyliczenieCeny", wyliczenieCenyColumnBase); + var zmianaColumnBase32 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.Columns.Add("Zmiana", zmianaColumnBase32); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase = new TableMappingBase(skladnikWzorca, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase, false); + defaultTableMappings158.Add(blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skWzIdColumnBase, skladnikWzorca.FindProperty("SkWzId")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase26, skladnikWzorca.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase2, skladnikWzorca.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrSkWzIdColumnBase, skladnikWzorca.FindProperty("CentrSkWzId")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czyDodatekColumnBase, skladnikWzorca.FindProperty("CzyDodatek")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase3, skladnikWzorca.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase30, skladnikWzorca.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase35, skladnikWzorca.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)obowiazkowyColumnBase, skladnikWzorca.FindProperty("Obowiazkowy")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozneCenyColumnBase, skladnikWzorca.FindProperty("RozneCeny")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdWzorcaColumnBase, skladnikWzorca.FindProperty("TowIdWzorca")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wyborWieluColumnBase, skladnikWzorca.FindProperty("WyborWielu")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wyliczenieCenyColumnBase, skladnikWzorca.FindProperty("WyliczenieCeny")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase32, skladnikWzorca.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSkladnikWzorcaMappingBase); + + var tableMappings158 = new List(); + skladnikWzorca.SetRuntimeAnnotation("Relational:TableMappings", tableMappings158); + var skladnikWzorcaTable = new Table("SkladnikWzorca", null, relationalModel); + var skWzIdColumn = new Column("SkWzId", "numeric(9,0)", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("SkWzId", skWzIdColumn); + var aktywnyColumn26 = new Column("Aktywny", "smallint", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("Aktywny", aktywnyColumn26); + var cenaColumn2 = new Column("Cena", "decimal(15,4)", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("Cena", cenaColumn2); + var centrSkWzIdColumn = new Column("CentrSkWzId", "numeric(9,0)", skladnikWzorcaTable) + { + IsNullable = true + }; + skladnikWzorcaTable.Columns.Add("CentrSkWzId", centrSkWzIdColumn); + var czyDodatekColumn = new Column("CzyDodatek", "smallint", skladnikWzorcaTable) + { + IsNullable = true + }; + skladnikWzorcaTable.Columns.Add("CzyDodatek", czyDodatekColumn); + var iloscColumn3 = new Column("Ilosc", "decimal(15,4)", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("Ilosc", iloscColumn3); + var kolejnoscColumn30 = new Column("Kolejnosc", "smallint", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("Kolejnosc", kolejnoscColumn30); + var nazwaColumn35 = new Column("Nazwa", "varchar(60)", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("Nazwa", nazwaColumn35); + var obowiazkowyColumn = new Column("Obowiazkowy", "smallint", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("Obowiazkowy", obowiazkowyColumn); + var rozneCenyColumn = new Column("RozneCeny", "smallint", skladnikWzorcaTable) + { + IsNullable = true + }; + skladnikWzorcaTable.Columns.Add("RozneCeny", rozneCenyColumn); + var towIdWzorcaColumn = new Column("TowIdWzorca", "numeric(9,0)", skladnikWzorcaTable) + { + IsNullable = true + }; + skladnikWzorcaTable.Columns.Add("TowIdWzorca", towIdWzorcaColumn); + var wyborWieluColumn = new Column("WyborWielu", "smallint", skladnikWzorcaTable) + { + IsNullable = true + }; + skladnikWzorcaTable.Columns.Add("WyborWielu", wyborWieluColumn); + var wyliczenieCenyColumn = new Column("WyliczenieCeny", "smallint", skladnikWzorcaTable) + { + IsNullable = true + }; + skladnikWzorcaTable.Columns.Add("WyliczenieCeny", wyliczenieCenyColumn); + var zmianaColumn32 = new Column("Zmiana", "datetime", skladnikWzorcaTable); + skladnikWzorcaTable.Columns.Add("Zmiana", zmianaColumn32); + var pK_SKLADNIKWZORCA = new UniqueConstraint("PK_SKLADNIKWZORCA", skladnikWzorcaTable, new[] { skWzIdColumn }); + skladnikWzorcaTable.PrimaryKey = pK_SKLADNIKWZORCA; + var pK_SKLADNIKWZORCAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", + new[] { "SkWzId" }); + pK_SKLADNIKWZORCA.MappedKeys.Add(pK_SKLADNIKWZORCAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLADNIKWZORCAUc).Add(pK_SKLADNIKWZORCA); + skladnikWzorcaTable.UniqueConstraints.Add("PK_SKLADNIKWZORCA", pK_SKLADNIKWZORCA); + var idx_CentrSkWzId = new TableIndex( + "idx_CentrSkWzId", skladnikWzorcaTable, new[] { centrSkWzIdColumn }, false); + var idx_CentrSkWzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", + "idx_CentrSkWzId"); + idx_CentrSkWzId.MappedIndexes.Add(idx_CentrSkWzIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrSkWzIdIx).Add(idx_CentrSkWzId); + skladnikWzorcaTable.Indexes.Add("idx_CentrSkWzId", idx_CentrSkWzId); + var idx_SkladnikWzorca_TowIdWzorca = new TableIndex( + "idx_SkladnikWzorca_TowIdWzorca", skladnikWzorcaTable, new[] { towIdWzorcaColumn, kolejnoscColumn30 }, false); + var idx_SkladnikWzorca_TowIdWzorcaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", + "idx_SkladnikWzorca_TowIdWzorca"); + idx_SkladnikWzorca_TowIdWzorca.MappedIndexes.Add(idx_SkladnikWzorca_TowIdWzorcaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkladnikWzorca_TowIdWzorcaIx).Add(idx_SkladnikWzorca_TowIdWzorca); + skladnikWzorcaTable.Indexes.Add("idx_SkladnikWzorca_TowIdWzorca", idx_SkladnikWzorca_TowIdWzorca); + relationalModel.Tables.Add(("SkladnikWzorca", null), skladnikWzorcaTable); + var skladnikWzorcaTableMapping = new TableMapping(skladnikWzorca, skladnikWzorcaTable, true); + skladnikWzorcaTable.AddTypeMapping(skladnikWzorcaTableMapping, false); + tableMappings158.Add(skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(skWzIdColumn, skladnikWzorca.FindProperty("SkWzId")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn26, skladnikWzorca.FindProperty("Aktywny")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn2, skladnikWzorca.FindProperty("Cena")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(centrSkWzIdColumn, skladnikWzorca.FindProperty("CentrSkWzId")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(czyDodatekColumn, skladnikWzorca.FindProperty("CzyDodatek")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn3, skladnikWzorca.FindProperty("Ilosc")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn30, skladnikWzorca.FindProperty("Kolejnosc")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn35, skladnikWzorca.FindProperty("Nazwa")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(obowiazkowyColumn, skladnikWzorca.FindProperty("Obowiazkowy")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(rozneCenyColumn, skladnikWzorca.FindProperty("RozneCeny")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(towIdWzorcaColumn, skladnikWzorca.FindProperty("TowIdWzorca")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(wyborWieluColumn, skladnikWzorca.FindProperty("WyborWielu")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(wyliczenieCenyColumn, skladnikWzorca.FindProperty("WyliczenieCeny")!, skladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn32, skladnikWzorca.FindProperty("Zmiana")!, skladnikWzorcaTableMapping); + + var sklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Sklep")!; + + var defaultTableMappings159 = new List>(); + sklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings159); + var blinkBackofficeServicesPcmDbEntitiesSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Sklep", null, relationalModel); + var dataBOColumnBase = new ColumnBase("DataBO", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("DataBO", dataBOColumnBase); + var kolejnyWDniuBOColumnBase = new ColumnBase("KolejnyWDniuBO", "int", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("KolejnyWDniuBO", kolejnyWDniuBOColumnBase); + var krajIdColumnBase2 = new ColumnBase("KrajId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("KrajId", krajIdColumnBase2); + var magIdColumnBase9 = new ColumnBase("MagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("MagId", magIdColumnBase9); + var nrSeryjnyColumnBase = new ColumnBase("NrSeryjny", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("NrSeryjny", nrSeryjnyColumnBase); + var nrSklepuColumnBase = new ColumnBase("NrSklepu", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("NrSklepu", nrSklepuColumnBase); + var okrZamknietyColumnBase = new ColumnBase("OkrZamkniety", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("OkrZamkniety", okrZamknietyColumnBase); + var ostEksportColumnBase = new ColumnBase("OstEksport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("OstEksport", ostEksportColumnBase); + var ostImportColumnBase = new ColumnBase("OstImport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("OstImport", ostImportColumnBase); + var pelnyImportColumnBase = new ColumnBase("PelnyImport", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("PelnyImport", pelnyImportColumnBase); + var potwEksportColumnBase = new ColumnBase("PotwEksport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("PotwEksport", potwEksportColumnBase); + var rolaColumnBase = new ColumnBase("Rola", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("Rola", rolaColumnBase); + var sklepIdColumnBase4 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("SklepId", sklepIdColumnBase4); + var wymImportColumnBase = new ColumnBase("WymImport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.Columns.Add("WymImport", wymImportColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Sklep", blinkBackofficeServicesPcmDbEntitiesSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepMappingBase = new TableMappingBase(sklep, blinkBackofficeServicesPcmDbEntitiesSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepMappingBase, false); + defaultTableMappings159.Add(blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase4, sklep.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataBOColumnBase, sklep.FindProperty("DataBO")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyWDniuBOColumnBase, sklep.FindProperty("KolejnyWDniuBO")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)krajIdColumnBase2, sklep.FindProperty("KrajId")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase9, sklep.FindProperty("MagId")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrSeryjnyColumnBase, sklep.FindProperty("NrSeryjny")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrSklepuColumnBase, sklep.FindProperty("NrSklepu")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)okrZamknietyColumnBase, sklep.FindProperty("OkrZamkniety")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ostEksportColumnBase, sklep.FindProperty("OstEksport")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ostImportColumnBase, sklep.FindProperty("OstImport")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pelnyImportColumnBase, sklep.FindProperty("PelnyImport")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)potwEksportColumnBase, sklep.FindProperty("PotwEksport")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaColumnBase, sklep.FindProperty("Rola")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wymImportColumnBase, sklep.FindProperty("WymImport")!, blinkBackofficeServicesPcmDbEntitiesSklepMappingBase); + + var tableMappings159 = new List(); + sklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings159); + var sklepTable = new Table("Sklep", null, relationalModel); + var sklepIdColumn4 = new Column("SklepId", "numeric(9,0)", sklepTable); + sklepTable.Columns.Add("SklepId", sklepIdColumn4); + var dataBOColumn = new Column("DataBO", "datetime", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("DataBO", dataBOColumn); + var kolejnyWDniuBOColumn = new Column("KolejnyWDniuBO", "int", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("KolejnyWDniuBO", kolejnyWDniuBOColumn); + var krajIdColumn2 = new Column("KrajId", "numeric(9,0)", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("KrajId", krajIdColumn2); + var magIdColumn9 = new Column("MagId", "numeric(9,0)", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("MagId", magIdColumn9); + var nrSeryjnyColumn = new Column("NrSeryjny", "varchar(40)", sklepTable); + sklepTable.Columns.Add("NrSeryjny", nrSeryjnyColumn); + var nrSklepuColumn = new Column("NrSklepu", "smallint", sklepTable); + sklepTable.Columns.Add("NrSklepu", nrSklepuColumn); + var okrZamknietyColumn = new Column("OkrZamkniety", "datetime", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("OkrZamkniety", okrZamknietyColumn); + var ostEksportColumn = new Column("OstEksport", "datetime", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("OstEksport", ostEksportColumn); + var ostImportColumn = new Column("OstImport", "datetime", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("OstImport", ostImportColumn); + var pelnyImportColumn = new Column("PelnyImport", "smallint", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("PelnyImport", pelnyImportColumn); + var potwEksportColumn = new Column("PotwEksport", "datetime", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("PotwEksport", potwEksportColumn); + var rolaColumn = new Column("Rola", "smallint", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("Rola", rolaColumn); + var wymImportColumn = new Column("WymImport", "datetime", sklepTable) + { + IsNullable = true + }; + sklepTable.Columns.Add("WymImport", wymImportColumn); + var pK_SKLEP = new UniqueConstraint("PK_SKLEP", sklepTable, new[] { sklepIdColumn4 }); + sklepTable.PrimaryKey = pK_SKLEP; + var pK_SKLEPUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + pK_SKLEP.MappedKeys.Add(pK_SKLEPUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPUc).Add(pK_SKLEP); + sklepTable.UniqueConstraints.Add("PK_SKLEP", pK_SKLEP); + var iX_Sklep_KrajId = new TableIndex( + "IX_Sklep_KrajId", sklepTable, new[] { krajIdColumn2 }, false); + var iX_Sklep_KrajIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "KrajId" }); + iX_Sklep_KrajId.MappedIndexes.Add(iX_Sklep_KrajIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Sklep_KrajIdIx).Add(iX_Sklep_KrajId); + sklepTable.Indexes.Add("IX_Sklep_KrajId", iX_Sklep_KrajId); + var iX_Sklep_MagId = new TableIndex( + "IX_Sklep_MagId", sklepTable, new[] { magIdColumn9 }, false); + var iX_Sklep_MagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "MagId" }); + iX_Sklep_MagId.MappedIndexes.Add(iX_Sklep_MagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Sklep_MagIdIx).Add(iX_Sklep_MagId); + sklepTable.Indexes.Add("IX_Sklep_MagId", iX_Sklep_MagId); + relationalModel.Tables.Add(("Sklep", null), sklepTable); + var sklepTableMapping = new TableMapping(sklep, sklepTable, true); + sklepTable.AddTypeMapping(sklepTableMapping, false); + tableMappings159.Add(sklepTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn4, sklep.FindProperty("SklepId")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(dataBOColumn, sklep.FindProperty("DataBO")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(kolejnyWDniuBOColumn, sklep.FindProperty("KolejnyWDniuBO")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(krajIdColumn2, sklep.FindProperty("KrajId")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn9, sklep.FindProperty("MagId")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(nrSeryjnyColumn, sklep.FindProperty("NrSeryjny")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(nrSklepuColumn, sklep.FindProperty("NrSklepu")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(okrZamknietyColumn, sklep.FindProperty("OkrZamkniety")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(ostEksportColumn, sklep.FindProperty("OstEksport")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(ostImportColumn, sklep.FindProperty("OstImport")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(pelnyImportColumn, sklep.FindProperty("PelnyImport")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(potwEksportColumn, sklep.FindProperty("PotwEksport")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(rolaColumn, sklep.FindProperty("Rola")!, sklepTableMapping); + RelationalModel.CreateColumnMapping(wymImportColumn, sklep.FindProperty("WymImport")!, sklepTableMapping); + + var sklepArtykul = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul")!; + + var defaultTableMappings160 = new List>(); + sklepArtykul.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings160); + var blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", null, relationalModel); + var artNazwaColumnBase0 = new ColumnBase("ArtNazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase.Columns.Add("ArtNazwa", artNazwaColumnBase0); + var glownySklepTowIdColumnBase = new ColumnBase("GlownySklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase.Columns.Add("GlownySklepTowId", glownySklepTowIdColumnBase); + var sklepArtIdColumnBase = new ColumnBase("SklepArtId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase.Columns.Add("SklepArtId", sklepArtIdColumnBase); + var sklepIdColumnBase5 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase.Columns.Add("SklepId", sklepIdColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepArtykulMappingBase = new TableMappingBase(sklepArtykul, blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepArtykulTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepArtykulMappingBase, false); + defaultTableMappings160.Add(blinkBackofficeServicesPcmDbEntitiesSklepArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepArtIdColumnBase, sklepArtykul.FindProperty("SklepArtId")!, blinkBackofficeServicesPcmDbEntitiesSklepArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase5, sklepArtykul.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)artNazwaColumnBase0, sklepArtykul.FindProperty("ArtNazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepArtykulMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)glownySklepTowIdColumnBase, sklepArtykul.FindProperty("GlownySklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepArtykulMappingBase); + + var tableMappings160 = new List(); + sklepArtykul.SetRuntimeAnnotation("Relational:TableMappings", tableMappings160); + var sklepArtykulTable = new Table("SklepArtykul", null, relationalModel); + var sklepIdColumn5 = new Column("SklepId", "numeric(9,0)", sklepArtykulTable); + sklepArtykulTable.Columns.Add("SklepId", sklepIdColumn5); + var sklepArtIdColumn = new Column("SklepArtId", "numeric(9,0)", sklepArtykulTable); + sklepArtykulTable.Columns.Add("SklepArtId", sklepArtIdColumn); + var artNazwaColumn0 = new Column("ArtNazwa", "varchar(120)", sklepArtykulTable); + sklepArtykulTable.Columns.Add("ArtNazwa", artNazwaColumn0); + var glownySklepTowIdColumn = new Column("GlownySklepTowId", "numeric(9,0)", sklepArtykulTable) + { + IsNullable = true + }; + sklepArtykulTable.Columns.Add("GlownySklepTowId", glownySklepTowIdColumn); + var pK_SKLEPARTYKUL = new UniqueConstraint("PK_SKLEPARTYKUL", sklepArtykulTable, new[] { sklepIdColumn5, sklepArtIdColumn }); + sklepArtykulTable.PrimaryKey = pK_SKLEPARTYKUL; + var pK_SKLEPARTYKULUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", + new[] { "SklepId", "SklepArtId" }); + pK_SKLEPARTYKUL.MappedKeys.Add(pK_SKLEPARTYKULUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPARTYKULUc).Add(pK_SKLEPARTYKUL); + sklepArtykulTable.UniqueConstraints.Add("PK_SKLEPARTYKUL", pK_SKLEPARTYKUL); + var iX_SklepArtykul_SklepId_GlownySklepTowId = new TableIndex( + "IX_SklepArtykul_SklepId_GlownySklepTowId", sklepArtykulTable, new[] { sklepIdColumn5, glownySklepTowIdColumn }, false); + var iX_SklepArtykul_SklepId_GlownySklepTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", + new[] { "SklepId", "GlownySklepTowId" }); + iX_SklepArtykul_SklepId_GlownySklepTowId.MappedIndexes.Add(iX_SklepArtykul_SklepId_GlownySklepTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepArtykul_SklepId_GlownySklepTowIdIx).Add(iX_SklepArtykul_SklepId_GlownySklepTowId); + sklepArtykulTable.Indexes.Add("IX_SklepArtykul_SklepId_GlownySklepTowId", iX_SklepArtykul_SklepId_GlownySklepTowId); + relationalModel.Tables.Add(("SklepArtykul", null), sklepArtykulTable); + var sklepArtykulTableMapping = new TableMapping(sklepArtykul, sklepArtykulTable, true); + sklepArtykulTable.AddTypeMapping(sklepArtykulTableMapping, false); + tableMappings160.Add(sklepArtykulTableMapping); + RelationalModel.CreateColumnMapping(sklepArtIdColumn, sklepArtykul.FindProperty("SklepArtId")!, sklepArtykulTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn5, sklepArtykul.FindProperty("SklepId")!, sklepArtykulTableMapping); + RelationalModel.CreateColumnMapping(artNazwaColumn0, sklepArtykul.FindProperty("ArtNazwa")!, sklepArtykulTableMapping); + RelationalModel.CreateColumnMapping(glownySklepTowIdColumn, sklepArtykul.FindProperty("GlownySklepTowId")!, sklepArtykulTableMapping); + + var sklepBank = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepBank")!; + + var defaultTableMappings161 = new List>(); + sklepBank.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings161); + var blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepBank", null, relationalModel); + var adresColumnBase0 = new ColumnBase("Adres", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("Adres", adresColumnBase0); + var aktywnyColumnBase27 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("Aktywny", aktywnyColumnBase27); + var bankIdColumnBase2 = new ColumnBase("BankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("BankId", bankIdColumnBase2); + var nazwaColumnBase36 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("Nazwa", nazwaColumnBase36); + var nrRozliBankColumnBase0 = new ColumnBase("NrRozliBank", "varchar(8)", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("NrRozliBank", nrRozliBankColumnBase0); + var sWIFTColumnBase0 = new ColumnBase("SWIFT", "varchar(11)", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("SWIFT", sWIFTColumnBase0); + var sklepBankIdColumnBase = new ColumnBase("SklepBankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("SklepBankId", sklepBankIdColumnBase); + var sklepIdColumnBase6 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("SklepId", sklepIdColumnBase6); + var zmianaColumnBase33 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.Columns.Add("Zmiana", zmianaColumnBase33); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepBank", blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase = new TableMappingBase(sklepBank, blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepBankTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase, false); + defaultTableMappings161.Add(blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepBankIdColumnBase, sklepBank.FindProperty("SklepBankId")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase6, sklepBank.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)adresColumnBase0, sklepBank.FindProperty("Adres")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase27, sklepBank.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bankIdColumnBase2, sklepBank.FindProperty("BankId")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase36, sklepBank.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrRozliBankColumnBase0, sklepBank.FindProperty("NrRozliBank")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sWIFTColumnBase0, sklepBank.FindProperty("SWIFT")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase33, sklepBank.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepBankMappingBase); + + var tableMappings161 = new List(); + sklepBank.SetRuntimeAnnotation("Relational:TableMappings", tableMappings161); + var sklepBankTable = new Table("SklepBank", null, relationalModel); + var sklepIdColumn6 = new Column("SklepId", "numeric(9,0)", sklepBankTable); + sklepBankTable.Columns.Add("SklepId", sklepIdColumn6); + var sklepBankIdColumn = new Column("SklepBankId", "numeric(9,0)", sklepBankTable); + sklepBankTable.Columns.Add("SklepBankId", sklepBankIdColumn); + var adresColumn0 = new Column("Adres", "varchar(255)", sklepBankTable); + sklepBankTable.Columns.Add("Adres", adresColumn0); + var aktywnyColumn27 = new Column("Aktywny", "smallint", sklepBankTable); + sklepBankTable.Columns.Add("Aktywny", aktywnyColumn27); + var bankIdColumn2 = new Column("BankId", "numeric(9,0)", sklepBankTable) + { + IsNullable = true + }; + sklepBankTable.Columns.Add("BankId", bankIdColumn2); + var nazwaColumn36 = new Column("Nazwa", "varchar(255)", sklepBankTable); + sklepBankTable.Columns.Add("Nazwa", nazwaColumn36); + var nrRozliBankColumn0 = new Column("NrRozliBank", "varchar(8)", sklepBankTable) + { + IsNullable = true + }; + sklepBankTable.Columns.Add("NrRozliBank", nrRozliBankColumn0); + var sWIFTColumn0 = new Column("SWIFT", "varchar(11)", sklepBankTable) + { + IsNullable = true + }; + sklepBankTable.Columns.Add("SWIFT", sWIFTColumn0); + var zmianaColumn33 = new Column("Zmiana", "datetime", sklepBankTable); + sklepBankTable.Columns.Add("Zmiana", zmianaColumn33); + var pK_SklepBank = new UniqueConstraint("PK_SklepBank", sklepBankTable, new[] { sklepIdColumn6, sklepBankIdColumn }); + sklepBankTable.PrimaryKey = pK_SklepBank; + var pK_SklepBankUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepBank", + new[] { "SklepId", "SklepBankId" }); + pK_SklepBank.MappedKeys.Add(pK_SklepBankUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepBankUc).Add(pK_SklepBank); + sklepBankTable.UniqueConstraints.Add("PK_SklepBank", pK_SklepBank); + relationalModel.Tables.Add(("SklepBank", null), sklepBankTable); + var sklepBankTableMapping = new TableMapping(sklepBank, sklepBankTable, true); + sklepBankTable.AddTypeMapping(sklepBankTableMapping, false); + tableMappings161.Add(sklepBankTableMapping); + RelationalModel.CreateColumnMapping(sklepBankIdColumn, sklepBank.FindProperty("SklepBankId")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn6, sklepBank.FindProperty("SklepId")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(adresColumn0, sklepBank.FindProperty("Adres")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn27, sklepBank.FindProperty("Aktywny")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(bankIdColumn2, sklepBank.FindProperty("BankId")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn36, sklepBank.FindProperty("Nazwa")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(nrRozliBankColumn0, sklepBank.FindProperty("NrRozliBank")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(sWIFTColumn0, sklepBank.FindProperty("SWIFT")!, sklepBankTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn33, sklepBank.FindProperty("Zmiana")!, sklepBankTableMapping); + + var sklepDefinicjaKodu = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDefinicjaKodu")!; + + var defaultTableMappings162 = new List>(); + sklepDefinicjaKodu.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings162); + var blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDefinicjaKodu", null, relationalModel); + var aktywnyColumnBase28 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("Aktywny", aktywnyColumnBase28); + var dKIdColumnBase1 = new ColumnBase("DKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("DKId", dKIdColumnBase1); + var dataDoColumnBase2 = new ColumnBase("DataDo", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("DataDo", dataDoColumnBase2); + var dataOdColumnBase2 = new ColumnBase("DataOd", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("DataOd", dataOdColumnBase2); + var nazwaColumnBase37 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("Nazwa", nazwaColumnBase37); + var sklepDKIdColumnBase = new ColumnBase("SklepDKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("SklepDKId", sklepDKIdColumnBase); + var sklepIdColumnBase7 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("SklepId", sklepIdColumnBase7); + var typColumnBase21 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("Typ", typColumnBase21); + var zmianaColumnBase34 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.Columns.Add("Zmiana", zmianaColumnBase34); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDefinicjaKodu", blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase = new TableMappingBase(sklepDefinicjaKodu, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase, false); + defaultTableMappings162.Add(blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDKIdColumnBase, sklepDefinicjaKodu.FindProperty("SklepDKId")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase7, sklepDefinicjaKodu.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase28, sklepDefinicjaKodu.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dKIdColumnBase1, sklepDefinicjaKodu.FindProperty("DKId")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDoColumnBase2, sklepDefinicjaKodu.FindProperty("DataDo")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataOdColumnBase2, sklepDefinicjaKodu.FindProperty("DataOd")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase37, sklepDefinicjaKodu.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase21, sklepDefinicjaKodu.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase34, sklepDefinicjaKodu.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepDefinicjaKoduMappingBase); + + var tableMappings162 = new List(); + sklepDefinicjaKodu.SetRuntimeAnnotation("Relational:TableMappings", tableMappings162); + var sklepDefinicjaKoduTable = new Table("SklepDefinicjaKodu", null, relationalModel); + var sklepIdColumn7 = new Column("SklepId", "numeric(9,0)", sklepDefinicjaKoduTable); + sklepDefinicjaKoduTable.Columns.Add("SklepId", sklepIdColumn7); + var sklepDKIdColumn = new Column("SklepDKId", "numeric(9,0)", sklepDefinicjaKoduTable); + sklepDefinicjaKoduTable.Columns.Add("SklepDKId", sklepDKIdColumn); + var aktywnyColumn28 = new Column("Aktywny", "smallint", sklepDefinicjaKoduTable); + sklepDefinicjaKoduTable.Columns.Add("Aktywny", aktywnyColumn28); + var dKIdColumn1 = new Column("DKId", "numeric(9,0)", sklepDefinicjaKoduTable) + { + IsNullable = true + }; + sklepDefinicjaKoduTable.Columns.Add("DKId", dKIdColumn1); + var dataDoColumn2 = new Column("DataDo", "datetime", sklepDefinicjaKoduTable) + { + IsNullable = true + }; + sklepDefinicjaKoduTable.Columns.Add("DataDo", dataDoColumn2); + var dataOdColumn2 = new Column("DataOd", "datetime", sklepDefinicjaKoduTable) + { + IsNullable = true + }; + sklepDefinicjaKoduTable.Columns.Add("DataOd", dataOdColumn2); + var nazwaColumn37 = new Column("Nazwa", "varchar(120)", sklepDefinicjaKoduTable); + sklepDefinicjaKoduTable.Columns.Add("Nazwa", nazwaColumn37); + var typColumn21 = new Column("Typ", "smallint", sklepDefinicjaKoduTable); + sklepDefinicjaKoduTable.Columns.Add("Typ", typColumn21); + var zmianaColumn34 = new Column("Zmiana", "datetime", sklepDefinicjaKoduTable); + sklepDefinicjaKoduTable.Columns.Add("Zmiana", zmianaColumn34); + var pK_SKDEFKODU = new UniqueConstraint("PK_SKDEFKODU", sklepDefinicjaKoduTable, new[] { sklepIdColumn7, sklepDKIdColumn }); + sklepDefinicjaKoduTable.PrimaryKey = pK_SKDEFKODU; + var pK_SKDEFKODUUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDefinicjaKodu", + new[] { "SklepId", "SklepDKId" }); + pK_SKDEFKODU.MappedKeys.Add(pK_SKDEFKODUUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKDEFKODUUc).Add(pK_SKDEFKODU); + sklepDefinicjaKoduTable.UniqueConstraints.Add("PK_SKDEFKODU", pK_SKDEFKODU); + relationalModel.Tables.Add(("SklepDefinicjaKodu", null), sklepDefinicjaKoduTable); + var sklepDefinicjaKoduTableMapping = new TableMapping(sklepDefinicjaKodu, sklepDefinicjaKoduTable, true); + sklepDefinicjaKoduTable.AddTypeMapping(sklepDefinicjaKoduTableMapping, false); + tableMappings162.Add(sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(sklepDKIdColumn, sklepDefinicjaKodu.FindProperty("SklepDKId")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn7, sklepDefinicjaKodu.FindProperty("SklepId")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn28, sklepDefinicjaKodu.FindProperty("Aktywny")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(dKIdColumn1, sklepDefinicjaKodu.FindProperty("DKId")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(dataDoColumn2, sklepDefinicjaKodu.FindProperty("DataDo")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(dataOdColumn2, sklepDefinicjaKodu.FindProperty("DataOd")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn37, sklepDefinicjaKodu.FindProperty("Nazwa")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(typColumn21, sklepDefinicjaKodu.FindProperty("Typ")!, sklepDefinicjaKoduTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn34, sklepDefinicjaKodu.FindProperty("Zmiana")!, sklepDefinicjaKoduTableMapping); + + var sklepDlugiZasob = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDlugiZasob")!; + + var defaultTableMappings163 = new List>(); + sklepDlugiZasob.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings163); + var blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDlugiZasob", null, relationalModel); + var sklepIdColumnBase8 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase.Columns.Add("SklepId", sklepIdColumnBase8); + var sklepWersjaColumnBase = new ColumnBase("SklepWersja", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase.Columns.Add("SklepWersja", sklepWersjaColumnBase); + var sklepZasobIdColumnBase = new ColumnBase("SklepZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase.Columns.Add("SklepZasobId", sklepZasobIdColumnBase); + var zasobIdColumnBase2 = new ColumnBase("ZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase.Columns.Add("ZasobId", zasobIdColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDlugiZasob", blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobMappingBase = new TableMappingBase(sklepDlugiZasob, blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobMappingBase, false); + defaultTableMappings163.Add(blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase8, sklepDlugiZasob.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zasobIdColumnBase2, sklepDlugiZasob.FindProperty("ZasobId")!, blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWersjaColumnBase, sklepDlugiZasob.FindProperty("SklepWersja")!, blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZasobIdColumnBase, sklepDlugiZasob.FindProperty("SklepZasobId")!, blinkBackofficeServicesPcmDbEntitiesSklepDlugiZasobMappingBase); + + var tableMappings163 = new List(); + sklepDlugiZasob.SetRuntimeAnnotation("Relational:TableMappings", tableMappings163); + var sklepDlugiZasobTable = new Table("SklepDlugiZasob", null, relationalModel); + var zasobIdColumn2 = new Column("ZasobId", "numeric(9,0)", sklepDlugiZasobTable); + sklepDlugiZasobTable.Columns.Add("ZasobId", zasobIdColumn2); + var sklepIdColumn8 = new Column("SklepId", "numeric(9,0)", sklepDlugiZasobTable); + sklepDlugiZasobTable.Columns.Add("SklepId", sklepIdColumn8); + var sklepWersjaColumn = new Column("SklepWersja", "varchar(40)", sklepDlugiZasobTable); + sklepDlugiZasobTable.Columns.Add("SklepWersja", sklepWersjaColumn); + var sklepZasobIdColumn = new Column("SklepZasobId", "numeric(9,0)", sklepDlugiZasobTable); + sklepDlugiZasobTable.Columns.Add("SklepZasobId", sklepZasobIdColumn); + var pK_SklepDlugiZasob = new UniqueConstraint("PK_SklepDlugiZasob", sklepDlugiZasobTable, new[] { zasobIdColumn2, sklepIdColumn8 }); + sklepDlugiZasobTable.PrimaryKey = pK_SklepDlugiZasob; + var pK_SklepDlugiZasobUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDlugiZasob", + new[] { "ZasobId", "SklepId" }); + pK_SklepDlugiZasob.MappedKeys.Add(pK_SklepDlugiZasobUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepDlugiZasobUc).Add(pK_SklepDlugiZasob); + sklepDlugiZasobTable.UniqueConstraints.Add("PK_SklepDlugiZasob", pK_SklepDlugiZasob); + var ixSklepDlugiZasob_SklepIdent = new TableIndex( + "IxSklepDlugiZasob_SklepIdent", sklepDlugiZasobTable, new[] { sklepIdColumn8, sklepZasobIdColumn }, false); + var ixSklepDlugiZasob_SklepIdentIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDlugiZasob", + "IxSklepDlugiZasob_SklepIdent"); + ixSklepDlugiZasob_SklepIdent.MappedIndexes.Add(ixSklepDlugiZasob_SklepIdentIx); + RelationalModel.GetOrCreateTableIndexes(ixSklepDlugiZasob_SklepIdentIx).Add(ixSklepDlugiZasob_SklepIdent); + sklepDlugiZasobTable.Indexes.Add("IxSklepDlugiZasob_SklepIdent", ixSklepDlugiZasob_SklepIdent); + relationalModel.Tables.Add(("SklepDlugiZasob", null), sklepDlugiZasobTable); + var sklepDlugiZasobTableMapping = new TableMapping(sklepDlugiZasob, sklepDlugiZasobTable, true); + sklepDlugiZasobTable.AddTypeMapping(sklepDlugiZasobTableMapping, false); + tableMappings163.Add(sklepDlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn8, sklepDlugiZasob.FindProperty("SklepId")!, sklepDlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(zasobIdColumn2, sklepDlugiZasob.FindProperty("ZasobId")!, sklepDlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(sklepWersjaColumn, sklepDlugiZasob.FindProperty("SklepWersja")!, sklepDlugiZasobTableMapping); + RelationalModel.CreateColumnMapping(sklepZasobIdColumn, sklepDlugiZasob.FindProperty("SklepZasobId")!, sklepDlugiZasobTableMapping); + + var sklepDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDok")!; + + var defaultTableMappings164 = new List>(); + sklepDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings164); + var blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDok", null, relationalModel); + var aktywnyColumnBase29 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Aktywny", aktywnyColumnBase29); + var centrDokIdColumnBase0 = new ColumnBase("CentrDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("CentrDokId", centrDokIdColumnBase0); + var centrEksportFKColumnBase = new ColumnBase("CentrEksportFK", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("CentrEksportFK", centrEksportFKColumnBase); + var cenySpBruttoColumnBase0 = new ColumnBase("CenySpBrutto", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("CenySpBrutto", cenySpBruttoColumnBase0); + var cenyZakBruttoColumnBase0 = new ColumnBase("CenyZakBrutto", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("CenyZakBrutto", cenyZakBruttoColumnBase0); + var dataColumnBase5 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Data", dataColumnBase5); + var dataDodColumnBase0 = new ColumnBase("DataDod", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("DataDod", dataDodColumnBase0); + var dataPomColumnBase0 = new ColumnBase("DataPom", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("DataPom", dataPomColumnBase0); + var doZaplatyColumnBase0 = new ColumnBase("DoZaplaty", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("DoZaplaty", doZaplatyColumnBase0); + var dokIdColumnBase21 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("DokId", dokIdColumnBase21); + var eksportFKColumnBase1 = new ColumnBase("EksportFK", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("EksportFK", eksportFKColumnBase1); + var formaPlatColumnBase1 = new ColumnBase("FormaPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("FormaPlat", formaPlatColumnBase1); + var kolejnyWDniuColumnBase1 = new ColumnBase("KolejnyWDniu", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("KolejnyWDniu", kolejnyWDniuColumnBase1); + var kursColumnBase5 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kurs", kursColumnBase5); + var kwota1ColumnBase0 = new ColumnBase("Kwota1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota1", kwota1ColumnBase0); + var kwota10ColumnBase0 = new ColumnBase("Kwota10", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota10", kwota10ColumnBase0); + var kwota11ColumnBase0 = new ColumnBase("Kwota11", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota11", kwota11ColumnBase0); + var kwota12ColumnBase0 = new ColumnBase("Kwota12", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota12", kwota12ColumnBase0); + var kwota2ColumnBase0 = new ColumnBase("Kwota2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota2", kwota2ColumnBase0); + var kwota3ColumnBase0 = new ColumnBase("Kwota3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota3", kwota3ColumnBase0); + var kwota4ColumnBase0 = new ColumnBase("Kwota4", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota4", kwota4ColumnBase0); + var kwota5ColumnBase0 = new ColumnBase("Kwota5", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota5", kwota5ColumnBase0); + var kwota6ColumnBase0 = new ColumnBase("Kwota6", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota6", kwota6ColumnBase0); + var kwota7ColumnBase0 = new ColumnBase("Kwota7", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota7", kwota7ColumnBase0); + var kwota8ColumnBase0 = new ColumnBase("Kwota8", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota8", kwota8ColumnBase0); + var kwota9ColumnBase0 = new ColumnBase("Kwota9", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Kwota9", kwota9ColumnBase0); + var nettoColumnBase3 = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Netto", nettoColumnBase3); + var nettoDetColumnBase2 = new ColumnBase("NettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NettoDet", nettoDetColumnBase2); + var nettoDetUslugiColumnBase0 = new ColumnBase("NettoDetUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NettoDetUslugi", nettoDetUslugiColumnBase0); + var nettoMagColumnBase2 = new ColumnBase("NettoMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NettoMag", nettoMagColumnBase2); + var nettoMagUslugiColumnBase0 = new ColumnBase("NettoMagUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NettoMagUslugi", nettoMagUslugiColumnBase0); + var nettoUslugiColumnBase0 = new ColumnBase("NettoUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NettoUslugi", nettoUslugiColumnBase0); + var nrDokColumnBase0 = new ColumnBase("NrDok", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NrDok", nrDokColumnBase0); + var nrKolejnyColumnBase0 = new ColumnBase("NrKolejny", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NrKolejny", nrKolejnyColumnBase0); + var nrKolejnyMagColumnBase0 = new ColumnBase("NrKolejnyMag", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("NrKolejnyMag", nrKolejnyMagColumnBase0); + var opcja1ColumnBase2 = new ColumnBase("Opcja1", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja1", opcja1ColumnBase2); + var opcja2ColumnBase4 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja2", opcja2ColumnBase4); + var opcja3ColumnBase0 = new ColumnBase("Opcja3", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja3", opcja3ColumnBase0); + var opcja4ColumnBase0 = new ColumnBase("Opcja4", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja4", opcja4ColumnBase0); + var opcja5ColumnBase0 = new ColumnBase("Opcja5", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja5", opcja5ColumnBase0); + var opcja6ColumnBase0 = new ColumnBase("Opcja6", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja6", opcja6ColumnBase0); + var opcja7ColumnBase0 = new ColumnBase("Opcja7", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja7", opcja7ColumnBase0); + var opcja8ColumnBase0 = new ColumnBase("Opcja8", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Opcja8", opcja8ColumnBase0); + var param1ColumnBase7 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Param1", param1ColumnBase7); + var param2ColumnBase5 = new ColumnBase("Param2", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Param2", param2ColumnBase5); + var param3ColumnBase3 = new ColumnBase("Param3", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Param3", param3ColumnBase3); + var param4ColumnBase0 = new ColumnBase("Param4", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Param4", param4ColumnBase0); + var param5ColumnBase0 = new ColumnBase("Param5", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Param5", param5ColumnBase0); + var param6ColumnBase0 = new ColumnBase("Param6", "int", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Param6", param6ColumnBase0); + var podatekColumnBase3 = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Podatek", podatekColumnBase3); + var podatekDetColumnBase2 = new ColumnBase("PodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("PodatekDet", podatekDetColumnBase2); + var podatekDetUslugiColumnBase0 = new ColumnBase("PodatekDetUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("PodatekDetUslugi", podatekDetUslugiColumnBase0); + var podatekMagColumnBase2 = new ColumnBase("PodatekMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("PodatekMag", podatekMagColumnBase2); + var podatekMagUslugiColumnBase0 = new ColumnBase("PodatekMagUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("PodatekMagUslugi", podatekMagUslugiColumnBase0); + var podatekUslugiColumnBase0 = new ColumnBase("PodatekUslugi", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("PodatekUslugi", podatekUslugiColumnBase0); + var poziomCenColumnBase4 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("PoziomCen", poziomCenColumnBase4); + var rabatProcColumnBase1 = new ColumnBase("RabatProc", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("RabatProc", rabatProcColumnBase1); + var razemColumnBase0 = new ColumnBase("Razem", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Razem", razemColumnBase0); + var sklepDokIdColumnBase = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase); + var sklepIdColumnBase9 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepId", sklepIdColumnBase9); + var sklepKBIdColumnBase = new ColumnBase("SklepKBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepKBId", sklepKBIdColumnBase); + var sklepKasaIdColumnBase = new ColumnBase("SklepKasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepKasaId", sklepKasaIdColumnBase); + var sklepKontrIdColumnBase = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase); + var sklepMagIdColumnBase = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase); + var sklepPlatnikIdColumnBase = new ColumnBase("SklepPlatnikId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepPlatnikId", sklepPlatnikIdColumnBase); + var sklepUzIdColumnBase = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase); + var sklepWalIdColumnBase = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase); + var sklepWalIdPlatnosciColumnBase = new ColumnBase("SklepWalIdPlatnosci", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("SklepWalIdPlatnosci", sklepWalIdPlatnosciColumnBase); + var terminPlatColumnBase0 = new ColumnBase("TerminPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("TerminPlat", terminPlatColumnBase0); + var typDokColumnBase0 = new ColumnBase("TypDok", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("TypDok", typDokColumnBase0); + var zaplaconoColumnBase0 = new ColumnBase("Zaplacono", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Zaplacono", zaplaconoColumnBase0); + var zaplaconoPodatekColumnBase0 = new ColumnBase("ZaplaconoPodatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("ZaplaconoPodatek", zaplaconoPodatekColumnBase0); + var zaplaconoWKasieColumnBase0 = new ColumnBase("ZaplaconoWKasie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("ZaplaconoWKasie", zaplaconoWKasieColumnBase0); + var zmianaColumnBase35 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.Columns.Add("Zmiana", zmianaColumnBase35); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDok", blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase = new TableMappingBase(sklepDok, blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase, false); + defaultTableMappings164.Add(blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase, sklepDok.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase9, sklepDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase29, sklepDok.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrDokIdColumnBase0, sklepDok.FindProperty("CentrDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrEksportFKColumnBase, sklepDok.FindProperty("CentrEksportFK")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenySpBruttoColumnBase0, sklepDok.FindProperty("CenySpBrutto")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenyZakBruttoColumnBase0, sklepDok.FindProperty("CenyZakBrutto")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase5, sklepDok.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDodColumnBase0, sklepDok.FindProperty("DataDod")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataPomColumnBase0, sklepDok.FindProperty("DataPom")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)doZaplatyColumnBase0, sklepDok.FindProperty("DoZaplaty")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase21, sklepDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)eksportFKColumnBase1, sklepDok.FindProperty("EksportFK")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaPlatColumnBase1, sklepDok.FindProperty("FormaPlat")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyWDniuColumnBase1, sklepDok.FindProperty("KolejnyWDniu")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase5, sklepDok.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota1ColumnBase0, sklepDok.FindProperty("Kwota1")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota10ColumnBase0, sklepDok.FindProperty("Kwota10")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota11ColumnBase0, sklepDok.FindProperty("Kwota11")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota12ColumnBase0, sklepDok.FindProperty("Kwota12")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota2ColumnBase0, sklepDok.FindProperty("Kwota2")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota3ColumnBase0, sklepDok.FindProperty("Kwota3")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota4ColumnBase0, sklepDok.FindProperty("Kwota4")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota5ColumnBase0, sklepDok.FindProperty("Kwota5")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota6ColumnBase0, sklepDok.FindProperty("Kwota6")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota7ColumnBase0, sklepDok.FindProperty("Kwota7")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota8ColumnBase0, sklepDok.FindProperty("Kwota8")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwota9ColumnBase0, sklepDok.FindProperty("Kwota9")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase3, sklepDok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetColumnBase2, sklepDok.FindProperty("NettoDet")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetUslugiColumnBase0, sklepDok.FindProperty("NettoDetUslugi")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagColumnBase2, sklepDok.FindProperty("NettoMag")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagUslugiColumnBase0, sklepDok.FindProperty("NettoMagUslugi")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoUslugiColumnBase0, sklepDok.FindProperty("NettoUslugi")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDokColumnBase0, sklepDok.FindProperty("NrDok")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrKolejnyColumnBase0, sklepDok.FindProperty("NrKolejny")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrKolejnyMagColumnBase0, sklepDok.FindProperty("NrKolejnyMag")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja1ColumnBase2, sklepDok.FindProperty("Opcja1")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase4, sklepDok.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja3ColumnBase0, sklepDok.FindProperty("Opcja3")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja4ColumnBase0, sklepDok.FindProperty("Opcja4")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja5ColumnBase0, sklepDok.FindProperty("Opcja5")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja6ColumnBase0, sklepDok.FindProperty("Opcja6")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja7ColumnBase0, sklepDok.FindProperty("Opcja7")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja8ColumnBase0, sklepDok.FindProperty("Opcja8")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase7, sklepDok.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase5, sklepDok.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase3, sklepDok.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param4ColumnBase0, sklepDok.FindProperty("Param4")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param5ColumnBase0, sklepDok.FindProperty("Param5")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param6ColumnBase0, sklepDok.FindProperty("Param6")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase3, sklepDok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetColumnBase2, sklepDok.FindProperty("PodatekDet")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetUslugiColumnBase0, sklepDok.FindProperty("PodatekDetUslugi")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagColumnBase2, sklepDok.FindProperty("PodatekMag")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagUslugiColumnBase0, sklepDok.FindProperty("PodatekMagUslugi")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekUslugiColumnBase0, sklepDok.FindProperty("PodatekUslugi")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase4, sklepDok.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatProcColumnBase1, sklepDok.FindProperty("RabatProc")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)razemColumnBase0, sklepDok.FindProperty("Razem")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKBIdColumnBase, sklepDok.FindProperty("SklepKBId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKasaIdColumnBase, sklepDok.FindProperty("SklepKasaId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase, sklepDok.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase, sklepDok.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepPlatnikIdColumnBase, sklepDok.FindProperty("SklepPlatnikId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase, sklepDok.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase, sklepDok.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdPlatnosciColumnBase, sklepDok.FindProperty("SklepWalIdPlatnosci")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)terminPlatColumnBase0, sklepDok.FindProperty("TerminPlat")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typDokColumnBase0, sklepDok.FindProperty("TypDok")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zaplaconoColumnBase0, sklepDok.FindProperty("Zaplacono")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zaplaconoPodatekColumnBase0, sklepDok.FindProperty("ZaplaconoPodatek")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zaplaconoWKasieColumnBase0, sklepDok.FindProperty("ZaplaconoWKasie")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase35, sklepDok.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepDokMappingBase); + + var tableMappings164 = new List(); + sklepDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings164); + var sklepDokTable = new Table("SklepDok", null, relationalModel); + var sklepIdColumn9 = new Column("SklepId", "numeric(9,0)", sklepDokTable); + sklepDokTable.Columns.Add("SklepId", sklepIdColumn9); + var sklepDokIdColumn = new Column("SklepDokId", "numeric(9,0)", sklepDokTable); + sklepDokTable.Columns.Add("SklepDokId", sklepDokIdColumn); + var aktywnyColumn29 = new Column("Aktywny", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("Aktywny", aktywnyColumn29); + var centrDokIdColumn0 = new Column("CentrDokId", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("CentrDokId", centrDokIdColumn0); + var centrEksportFKColumn = new Column("CentrEksportFK", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("CentrEksportFK", centrEksportFKColumn); + var cenySpBruttoColumn0 = new Column("CenySpBrutto", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("CenySpBrutto", cenySpBruttoColumn0); + var cenyZakBruttoColumn0 = new Column("CenyZakBrutto", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("CenyZakBrutto", cenyZakBruttoColumn0); + var dataColumn5 = new Column("Data", "datetime", sklepDokTable); + sklepDokTable.Columns.Add("Data", dataColumn5); + var dataDodColumn0 = new Column("DataDod", "datetime", sklepDokTable); + sklepDokTable.Columns.Add("DataDod", dataDodColumn0); + var dataPomColumn0 = new Column("DataPom", "datetime", sklepDokTable); + sklepDokTable.Columns.Add("DataPom", dataPomColumn0); + var doZaplatyColumn0 = new Column("DoZaplaty", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("DoZaplaty", doZaplatyColumn0); + var dokIdColumn21 = new Column("DokId", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("DokId", dokIdColumn21); + var eksportFKColumn1 = new Column("EksportFK", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("EksportFK", eksportFKColumn1); + var formaPlatColumn1 = new Column("FormaPlat", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("FormaPlat", formaPlatColumn1); + var kolejnyWDniuColumn1 = new Column("KolejnyWDniu", "int", sklepDokTable); + sklepDokTable.Columns.Add("KolejnyWDniu", kolejnyWDniuColumn1); + var kursColumn5 = new Column("Kurs", "decimal(15,4)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Kurs", kursColumn5); + var kwota1Column0 = new Column("Kwota1", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota1", kwota1Column0); + var kwota10Column0 = new Column("Kwota10", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota10", kwota10Column0); + var kwota11Column0 = new Column("Kwota11", "decimal(15,4)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Kwota11", kwota11Column0); + var kwota12Column0 = new Column("Kwota12", "decimal(15,4)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Kwota12", kwota12Column0); + var kwota2Column0 = new Column("Kwota2", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota2", kwota2Column0); + var kwota3Column0 = new Column("Kwota3", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota3", kwota3Column0); + var kwota4Column0 = new Column("Kwota4", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota4", kwota4Column0); + var kwota5Column0 = new Column("Kwota5", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota5", kwota5Column0); + var kwota6Column0 = new Column("Kwota6", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota6", kwota6Column0); + var kwota7Column0 = new Column("Kwota7", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota7", kwota7Column0); + var kwota8Column0 = new Column("Kwota8", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota8", kwota8Column0); + var kwota9Column0 = new Column("Kwota9", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Kwota9", kwota9Column0); + var nettoColumn3 = new Column("Netto", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Netto", nettoColumn3); + var nettoDetColumn2 = new Column("NettoDet", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("NettoDet", nettoDetColumn2); + var nettoDetUslugiColumn0 = new Column("NettoDetUslugi", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("NettoDetUslugi", nettoDetUslugiColumn0); + var nettoMagColumn2 = new Column("NettoMag", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("NettoMag", nettoMagColumn2); + var nettoMagUslugiColumn0 = new Column("NettoMagUslugi", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("NettoMagUslugi", nettoMagUslugiColumn0); + var nettoUslugiColumn0 = new Column("NettoUslugi", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("NettoUslugi", nettoUslugiColumn0); + var nrDokColumn0 = new Column("NrDok", "varchar(60)", sklepDokTable); + sklepDokTable.Columns.Add("NrDok", nrDokColumn0); + var nrKolejnyColumn0 = new Column("NrKolejny", "int", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("NrKolejny", nrKolejnyColumn0); + var nrKolejnyMagColumn0 = new Column("NrKolejnyMag", "int", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("NrKolejnyMag", nrKolejnyMagColumn0); + var opcja1Column2 = new Column("Opcja1", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("Opcja1", opcja1Column2); + var opcja2Column4 = new Column("Opcja2", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("Opcja2", opcja2Column4); + var opcja3Column0 = new Column("Opcja3", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("Opcja3", opcja3Column0); + var opcja4Column0 = new Column("Opcja4", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("Opcja4", opcja4Column0); + var opcja5Column0 = new Column("Opcja5", "smallint", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Opcja5", opcja5Column0); + var opcja6Column0 = new Column("Opcja6", "smallint", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Opcja6", opcja6Column0); + var opcja7Column0 = new Column("Opcja7", "smallint", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Opcja7", opcja7Column0); + var opcja8Column0 = new Column("Opcja8", "smallint", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Opcja8", opcja8Column0); + var param1Column7 = new Column("Param1", "int", sklepDokTable); + sklepDokTable.Columns.Add("Param1", param1Column7); + var param2Column5 = new Column("Param2", "int", sklepDokTable); + sklepDokTable.Columns.Add("Param2", param2Column5); + var param3Column3 = new Column("Param3", "int", sklepDokTable); + sklepDokTable.Columns.Add("Param3", param3Column3); + var param4Column0 = new Column("Param4", "int", sklepDokTable); + sklepDokTable.Columns.Add("Param4", param4Column0); + var param5Column0 = new Column("Param5", "int", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Param5", param5Column0); + var param6Column0 = new Column("Param6", "int", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("Param6", param6Column0); + var podatekColumn3 = new Column("Podatek", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Podatek", podatekColumn3); + var podatekDetColumn2 = new Column("PodatekDet", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("PodatekDet", podatekDetColumn2); + var podatekDetUslugiColumn0 = new Column("PodatekDetUslugi", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("PodatekDetUslugi", podatekDetUslugiColumn0); + var podatekMagColumn2 = new Column("PodatekMag", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("PodatekMag", podatekMagColumn2); + var podatekMagUslugiColumn0 = new Column("PodatekMagUslugi", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("PodatekMagUslugi", podatekMagUslugiColumn0); + var podatekUslugiColumn0 = new Column("PodatekUslugi", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("PodatekUslugi", podatekUslugiColumn0); + var poziomCenColumn4 = new Column("PoziomCen", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("PoziomCen", poziomCenColumn4); + var rabatProcColumn1 = new Column("RabatProc", "decimal(10,4)", sklepDokTable); + sklepDokTable.Columns.Add("RabatProc", rabatProcColumn1); + var razemColumn0 = new Column("Razem", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Razem", razemColumn0); + var sklepKBIdColumn = new Column("SklepKBId", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("SklepKBId", sklepKBIdColumn); + var sklepKasaIdColumn = new Column("SklepKasaId", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("SklepKasaId", sklepKasaIdColumn); + var sklepKontrIdColumn = new Column("SklepKontrId", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("SklepKontrId", sklepKontrIdColumn); + var sklepMagIdColumn = new Column("SklepMagId", "numeric(9,0)", sklepDokTable); + sklepDokTable.Columns.Add("SklepMagId", sklepMagIdColumn); + var sklepPlatnikIdColumn = new Column("SklepPlatnikId", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("SklepPlatnikId", sklepPlatnikIdColumn); + var sklepUzIdColumn = new Column("SklepUzId", "numeric(9,0)", sklepDokTable); + sklepDokTable.Columns.Add("SklepUzId", sklepUzIdColumn); + var sklepWalIdColumn = new Column("SklepWalId", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("SklepWalId", sklepWalIdColumn); + var sklepWalIdPlatnosciColumn = new Column("SklepWalIdPlatnosci", "numeric(9,0)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("SklepWalIdPlatnosci", sklepWalIdPlatnosciColumn); + var terminPlatColumn0 = new Column("TerminPlat", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("TerminPlat", terminPlatColumn0); + var typDokColumn0 = new Column("TypDok", "smallint", sklepDokTable); + sklepDokTable.Columns.Add("TypDok", typDokColumn0); + var zaplaconoColumn0 = new Column("Zaplacono", "decimal(15,4)", sklepDokTable); + sklepDokTable.Columns.Add("Zaplacono", zaplaconoColumn0); + var zaplaconoPodatekColumn0 = new Column("ZaplaconoPodatek", "decimal(15,4)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("ZaplaconoPodatek", zaplaconoPodatekColumn0); + var zaplaconoWKasieColumn0 = new Column("ZaplaconoWKasie", "decimal(15,4)", sklepDokTable) + { + IsNullable = true + }; + sklepDokTable.Columns.Add("ZaplaconoWKasie", zaplaconoWKasieColumn0); + var zmianaColumn35 = new Column("Zmiana", "datetime", sklepDokTable); + sklepDokTable.Columns.Add("Zmiana", zmianaColumn35); + var pK_SKLEPDOK = new UniqueConstraint("PK_SKLEPDOK", sklepDokTable, new[] { sklepIdColumn9, sklepDokIdColumn }); + sklepDokTable.PrimaryKey = pK_SKLEPDOK; + var pK_SKLEPDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + pK_SKLEPDOK.MappedKeys.Add(pK_SKLEPDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDOKUc).Add(pK_SKLEPDOK); + sklepDokTable.UniqueConstraints.Add("PK_SKLEPDOK", pK_SKLEPDOK); + var idx_SkDokId = new TableIndex( + "idx_SkDokId", sklepDokTable, new[] { dokIdColumn21 }, false); + var idx_SkDokIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokId"); + idx_SkDokId.MappedIndexes.Add(idx_SkDokIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokIdIx).Add(idx_SkDokId); + sklepDokTable.Indexes.Add("idx_SkDokId", idx_SkDokId); + var idx_SkDokKasa = new TableIndex( + "idx_SkDokKasa", sklepDokTable, new[] { sklepIdColumn9, sklepKasaIdColumn }, false); + var idx_SkDokKasaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokKasa"); + idx_SkDokKasa.MappedIndexes.Add(idx_SkDokKasaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokKasaIx).Add(idx_SkDokKasa); + sklepDokTable.Indexes.Add("idx_SkDokKasa", idx_SkDokKasa); + var idx_SkDokKth = new TableIndex( + "idx_SkDokKth", sklepDokTable, new[] { sklepIdColumn9, sklepKontrIdColumn }, false); + var idx_SkDokKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokKth"); + idx_SkDokKth.MappedIndexes.Add(idx_SkDokKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokKthIx).Add(idx_SkDokKth); + sklepDokTable.Indexes.Add("idx_SkDokKth", idx_SkDokKth); + var idx_SkDokMag = new TableIndex( + "idx_SkDokMag", sklepDokTable, new[] { sklepIdColumn9, sklepMagIdColumn }, false); + var idx_SkDokMagIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokMag"); + idx_SkDokMag.MappedIndexes.Add(idx_SkDokMagIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokMagIx).Add(idx_SkDokMag); + sklepDokTable.Indexes.Add("idx_SkDokMag", idx_SkDokMag); + var idx_SkDokPlatKth = new TableIndex( + "idx_SkDokPlatKth", sklepDokTable, new[] { sklepIdColumn9, sklepPlatnikIdColumn }, false); + var idx_SkDokPlatKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokPlatKth"); + idx_SkDokPlatKth.MappedIndexes.Add(idx_SkDokPlatKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokPlatKthIx).Add(idx_SkDokPlatKth); + sklepDokTable.Indexes.Add("idx_SkDokPlatKth", idx_SkDokPlatKth); + var idx_SkDokTypDokDataKolejnyWDniu = new TableIndex( + "idx_SkDokTypDokDataKolejnyWDniu", sklepDokTable, new[] { typDokColumn0, dataColumn5, kolejnyWDniuColumn1 }, false); + var idx_SkDokTypDokDataKolejnyWDniuIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokTypDokDataKolejnyWDniu"); + idx_SkDokTypDokDataKolejnyWDniu.MappedIndexes.Add(idx_SkDokTypDokDataKolejnyWDniuIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokTypDokDataKolejnyWDniuIx).Add(idx_SkDokTypDokDataKolejnyWDniu); + sklepDokTable.Indexes.Add("idx_SkDokTypDokDataKolejnyWDniu", idx_SkDokTypDokDataKolejnyWDniu); + var idx_SkDokUz = new TableIndex( + "idx_SkDokUz", sklepDokTable, new[] { sklepIdColumn9, sklepUzIdColumn }, false); + var idx_SkDokUzIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokUz"); + idx_SkDokUz.MappedIndexes.Add(idx_SkDokUzIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokUzIx).Add(idx_SkDokUz); + sklepDokTable.Indexes.Add("idx_SkDokUz", idx_SkDokUz); + var idx_SkDokWal = new TableIndex( + "idx_SkDokWal", sklepDokTable, new[] { sklepIdColumn9, sklepWalIdColumn }, false); + var idx_SkDokWalIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokWal"); + idx_SkDokWal.MappedIndexes.Add(idx_SkDokWalIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokWalIx).Add(idx_SkDokWal); + sklepDokTable.Indexes.Add("idx_SkDokWal", idx_SkDokWal); + var idx_SkDokZmiana = new TableIndex( + "idx_SkDokZmiana", sklepDokTable, new[] { zmianaColumn35 }, false); + var idx_SkDokZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SkDokZmiana"); + idx_SkDokZmiana.MappedIndexes.Add(idx_SkDokZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDokZmianaIx).Add(idx_SkDokZmiana); + sklepDokTable.Indexes.Add("idx_SkDokZmiana", idx_SkDokZmiana); + var idx_SklepDataKolejnyWDniu = new TableIndex( + "idx_SklepDataKolejnyWDniu", sklepDokTable, new[] { sklepIdColumn9, dataColumn5, kolejnyWDniuColumn1 }, false); + var idx_SklepDataKolejnyWDniuIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + "idx_SklepDataKolejnyWDniu"); + idx_SklepDataKolejnyWDniu.MappedIndexes.Add(idx_SklepDataKolejnyWDniuIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepDataKolejnyWDniuIx).Add(idx_SklepDataKolejnyWDniu); + sklepDokTable.Indexes.Add("idx_SklepDataKolejnyWDniu", idx_SklepDataKolejnyWDniu); + relationalModel.Tables.Add(("SklepDok", null), sklepDokTable); + var sklepDokTableMapping = new TableMapping(sklepDok, sklepDokTable, true); + sklepDokTable.AddTypeMapping(sklepDokTableMapping, false); + tableMappings164.Add(sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn, sklepDok.FindProperty("SklepDokId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn9, sklepDok.FindProperty("SklepId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn29, sklepDok.FindProperty("Aktywny")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(centrDokIdColumn0, sklepDok.FindProperty("CentrDokId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(centrEksportFKColumn, sklepDok.FindProperty("CentrEksportFK")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(cenySpBruttoColumn0, sklepDok.FindProperty("CenySpBrutto")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(cenyZakBruttoColumn0, sklepDok.FindProperty("CenyZakBrutto")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(dataColumn5, sklepDok.FindProperty("Data")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(dataDodColumn0, sklepDok.FindProperty("DataDod")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(dataPomColumn0, sklepDok.FindProperty("DataPom")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(doZaplatyColumn0, sklepDok.FindProperty("DoZaplaty")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn21, sklepDok.FindProperty("DokId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(eksportFKColumn1, sklepDok.FindProperty("EksportFK")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(formaPlatColumn1, sklepDok.FindProperty("FormaPlat")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kolejnyWDniuColumn1, sklepDok.FindProperty("KolejnyWDniu")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kursColumn5, sklepDok.FindProperty("Kurs")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota1Column0, sklepDok.FindProperty("Kwota1")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota10Column0, sklepDok.FindProperty("Kwota10")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota11Column0, sklepDok.FindProperty("Kwota11")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota12Column0, sklepDok.FindProperty("Kwota12")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota2Column0, sklepDok.FindProperty("Kwota2")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota3Column0, sklepDok.FindProperty("Kwota3")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota4Column0, sklepDok.FindProperty("Kwota4")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota5Column0, sklepDok.FindProperty("Kwota5")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota6Column0, sklepDok.FindProperty("Kwota6")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota7Column0, sklepDok.FindProperty("Kwota7")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota8Column0, sklepDok.FindProperty("Kwota8")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(kwota9Column0, sklepDok.FindProperty("Kwota9")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn3, sklepDok.FindProperty("Netto")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetColumn2, sklepDok.FindProperty("NettoDet")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetUslugiColumn0, sklepDok.FindProperty("NettoDetUslugi")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagColumn2, sklepDok.FindProperty("NettoMag")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagUslugiColumn0, sklepDok.FindProperty("NettoMagUslugi")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nettoUslugiColumn0, sklepDok.FindProperty("NettoUslugi")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nrDokColumn0, sklepDok.FindProperty("NrDok")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nrKolejnyColumn0, sklepDok.FindProperty("NrKolejny")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(nrKolejnyMagColumn0, sklepDok.FindProperty("NrKolejnyMag")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja1Column2, sklepDok.FindProperty("Opcja1")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column4, sklepDok.FindProperty("Opcja2")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja3Column0, sklepDok.FindProperty("Opcja3")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja4Column0, sklepDok.FindProperty("Opcja4")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja5Column0, sklepDok.FindProperty("Opcja5")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja6Column0, sklepDok.FindProperty("Opcja6")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja7Column0, sklepDok.FindProperty("Opcja7")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(opcja8Column0, sklepDok.FindProperty("Opcja8")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(param1Column7, sklepDok.FindProperty("Param1")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(param2Column5, sklepDok.FindProperty("Param2")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(param3Column3, sklepDok.FindProperty("Param3")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(param4Column0, sklepDok.FindProperty("Param4")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(param5Column0, sklepDok.FindProperty("Param5")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(param6Column0, sklepDok.FindProperty("Param6")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn3, sklepDok.FindProperty("Podatek")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetColumn2, sklepDok.FindProperty("PodatekDet")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetUslugiColumn0, sklepDok.FindProperty("PodatekDetUslugi")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagColumn2, sklepDok.FindProperty("PodatekMag")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagUslugiColumn0, sklepDok.FindProperty("PodatekMagUslugi")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(podatekUslugiColumn0, sklepDok.FindProperty("PodatekUslugi")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn4, sklepDok.FindProperty("PoziomCen")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(rabatProcColumn1, sklepDok.FindProperty("RabatProc")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(razemColumn0, sklepDok.FindProperty("Razem")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepKBIdColumn, sklepDok.FindProperty("SklepKBId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepKasaIdColumn, sklepDok.FindProperty("SklepKasaId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn, sklepDok.FindProperty("SklepKontrId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn, sklepDok.FindProperty("SklepMagId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepPlatnikIdColumn, sklepDok.FindProperty("SklepPlatnikId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn, sklepDok.FindProperty("SklepUzId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn, sklepDok.FindProperty("SklepWalId")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdPlatnosciColumn, sklepDok.FindProperty("SklepWalIdPlatnosci")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(terminPlatColumn0, sklepDok.FindProperty("TerminPlat")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(typDokColumn0, sklepDok.FindProperty("TypDok")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(zaplaconoColumn0, sklepDok.FindProperty("Zaplacono")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(zaplaconoPodatekColumn0, sklepDok.FindProperty("ZaplaconoPodatek")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(zaplaconoWKasieColumn0, sklepDok.FindProperty("ZaplaconoWKasie")!, sklepDokTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn35, sklepDok.FindProperty("Zmiana")!, sklepDokTableMapping); + + var sklepDokDodKth = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth")!; + + var defaultTableMappings165 = new List>(); + sklepDokDodKth.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings165); + var blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth", null, relationalModel); + var kwotaColumnBase5 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase.Columns.Add("Kwota", kwotaColumnBase5); + var sklepDokIdColumnBase0 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase0); + var sklepIdColumnBase10 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase.Columns.Add("SklepId", sklepIdColumnBase10); + var sklepKontrIdColumnBase0 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase0); + var znaczenieColumnBase18 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase.Columns.Add("Znaczenie", znaczenieColumnBase18); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth", blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase = new TableMappingBase(sklepDokDodKth, blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase, false); + defaultTableMappings165.Add(blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase0, sklepDokDodKth.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase10, sklepDokDodKth.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase18, sklepDokDodKth.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase5, sklepDokDodKth.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase0, sklepDokDodKth.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokDodKthMappingBase); + + var tableMappings165 = new List(); + sklepDokDodKth.SetRuntimeAnnotation("Relational:TableMappings", tableMappings165); + var sklepDokDodKthTable = new Table("SklepDokDodKth", null, relationalModel); + var sklepIdColumn10 = new Column("SklepId", "numeric(9,0)", sklepDokDodKthTable); + sklepDokDodKthTable.Columns.Add("SklepId", sklepIdColumn10); + var sklepDokIdColumn0 = new Column("SklepDokId", "numeric(9,0)", sklepDokDodKthTable); + sklepDokDodKthTable.Columns.Add("SklepDokId", sklepDokIdColumn0); + var znaczenieColumn18 = new Column("Znaczenie", "smallint", sklepDokDodKthTable); + sklepDokDodKthTable.Columns.Add("Znaczenie", znaczenieColumn18); + var kwotaColumn5 = new Column("Kwota", "decimal(15,4)", sklepDokDodKthTable) + { + IsNullable = true + }; + sklepDokDodKthTable.Columns.Add("Kwota", kwotaColumn5); + var sklepKontrIdColumn0 = new Column("SklepKontrId", "numeric(9,0)", sklepDokDodKthTable); + sklepDokDodKthTable.Columns.Add("SklepKontrId", sklepKontrIdColumn0); + var pK_SKLEPDOKDODKTH = new UniqueConstraint("PK_SKLEPDOKDODKTH", sklepDokDodKthTable, new[] { sklepIdColumn10, sklepDokIdColumn0, znaczenieColumn18 }); + sklepDokDodKthTable.PrimaryKey = pK_SKLEPDOKDODKTH; + var pK_SKLEPDOKDODKTHUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth", + new[] { "SklepId", "SklepDokId", "Znaczenie" }); + pK_SKLEPDOKDODKTH.MappedKeys.Add(pK_SKLEPDOKDODKTHUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDOKDODKTHUc).Add(pK_SKLEPDOKDODKTH); + sklepDokDodKthTable.UniqueConstraints.Add("PK_SKLEPDOKDODKTH", pK_SKLEPDOKDODKTH); + var idx_SkDDKth = new TableIndex( + "idx_SkDDKth", sklepDokDodKthTable, new[] { sklepIdColumn10, sklepKontrIdColumn0 }, false); + var idx_SkDDKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth", + "idx_SkDDKth"); + idx_SkDDKth.MappedIndexes.Add(idx_SkDDKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDDKthIx).Add(idx_SkDDKth); + sklepDokDodKthTable.Indexes.Add("idx_SkDDKth", idx_SkDDKth); + relationalModel.Tables.Add(("SklepDokDodKth", null), sklepDokDodKthTable); + var sklepDokDodKthTableMapping = new TableMapping(sklepDokDodKth, sklepDokDodKthTable, true); + sklepDokDodKthTable.AddTypeMapping(sklepDokDodKthTableMapping, false); + tableMappings165.Add(sklepDokDodKthTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn0, sklepDokDodKth.FindProperty("SklepDokId")!, sklepDokDodKthTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn10, sklepDokDodKth.FindProperty("SklepId")!, sklepDokDodKthTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn18, sklepDokDodKth.FindProperty("Znaczenie")!, sklepDokDodKthTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn5, sklepDokDodKth.FindProperty("Kwota")!, sklepDokDodKthTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn0, sklepDokDodKth.FindProperty("SklepKontrId")!, sklepDokDodKthTableMapping); + + var sklepDokKurs = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs")!; + + var defaultTableMappings166 = new List>(); + sklepDokKurs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings166); + var blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs", null, relationalModel); + var dataColumnBase6 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.Columns.Add("Data", dataColumnBase6); + var kursColumnBase6 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.Columns.Add("Kurs", kursColumnBase6); + var nrTabeliColumnBase1 = new ColumnBase("NrTabeli", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.Columns.Add("NrTabeli", nrTabeliColumnBase1); + var sklepDokIdColumnBase1 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase1); + var sklepIdColumnBase11 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.Columns.Add("SklepId", sklepIdColumnBase11); + var sklepWalIdColumnBase0 = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase0); + var znaczenieColumnBase19 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.Columns.Add("Znaczenie", znaczenieColumnBase19); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs", blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase = new TableMappingBase(sklepDokKurs, blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDokKursTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase, false); + defaultTableMappings166.Add(blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase1, sklepDokKurs.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase11, sklepDokKurs.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase19, sklepDokKurs.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase6, sklepDokKurs.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase6, sklepDokKurs.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrTabeliColumnBase1, sklepDokKurs.FindProperty("NrTabeli")!, blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase0, sklepDokKurs.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokKursMappingBase); + + var tableMappings166 = new List(); + sklepDokKurs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings166); + var sklepDokKursTable = new Table("SklepDokKurs", null, relationalModel); + var sklepIdColumn11 = new Column("SklepId", "numeric(9,0)", sklepDokKursTable); + sklepDokKursTable.Columns.Add("SklepId", sklepIdColumn11); + var sklepDokIdColumn1 = new Column("SklepDokId", "numeric(9,0)", sklepDokKursTable); + sklepDokKursTable.Columns.Add("SklepDokId", sklepDokIdColumn1); + var znaczenieColumn19 = new Column("Znaczenie", "smallint", sklepDokKursTable); + sklepDokKursTable.Columns.Add("Znaczenie", znaczenieColumn19); + var dataColumn6 = new Column("Data", "datetime", sklepDokKursTable) + { + IsNullable = true + }; + sklepDokKursTable.Columns.Add("Data", dataColumn6); + var kursColumn6 = new Column("Kurs", "decimal(15,4)", sklepDokKursTable) + { + IsNullable = true + }; + sklepDokKursTable.Columns.Add("Kurs", kursColumn6); + var nrTabeliColumn1 = new Column("NrTabeli", "varchar(60)", sklepDokKursTable) + { + IsNullable = true + }; + sklepDokKursTable.Columns.Add("NrTabeli", nrTabeliColumn1); + var sklepWalIdColumn0 = new Column("SklepWalId", "numeric(9,0)", sklepDokKursTable); + sklepDokKursTable.Columns.Add("SklepWalId", sklepWalIdColumn0); + var pK_SKLEPDOKKURS = new UniqueConstraint("PK_SKLEPDOKKURS", sklepDokKursTable, new[] { sklepIdColumn11, sklepDokIdColumn1, znaczenieColumn19 }); + sklepDokKursTable.PrimaryKey = pK_SKLEPDOKKURS; + var pK_SKLEPDOKKURSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs", + new[] { "SklepId", "SklepDokId", "Znaczenie" }); + pK_SKLEPDOKKURS.MappedKeys.Add(pK_SKLEPDOKKURSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDOKKURSUc).Add(pK_SKLEPDOKKURS); + sklepDokKursTable.UniqueConstraints.Add("PK_SKLEPDOKKURS", pK_SKLEPDOKKURS); + var idx_SklDokKursWal = new TableIndex( + "idx_SklDokKursWal", sklepDokKursTable, new[] { sklepIdColumn11, sklepWalIdColumn0 }, false); + var idx_SklDokKursWalIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs", + "idx_SklDokKursWal"); + idx_SklDokKursWal.MappedIndexes.Add(idx_SklDokKursWalIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklDokKursWalIx).Add(idx_SklDokKursWal); + sklepDokKursTable.Indexes.Add("idx_SklDokKursWal", idx_SklDokKursWal); + relationalModel.Tables.Add(("SklepDokKurs", null), sklepDokKursTable); + var sklepDokKursTableMapping = new TableMapping(sklepDokKurs, sklepDokKursTable, true); + sklepDokKursTable.AddTypeMapping(sklepDokKursTableMapping, false); + tableMappings166.Add(sklepDokKursTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn1, sklepDokKurs.FindProperty("SklepDokId")!, sklepDokKursTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn11, sklepDokKurs.FindProperty("SklepId")!, sklepDokKursTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn19, sklepDokKurs.FindProperty("Znaczenie")!, sklepDokKursTableMapping); + RelationalModel.CreateColumnMapping(dataColumn6, sklepDokKurs.FindProperty("Data")!, sklepDokKursTableMapping); + RelationalModel.CreateColumnMapping(kursColumn6, sklepDokKurs.FindProperty("Kurs")!, sklepDokKursTableMapping); + RelationalModel.CreateColumnMapping(nrTabeliColumn1, sklepDokKurs.FindProperty("NrTabeli")!, sklepDokKursTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn0, sklepDokKurs.FindProperty("SklepWalId")!, sklepDokKursTableMapping); + + var sklepDokPunkty = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDokPunkty")!; + + var defaultTableMappings167 = new List>(); + sklepDokPunkty.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings167); + var blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDokPunkty", null, relationalModel); + var gdzieColumnBase = new ColumnBase("Gdzie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase.Columns.Add("Gdzie", gdzieColumnBase); + var kiedyColumnBase2 = new ColumnBase("Kiedy", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase.Columns.Add("Kiedy", kiedyColumnBase2); + var kwotaColumnBase6 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase.Columns.Add("Kwota", kwotaColumnBase6); + var sklepDokIdColumnBase2 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase2); + var sklepIdColumnBase12 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase.Columns.Add("SklepId", sklepIdColumnBase12); + var typColumnBase22 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase.Columns.Add("Typ", typColumnBase22); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDokPunkty", blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase = new TableMappingBase(sklepDokPunkty, blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase, false); + defaultTableMappings167.Add(blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)gdzieColumnBase, sklepDokPunkty.FindProperty("Gdzie")!, blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase2, sklepDokPunkty.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase12, sklepDokPunkty.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase22, sklepDokPunkty.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase2, sklepDokPunkty.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase6, sklepDokPunkty.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesSklepDokPunktyMappingBase); + + var tableMappings167 = new List(); + sklepDokPunkty.SetRuntimeAnnotation("Relational:TableMappings", tableMappings167); + var sklepDokPunktyTable = new Table("SklepDokPunkty", null, relationalModel); + var sklepIdColumn12 = new Column("SklepId", "numeric(9,0)", sklepDokPunktyTable); + sklepDokPunktyTable.Columns.Add("SklepId", sklepIdColumn12); + var sklepDokIdColumn2 = new Column("SklepDokId", "numeric(9,0)", sklepDokPunktyTable); + sklepDokPunktyTable.Columns.Add("SklepDokId", sklepDokIdColumn2); + var typColumn22 = new Column("Typ", "smallint", sklepDokPunktyTable); + sklepDokPunktyTable.Columns.Add("Typ", typColumn22); + var gdzieColumn = new Column("Gdzie", "smallint", sklepDokPunktyTable); + sklepDokPunktyTable.Columns.Add("Gdzie", gdzieColumn); + var kiedyColumn2 = new Column("Kiedy", "datetime", sklepDokPunktyTable); + sklepDokPunktyTable.Columns.Add("Kiedy", kiedyColumn2); + var kwotaColumn6 = new Column("Kwota", "decimal(15,4)", sklepDokPunktyTable); + sklepDokPunktyTable.Columns.Add("Kwota", kwotaColumn6); + var pK_SKLEPDOKPUNKTY = new UniqueConstraint("PK_SKLEPDOKPUNKTY", sklepDokPunktyTable, new[] { sklepIdColumn12, sklepDokIdColumn2, typColumn22, gdzieColumn }); + sklepDokPunktyTable.PrimaryKey = pK_SKLEPDOKPUNKTY; + var pK_SKLEPDOKPUNKTYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokPunkty", + new[] { "SklepId", "SklepDokId", "Typ", "Gdzie" }); + pK_SKLEPDOKPUNKTY.MappedKeys.Add(pK_SKLEPDOKPUNKTYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDOKPUNKTYUc).Add(pK_SKLEPDOKPUNKTY); + sklepDokPunktyTable.UniqueConstraints.Add("PK_SKLEPDOKPUNKTY", pK_SKLEPDOKPUNKTY); + relationalModel.Tables.Add(("SklepDokPunkty", null), sklepDokPunktyTable); + var sklepDokPunktyTableMapping = new TableMapping(sklepDokPunkty, sklepDokPunktyTable, true); + sklepDokPunktyTable.AddTypeMapping(sklepDokPunktyTableMapping, false); + tableMappings167.Add(sklepDokPunktyTableMapping); + RelationalModel.CreateColumnMapping(gdzieColumn, sklepDokPunkty.FindProperty("Gdzie")!, sklepDokPunktyTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn2, sklepDokPunkty.FindProperty("SklepDokId")!, sklepDokPunktyTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn12, sklepDokPunkty.FindProperty("SklepId")!, sklepDokPunktyTableMapping); + RelationalModel.CreateColumnMapping(typColumn22, sklepDokPunkty.FindProperty("Typ")!, sklepDokPunktyTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn2, sklepDokPunkty.FindProperty("Kiedy")!, sklepDokPunktyTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn6, sklepDokPunkty.FindProperty("Kwota")!, sklepDokPunktyTableMapping); + + var sklepDokWaluta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta")!; + + var defaultTableMappings168 = new List>(); + sklepDokWaluta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings168); + var blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta", null, relationalModel); + var dokKwotaColumnBase0 = new ColumnBase("DokKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("DokKwota", dokKwotaColumnBase0); + var kursColumnBase7 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("Kurs", kursColumnBase7); + var sklepDokIdColumnBase3 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase3); + var sklepIdColumnBase13 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("SklepId", sklepIdColumnBase13); + var sklepWalIdColumnBase1 = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase1); + var walKwotaColumnBase1 = new ColumnBase("WalKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("WalKwota", walKwotaColumnBase1); + var walNettoColumnBase0 = new ColumnBase("WalNetto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("WalNetto", walNettoColumnBase0); + var walNettoDetColumnBase0 = new ColumnBase("WalNettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("WalNettoDet", walNettoDetColumnBase0); + var walPodatekColumnBase0 = new ColumnBase("WalPodatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("WalPodatek", walPodatekColumnBase0); + var walPodatekDetColumnBase0 = new ColumnBase("WalPodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.Columns.Add("WalPodatekDet", walPodatekDetColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta", blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase = new TableMappingBase(sklepDokWaluta, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase, false); + defaultTableMappings168.Add(blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase3, sklepDokWaluta.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase13, sklepDokWaluta.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase1, sklepDokWaluta.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokKwotaColumnBase0, sklepDokWaluta.FindProperty("DokKwota")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase7, sklepDokWaluta.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walKwotaColumnBase1, sklepDokWaluta.FindProperty("WalKwota")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walNettoColumnBase0, sklepDokWaluta.FindProperty("WalNetto")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walNettoDetColumnBase0, sklepDokWaluta.FindProperty("WalNettoDet")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walPodatekColumnBase0, sklepDokWaluta.FindProperty("WalPodatek")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walPodatekDetColumnBase0, sklepDokWaluta.FindProperty("WalPodatekDet")!, blinkBackofficeServicesPcmDbEntitiesSklepDokWalutaMappingBase); + + var tableMappings168 = new List(); + sklepDokWaluta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings168); + var sklepDokWalutaTable = new Table("SklepDokWaluta", null, relationalModel); + var sklepIdColumn13 = new Column("SklepId", "numeric(9,0)", sklepDokWalutaTable); + sklepDokWalutaTable.Columns.Add("SklepId", sklepIdColumn13); + var sklepDokIdColumn3 = new Column("SklepDokId", "numeric(9,0)", sklepDokWalutaTable); + sklepDokWalutaTable.Columns.Add("SklepDokId", sklepDokIdColumn3); + var sklepWalIdColumn1 = new Column("SklepWalId", "numeric(9,0)", sklepDokWalutaTable); + sklepDokWalutaTable.Columns.Add("SklepWalId", sklepWalIdColumn1); + var dokKwotaColumn0 = new Column("DokKwota", "decimal(15,4)", sklepDokWalutaTable); + sklepDokWalutaTable.Columns.Add("DokKwota", dokKwotaColumn0); + var kursColumn7 = new Column("Kurs", "decimal(15,4)", sklepDokWalutaTable); + sklepDokWalutaTable.Columns.Add("Kurs", kursColumn7); + var walKwotaColumn1 = new Column("WalKwota", "decimal(15,4)", sklepDokWalutaTable); + sklepDokWalutaTable.Columns.Add("WalKwota", walKwotaColumn1); + var walNettoColumn0 = new Column("WalNetto", "decimal(15,4)", sklepDokWalutaTable) + { + IsNullable = true + }; + sklepDokWalutaTable.Columns.Add("WalNetto", walNettoColumn0); + var walNettoDetColumn0 = new Column("WalNettoDet", "decimal(15,4)", sklepDokWalutaTable) + { + IsNullable = true + }; + sklepDokWalutaTable.Columns.Add("WalNettoDet", walNettoDetColumn0); + var walPodatekColumn0 = new Column("WalPodatek", "decimal(15,4)", sklepDokWalutaTable) + { + IsNullable = true + }; + sklepDokWalutaTable.Columns.Add("WalPodatek", walPodatekColumn0); + var walPodatekDetColumn0 = new Column("WalPodatekDet", "decimal(15,4)", sklepDokWalutaTable) + { + IsNullable = true + }; + sklepDokWalutaTable.Columns.Add("WalPodatekDet", walPodatekDetColumn0); + var pK_SKLEPDOKWALUTA = new UniqueConstraint("PK_SKLEPDOKWALUTA", sklepDokWalutaTable, new[] { sklepIdColumn13, sklepDokIdColumn3, sklepWalIdColumn1 }); + sklepDokWalutaTable.PrimaryKey = pK_SKLEPDOKWALUTA; + var pK_SKLEPDOKWALUTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta", + new[] { "SklepId", "SklepDokId", "SklepWalId" }); + pK_SKLEPDOKWALUTA.MappedKeys.Add(pK_SKLEPDOKWALUTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDOKWALUTAUc).Add(pK_SKLEPDOKWALUTA); + sklepDokWalutaTable.UniqueConstraints.Add("PK_SKLEPDOKWALUTA", pK_SKLEPDOKWALUTA); + var idx_SkWalDok = new TableIndex( + "idx_SkWalDok", sklepDokWalutaTable, new[] { sklepIdColumn13, sklepWalIdColumn1 }, false); + var idx_SkWalDokIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta", + "idx_SkWalDok"); + idx_SkWalDok.MappedIndexes.Add(idx_SkWalDokIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkWalDokIx).Add(idx_SkWalDok); + sklepDokWalutaTable.Indexes.Add("idx_SkWalDok", idx_SkWalDok); + relationalModel.Tables.Add(("SklepDokWaluta", null), sklepDokWalutaTable); + var sklepDokWalutaTableMapping = new TableMapping(sklepDokWaluta, sklepDokWalutaTable, true); + sklepDokWalutaTable.AddTypeMapping(sklepDokWalutaTableMapping, false); + tableMappings168.Add(sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn3, sklepDokWaluta.FindProperty("SklepDokId")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn13, sklepDokWaluta.FindProperty("SklepId")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn1, sklepDokWaluta.FindProperty("SklepWalId")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(dokKwotaColumn0, sklepDokWaluta.FindProperty("DokKwota")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(kursColumn7, sklepDokWaluta.FindProperty("Kurs")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walKwotaColumn1, sklepDokWaluta.FindProperty("WalKwota")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walNettoColumn0, sklepDokWaluta.FindProperty("WalNetto")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walNettoDetColumn0, sklepDokWaluta.FindProperty("WalNettoDet")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walPodatekColumn0, sklepDokWaluta.FindProperty("WalPodatek")!, sklepDokWalutaTableMapping); + RelationalModel.CreateColumnMapping(walPodatekDetColumn0, sklepDokWaluta.FindProperty("WalPodatekDet")!, sklepDokWalutaTableMapping); + + var sklepDost = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDost")!; + + var defaultTableMappings169 = new List>(); + sklepDost.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings169); + var blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDost", null, relationalModel); + var cenaZakColumnBase1 = new ColumnBase("CenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("CenaZak", cenaZakColumnBase1); + var ileWZgrzewceColumnBase1 = new ColumnBase("IleWZgrzewce", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("IleWZgrzewce", ileWZgrzewceColumnBase1); + var kodColumnBase10 = new ColumnBase("Kod", "varchar(30)", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("Kod", kodColumnBase10); + var narzucanyColumnBase0 = new ColumnBase("Narzucany", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("Narzucany", narzucanyColumnBase0); + var rabatOdWartColumnBase0 = new ColumnBase("RabatOdWart", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("RabatOdWart", rabatOdWartColumnBase0); + var sklepIdColumnBase14 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("SklepId", sklepIdColumnBase14); + var sklepKontrIdColumnBase1 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase1); + var sklepTowIdColumnBase = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDost", blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase = new TableMappingBase(sklepDost, blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDostTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase, false); + defaultTableMappings169.Add(blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase14, sklepDost.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase1, sklepDost.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase, sklepDost.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakColumnBase1, sklepDost.FindProperty("CenaZak")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWZgrzewceColumnBase1, sklepDost.FindProperty("IleWZgrzewce")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase10, sklepDost.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzucanyColumnBase0, sklepDost.FindProperty("Narzucany")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatOdWartColumnBase0, sklepDost.FindProperty("RabatOdWart")!, blinkBackofficeServicesPcmDbEntitiesSklepDostMappingBase); + + var tableMappings169 = new List(); + sklepDost.SetRuntimeAnnotation("Relational:TableMappings", tableMappings169); + var sklepDostTable = new Table("SklepDost", null, relationalModel); + var sklepIdColumn14 = new Column("SklepId", "numeric(9,0)", sklepDostTable); + sklepDostTable.Columns.Add("SklepId", sklepIdColumn14); + var sklepTowIdColumn = new Column("SklepTowId", "numeric(9,0)", sklepDostTable); + sklepDostTable.Columns.Add("SklepTowId", sklepTowIdColumn); + var sklepKontrIdColumn1 = new Column("SklepKontrId", "numeric(9,0)", sklepDostTable); + sklepDostTable.Columns.Add("SklepKontrId", sklepKontrIdColumn1); + var cenaZakColumn1 = new Column("CenaZak", "decimal(15,4)", sklepDostTable) + { + IsNullable = true + }; + sklepDostTable.Columns.Add("CenaZak", cenaZakColumn1); + var ileWZgrzewceColumn1 = new Column("IleWZgrzewce", "decimal(15,4)", sklepDostTable) + { + IsNullable = true + }; + sklepDostTable.Columns.Add("IleWZgrzewce", ileWZgrzewceColumn1); + var kodColumn10 = new Column("Kod", "varchar(30)", sklepDostTable) + { + IsNullable = true + }; + sklepDostTable.Columns.Add("Kod", kodColumn10); + var narzucanyColumn0 = new Column("Narzucany", "smallint", sklepDostTable) + { + IsNullable = true + }; + sklepDostTable.Columns.Add("Narzucany", narzucanyColumn0); + var rabatOdWartColumn0 = new Column("RabatOdWart", "decimal(15,4)", sklepDostTable) + { + IsNullable = true + }; + sklepDostTable.Columns.Add("RabatOdWart", rabatOdWartColumn0); + var pK_SKLEPDOST = new UniqueConstraint("PK_SKLEPDOST", sklepDostTable, new[] { sklepIdColumn14, sklepTowIdColumn, sklepKontrIdColumn1 }); + sklepDostTable.PrimaryKey = pK_SKLEPDOST; + var pK_SKLEPDOSTUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDost", + new[] { "SklepId", "SklepTowId", "SklepKontrId" }); + pK_SKLEPDOST.MappedKeys.Add(pK_SKLEPDOSTUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDOSTUc).Add(pK_SKLEPDOST); + sklepDostTable.UniqueConstraints.Add("PK_SKLEPDOST", pK_SKLEPDOST); + var idx_SkDostKth = new TableIndex( + "idx_SkDostKth", sklepDostTable, new[] { sklepIdColumn14, sklepKontrIdColumn1 }, false); + var idx_SkDostKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDost", + "idx_SkDostKth"); + idx_SkDostKth.MappedIndexes.Add(idx_SkDostKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDostKthIx).Add(idx_SkDostKth); + sklepDostTable.Indexes.Add("idx_SkDostKth", idx_SkDostKth); + relationalModel.Tables.Add(("SklepDost", null), sklepDostTable); + var sklepDostTableMapping = new TableMapping(sklepDost, sklepDostTable, true); + sklepDostTable.AddTypeMapping(sklepDostTableMapping, false); + tableMappings169.Add(sklepDostTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn14, sklepDost.FindProperty("SklepId")!, sklepDostTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn1, sklepDost.FindProperty("SklepKontrId")!, sklepDostTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn, sklepDost.FindProperty("SklepTowId")!, sklepDostTableMapping); + RelationalModel.CreateColumnMapping(cenaZakColumn1, sklepDost.FindProperty("CenaZak")!, sklepDostTableMapping); + RelationalModel.CreateColumnMapping(ileWZgrzewceColumn1, sklepDost.FindProperty("IleWZgrzewce")!, sklepDostTableMapping); + RelationalModel.CreateColumnMapping(kodColumn10, sklepDost.FindProperty("Kod")!, sklepDostTableMapping); + RelationalModel.CreateColumnMapping(narzucanyColumn0, sklepDost.FindProperty("Narzucany")!, sklepDostTableMapping); + RelationalModel.CreateColumnMapping(rabatOdWartColumn0, sklepDost.FindProperty("RabatOdWart")!, sklepDostTableMapping); + + var sklepDzienRozl = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl")!; + + var defaultTableMappings170 = new List>(); + sklepDzienRozl.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings170); + var blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", null, relationalModel); + var dzienColumnBase4 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase.Columns.Add("Dzien", dzienColumnBase4); + var sklepIdColumnBase15 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase.Columns.Add("SklepId", sklepIdColumnBase15); + var statusColumnBase5 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase.Columns.Add("Status", statusColumnBase5); + var zmianaColumnBase36 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase.Columns.Add("Zmiana", zmianaColumnBase36); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlMappingBase = new TableMappingBase(sklepDzienRozl, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlMappingBase, false); + defaultTableMappings170.Add(blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase4, sklepDzienRozl.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase15, sklepDzienRozl.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase5, sklepDzienRozl.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase36, sklepDzienRozl.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlMappingBase); + + var tableMappings170 = new List(); + sklepDzienRozl.SetRuntimeAnnotation("Relational:TableMappings", tableMappings170); + var sklepDzienRozlTable = new Table("SklepDzienRozl", null, relationalModel); + var sklepIdColumn15 = new Column("SklepId", "numeric(9,0)", sklepDzienRozlTable); + sklepDzienRozlTable.Columns.Add("SklepId", sklepIdColumn15); + var dzienColumn4 = new Column("Dzien", "datetime", sklepDzienRozlTable); + sklepDzienRozlTable.Columns.Add("Dzien", dzienColumn4); + var statusColumn5 = new Column("Status", "smallint", sklepDzienRozlTable); + sklepDzienRozlTable.Columns.Add("Status", statusColumn5); + var zmianaColumn36 = new Column("Zmiana", "datetime", sklepDzienRozlTable); + sklepDzienRozlTable.Columns.Add("Zmiana", zmianaColumn36); + var pK_SKLEPDZIENROZL = new UniqueConstraint("PK_SKLEPDZIENROZL", sklepDzienRozlTable, new[] { sklepIdColumn15, dzienColumn4 }); + sklepDzienRozlTable.PrimaryKey = pK_SKLEPDZIENROZL; + var pK_SKLEPDZIENROZLUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", + new[] { "SklepId", "Dzien" }); + pK_SKLEPDZIENROZL.MappedKeys.Add(pK_SKLEPDZIENROZLUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDZIENROZLUc).Add(pK_SKLEPDZIENROZL); + sklepDzienRozlTable.UniqueConstraints.Add("PK_SKLEPDZIENROZL", pK_SKLEPDZIENROZL); + var idx_SkDzienZmiana = new TableIndex( + "idx_SkDzienZmiana", sklepDzienRozlTable, new[] { zmianaColumn36 }, false); + var idx_SkDzienZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", + "idx_SkDzienZmiana"); + idx_SkDzienZmiana.MappedIndexes.Add(idx_SkDzienZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkDzienZmianaIx).Add(idx_SkDzienZmiana); + sklepDzienRozlTable.Indexes.Add("idx_SkDzienZmiana", idx_SkDzienZmiana); + relationalModel.Tables.Add(("SklepDzienRozl", null), sklepDzienRozlTable); + var sklepDzienRozlTableMapping = new TableMapping(sklepDzienRozl, sklepDzienRozlTable, true); + sklepDzienRozlTable.AddTypeMapping(sklepDzienRozlTableMapping, false); + tableMappings170.Add(sklepDzienRozlTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn4, sklepDzienRozl.FindProperty("Dzien")!, sklepDzienRozlTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn15, sklepDzienRozl.FindProperty("SklepId")!, sklepDzienRozlTableMapping); + RelationalModel.CreateColumnMapping(statusColumn5, sklepDzienRozl.FindProperty("Status")!, sklepDzienRozlTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn36, sklepDzienRozl.FindProperty("Zmiana")!, sklepDzienRozlTableMapping); + + var sklepDzienRozlParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozlParam")!; + + var defaultTableMappings171 = new List>(); + sklepDzienRozlParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings171); + var blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozlParam", null, relationalModel); + var dzienColumnBase5 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase.Columns.Add("Dzien", dzienColumnBase5); + var sklepIdColumnBase16 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase.Columns.Add("SklepId", sklepIdColumnBase16); + var wartoscColumnBase10 = new ColumnBase("Wartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase.Columns.Add("Wartosc", wartoscColumnBase10); + var znaczenieColumnBase20 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase.Columns.Add("Znaczenie", znaczenieColumnBase20); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozlParam", blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamMappingBase = new TableMappingBase(sklepDzienRozlParam, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamMappingBase, false); + defaultTableMappings171.Add(blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase5, sklepDzienRozlParam.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase16, sklepDzienRozlParam.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase20, sklepDzienRozlParam.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase10, sklepDzienRozlParam.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepDzienRozlParamMappingBase); + + var tableMappings171 = new List(); + sklepDzienRozlParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings171); + var sklepDzienRozlParamTable = new Table("SklepDzienRozlParam", null, relationalModel); + var sklepIdColumn16 = new Column("SklepId", "numeric(9,0)", sklepDzienRozlParamTable); + sklepDzienRozlParamTable.Columns.Add("SklepId", sklepIdColumn16); + var dzienColumn5 = new Column("Dzien", "datetime", sklepDzienRozlParamTable); + sklepDzienRozlParamTable.Columns.Add("Dzien", dzienColumn5); + var znaczenieColumn20 = new Column("Znaczenie", "smallint", sklepDzienRozlParamTable); + sklepDzienRozlParamTable.Columns.Add("Znaczenie", znaczenieColumn20); + var wartoscColumn10 = new Column("Wartosc", "varchar(255)", sklepDzienRozlParamTable); + sklepDzienRozlParamTable.Columns.Add("Wartosc", wartoscColumn10); + var pK_SKLEPDZIENROZLPARAM = new UniqueConstraint("PK_SKLEPDZIENROZLPARAM", sklepDzienRozlParamTable, new[] { sklepIdColumn16, dzienColumn5, znaczenieColumn20 }); + sklepDzienRozlParamTable.PrimaryKey = pK_SKLEPDZIENROZLPARAM; + var pK_SKLEPDZIENROZLPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozlParam", + new[] { "SklepId", "Dzien", "Znaczenie" }); + pK_SKLEPDZIENROZLPARAM.MappedKeys.Add(pK_SKLEPDZIENROZLPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPDZIENROZLPARAMUc).Add(pK_SKLEPDZIENROZLPARAM); + sklepDzienRozlParamTable.UniqueConstraints.Add("PK_SKLEPDZIENROZLPARAM", pK_SKLEPDZIENROZLPARAM); + relationalModel.Tables.Add(("SklepDzienRozlParam", null), sklepDzienRozlParamTable); + var sklepDzienRozlParamTableMapping = new TableMapping(sklepDzienRozlParam, sklepDzienRozlParamTable, true); + sklepDzienRozlParamTable.AddTypeMapping(sklepDzienRozlParamTableMapping, false); + tableMappings171.Add(sklepDzienRozlParamTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn5, sklepDzienRozlParam.FindProperty("Dzien")!, sklepDzienRozlParamTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn16, sklepDzienRozlParam.FindProperty("SklepId")!, sklepDzienRozlParamTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn20, sklepDzienRozlParam.FindProperty("Znaczenie")!, sklepDzienRozlParamTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn10, sklepDzienRozlParam.FindProperty("Wartosc")!, sklepDzienRozlParamTableMapping); + + var sklepEmail = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepEmail")!; + + var defaultTableMappings172 = new List>(); + sklepEmail.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings172); + var blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", null, relationalModel); + var aktywnyColumnBase30 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Aktywny", aktywnyColumnBase30); + var authColumnBase0 = new ColumnBase("Auth", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Auth", authColumnBase0); + var hasloColumnBase0 = new ColumnBase("Haslo", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Haslo", hasloColumnBase0); + var hostColumnBase0 = new ColumnBase("Host", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Host", hostColumnBase0); + var kopiaColumnBase0 = new ColumnBase("Kopia", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Kopia", kopiaColumnBase0); + var kopiaEmailColumnBase0 = new ColumnBase("KopiaEmail", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("KopiaEmail", kopiaEmailColumnBase0); + var loginColumnBase0 = new ColumnBase("Login", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Login", loginColumnBase0); + var nadawcaColumnBase1 = new ColumnBase("Nadawca", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Nadawca", nadawcaColumnBase1); + var nazwaColumnBase38 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Nazwa", nazwaColumnBase38); + var portColumnBase0 = new ColumnBase("Port", "varchar(5)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Port", portColumnBase0); + var sklepEmIdColumnBase = new ColumnBase("SklepEmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepEmId", sklepEmIdColumnBase); + var sklepIdColumnBase17 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepId", sklepIdColumnBase17); + var sklepTEDIdColumnBase = new ColumnBase("SklepTEDId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepTEDId", sklepTEDIdColumnBase); + var sklepTEHRIdColumnBase = new ColumnBase("SklepTEHRId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepTEHRId", sklepTEHRIdColumnBase); + var sklepTERIdColumnBase = new ColumnBase("SklepTERId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepTERId", sklepTERIdColumnBase); + var sklepTEWIdColumnBase = new ColumnBase("SklepTEWId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepTEWId", sklepTEWIdColumnBase); + var sklepTEZIIdColumnBase = new ColumnBase("SklepTEZIId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepTEZIId", sklepTEZIIdColumnBase); + var sklepUzIdColumnBase0 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase0); + var tLSColumnBase0 = new ColumnBase("TLS", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("TLS", tLSColumnBase0); + var tLSVerColumnBase0 = new ColumnBase("TLSVer", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("TLSVer", tLSVerColumnBase0); + var zmianaColumnBase37 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.Columns.Add("Zmiana", zmianaColumnBase37); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase = new TableMappingBase(sklepEmail, blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepEmailTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase, false); + defaultTableMappings172.Add(blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepEmIdColumnBase, sklepEmail.FindProperty("SklepEmId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase17, sklepEmail.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase30, sklepEmail.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)authColumnBase0, sklepEmail.FindProperty("Auth")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloColumnBase0, sklepEmail.FindProperty("Haslo")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hostColumnBase0, sklepEmail.FindProperty("Host")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kopiaColumnBase0, sklepEmail.FindProperty("Kopia")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kopiaEmailColumnBase0, sklepEmail.FindProperty("KopiaEmail")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)loginColumnBase0, sklepEmail.FindProperty("Login")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nadawcaColumnBase1, sklepEmail.FindProperty("Nadawca")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase38, sklepEmail.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)portColumnBase0, sklepEmail.FindProperty("Port")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTEDIdColumnBase, sklepEmail.FindProperty("SklepTEDId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTEHRIdColumnBase, sklepEmail.FindProperty("SklepTEHRId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTERIdColumnBase, sklepEmail.FindProperty("SklepTERId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTEWIdColumnBase, sklepEmail.FindProperty("SklepTEWId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTEZIIdColumnBase, sklepEmail.FindProperty("SklepTEZIId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase0, sklepEmail.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tLSColumnBase0, sklepEmail.FindProperty("TLS")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tLSVerColumnBase0, sklepEmail.FindProperty("TLSVer")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase37, sklepEmail.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepEmailMappingBase); + + var tableMappings172 = new List(); + sklepEmail.SetRuntimeAnnotation("Relational:TableMappings", tableMappings172); + var sklepEmailTable = new Table("SklepEmail", null, relationalModel); + var sklepIdColumn17 = new Column("SklepId", "numeric(9,0)", sklepEmailTable); + sklepEmailTable.Columns.Add("SklepId", sklepIdColumn17); + var sklepEmIdColumn = new Column("SklepEmId", "numeric(9,0)", sklepEmailTable); + sklepEmailTable.Columns.Add("SklepEmId", sklepEmIdColumn); + var aktywnyColumn30 = new Column("Aktywny", "smallint", sklepEmailTable); + sklepEmailTable.Columns.Add("Aktywny", aktywnyColumn30); + var authColumn0 = new Column("Auth", "smallint", sklepEmailTable); + sklepEmailTable.Columns.Add("Auth", authColumn0); + var hasloColumn0 = new Column("Haslo", "varchar(255)", sklepEmailTable); + sklepEmailTable.Columns.Add("Haslo", hasloColumn0); + var hostColumn0 = new Column("Host", "varchar(120)", sklepEmailTable); + sklepEmailTable.Columns.Add("Host", hostColumn0); + var kopiaColumn0 = new Column("Kopia", "smallint", sklepEmailTable); + sklepEmailTable.Columns.Add("Kopia", kopiaColumn0); + var kopiaEmailColumn0 = new Column("KopiaEmail", "varchar(255)", sklepEmailTable) + { + IsNullable = true + }; + sklepEmailTable.Columns.Add("KopiaEmail", kopiaEmailColumn0); + var loginColumn0 = new Column("Login", "varchar(255)", sklepEmailTable); + sklepEmailTable.Columns.Add("Login", loginColumn0); + var nadawcaColumn1 = new Column("Nadawca", "varchar(120)", sklepEmailTable); + sklepEmailTable.Columns.Add("Nadawca", nadawcaColumn1); + var nazwaColumn38 = new Column("Nazwa", "varchar(60)", sklepEmailTable); + sklepEmailTable.Columns.Add("Nazwa", nazwaColumn38); + var portColumn0 = new Column("Port", "varchar(5)", sklepEmailTable); + sklepEmailTable.Columns.Add("Port", portColumn0); + var sklepTEDIdColumn = new Column("SklepTEDId", "numeric(9,0)", sklepEmailTable) + { + IsNullable = true + }; + sklepEmailTable.Columns.Add("SklepTEDId", sklepTEDIdColumn); + var sklepTEHRIdColumn = new Column("SklepTEHRId", "numeric(9,0)", sklepEmailTable) + { + IsNullable = true + }; + sklepEmailTable.Columns.Add("SklepTEHRId", sklepTEHRIdColumn); + var sklepTERIdColumn = new Column("SklepTERId", "numeric(9,0)", sklepEmailTable) + { + IsNullable = true + }; + sklepEmailTable.Columns.Add("SklepTERId", sklepTERIdColumn); + var sklepTEWIdColumn = new Column("SklepTEWId", "numeric(9,0)", sklepEmailTable) + { + IsNullable = true + }; + sklepEmailTable.Columns.Add("SklepTEWId", sklepTEWIdColumn); + var sklepTEZIIdColumn = new Column("SklepTEZIId", "numeric(9,0)", sklepEmailTable) + { + IsNullable = true + }; + sklepEmailTable.Columns.Add("SklepTEZIId", sklepTEZIIdColumn); + var sklepUzIdColumn0 = new Column("SklepUzId", "numeric(9,0)", sklepEmailTable) + { + IsNullable = true + }; + sklepEmailTable.Columns.Add("SklepUzId", sklepUzIdColumn0); + var tLSColumn0 = new Column("TLS", "smallint", sklepEmailTable); + sklepEmailTable.Columns.Add("TLS", tLSColumn0); + var tLSVerColumn0 = new Column("TLSVer", "smallint", sklepEmailTable); + sklepEmailTable.Columns.Add("TLSVer", tLSVerColumn0); + var zmianaColumn37 = new Column("Zmiana", "datetime", sklepEmailTable); + sklepEmailTable.Columns.Add("Zmiana", zmianaColumn37); + var pK_SklepEmail = new UniqueConstraint("PK_SklepEmail", sklepEmailTable, new[] { sklepIdColumn17, sklepEmIdColumn }); + sklepEmailTable.PrimaryKey = pK_SklepEmail; + var pK_SklepEmailUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepEmId" }); + pK_SklepEmail.MappedKeys.Add(pK_SklepEmailUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepEmailUc).Add(pK_SklepEmail); + sklepEmailTable.UniqueConstraints.Add("PK_SklepEmail", pK_SklepEmail); + var iX_SklepEmail_SklepId_SklepTEDId = new TableIndex( + "IX_SklepEmail_SklepId_SklepTEDId", sklepEmailTable, new[] { sklepIdColumn17, sklepTEDIdColumn }, false); + var iX_SklepEmail_SklepId_SklepTEDIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepTEDId" }); + iX_SklepEmail_SklepId_SklepTEDId.MappedIndexes.Add(iX_SklepEmail_SklepId_SklepTEDIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepEmail_SklepId_SklepTEDIdIx).Add(iX_SklepEmail_SklepId_SklepTEDId); + sklepEmailTable.Indexes.Add("IX_SklepEmail_SklepId_SklepTEDId", iX_SklepEmail_SklepId_SklepTEDId); + var iX_SklepEmail_SklepId_SklepTERId = new TableIndex( + "IX_SklepEmail_SklepId_SklepTERId", sklepEmailTable, new[] { sklepIdColumn17, sklepTERIdColumn }, false); + var iX_SklepEmail_SklepId_SklepTERIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepTERId" }); + iX_SklepEmail_SklepId_SklepTERId.MappedIndexes.Add(iX_SklepEmail_SklepId_SklepTERIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepEmail_SklepId_SklepTERIdIx).Add(iX_SklepEmail_SklepId_SklepTERId); + sklepEmailTable.Indexes.Add("IX_SklepEmail_SklepId_SklepTERId", iX_SklepEmail_SklepId_SklepTERId); + var iX_SklepEmail_SklepId_SklepTEWId = new TableIndex( + "IX_SklepEmail_SklepId_SklepTEWId", sklepEmailTable, new[] { sklepIdColumn17, sklepTEWIdColumn }, false); + var iX_SklepEmail_SklepId_SklepTEWIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepTEWId" }); + iX_SklepEmail_SklepId_SklepTEWId.MappedIndexes.Add(iX_SklepEmail_SklepId_SklepTEWIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepEmail_SklepId_SklepTEWIdIx).Add(iX_SklepEmail_SklepId_SklepTEWId); + sklepEmailTable.Indexes.Add("IX_SklepEmail_SklepId_SklepTEWId", iX_SklepEmail_SklepId_SklepTEWId); + var iX_SklepEmail_SklepId_SklepUzId = new TableIndex( + "IX_SklepEmail_SklepId_SklepUzId", sklepEmailTable, new[] { sklepIdColumn17, sklepUzIdColumn0 }, false); + var iX_SklepEmail_SklepId_SklepUzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepUzId" }); + iX_SklepEmail_SklepId_SklepUzId.MappedIndexes.Add(iX_SklepEmail_SklepId_SklepUzIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepEmail_SklepId_SklepUzIdIx).Add(iX_SklepEmail_SklepId_SklepUzId); + sklepEmailTable.Indexes.Add("IX_SklepEmail_SklepId_SklepUzId", iX_SklepEmail_SklepId_SklepUzId); + relationalModel.Tables.Add(("SklepEmail", null), sklepEmailTable); + var sklepEmailTableMapping = new TableMapping(sklepEmail, sklepEmailTable, true); + sklepEmailTable.AddTypeMapping(sklepEmailTableMapping, false); + tableMappings172.Add(sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepEmIdColumn, sklepEmail.FindProperty("SklepEmId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn17, sklepEmail.FindProperty("SklepId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn30, sklepEmail.FindProperty("Aktywny")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(authColumn0, sklepEmail.FindProperty("Auth")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(hasloColumn0, sklepEmail.FindProperty("Haslo")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(hostColumn0, sklepEmail.FindProperty("Host")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(kopiaColumn0, sklepEmail.FindProperty("Kopia")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(kopiaEmailColumn0, sklepEmail.FindProperty("KopiaEmail")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(loginColumn0, sklepEmail.FindProperty("Login")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(nadawcaColumn1, sklepEmail.FindProperty("Nadawca")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn38, sklepEmail.FindProperty("Nazwa")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(portColumn0, sklepEmail.FindProperty("Port")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepTEDIdColumn, sklepEmail.FindProperty("SklepTEDId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepTEHRIdColumn, sklepEmail.FindProperty("SklepTEHRId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepTERIdColumn, sklepEmail.FindProperty("SklepTERId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepTEWIdColumn, sklepEmail.FindProperty("SklepTEWId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepTEZIIdColumn, sklepEmail.FindProperty("SklepTEZIId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn0, sklepEmail.FindProperty("SklepUzId")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(tLSColumn0, sklepEmail.FindProperty("TLS")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(tLSVerColumn0, sklepEmail.FindProperty("TLSVer")!, sklepEmailTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn37, sklepEmail.FindProperty("Zmiana")!, sklepEmailTableMapping); + + var sklepFlagi = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi")!; + + var defaultTableMappings173 = new List>(); + sklepFlagi.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings173); + var blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", null, relationalModel); + var aktywnyColumnBase31 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("Aktywny", aktywnyColumnBase31); + var blokCenSpColumnBase = new ColumnBase("BlokCenSp", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("BlokCenSp", blokCenSpColumnBase); + var blokCenyZakColumnBase = new ColumnBase("BlokCenyZak", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("BlokCenyZak", blokCenyZakColumnBase); + var blokDostawcowColumnBase = new ColumnBase("BlokDostawcow", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("BlokDostawcow", blokDostawcowColumnBase); + var blokZmianColumnBase = new ColumnBase("BlokZmian", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("BlokZmian", blokZmianColumnBase); + var doKiedyPrzyjecieColumnBase0 = new ColumnBase("DoKiedyPrzyjecie", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("DoKiedyPrzyjecie", doKiedyPrzyjecieColumnBase0); + var narzCenaDetColumnBase = new ColumnBase("NarzCenaDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("NarzCenaDet", narzCenaDetColumnBase); + var narzCenaDodColumnBase = new ColumnBase("NarzCenaDod", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("NarzCenaDod", narzCenaDodColumnBase); + var narzCenaHurtColumnBase = new ColumnBase("NarzCenaHurt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("NarzCenaHurt", narzCenaHurtColumnBase); + var narzCenaNocColumnBase = new ColumnBase("NarzCenaNoc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("NarzCenaNoc", narzCenaNocColumnBase); + var narzCenaOtwartaColumnBase = new ColumnBase("NarzCenaOtwarta", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("NarzCenaOtwarta", narzCenaOtwartaColumnBase); + var narzCenaZakColumnBase = new ColumnBase("NarzCenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("NarzCenaZak", narzCenaZakColumnBase); + var sklepIdColumnBase18 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("SklepId", sklepIdColumnBase18); + var statusZamColumnBase0 = new ColumnBase("StatusZam", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("StatusZam", statusZamColumnBase0); + var towIdColumnBase19 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("TowId", towIdColumnBase19); + var zmianaColumnBase38 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("Zmiana", zmianaColumnBase38); + var zmianaIstotnaColumnBase0 = new ColumnBase("ZmianaIstotna", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("ZmianaIstotna", zmianaIstotnaColumnBase0); + var zmianaTylkoCenColumnBase = new ColumnBase("ZmianaTylkoCen", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.Columns.Add("ZmianaTylkoCen", zmianaTylkoCenColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase = new TableMappingBase(sklepFlagi, blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepFlagiTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase, false); + defaultTableMappings173.Add(blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase18, sklepFlagi.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase19, sklepFlagi.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase31, sklepFlagi.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokCenSpColumnBase, sklepFlagi.FindProperty("BlokCenSp")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokCenyZakColumnBase, sklepFlagi.FindProperty("BlokCenyZak")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokDostawcowColumnBase, sklepFlagi.FindProperty("BlokDostawcow")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokZmianColumnBase, sklepFlagi.FindProperty("BlokZmian")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)doKiedyPrzyjecieColumnBase0, sklepFlagi.FindProperty("DoKiedyPrzyjecie")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzCenaDetColumnBase, sklepFlagi.FindProperty("NarzCenaDet")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzCenaDodColumnBase, sklepFlagi.FindProperty("NarzCenaDod")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzCenaHurtColumnBase, sklepFlagi.FindProperty("NarzCenaHurt")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzCenaNocColumnBase, sklepFlagi.FindProperty("NarzCenaNoc")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzCenaOtwartaColumnBase, sklepFlagi.FindProperty("NarzCenaOtwarta")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzCenaZakColumnBase, sklepFlagi.FindProperty("NarzCenaZak")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusZamColumnBase0, sklepFlagi.FindProperty("StatusZam")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase38, sklepFlagi.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaIstotnaColumnBase0, sklepFlagi.FindProperty("ZmianaIstotna")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaTylkoCenColumnBase, sklepFlagi.FindProperty("ZmianaTylkoCen")!, blinkBackofficeServicesPcmDbEntitiesSklepFlagiMappingBase); + + var tableMappings173 = new List(); + sklepFlagi.SetRuntimeAnnotation("Relational:TableMappings", tableMappings173); + var sklepFlagiTable = new Table("SklepFlagi", null, relationalModel); + var sklepIdColumn18 = new Column("SklepId", "numeric(9,0)", sklepFlagiTable); + sklepFlagiTable.Columns.Add("SklepId", sklepIdColumn18); + var towIdColumn19 = new Column("TowId", "numeric(9,0)", sklepFlagiTable); + sklepFlagiTable.Columns.Add("TowId", towIdColumn19); + var aktywnyColumn31 = new Column("Aktywny", "smallint", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("Aktywny", aktywnyColumn31); + var blokCenSpColumn = new Column("BlokCenSp", "smallint", sklepFlagiTable); + sklepFlagiTable.Columns.Add("BlokCenSp", blokCenSpColumn); + var blokCenyZakColumn = new Column("BlokCenyZak", "smallint", sklepFlagiTable); + sklepFlagiTable.Columns.Add("BlokCenyZak", blokCenyZakColumn); + var blokDostawcowColumn = new Column("BlokDostawcow", "smallint", sklepFlagiTable); + sklepFlagiTable.Columns.Add("BlokDostawcow", blokDostawcowColumn); + var blokZmianColumn = new Column("BlokZmian", "smallint", sklepFlagiTable); + sklepFlagiTable.Columns.Add("BlokZmian", blokZmianColumn); + var doKiedyPrzyjecieColumn0 = new Column("DoKiedyPrzyjecie", "datetime", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("DoKiedyPrzyjecie", doKiedyPrzyjecieColumn0); + var narzCenaDetColumn = new Column("NarzCenaDet", "decimal(15,4)", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("NarzCenaDet", narzCenaDetColumn); + var narzCenaDodColumn = new Column("NarzCenaDod", "decimal(15,4)", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("NarzCenaDod", narzCenaDodColumn); + var narzCenaHurtColumn = new Column("NarzCenaHurt", "decimal(15,4)", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("NarzCenaHurt", narzCenaHurtColumn); + var narzCenaNocColumn = new Column("NarzCenaNoc", "decimal(15,4)", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("NarzCenaNoc", narzCenaNocColumn); + var narzCenaOtwartaColumn = new Column("NarzCenaOtwarta", "smallint", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("NarzCenaOtwarta", narzCenaOtwartaColumn); + var narzCenaZakColumn = new Column("NarzCenaZak", "decimal(15,4)", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("NarzCenaZak", narzCenaZakColumn); + var statusZamColumn0 = new Column("StatusZam", "smallint", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("StatusZam", statusZamColumn0); + var zmianaColumn38 = new Column("Zmiana", "datetime", sklepFlagiTable); + sklepFlagiTable.Columns.Add("Zmiana", zmianaColumn38); + var zmianaIstotnaColumn0 = new Column("ZmianaIstotna", "datetime", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("ZmianaIstotna", zmianaIstotnaColumn0); + var zmianaTylkoCenColumn = new Column("ZmianaTylkoCen", "datetime", sklepFlagiTable) + { + IsNullable = true + }; + sklepFlagiTable.Columns.Add("ZmianaTylkoCen", zmianaTylkoCenColumn); + var pK_SKLEPFLAGI = new UniqueConstraint("PK_SKLEPFLAGI", sklepFlagiTable, new[] { sklepIdColumn18, towIdColumn19 }); + sklepFlagiTable.PrimaryKey = pK_SKLEPFLAGI; + var pK_SKLEPFLAGIUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + new[] { "SklepId", "TowId" }); + pK_SKLEPFLAGI.MappedKeys.Add(pK_SKLEPFLAGIUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPFLAGIUc).Add(pK_SKLEPFLAGI); + sklepFlagiTable.UniqueConstraints.Add("PK_SKLEPFLAGI", pK_SKLEPFLAGI); + var idx_SFZmianaIstotna = new TableIndex( + "idx_SFZmianaIstotna", sklepFlagiTable, new[] { sklepIdColumn18, zmianaIstotnaColumn0 }, false); + var idx_SFZmianaIstotnaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + "idx_SFZmianaIstotna"); + idx_SFZmianaIstotna.MappedIndexes.Add(idx_SFZmianaIstotnaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SFZmianaIstotnaIx).Add(idx_SFZmianaIstotna); + sklepFlagiTable.Indexes.Add("idx_SFZmianaIstotna", idx_SFZmianaIstotna); + var idx_SFZmianaTylkoCen = new TableIndex( + "idx_SFZmianaTylkoCen", sklepFlagiTable, new[] { sklepIdColumn18, zmianaTylkoCenColumn }, false); + var idx_SFZmianaTylkoCenIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + "idx_SFZmianaTylkoCen"); + idx_SFZmianaTylkoCen.MappedIndexes.Add(idx_SFZmianaTylkoCenIx); + RelationalModel.GetOrCreateTableIndexes(idx_SFZmianaTylkoCenIx).Add(idx_SFZmianaTylkoCen); + sklepFlagiTable.Indexes.Add("idx_SFZmianaTylkoCen", idx_SFZmianaTylkoCen); + var idx_SklepFlagZmiana = new TableIndex( + "idx_SklepFlagZmiana", sklepFlagiTable, new[] { zmianaColumn38 }, false); + var idx_SklepFlagZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + "idx_SklepFlagZmiana"); + idx_SklepFlagZmiana.MappedIndexes.Add(idx_SklepFlagZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepFlagZmianaIx).Add(idx_SklepFlagZmiana); + sklepFlagiTable.Indexes.Add("idx_SklepFlagZmiana", idx_SklepFlagZmiana); + var idx_SklFlgTowSklep = new TableIndex( + "idx_SklFlgTowSklep", sklepFlagiTable, new[] { towIdColumn19, sklepIdColumn18 }, false); + var idx_SklFlgTowSklepIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + "idx_SklFlgTowSklep"); + idx_SklFlgTowSklep.MappedIndexes.Add(idx_SklFlgTowSklepIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklFlgTowSklepIx).Add(idx_SklFlgTowSklep); + sklepFlagiTable.Indexes.Add("idx_SklFlgTowSklep", idx_SklFlgTowSklep); + relationalModel.Tables.Add(("SklepFlagi", null), sklepFlagiTable); + var sklepFlagiTableMapping = new TableMapping(sklepFlagi, sklepFlagiTable, true); + sklepFlagiTable.AddTypeMapping(sklepFlagiTableMapping, false); + tableMappings173.Add(sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn18, sklepFlagi.FindProperty("SklepId")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn19, sklepFlagi.FindProperty("TowId")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn31, sklepFlagi.FindProperty("Aktywny")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(blokCenSpColumn, sklepFlagi.FindProperty("BlokCenSp")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(blokCenyZakColumn, sklepFlagi.FindProperty("BlokCenyZak")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(blokDostawcowColumn, sklepFlagi.FindProperty("BlokDostawcow")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(blokZmianColumn, sklepFlagi.FindProperty("BlokZmian")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(doKiedyPrzyjecieColumn0, sklepFlagi.FindProperty("DoKiedyPrzyjecie")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(narzCenaDetColumn, sklepFlagi.FindProperty("NarzCenaDet")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(narzCenaDodColumn, sklepFlagi.FindProperty("NarzCenaDod")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(narzCenaHurtColumn, sklepFlagi.FindProperty("NarzCenaHurt")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(narzCenaNocColumn, sklepFlagi.FindProperty("NarzCenaNoc")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(narzCenaOtwartaColumn, sklepFlagi.FindProperty("NarzCenaOtwarta")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(narzCenaZakColumn, sklepFlagi.FindProperty("NarzCenaZak")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(statusZamColumn0, sklepFlagi.FindProperty("StatusZam")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn38, sklepFlagi.FindProperty("Zmiana")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(zmianaIstotnaColumn0, sklepFlagi.FindProperty("ZmianaIstotna")!, sklepFlagiTableMapping); + RelationalModel.CreateColumnMapping(zmianaTylkoCenColumn, sklepFlagi.FindProperty("ZmianaTylkoCen")!, sklepFlagiTableMapping); + + var sklepFormZgod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod")!; + + var defaultTableMappings174 = new List>(); + sklepFormZgod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings174); + var blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod", null, relationalModel); + var kolejnoscColumnBase31 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase31); + var sklepIdColumnBase19 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase.Columns.Add("SklepId", sklepIdColumnBase19); + var sklepTypOsIdColumnBase = new ColumnBase("SklepTypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase.Columns.Add("SklepTypOsId", sklepTypOsIdColumnBase); + var sklepZgIdColumnBase = new ColumnBase("SklepZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase.Columns.Add("SklepZgId", sklepZgIdColumnBase); + var wymaganaColumnBase0 = new ColumnBase("Wymagana", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase.Columns.Add("Wymagana", wymaganaColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod", blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase = new TableMappingBase(sklepFormZgod, blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepFormZgodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase, false); + defaultTableMappings174.Add(blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase19, sklepFormZgod.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTypOsIdColumnBase, sklepFormZgod.FindProperty("SklepTypOsId")!, blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZgIdColumnBase, sklepFormZgod.FindProperty("SklepZgId")!, blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase31, sklepFormZgod.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wymaganaColumnBase0, sklepFormZgod.FindProperty("Wymagana")!, blinkBackofficeServicesPcmDbEntitiesSklepFormZgodMappingBase); + + var tableMappings174 = new List(); + sklepFormZgod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings174); + var sklepFormZgodTable = new Table("SklepFormZgod", null, relationalModel); + var sklepIdColumn19 = new Column("SklepId", "numeric(9,0)", sklepFormZgodTable); + sklepFormZgodTable.Columns.Add("SklepId", sklepIdColumn19); + var sklepTypOsIdColumn = new Column("SklepTypOsId", "numeric(9,0)", sklepFormZgodTable); + sklepFormZgodTable.Columns.Add("SklepTypOsId", sklepTypOsIdColumn); + var sklepZgIdColumn = new Column("SklepZgId", "numeric(9,0)", sklepFormZgodTable); + sklepFormZgodTable.Columns.Add("SklepZgId", sklepZgIdColumn); + var kolejnoscColumn31 = new Column("Kolejnosc", "smallint", sklepFormZgodTable); + sklepFormZgodTable.Columns.Add("Kolejnosc", kolejnoscColumn31); + var wymaganaColumn0 = new Column("Wymagana", "smallint", sklepFormZgodTable) + { + IsNullable = true + }; + sklepFormZgodTable.Columns.Add("Wymagana", wymaganaColumn0); + var pK_SKLEPFORMZGOD = new UniqueConstraint("PK_SKLEPFORMZGOD", sklepFormZgodTable, new[] { sklepIdColumn19, sklepTypOsIdColumn, sklepZgIdColumn }); + sklepFormZgodTable.PrimaryKey = pK_SKLEPFORMZGOD; + var pK_SKLEPFORMZGODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod", + new[] { "SklepId", "SklepTypOsId", "SklepZgId" }); + pK_SKLEPFORMZGOD.MappedKeys.Add(pK_SKLEPFORMZGODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPFORMZGODUc).Add(pK_SKLEPFORMZGOD); + sklepFormZgodTable.UniqueConstraints.Add("PK_SKLEPFORMZGOD", pK_SKLEPFORMZGOD); + var idx_SKFMZG_SKZGODA = new TableIndex( + "idx_SKFMZG_SKZGODA", sklepFormZgodTable, new[] { sklepIdColumn19, sklepZgIdColumn }, false); + var idx_SKFMZG_SKZGODAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod", + "idx_SKFMZG_SKZGODA"); + idx_SKFMZG_SKZGODA.MappedIndexes.Add(idx_SKFMZG_SKZGODAIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKFMZG_SKZGODAIx).Add(idx_SKFMZG_SKZGODA); + sklepFormZgodTable.Indexes.Add("idx_SKFMZG_SKZGODA", idx_SKFMZG_SKZGODA); + relationalModel.Tables.Add(("SklepFormZgod", null), sklepFormZgodTable); + var sklepFormZgodTableMapping = new TableMapping(sklepFormZgod, sklepFormZgodTable, true); + sklepFormZgodTable.AddTypeMapping(sklepFormZgodTableMapping, false); + tableMappings174.Add(sklepFormZgodTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn19, sklepFormZgod.FindProperty("SklepId")!, sklepFormZgodTableMapping); + RelationalModel.CreateColumnMapping(sklepTypOsIdColumn, sklepFormZgod.FindProperty("SklepTypOsId")!, sklepFormZgodTableMapping); + RelationalModel.CreateColumnMapping(sklepZgIdColumn, sklepFormZgod.FindProperty("SklepZgId")!, sklepFormZgodTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn31, sklepFormZgod.FindProperty("Kolejnosc")!, sklepFormZgodTableMapping); + RelationalModel.CreateColumnMapping(wymaganaColumn0, sklepFormZgod.FindProperty("Wymagana")!, sklepFormZgodTableMapping); + + var sklepFormaPlatnPos7 = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepFormaPlatnPos7")!; + + var defaultTableMappings175 = new List>(); + sklepFormaPlatnPos7.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings175); + var blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepFormaPlatnPos7", null, relationalModel); + var aktywnyColumnBase32 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("Aktywny", aktywnyColumnBase32); + var autoryzacjaColumnBase1 = new ColumnBase("Autoryzacja", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("Autoryzacja", autoryzacjaColumnBase1); + var formaIdColumnBase1 = new ColumnBase("FormaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("FormaId", formaIdColumnBase1); + var kolejnoscColumnBase32 = new ColumnBase("Kolejnosc", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase32); + var nazwaColumnBase39 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("Nazwa", nazwaColumnBase39); + var resztaColumnBase0 = new ColumnBase("Reszta", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("Reszta", resztaColumnBase0); + var serwisPlatniczyColumnBase0 = new ColumnBase("SerwisPlatniczy", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("SerwisPlatniczy", serwisPlatniczyColumnBase0); + var sklepFormaIdColumnBase = new ColumnBase("SklepFormaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("SklepFormaId", sklepFormaIdColumnBase); + var sklepIdColumnBase20 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("SklepId", sklepIdColumnBase20); + var typColumnBase23 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("Typ", typColumnBase23); + var zmianaColumnBase39 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.Columns.Add("Zmiana", zmianaColumnBase39); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepFormaPlatnPos7", blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase = new TableMappingBase(sklepFormaPlatnPos7, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7TableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase, false); + defaultTableMappings175.Add(blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepFormaIdColumnBase, sklepFormaPlatnPos7.FindProperty("SklepFormaId")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase20, sklepFormaPlatnPos7.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase32, sklepFormaPlatnPos7.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)autoryzacjaColumnBase1, sklepFormaPlatnPos7.FindProperty("Autoryzacja")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaIdColumnBase1, sklepFormaPlatnPos7.FindProperty("FormaId")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase32, sklepFormaPlatnPos7.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase39, sklepFormaPlatnPos7.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)resztaColumnBase0, sklepFormaPlatnPos7.FindProperty("Reszta")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)serwisPlatniczyColumnBase0, sklepFormaPlatnPos7.FindProperty("SerwisPlatniczy")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase23, sklepFormaPlatnPos7.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase39, sklepFormaPlatnPos7.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepFormaPlatnPos7MappingBase); + + var tableMappings175 = new List(); + sklepFormaPlatnPos7.SetRuntimeAnnotation("Relational:TableMappings", tableMappings175); + var sklepFormaPlatnPos7Table = new Table("SklepFormaPlatnPos7", null, relationalModel); + var sklepIdColumn20 = new Column("SklepId", "numeric(9,0)", sklepFormaPlatnPos7Table); + sklepFormaPlatnPos7Table.Columns.Add("SklepId", sklepIdColumn20); + var sklepFormaIdColumn = new Column("SklepFormaId", "numeric(9,0)", sklepFormaPlatnPos7Table); + sklepFormaPlatnPos7Table.Columns.Add("SklepFormaId", sklepFormaIdColumn); + var aktywnyColumn32 = new Column("Aktywny", "smallint", sklepFormaPlatnPos7Table); + sklepFormaPlatnPos7Table.Columns.Add("Aktywny", aktywnyColumn32); + var autoryzacjaColumn1 = new Column("Autoryzacja", "smallint", sklepFormaPlatnPos7Table) + { + IsNullable = true + }; + sklepFormaPlatnPos7Table.Columns.Add("Autoryzacja", autoryzacjaColumn1); + var formaIdColumn1 = new Column("FormaId", "numeric(9,0)", sklepFormaPlatnPos7Table) + { + IsNullable = true + }; + sklepFormaPlatnPos7Table.Columns.Add("FormaId", formaIdColumn1); + var kolejnoscColumn32 = new Column("Kolejnosc", "numeric(9,0)", sklepFormaPlatnPos7Table) + { + IsNullable = true + }; + sklepFormaPlatnPos7Table.Columns.Add("Kolejnosc", kolejnoscColumn32); + var nazwaColumn39 = new Column("Nazwa", "varchar(60)", sklepFormaPlatnPos7Table); + sklepFormaPlatnPos7Table.Columns.Add("Nazwa", nazwaColumn39); + var resztaColumn0 = new Column("Reszta", "smallint", sklepFormaPlatnPos7Table); + sklepFormaPlatnPos7Table.Columns.Add("Reszta", resztaColumn0); + var serwisPlatniczyColumn0 = new Column("SerwisPlatniczy", "varchar(40)", sklepFormaPlatnPos7Table) + { + IsNullable = true + }; + sklepFormaPlatnPos7Table.Columns.Add("SerwisPlatniczy", serwisPlatniczyColumn0); + var typColumn23 = new Column("Typ", "smallint", sklepFormaPlatnPos7Table); + sklepFormaPlatnPos7Table.Columns.Add("Typ", typColumn23); + var zmianaColumn39 = new Column("Zmiana", "datetime", sklepFormaPlatnPos7Table); + sklepFormaPlatnPos7Table.Columns.Add("Zmiana", zmianaColumn39); + var pK_SklepFormaPlatnPos7 = new UniqueConstraint("PK_SklepFormaPlatnPos7", sklepFormaPlatnPos7Table, new[] { sklepIdColumn20, sklepFormaIdColumn }); + sklepFormaPlatnPos7Table.PrimaryKey = pK_SklepFormaPlatnPos7; + var pK_SklepFormaPlatnPos7Uc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormaPlatnPos7", + new[] { "SklepId", "SklepFormaId" }); + pK_SklepFormaPlatnPos7.MappedKeys.Add(pK_SklepFormaPlatnPos7Uc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepFormaPlatnPos7Uc).Add(pK_SklepFormaPlatnPos7); + sklepFormaPlatnPos7Table.UniqueConstraints.Add("PK_SklepFormaPlatnPos7", pK_SklepFormaPlatnPos7); + relationalModel.Tables.Add(("SklepFormaPlatnPos7", null), sklepFormaPlatnPos7Table); + var sklepFormaPlatnPos7TableMapping = new TableMapping(sklepFormaPlatnPos7, sklepFormaPlatnPos7Table, true); + sklepFormaPlatnPos7Table.AddTypeMapping(sklepFormaPlatnPos7TableMapping, false); + tableMappings175.Add(sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(sklepFormaIdColumn, sklepFormaPlatnPos7.FindProperty("SklepFormaId")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn20, sklepFormaPlatnPos7.FindProperty("SklepId")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn32, sklepFormaPlatnPos7.FindProperty("Aktywny")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(autoryzacjaColumn1, sklepFormaPlatnPos7.FindProperty("Autoryzacja")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(formaIdColumn1, sklepFormaPlatnPos7.FindProperty("FormaId")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn32, sklepFormaPlatnPos7.FindProperty("Kolejnosc")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn39, sklepFormaPlatnPos7.FindProperty("Nazwa")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(resztaColumn0, sklepFormaPlatnPos7.FindProperty("Reszta")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(serwisPlatniczyColumn0, sklepFormaPlatnPos7.FindProperty("SerwisPlatniczy")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(typColumn23, sklepFormaPlatnPos7.FindProperty("Typ")!, sklepFormaPlatnPos7TableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn39, sklepFormaPlatnPos7.FindProperty("Zmiana")!, sklepFormaPlatnPos7TableMapping); + + var sklepGrupaAkcyzowa = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa")!; + + var defaultTableMappings176 = new List>(); + sklepGrupaAkcyzowa.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings176); + var blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa", null, relationalModel); + var centrGrAkcIdColumnBase0 = new ColumnBase("CentrGrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase.Columns.Add("CentrGrAkcId", centrGrAkcIdColumnBase0); + var kodColumnBase11 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase.Columns.Add("Kod", kodColumnBase11); + var sklepGrAkcIdColumnBase = new ColumnBase("SklepGrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase.Columns.Add("SklepGrAkcId", sklepGrAkcIdColumnBase); + var sklepIdColumnBase21 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase.Columns.Add("SklepId", sklepIdColumnBase21); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa", blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaMappingBase = new TableMappingBase(sklepGrupaAkcyzowa, blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaMappingBase, false); + defaultTableMappings176.Add(blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepGrAkcIdColumnBase, sklepGrupaAkcyzowa.FindProperty("SklepGrAkcId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase21, sklepGrupaAkcyzowa.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrGrAkcIdColumnBase0, sklepGrupaAkcyzowa.FindProperty("CentrGrAkcId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase11, sklepGrupaAkcyzowa.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaAkcyzowaMappingBase); + + var tableMappings176 = new List(); + sklepGrupaAkcyzowa.SetRuntimeAnnotation("Relational:TableMappings", tableMappings176); + var sklepGrupaAkcyzowaTable = new Table("SklepGrupaAkcyzowa", null, relationalModel); + var sklepIdColumn21 = new Column("SklepId", "numeric(9,0)", sklepGrupaAkcyzowaTable); + sklepGrupaAkcyzowaTable.Columns.Add("SklepId", sklepIdColumn21); + var sklepGrAkcIdColumn = new Column("SklepGrAkcId", "numeric(9,0)", sklepGrupaAkcyzowaTable); + sklepGrupaAkcyzowaTable.Columns.Add("SklepGrAkcId", sklepGrAkcIdColumn); + var centrGrAkcIdColumn0 = new Column("CentrGrAkcId", "numeric(9,0)", sklepGrupaAkcyzowaTable) + { + IsNullable = true + }; + sklepGrupaAkcyzowaTable.Columns.Add("CentrGrAkcId", centrGrAkcIdColumn0); + var kodColumn11 = new Column("Kod", "varchar(20)", sklepGrupaAkcyzowaTable); + sklepGrupaAkcyzowaTable.Columns.Add("Kod", kodColumn11); + var pK_SKLEPGRUPAAKCYZOWA = new UniqueConstraint("PK_SKLEPGRUPAAKCYZOWA", sklepGrupaAkcyzowaTable, new[] { sklepIdColumn21, sklepGrAkcIdColumn }); + sklepGrupaAkcyzowaTable.PrimaryKey = pK_SKLEPGRUPAAKCYZOWA; + var pK_SKLEPGRUPAAKCYZOWAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa", + new[] { "SklepId", "SklepGrAkcId" }); + pK_SKLEPGRUPAAKCYZOWA.MappedKeys.Add(pK_SKLEPGRUPAAKCYZOWAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPGRUPAAKCYZOWAUc).Add(pK_SKLEPGRUPAAKCYZOWA); + sklepGrupaAkcyzowaTable.UniqueConstraints.Add("PK_SKLEPGRUPAAKCYZOWA", pK_SKLEPGRUPAAKCYZOWA); + relationalModel.Tables.Add(("SklepGrupaAkcyzowa", null), sklepGrupaAkcyzowaTable); + var sklepGrupaAkcyzowaTableMapping = new TableMapping(sklepGrupaAkcyzowa, sklepGrupaAkcyzowaTable, true); + sklepGrupaAkcyzowaTable.AddTypeMapping(sklepGrupaAkcyzowaTableMapping, false); + tableMappings176.Add(sklepGrupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(sklepGrAkcIdColumn, sklepGrupaAkcyzowa.FindProperty("SklepGrAkcId")!, sklepGrupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn21, sklepGrupaAkcyzowa.FindProperty("SklepId")!, sklepGrupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(centrGrAkcIdColumn0, sklepGrupaAkcyzowa.FindProperty("CentrGrAkcId")!, sklepGrupaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(kodColumn11, sklepGrupaAkcyzowa.FindProperty("Kod")!, sklepGrupaAkcyzowaTableMapping); + + var sklepGrupaPromocji = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaPromocji")!; + + var defaultTableMappings177 = new List>(); + sklepGrupaPromocji.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings177); + var blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaPromocji", null, relationalModel); + var aktywnaColumnBase1 = new ColumnBase("Aktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("Aktywna", aktywnaColumnBase1); + var grupaIdColumnBase1 = new ColumnBase("GrupaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("GrupaId", grupaIdColumnBase1); + var nazwaColumnBase40 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("Nazwa", nazwaColumnBase40); + var opisColumnBase5 = new ColumnBase("Opis", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("Opis", opisColumnBase5); + var sklepGrupaIdColumnBase = new ColumnBase("SklepGrupaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("SklepGrupaId", sklepGrupaIdColumnBase); + var sklepIdColumnBase22 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("SklepId", sklepIdColumnBase22); + var typColumnBase24 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("Typ", typColumnBase24); + var zmianaColumnBase40 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.Columns.Add("Zmiana", zmianaColumnBase40); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaPromocji", blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase = new TableMappingBase(sklepGrupaPromocji, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase, false); + defaultTableMappings177.Add(blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepGrupaIdColumnBase, sklepGrupaPromocji.FindProperty("SklepGrupaId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase22, sklepGrupaPromocji.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnaColumnBase1, sklepGrupaPromocji.FindProperty("Aktywna")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupaIdColumnBase1, sklepGrupaPromocji.FindProperty("GrupaId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase40, sklepGrupaPromocji.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase5, sklepGrupaPromocji.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase24, sklepGrupaPromocji.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase40, sklepGrupaPromocji.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaPromocjiMappingBase); + + var tableMappings177 = new List(); + sklepGrupaPromocji.SetRuntimeAnnotation("Relational:TableMappings", tableMappings177); + var sklepGrupaPromocjiTable = new Table("SklepGrupaPromocji", null, relationalModel); + var sklepIdColumn22 = new Column("SklepId", "numeric(9,0)", sklepGrupaPromocjiTable); + sklepGrupaPromocjiTable.Columns.Add("SklepId", sklepIdColumn22); + var sklepGrupaIdColumn = new Column("SklepGrupaId", "numeric(9,0)", sklepGrupaPromocjiTable); + sklepGrupaPromocjiTable.Columns.Add("SklepGrupaId", sklepGrupaIdColumn); + var aktywnaColumn1 = new Column("Aktywna", "smallint", sklepGrupaPromocjiTable); + sklepGrupaPromocjiTable.Columns.Add("Aktywna", aktywnaColumn1); + var grupaIdColumn1 = new Column("GrupaId", "numeric(9,0)", sklepGrupaPromocjiTable) + { + IsNullable = true + }; + sklepGrupaPromocjiTable.Columns.Add("GrupaId", grupaIdColumn1); + var nazwaColumn40 = new Column("Nazwa", "varchar(255)", sklepGrupaPromocjiTable); + sklepGrupaPromocjiTable.Columns.Add("Nazwa", nazwaColumn40); + var opisColumn5 = new Column("Opis", "varchar(255)", sklepGrupaPromocjiTable); + sklepGrupaPromocjiTable.Columns.Add("Opis", opisColumn5); + var typColumn24 = new Column("Typ", "smallint", sklepGrupaPromocjiTable); + sklepGrupaPromocjiTable.Columns.Add("Typ", typColumn24); + var zmianaColumn40 = new Column("Zmiana", "datetime", sklepGrupaPromocjiTable); + sklepGrupaPromocjiTable.Columns.Add("Zmiana", zmianaColumn40); + var pK_SklepGrupaPromocji = new UniqueConstraint("PK_SklepGrupaPromocji", sklepGrupaPromocjiTable, new[] { sklepIdColumn22, sklepGrupaIdColumn }); + sklepGrupaPromocjiTable.PrimaryKey = pK_SklepGrupaPromocji; + var pK_SklepGrupaPromocjiUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaPromocji", + new[] { "SklepId", "SklepGrupaId" }); + pK_SklepGrupaPromocji.MappedKeys.Add(pK_SklepGrupaPromocjiUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepGrupaPromocjiUc).Add(pK_SklepGrupaPromocji); + sklepGrupaPromocjiTable.UniqueConstraints.Add("PK_SklepGrupaPromocji", pK_SklepGrupaPromocji); + relationalModel.Tables.Add(("SklepGrupaPromocji", null), sklepGrupaPromocjiTable); + var sklepGrupaPromocjiTableMapping = new TableMapping(sklepGrupaPromocji, sklepGrupaPromocjiTable, true); + sklepGrupaPromocjiTable.AddTypeMapping(sklepGrupaPromocjiTableMapping, false); + tableMappings177.Add(sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(sklepGrupaIdColumn, sklepGrupaPromocji.FindProperty("SklepGrupaId")!, sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn22, sklepGrupaPromocji.FindProperty("SklepId")!, sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(aktywnaColumn1, sklepGrupaPromocji.FindProperty("Aktywna")!, sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(grupaIdColumn1, sklepGrupaPromocji.FindProperty("GrupaId")!, sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn40, sklepGrupaPromocji.FindProperty("Nazwa")!, sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(opisColumn5, sklepGrupaPromocji.FindProperty("Opis")!, sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(typColumn24, sklepGrupaPromocji.FindProperty("Typ")!, sklepGrupaPromocjiTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn40, sklepGrupaPromocji.FindProperty("Zmiana")!, sklepGrupaPromocjiTableMapping); + + var sklepGrupaUz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz")!; + + var defaultTableMappings178 = new List>(); + sklepGrupaUz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings178); + var blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz", null, relationalModel); + var sklepIdColumnBase23 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase.Columns.Add("SklepId", sklepIdColumnBase23); + var sklepRolaIdColumnBase = new ColumnBase("SklepRolaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase.Columns.Add("SklepRolaId", sklepRolaIdColumnBase); + var sklepUzIdColumnBase1 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz", blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzMappingBase = new TableMappingBase(sklepGrupaUz, blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzMappingBase, false); + defaultTableMappings178.Add(blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase23, sklepGrupaUz.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase1, sklepGrupaUz.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRolaIdColumnBase, sklepGrupaUz.FindProperty("SklepRolaId")!, blinkBackofficeServicesPcmDbEntitiesSklepGrupaUzMappingBase); + + var tableMappings178 = new List(); + sklepGrupaUz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings178); + var sklepGrupaUzTable = new Table("SklepGrupaUz", null, relationalModel); + var sklepIdColumn23 = new Column("SklepId", "numeric(9,0)", sklepGrupaUzTable); + sklepGrupaUzTable.Columns.Add("SklepId", sklepIdColumn23); + var sklepUzIdColumn1 = new Column("SklepUzId", "numeric(9,0)", sklepGrupaUzTable); + sklepGrupaUzTable.Columns.Add("SklepUzId", sklepUzIdColumn1); + var sklepRolaIdColumn = new Column("SklepRolaId", "numeric(9,0)", sklepGrupaUzTable); + sklepGrupaUzTable.Columns.Add("SklepRolaId", sklepRolaIdColumn); + var pK_SK_GR_UZ = new UniqueConstraint("PK_SK_GR_UZ", sklepGrupaUzTable, new[] { sklepIdColumn23, sklepUzIdColumn1 }); + sklepGrupaUzTable.PrimaryKey = pK_SK_GR_UZ; + var pK_SK_GR_UZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz", + new[] { "SklepId", "SklepUzId" }); + pK_SK_GR_UZ.MappedKeys.Add(pK_SK_GR_UZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SK_GR_UZUc).Add(pK_SK_GR_UZ); + sklepGrupaUzTable.UniqueConstraints.Add("PK_SK_GR_UZ", pK_SK_GR_UZ); + var idx_SkRola = new TableIndex( + "idx_SkRola", sklepGrupaUzTable, new[] { sklepIdColumn23, sklepRolaIdColumn }, false); + var idx_SkRolaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz", + "idx_SkRola"); + idx_SkRola.MappedIndexes.Add(idx_SkRolaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkRolaIx).Add(idx_SkRola); + sklepGrupaUzTable.Indexes.Add("idx_SkRola", idx_SkRola); + relationalModel.Tables.Add(("SklepGrupaUz", null), sklepGrupaUzTable); + var sklepGrupaUzTableMapping = new TableMapping(sklepGrupaUz, sklepGrupaUzTable, true); + sklepGrupaUzTable.AddTypeMapping(sklepGrupaUzTableMapping, false); + tableMappings178.Add(sklepGrupaUzTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn23, sklepGrupaUz.FindProperty("SklepId")!, sklepGrupaUzTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn1, sklepGrupaUz.FindProperty("SklepUzId")!, sklepGrupaUzTableMapping); + RelationalModel.CreateColumnMapping(sklepRolaIdColumn, sklepGrupaUz.FindProperty("SklepRolaId")!, sklepGrupaUzTableMapping); + + var sklepIstw = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepIstw")!; + + var defaultTableMappings179 = new List>(); + sklepIstw.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings179); + var blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepIstw", null, relationalModel); + var cenaMagColumnBase1 = new ColumnBase("CenaMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("CenaMag", cenaMagColumnBase1); + var rezerwacjaMagColumnBase0 = new ColumnBase("RezerwacjaMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("RezerwacjaMag", rezerwacjaMagColumnBase0); + var sklepIdColumnBase24 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("SklepId", sklepIdColumnBase24); + var sklepMagIdColumnBase0 = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase0); + var sklepTowIdColumnBase0 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase0); + var stanMagColumnBase0 = new ColumnBase("StanMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("StanMag", stanMagColumnBase0); + var stanMaxColumnBase0 = new ColumnBase("StanMax", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("StanMax", stanMaxColumnBase0); + var stanMinColumnBase0 = new ColumnBase("StanMin", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.Columns.Add("StanMin", stanMinColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepIstw", blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase = new TableMappingBase(sklepIstw, blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepIstwTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase, false); + defaultTableMappings179.Add(blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase24, sklepIstw.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase0, sklepIstw.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase0, sklepIstw.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaMagColumnBase1, sklepIstw.FindProperty("CenaMag")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwacjaMagColumnBase0, sklepIstw.FindProperty("RezerwacjaMag")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanMagColumnBase0, sklepIstw.FindProperty("StanMag")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanMaxColumnBase0, sklepIstw.FindProperty("StanMax")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanMinColumnBase0, sklepIstw.FindProperty("StanMin")!, blinkBackofficeServicesPcmDbEntitiesSklepIstwMappingBase); + + var tableMappings179 = new List(); + sklepIstw.SetRuntimeAnnotation("Relational:TableMappings", tableMappings179); + var sklepIstwTable = new Table("SklepIstw", null, relationalModel); + var sklepIdColumn24 = new Column("SklepId", "numeric(9,0)", sklepIstwTable); + sklepIstwTable.Columns.Add("SklepId", sklepIdColumn24); + var sklepTowIdColumn0 = new Column("SklepTowId", "numeric(9,0)", sklepIstwTable); + sklepIstwTable.Columns.Add("SklepTowId", sklepTowIdColumn0); + var sklepMagIdColumn0 = new Column("SklepMagId", "numeric(9,0)", sklepIstwTable); + sklepIstwTable.Columns.Add("SklepMagId", sklepMagIdColumn0); + var cenaMagColumn1 = new Column("CenaMag", "decimal(15,4)", sklepIstwTable); + sklepIstwTable.Columns.Add("CenaMag", cenaMagColumn1); + var rezerwacjaMagColumn0 = new Column("RezerwacjaMag", "decimal(15,4)", sklepIstwTable) + { + IsNullable = true + }; + sklepIstwTable.Columns.Add("RezerwacjaMag", rezerwacjaMagColumn0); + var stanMagColumn0 = new Column("StanMag", "decimal(15,4)", sklepIstwTable); + sklepIstwTable.Columns.Add("StanMag", stanMagColumn0); + var stanMaxColumn0 = new Column("StanMax", "decimal(15,4)", sklepIstwTable); + sklepIstwTable.Columns.Add("StanMax", stanMaxColumn0); + var stanMinColumn0 = new Column("StanMin", "decimal(15,4)", sklepIstwTable); + sklepIstwTable.Columns.Add("StanMin", stanMinColumn0); + var pK_SKLEPISTW = new UniqueConstraint("PK_SKLEPISTW", sklepIstwTable, new[] { sklepIdColumn24, sklepTowIdColumn0, sklepMagIdColumn0 }); + sklepIstwTable.PrimaryKey = pK_SKLEPISTW; + var pK_SKLEPISTWUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepIstw", + new[] { "SklepId", "SklepTowId", "SklepMagId" }); + pK_SKLEPISTW.MappedKeys.Add(pK_SKLEPISTWUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPISTWUc).Add(pK_SKLEPISTW); + sklepIstwTable.UniqueConstraints.Add("PK_SKLEPISTW", pK_SKLEPISTW); + var iX_SklepIstw_SklepId_SklepMagId = new TableIndex( + "IX_SklepIstw_SklepId_SklepMagId", sklepIstwTable, new[] { sklepIdColumn24, sklepMagIdColumn0 }, false); + var iX_SklepIstw_SklepId_SklepMagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepIstw", + new[] { "SklepId", "SklepMagId" }); + iX_SklepIstw_SklepId_SklepMagId.MappedIndexes.Add(iX_SklepIstw_SklepId_SklepMagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepIstw_SklepId_SklepMagIdIx).Add(iX_SklepIstw_SklepId_SklepMagId); + sklepIstwTable.Indexes.Add("IX_SklepIstw_SklepId_SklepMagId", iX_SklepIstw_SklepId_SklepMagId); + relationalModel.Tables.Add(("SklepIstw", null), sklepIstwTable); + var sklepIstwTableMapping = new TableMapping(sklepIstw, sklepIstwTable, true); + sklepIstwTable.AddTypeMapping(sklepIstwTableMapping, false); + tableMappings179.Add(sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn24, sklepIstw.FindProperty("SklepId")!, sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn0, sklepIstw.FindProperty("SklepMagId")!, sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn0, sklepIstw.FindProperty("SklepTowId")!, sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(cenaMagColumn1, sklepIstw.FindProperty("CenaMag")!, sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(rezerwacjaMagColumn0, sklepIstw.FindProperty("RezerwacjaMag")!, sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(stanMagColumn0, sklepIstw.FindProperty("StanMag")!, sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(stanMaxColumn0, sklepIstw.FindProperty("StanMax")!, sklepIstwTableMapping); + RelationalModel.CreateColumnMapping(stanMinColumn0, sklepIstw.FindProperty("StanMin")!, sklepIstwTableMapping); + + var sklepKartaLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj")!; + + var defaultTableMappings180 = new List>(); + sklepKartaLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings180); + var blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", null, relationalModel); + var kodKartyColumnBase2 = new ColumnBase("KodKarty", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("KodKarty", kodKartyColumnBase2); + var opis1ColumnBase1 = new ColumnBase("Opis1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("Opis1", opis1ColumnBase1); + var opis2ColumnBase1 = new ColumnBase("Opis2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("Opis2", opis2ColumnBase1); + var posiadaczColumnBase0 = new ColumnBase("Posiadacz", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("Posiadacz", posiadaczColumnBase0); + var sklepIdColumnBase25 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("SklepId", sklepIdColumnBase25); + var sklepKartaIdColumnBase = new ColumnBase("SklepKartaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("SklepKartaId", sklepKartaIdColumnBase); + var sklepKontoIdColumnBase = new ColumnBase("SklepKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("SklepKontoId", sklepKontoIdColumnBase); + var typKartyColumnBase1 = new ColumnBase("TypKarty", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("TypKarty", typKartyColumnBase1); + var uniewaznionoColumnBase0 = new ColumnBase("Uniewazniono", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("Uniewazniono", uniewaznionoColumnBase0); + var waznaDoColumnBase0 = new ColumnBase("WaznaDo", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("WaznaDo", waznaDoColumnBase0); + var waznaOdColumnBase0 = new ColumnBase("WaznaOd", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.Columns.Add("WaznaOd", waznaOdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase = new TableMappingBase(sklepKartaLoj, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKartaLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase, false); + defaultTableMappings180.Add(blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase25, sklepKartaLoj.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKartaIdColumnBase, sklepKartaLoj.FindProperty("SklepKartaId")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKartyColumnBase2, sklepKartaLoj.FindProperty("KodKarty")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis1ColumnBase1, sklepKartaLoj.FindProperty("Opis1")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis2ColumnBase1, sklepKartaLoj.FindProperty("Opis2")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posiadaczColumnBase0, sklepKartaLoj.FindProperty("Posiadacz")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontoIdColumnBase, sklepKartaLoj.FindProperty("SklepKontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKartyColumnBase1, sklepKartaLoj.FindProperty("TypKarty")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uniewaznionoColumnBase0, sklepKartaLoj.FindProperty("Uniewazniono")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)waznaDoColumnBase0, sklepKartaLoj.FindProperty("WaznaDo")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)waznaOdColumnBase0, sklepKartaLoj.FindProperty("WaznaOd")!, blinkBackofficeServicesPcmDbEntitiesSklepKartaLojMappingBase); + + var tableMappings180 = new List(); + sklepKartaLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings180); + var sklepKartaLojTable = new Table("SklepKartaLoj", null, relationalModel); + var sklepIdColumn25 = new Column("SklepId", "numeric(9,0)", sklepKartaLojTable); + sklepKartaLojTable.Columns.Add("SklepId", sklepIdColumn25); + var sklepKartaIdColumn = new Column("SklepKartaId", "numeric(9,0)", sklepKartaLojTable); + sklepKartaLojTable.Columns.Add("SklepKartaId", sklepKartaIdColumn); + var kodKartyColumn2 = new Column("KodKarty", "varchar(40)", sklepKartaLojTable) + { + IsNullable = true + }; + sklepKartaLojTable.Columns.Add("KodKarty", kodKartyColumn2); + var opis1Column1 = new Column("Opis1", "varchar(40)", sklepKartaLojTable) + { + IsNullable = true + }; + sklepKartaLojTable.Columns.Add("Opis1", opis1Column1); + var opis2Column1 = new Column("Opis2", "varchar(40)", sklepKartaLojTable) + { + IsNullable = true + }; + sklepKartaLojTable.Columns.Add("Opis2", opis2Column1); + var posiadaczColumn0 = new Column("Posiadacz", "varchar(40)", sklepKartaLojTable) + { + IsNullable = true + }; + sklepKartaLojTable.Columns.Add("Posiadacz", posiadaczColumn0); + var sklepKontoIdColumn = new Column("SklepKontoId", "numeric(9,0)", sklepKartaLojTable); + sklepKartaLojTable.Columns.Add("SklepKontoId", sklepKontoIdColumn); + var typKartyColumn1 = new Column("TypKarty", "smallint", sklepKartaLojTable); + sklepKartaLojTable.Columns.Add("TypKarty", typKartyColumn1); + var uniewaznionoColumn0 = new Column("Uniewazniono", "datetime", sklepKartaLojTable) + { + IsNullable = true + }; + sklepKartaLojTable.Columns.Add("Uniewazniono", uniewaznionoColumn0); + var waznaDoColumn0 = new Column("WaznaDo", "datetime", sklepKartaLojTable) + { + IsNullable = true + }; + sklepKartaLojTable.Columns.Add("WaznaDo", waznaDoColumn0); + var waznaOdColumn0 = new Column("WaznaOd", "datetime", sklepKartaLojTable) + { + IsNullable = true + }; + sklepKartaLojTable.Columns.Add("WaznaOd", waznaOdColumn0); + var pK_SKLEPKARTALOJ = new UniqueConstraint("PK_SKLEPKARTALOJ", sklepKartaLojTable, new[] { sklepIdColumn25, sklepKartaIdColumn }); + sklepKartaLojTable.PrimaryKey = pK_SKLEPKARTALOJ; + var pK_SKLEPKARTALOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", + new[] { "SklepId", "SklepKartaId" }); + pK_SKLEPKARTALOJ.MappedKeys.Add(pK_SKLEPKARTALOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPKARTALOJUc).Add(pK_SKLEPKARTALOJ); + sklepKartaLojTable.UniqueConstraints.Add("PK_SKLEPKARTALOJ", pK_SKLEPKARTALOJ); + var idx_SKLoj_KodKarty = new TableIndex( + "idx_SKLoj_KodKarty", sklepKartaLojTable, new[] { kodKartyColumn2 }, false); + var idx_SKLoj_KodKartyIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", + "idx_SKLoj_KodKarty"); + idx_SKLoj_KodKarty.MappedIndexes.Add(idx_SKLoj_KodKartyIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKLoj_KodKartyIx).Add(idx_SKLoj_KodKarty); + sklepKartaLojTable.Indexes.Add("idx_SKLoj_KodKarty", idx_SKLoj_KodKarty); + var idx_SKLoj_SKonto = new TableIndex( + "idx_SKLoj_SKonto", sklepKartaLojTable, new[] { sklepIdColumn25, sklepKontoIdColumn }, false); + var idx_SKLoj_SKontoIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", + "idx_SKLoj_SKonto"); + idx_SKLoj_SKonto.MappedIndexes.Add(idx_SKLoj_SKontoIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKLoj_SKontoIx).Add(idx_SKLoj_SKonto); + sklepKartaLojTable.Indexes.Add("idx_SKLoj_SKonto", idx_SKLoj_SKonto); + relationalModel.Tables.Add(("SklepKartaLoj", null), sklepKartaLojTable); + var sklepKartaLojTableMapping = new TableMapping(sklepKartaLoj, sklepKartaLojTable, true); + sklepKartaLojTable.AddTypeMapping(sklepKartaLojTableMapping, false); + tableMappings180.Add(sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn25, sklepKartaLoj.FindProperty("SklepId")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(sklepKartaIdColumn, sklepKartaLoj.FindProperty("SklepKartaId")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(kodKartyColumn2, sklepKartaLoj.FindProperty("KodKarty")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(opis1Column1, sklepKartaLoj.FindProperty("Opis1")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(opis2Column1, sklepKartaLoj.FindProperty("Opis2")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(posiadaczColumn0, sklepKartaLoj.FindProperty("Posiadacz")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(sklepKontoIdColumn, sklepKartaLoj.FindProperty("SklepKontoId")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(typKartyColumn1, sklepKartaLoj.FindProperty("TypKarty")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(uniewaznionoColumn0, sklepKartaLoj.FindProperty("Uniewazniono")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(waznaDoColumn0, sklepKartaLoj.FindProperty("WaznaDo")!, sklepKartaLojTableMapping); + RelationalModel.CreateColumnMapping(waznaOdColumn0, sklepKartaLoj.FindProperty("WaznaOd")!, sklepKartaLojTableMapping); + + var sklepKasa = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKasa")!; + + var defaultTableMappings181 = new List>(); + sklepKasa.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings181); + var blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", null, relationalModel); + var aktywnyColumnBase33 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("Aktywny", aktywnyColumnBase33); + var nazwaColumnBase41 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("Nazwa", nazwaColumnBase41); + var nrUnikatowyColumnBase0 = new ColumnBase("NrUnikatowy", "varchar(30)", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("NrUnikatowy", nrUnikatowyColumnBase0); + var numerColumnBase5 = new ColumnBase("Numer", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("Numer", numerColumnBase5); + var rodzajColumnBase6 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("Rodzaj", rodzajColumnBase6); + var sklepIdColumnBase26 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("SklepId", sklepIdColumnBase26); + var sklepKasaIdColumnBase0 = new ColumnBase("SklepKasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("SklepKasaId", sklepKasaIdColumnBase0); + var sklepMagIdColumnBase1 = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase1); + var stanowiskoColumnBase1 = new ColumnBase("Stanowisko", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("Stanowisko", stanowiskoColumnBase1); + var typColumnBase25 = new ColumnBase("Typ", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.Columns.Add("Typ", typColumnBase25); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase = new TableMappingBase(sklepKasa, blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKasaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase, false); + defaultTableMappings181.Add(blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase26, sklepKasa.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKasaIdColumnBase0, sklepKasa.FindProperty("SklepKasaId")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase33, sklepKasa.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase41, sklepKasa.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrUnikatowyColumnBase0, sklepKasa.FindProperty("NrUnikatowy")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase5, sklepKasa.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase6, sklepKasa.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase1, sklepKasa.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanowiskoColumnBase1, sklepKasa.FindProperty("Stanowisko")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase25, sklepKasa.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaMappingBase); + + var tableMappings181 = new List(); + sklepKasa.SetRuntimeAnnotation("Relational:TableMappings", tableMappings181); + var sklepKasaTable = new Table("SklepKasa", null, relationalModel); + var sklepIdColumn26 = new Column("SklepId", "numeric(9,0)", sklepKasaTable); + sklepKasaTable.Columns.Add("SklepId", sklepIdColumn26); + var sklepKasaIdColumn0 = new Column("SklepKasaId", "numeric(9,0)", sklepKasaTable); + sklepKasaTable.Columns.Add("SklepKasaId", sklepKasaIdColumn0); + var aktywnyColumn33 = new Column("Aktywny", "smallint", sklepKasaTable); + sklepKasaTable.Columns.Add("Aktywny", aktywnyColumn33); + var nazwaColumn41 = new Column("Nazwa", "varchar(40)", sklepKasaTable); + sklepKasaTable.Columns.Add("Nazwa", nazwaColumn41); + var nrUnikatowyColumn0 = new Column("NrUnikatowy", "varchar(30)", sklepKasaTable) + { + IsNullable = true + }; + sklepKasaTable.Columns.Add("NrUnikatowy", nrUnikatowyColumn0); + var numerColumn5 = new Column("Numer", "smallint", sklepKasaTable); + sklepKasaTable.Columns.Add("Numer", numerColumn5); + var rodzajColumn6 = new Column("Rodzaj", "smallint", sklepKasaTable); + sklepKasaTable.Columns.Add("Rodzaj", rodzajColumn6); + var sklepMagIdColumn1 = new Column("SklepMagId", "numeric(9,0)", sklepKasaTable); + sklepKasaTable.Columns.Add("SklepMagId", sklepMagIdColumn1); + var stanowiskoColumn1 = new Column("Stanowisko", "varchar(40)", sklepKasaTable); + sklepKasaTable.Columns.Add("Stanowisko", stanowiskoColumn1); + var typColumn25 = new Column("Typ", "varchar(40)", sklepKasaTable); + sklepKasaTable.Columns.Add("Typ", typColumn25); + var pK_SKLEPKASA = new UniqueConstraint("PK_SKLEPKASA", sklepKasaTable, new[] { sklepIdColumn26, sklepKasaIdColumn0 }); + sklepKasaTable.PrimaryKey = pK_SKLEPKASA; + var pK_SKLEPKASAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + new[] { "SklepId", "SklepKasaId" }); + pK_SKLEPKASA.MappedKeys.Add(pK_SKLEPKASAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPKASAUc).Add(pK_SKLEPKASA); + sklepKasaTable.UniqueConstraints.Add("PK_SKLEPKASA", pK_SKLEPKASA); + var iX_SklepKasa_SklepId_SklepMagId = new TableIndex( + "IX_SklepKasa_SklepId_SklepMagId", sklepKasaTable, new[] { sklepIdColumn26, sklepMagIdColumn1 }, false); + var iX_SklepKasa_SklepId_SklepMagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + new[] { "SklepId", "SklepMagId" }); + iX_SklepKasa_SklepId_SklepMagId.MappedIndexes.Add(iX_SklepKasa_SklepId_SklepMagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKasa_SklepId_SklepMagIdIx).Add(iX_SklepKasa_SklepId_SklepMagId); + sklepKasaTable.Indexes.Add("IX_SklepKasa_SklepId_SklepMagId", iX_SklepKasa_SklepId_SklepMagId); + relationalModel.Tables.Add(("SklepKasa", null), sklepKasaTable); + var sklepKasaTableMapping = new TableMapping(sklepKasa, sklepKasaTable, true); + sklepKasaTable.AddTypeMapping(sklepKasaTableMapping, false); + tableMappings181.Add(sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn26, sklepKasa.FindProperty("SklepId")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(sklepKasaIdColumn0, sklepKasa.FindProperty("SklepKasaId")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn33, sklepKasa.FindProperty("Aktywny")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn41, sklepKasa.FindProperty("Nazwa")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(nrUnikatowyColumn0, sklepKasa.FindProperty("NrUnikatowy")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(numerColumn5, sklepKasa.FindProperty("Numer")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn6, sklepKasa.FindProperty("Rodzaj")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn1, sklepKasa.FindProperty("SklepMagId")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(stanowiskoColumn1, sklepKasa.FindProperty("Stanowisko")!, sklepKasaTableMapping); + RelationalModel.CreateColumnMapping(typColumn25, sklepKasa.FindProperty("Typ")!, sklepKasaTableMapping); + + var sklepKasaFormaPlatn = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn")!; + + var defaultTableMappings182 = new List>(); + sklepKasaFormaPlatn.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings182); + var blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn", null, relationalModel); + var aktywnyColumnBase34 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase.Columns.Add("Aktywny", aktywnyColumnBase34); + var sklepFormaIdColumnBase0 = new ColumnBase("SklepFormaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase.Columns.Add("SklepFormaId", sklepFormaIdColumnBase0); + var sklepIdColumnBase27 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase.Columns.Add("SklepId", sklepIdColumnBase27); + var sklepKasaIdColumnBase1 = new ColumnBase("SklepKasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase.Columns.Add("SklepKasaId", sklepKasaIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn", blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnMappingBase = new TableMappingBase(sklepKasaFormaPlatn, blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnMappingBase, false); + defaultTableMappings182.Add(blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepFormaIdColumnBase0, sklepKasaFormaPlatn.FindProperty("SklepFormaId")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase27, sklepKasaFormaPlatn.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKasaIdColumnBase1, sklepKasaFormaPlatn.FindProperty("SklepKasaId")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase34, sklepKasaFormaPlatn.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepKasaFormaPlatnMappingBase); + + var tableMappings182 = new List(); + sklepKasaFormaPlatn.SetRuntimeAnnotation("Relational:TableMappings", tableMappings182); + var sklepKasaFormaPlatnTable = new Table("SklepKasaFormaPlatn", null, relationalModel); + var sklepIdColumn27 = new Column("SklepId", "numeric(9,0)", sklepKasaFormaPlatnTable); + sklepKasaFormaPlatnTable.Columns.Add("SklepId", sklepIdColumn27); + var sklepFormaIdColumn0 = new Column("SklepFormaId", "numeric(9,0)", sklepKasaFormaPlatnTable); + sklepKasaFormaPlatnTable.Columns.Add("SklepFormaId", sklepFormaIdColumn0); + var sklepKasaIdColumn1 = new Column("SklepKasaId", "numeric(9,0)", sklepKasaFormaPlatnTable); + sklepKasaFormaPlatnTable.Columns.Add("SklepKasaId", sklepKasaIdColumn1); + var aktywnyColumn34 = new Column("Aktywny", "smallint", sklepKasaFormaPlatnTable); + sklepKasaFormaPlatnTable.Columns.Add("Aktywny", aktywnyColumn34); + var pK_SklepKasaFormaPlatn = new UniqueConstraint("PK_SklepKasaFormaPlatn", sklepKasaFormaPlatnTable, new[] { sklepIdColumn27, sklepFormaIdColumn0, sklepKasaIdColumn1 }); + sklepKasaFormaPlatnTable.PrimaryKey = pK_SklepKasaFormaPlatn; + var pK_SklepKasaFormaPlatnUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn", + new[] { "SklepId", "SklepFormaId", "SklepKasaId" }); + pK_SklepKasaFormaPlatn.MappedKeys.Add(pK_SklepKasaFormaPlatnUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepKasaFormaPlatnUc).Add(pK_SklepKasaFormaPlatn); + sklepKasaFormaPlatnTable.UniqueConstraints.Add("PK_SklepKasaFormaPlatn", pK_SklepKasaFormaPlatn); + var iX_SklepKasaFormaPlatn_SklepId_SklepKasaId = new TableIndex( + "IX_SklepKasaFormaPlatn_SklepId_SklepKasaId", sklepKasaFormaPlatnTable, new[] { sklepIdColumn27, sklepKasaIdColumn1 }, false); + var iX_SklepKasaFormaPlatn_SklepId_SklepKasaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn", + new[] { "SklepId", "SklepKasaId" }); + iX_SklepKasaFormaPlatn_SklepId_SklepKasaId.MappedIndexes.Add(iX_SklepKasaFormaPlatn_SklepId_SklepKasaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKasaFormaPlatn_SklepId_SklepKasaIdIx).Add(iX_SklepKasaFormaPlatn_SklepId_SklepKasaId); + sklepKasaFormaPlatnTable.Indexes.Add("IX_SklepKasaFormaPlatn_SklepId_SklepKasaId", iX_SklepKasaFormaPlatn_SklepId_SklepKasaId); + relationalModel.Tables.Add(("SklepKasaFormaPlatn", null), sklepKasaFormaPlatnTable); + var sklepKasaFormaPlatnTableMapping = new TableMapping(sklepKasaFormaPlatn, sklepKasaFormaPlatnTable, true); + sklepKasaFormaPlatnTable.AddTypeMapping(sklepKasaFormaPlatnTableMapping, false); + tableMappings182.Add(sklepKasaFormaPlatnTableMapping); + RelationalModel.CreateColumnMapping(sklepFormaIdColumn0, sklepKasaFormaPlatn.FindProperty("SklepFormaId")!, sklepKasaFormaPlatnTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn27, sklepKasaFormaPlatn.FindProperty("SklepId")!, sklepKasaFormaPlatnTableMapping); + RelationalModel.CreateColumnMapping(sklepKasaIdColumn1, sklepKasaFormaPlatn.FindProperty("SklepKasaId")!, sklepKasaFormaPlatnTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn34, sklepKasaFormaPlatn.FindProperty("Aktywny")!, sklepKasaFormaPlatnTableMapping); + + var sklepKontoBankowe = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe")!; + + var defaultTableMappings183 = new List>(); + sklepKontoBankowe.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings183); + var blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", null, relationalModel); + var aktywneColumnBase2 = new ColumnBase("Aktywne", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("Aktywne", aktywneColumnBase2); + var domyslneColumnBase2 = new ColumnBase("Domyslne", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("Domyslne", domyslneColumnBase2); + var kBIdColumnBase1 = new ColumnBase("KBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("KBId", kBIdColumnBase1); + var nazwaColumnBase42 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("Nazwa", nazwaColumnBase42); + var numerColumnBase6 = new ColumnBase("Numer", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("Numer", numerColumnBase6); + var powSklepKBIdColumnBase = new ColumnBase("PowSklepKBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("PowSklepKBId", powSklepKBIdColumnBase); + var sklepBankIdColumnBase0 = new ColumnBase("SklepBankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("SklepBankId", sklepBankIdColumnBase0); + var sklepIdColumnBase28 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("SklepId", sklepIdColumnBase28); + var sklepKBIdColumnBase0 = new ColumnBase("SklepKBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("SklepKBId", sklepKBIdColumnBase0); + var sklepKBIdOplatColumnBase = new ColumnBase("SklepKBIdOplat", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("SklepKBIdOplat", sklepKBIdOplatColumnBase); + var sklepMagIdColumnBase2 = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase2); + var sklepWalIdColumnBase2 = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase2); + var sufixColumnBase0 = new ColumnBase("Sufix", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("Sufix", sufixColumnBase0); + var typColumnBase26 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("Typ", typColumnBase26); + var zmianaColumnBase41 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.Columns.Add("Zmiana", zmianaColumnBase41); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase = new TableMappingBase(sklepKontoBankowe, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase, false); + defaultTableMappings183.Add(blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase28, sklepKontoBankowe.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKBIdColumnBase0, sklepKontoBankowe.FindProperty("SklepKBId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywneColumnBase2, sklepKontoBankowe.FindProperty("Aktywne")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslneColumnBase2, sklepKontoBankowe.FindProperty("Domyslne")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kBIdColumnBase1, sklepKontoBankowe.FindProperty("KBId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase42, sklepKontoBankowe.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase6, sklepKontoBankowe.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powSklepKBIdColumnBase, sklepKontoBankowe.FindProperty("PowSklepKBId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepBankIdColumnBase0, sklepKontoBankowe.FindProperty("SklepBankId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKBIdOplatColumnBase, sklepKontoBankowe.FindProperty("SklepKBIdOplat")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase2, sklepKontoBankowe.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase2, sklepKontoBankowe.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sufixColumnBase0, sklepKontoBankowe.FindProperty("Sufix")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase26, sklepKontoBankowe.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase41, sklepKontoBankowe.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweMappingBase); + + var tableMappings183 = new List(); + sklepKontoBankowe.SetRuntimeAnnotation("Relational:TableMappings", tableMappings183); + var sklepKontoBankoweTable = new Table("SklepKontoBankowe", null, relationalModel); + var sklepIdColumn28 = new Column("SklepId", "numeric(9,0)", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("SklepId", sklepIdColumn28); + var sklepKBIdColumn0 = new Column("SklepKBId", "numeric(9,0)", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("SklepKBId", sklepKBIdColumn0); + var aktywneColumn2 = new Column("Aktywne", "smallint", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("Aktywne", aktywneColumn2); + var domyslneColumn2 = new Column("Domyslne", "smallint", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("Domyslne", domyslneColumn2); + var kBIdColumn1 = new Column("KBId", "numeric(9,0)", sklepKontoBankoweTable) + { + IsNullable = true + }; + sklepKontoBankoweTable.Columns.Add("KBId", kBIdColumn1); + var nazwaColumn42 = new Column("Nazwa", "varchar(120)", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("Nazwa", nazwaColumn42); + var numerColumn6 = new Column("Numer", "varchar(40)", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("Numer", numerColumn6); + var powSklepKBIdColumn = new Column("PowSklepKBId", "numeric(9,0)", sklepKontoBankoweTable) + { + IsNullable = true + }; + sklepKontoBankoweTable.Columns.Add("PowSklepKBId", powSklepKBIdColumn); + var sklepBankIdColumn0 = new Column("SklepBankId", "numeric(9,0)", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("SklepBankId", sklepBankIdColumn0); + var sklepKBIdOplatColumn = new Column("SklepKBIdOplat", "numeric(9,0)", sklepKontoBankoweTable) + { + IsNullable = true + }; + sklepKontoBankoweTable.Columns.Add("SklepKBIdOplat", sklepKBIdOplatColumn); + var sklepMagIdColumn2 = new Column("SklepMagId", "numeric(9,0)", sklepKontoBankoweTable) + { + IsNullable = true + }; + sklepKontoBankoweTable.Columns.Add("SklepMagId", sklepMagIdColumn2); + var sklepWalIdColumn2 = new Column("SklepWalId", "numeric(9,0)", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("SklepWalId", sklepWalIdColumn2); + var sufixColumn0 = new Column("Sufix", "varchar(10)", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("Sufix", sufixColumn0); + var typColumn26 = new Column("Typ", "smallint", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("Typ", typColumn26); + var zmianaColumn41 = new Column("Zmiana", "datetime", sklepKontoBankoweTable); + sklepKontoBankoweTable.Columns.Add("Zmiana", zmianaColumn41); + var pK_SklepKontoBankowe = new UniqueConstraint("PK_SklepKontoBankowe", sklepKontoBankoweTable, new[] { sklepIdColumn28, sklepKBIdColumn0 }); + sklepKontoBankoweTable.PrimaryKey = pK_SklepKontoBankowe; + var pK_SklepKontoBankoweUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", + new[] { "SklepId", "SklepKBId" }); + pK_SklepKontoBankowe.MappedKeys.Add(pK_SklepKontoBankoweUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepKontoBankoweUc).Add(pK_SklepKontoBankowe); + sklepKontoBankoweTable.UniqueConstraints.Add("PK_SklepKontoBankowe", pK_SklepKontoBankowe); + var iX_SklepKontoBankowe_SklepId_SklepBankId = new TableIndex( + "IX_SklepKontoBankowe_SklepId_SklepBankId", sklepKontoBankoweTable, new[] { sklepIdColumn28, sklepBankIdColumn0 }, false); + var iX_SklepKontoBankowe_SklepId_SklepBankIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", + new[] { "SklepId", "SklepBankId" }); + iX_SklepKontoBankowe_SklepId_SklepBankId.MappedIndexes.Add(iX_SklepKontoBankowe_SklepId_SklepBankIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKontoBankowe_SklepId_SklepBankIdIx).Add(iX_SklepKontoBankowe_SklepId_SklepBankId); + sklepKontoBankoweTable.Indexes.Add("IX_SklepKontoBankowe_SklepId_SklepBankId", iX_SklepKontoBankowe_SklepId_SklepBankId); + var iX_SklepKontoBankowe_SklepId_SklepWalId = new TableIndex( + "IX_SklepKontoBankowe_SklepId_SklepWalId", sklepKontoBankoweTable, new[] { sklepIdColumn28, sklepWalIdColumn2 }, false); + var iX_SklepKontoBankowe_SklepId_SklepWalIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", + new[] { "SklepId", "SklepWalId" }); + iX_SklepKontoBankowe_SklepId_SklepWalId.MappedIndexes.Add(iX_SklepKontoBankowe_SklepId_SklepWalIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKontoBankowe_SklepId_SklepWalIdIx).Add(iX_SklepKontoBankowe_SklepId_SklepWalId); + sklepKontoBankoweTable.Indexes.Add("IX_SklepKontoBankowe_SklepId_SklepWalId", iX_SklepKontoBankowe_SklepId_SklepWalId); + relationalModel.Tables.Add(("SklepKontoBankowe", null), sklepKontoBankoweTable); + var sklepKontoBankoweTableMapping = new TableMapping(sklepKontoBankowe, sklepKontoBankoweTable, true); + sklepKontoBankoweTable.AddTypeMapping(sklepKontoBankoweTableMapping, false); + tableMappings183.Add(sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn28, sklepKontoBankowe.FindProperty("SklepId")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sklepKBIdColumn0, sklepKontoBankowe.FindProperty("SklepKBId")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(aktywneColumn2, sklepKontoBankowe.FindProperty("Aktywne")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(domyslneColumn2, sklepKontoBankowe.FindProperty("Domyslne")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(kBIdColumn1, sklepKontoBankowe.FindProperty("KBId")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn42, sklepKontoBankowe.FindProperty("Nazwa")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(numerColumn6, sklepKontoBankowe.FindProperty("Numer")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(powSklepKBIdColumn, sklepKontoBankowe.FindProperty("PowSklepKBId")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sklepBankIdColumn0, sklepKontoBankowe.FindProperty("SklepBankId")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sklepKBIdOplatColumn, sklepKontoBankowe.FindProperty("SklepKBIdOplat")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn2, sklepKontoBankowe.FindProperty("SklepMagId")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn2, sklepKontoBankowe.FindProperty("SklepWalId")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(sufixColumn0, sklepKontoBankowe.FindProperty("Sufix")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(typColumn26, sklepKontoBankowe.FindProperty("Typ")!, sklepKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn41, sklepKontoBankowe.FindProperty("Zmiana")!, sklepKontoBankoweTableMapping); + + var sklepKontoBankoweKontr = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr")!; + + var defaultTableMappings184 = new List>(); + sklepKontoBankoweKontr.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings184); + var blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", null, relationalModel); + var aktywneColumnBase3 = new ColumnBase("Aktywne", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("Aktywne", aktywneColumnBase3); + var domyslneColumnBase3 = new ColumnBase("Domyslne", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("Domyslne", domyslneColumnBase3); + var kBKIdColumnBase0 = new ColumnBase("KBKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("KBKId", kBKIdColumnBase0); + var nazwaColumnBase43 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("Nazwa", nazwaColumnBase43); + var numerColumnBase7 = new ColumnBase("Numer", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("Numer", numerColumnBase7); + var powSklepKBKIdColumnBase = new ColumnBase("PowSklepKBKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("PowSklepKBKId", powSklepKBKIdColumnBase); + var sklepBankIdColumnBase1 = new ColumnBase("SklepBankId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("SklepBankId", sklepBankIdColumnBase1); + var sklepIdColumnBase29 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("SklepId", sklepIdColumnBase29); + var sklepKBKIdColumnBase = new ColumnBase("SklepKBKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("SklepKBKId", sklepKBKIdColumnBase); + var sklepKontrIdColumnBase2 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase2); + var sklepWalIdColumnBase3 = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase3); + var typColumnBase27 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("Typ", typColumnBase27); + var wykazVatColumnBase0 = new ColumnBase("WykazVat", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.Columns.Add("WykazVat", wykazVatColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase = new TableMappingBase(sklepKontoBankoweKontr, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase, false); + defaultTableMappings184.Add(blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase29, sklepKontoBankoweKontr.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKBKIdColumnBase, sklepKontoBankoweKontr.FindProperty("SklepKBKId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywneColumnBase3, sklepKontoBankoweKontr.FindProperty("Aktywne")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslneColumnBase3, sklepKontoBankoweKontr.FindProperty("Domyslne")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kBKIdColumnBase0, sklepKontoBankoweKontr.FindProperty("KBKId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase43, sklepKontoBankoweKontr.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase7, sklepKontoBankoweKontr.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powSklepKBKIdColumnBase, sklepKontoBankoweKontr.FindProperty("PowSklepKBKId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepBankIdColumnBase1, sklepKontoBankoweKontr.FindProperty("SklepBankId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase2, sklepKontoBankoweKontr.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase3, sklepKontoBankoweKontr.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase27, sklepKontoBankoweKontr.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wykazVatColumnBase0, sklepKontoBankoweKontr.FindProperty("WykazVat")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoBankoweKontrMappingBase); + + var tableMappings184 = new List(); + sklepKontoBankoweKontr.SetRuntimeAnnotation("Relational:TableMappings", tableMappings184); + var sklepKontoBankoweKontrTable = new Table("SklepKontoBankoweKontr", null, relationalModel); + var sklepIdColumn29 = new Column("SklepId", "numeric(9,0)", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("SklepId", sklepIdColumn29); + var sklepKBKIdColumn = new Column("SklepKBKId", "numeric(9,0)", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("SklepKBKId", sklepKBKIdColumn); + var aktywneColumn3 = new Column("Aktywne", "smallint", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("Aktywne", aktywneColumn3); + var domyslneColumn3 = new Column("Domyslne", "smallint", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("Domyslne", domyslneColumn3); + var kBKIdColumn0 = new Column("KBKId", "numeric(9,0)", sklepKontoBankoweKontrTable) + { + IsNullable = true + }; + sklepKontoBankoweKontrTable.Columns.Add("KBKId", kBKIdColumn0); + var nazwaColumn43 = new Column("Nazwa", "varchar(120)", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("Nazwa", nazwaColumn43); + var numerColumn7 = new Column("Numer", "varchar(40)", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("Numer", numerColumn7); + var powSklepKBKIdColumn = new Column("PowSklepKBKId", "numeric(9,0)", sklepKontoBankoweKontrTable) + { + IsNullable = true + }; + sklepKontoBankoweKontrTable.Columns.Add("PowSklepKBKId", powSklepKBKIdColumn); + var sklepBankIdColumn1 = new Column("SklepBankId", "numeric(9,0)", sklepKontoBankoweKontrTable) + { + IsNullable = true + }; + sklepKontoBankoweKontrTable.Columns.Add("SklepBankId", sklepBankIdColumn1); + var sklepKontrIdColumn2 = new Column("SklepKontrId", "numeric(9,0)", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("SklepKontrId", sklepKontrIdColumn2); + var sklepWalIdColumn3 = new Column("SklepWalId", "numeric(9,0)", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("SklepWalId", sklepWalIdColumn3); + var typColumn27 = new Column("Typ", "smallint", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("Typ", typColumn27); + var wykazVatColumn0 = new Column("WykazVat", "smallint", sklepKontoBankoweKontrTable); + sklepKontoBankoweKontrTable.Columns.Add("WykazVat", wykazVatColumn0); + var pK_SklepKontoBankoweKontr = new UniqueConstraint("PK_SklepKontoBankoweKontr", sklepKontoBankoweKontrTable, new[] { sklepIdColumn29, sklepKBKIdColumn }); + sklepKontoBankoweKontrTable.PrimaryKey = pK_SklepKontoBankoweKontr; + var pK_SklepKontoBankoweKontrUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + new[] { "SklepId", "SklepKBKId" }); + pK_SklepKontoBankoweKontr.MappedKeys.Add(pK_SklepKontoBankoweKontrUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepKontoBankoweKontrUc).Add(pK_SklepKontoBankoweKontr); + sklepKontoBankoweKontrTable.UniqueConstraints.Add("PK_SklepKontoBankoweKontr", pK_SklepKontoBankoweKontr); + var iX_SklepKontoBankoweKontr_SklepId_SklepBankId = new TableIndex( + "IX_SklepKontoBankoweKontr_SklepId_SklepBankId", sklepKontoBankoweKontrTable, new[] { sklepIdColumn29, sklepBankIdColumn1 }, false); + var iX_SklepKontoBankoweKontr_SklepId_SklepBankIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + new[] { "SklepId", "SklepBankId" }); + iX_SklepKontoBankoweKontr_SklepId_SklepBankId.MappedIndexes.Add(iX_SklepKontoBankoweKontr_SklepId_SklepBankIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKontoBankoweKontr_SklepId_SklepBankIdIx).Add(iX_SklepKontoBankoweKontr_SklepId_SklepBankId); + sklepKontoBankoweKontrTable.Indexes.Add("IX_SklepKontoBankoweKontr_SklepId_SklepBankId", iX_SklepKontoBankoweKontr_SklepId_SklepBankId); + var iX_SklepKontoBankoweKontr_SklepId_SklepKontrId = new TableIndex( + "IX_SklepKontoBankoweKontr_SklepId_SklepKontrId", sklepKontoBankoweKontrTable, new[] { sklepIdColumn29, sklepKontrIdColumn2 }, false); + var iX_SklepKontoBankoweKontr_SklepId_SklepKontrIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + new[] { "SklepId", "SklepKontrId" }); + iX_SklepKontoBankoweKontr_SklepId_SklepKontrId.MappedIndexes.Add(iX_SklepKontoBankoweKontr_SklepId_SklepKontrIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKontoBankoweKontr_SklepId_SklepKontrIdIx).Add(iX_SklepKontoBankoweKontr_SklepId_SklepKontrId); + sklepKontoBankoweKontrTable.Indexes.Add("IX_SklepKontoBankoweKontr_SklepId_SklepKontrId", iX_SklepKontoBankoweKontr_SklepId_SklepKontrId); + var iX_SklepKontoBankoweKontr_SklepId_SklepWalId = new TableIndex( + "IX_SklepKontoBankoweKontr_SklepId_SklepWalId", sklepKontoBankoweKontrTable, new[] { sklepIdColumn29, sklepWalIdColumn3 }, false); + var iX_SklepKontoBankoweKontr_SklepId_SklepWalIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + new[] { "SklepId", "SklepWalId" }); + iX_SklepKontoBankoweKontr_SklepId_SklepWalId.MappedIndexes.Add(iX_SklepKontoBankoweKontr_SklepId_SklepWalIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKontoBankoweKontr_SklepId_SklepWalIdIx).Add(iX_SklepKontoBankoweKontr_SklepId_SklepWalId); + sklepKontoBankoweKontrTable.Indexes.Add("IX_SklepKontoBankoweKontr_SklepId_SklepWalId", iX_SklepKontoBankoweKontr_SklepId_SklepWalId); + relationalModel.Tables.Add(("SklepKontoBankoweKontr", null), sklepKontoBankoweKontrTable); + var sklepKontoBankoweKontrTableMapping = new TableMapping(sklepKontoBankoweKontr, sklepKontoBankoweKontrTable, true); + sklepKontoBankoweKontrTable.AddTypeMapping(sklepKontoBankoweKontrTableMapping, false); + tableMappings184.Add(sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn29, sklepKontoBankoweKontr.FindProperty("SklepId")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(sklepKBKIdColumn, sklepKontoBankoweKontr.FindProperty("SklepKBKId")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(aktywneColumn3, sklepKontoBankoweKontr.FindProperty("Aktywne")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(domyslneColumn3, sklepKontoBankoweKontr.FindProperty("Domyslne")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(kBKIdColumn0, sklepKontoBankoweKontr.FindProperty("KBKId")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn43, sklepKontoBankoweKontr.FindProperty("Nazwa")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(numerColumn7, sklepKontoBankoweKontr.FindProperty("Numer")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(powSklepKBKIdColumn, sklepKontoBankoweKontr.FindProperty("PowSklepKBKId")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(sklepBankIdColumn1, sklepKontoBankoweKontr.FindProperty("SklepBankId")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn2, sklepKontoBankoweKontr.FindProperty("SklepKontrId")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn3, sklepKontoBankoweKontr.FindProperty("SklepWalId")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(typColumn27, sklepKontoBankoweKontr.FindProperty("Typ")!, sklepKontoBankoweKontrTableMapping); + RelationalModel.CreateColumnMapping(wykazVatColumn0, sklepKontoBankoweKontr.FindProperty("WykazVat")!, sklepKontoBankoweKontrTableMapping); + + var sklepKontoLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj")!; + + var defaultTableMappings185 = new List>(); + sklepKontoLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings185); + var blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", null, relationalModel); + var aktywneColumnBase4 = new ColumnBase("Aktywne", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("Aktywne", aktywneColumnBase4); + var centrKontoIdColumnBase0 = new ColumnBase("CentrKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("CentrKontoId", centrKontoIdColumnBase0); + var kontoIdColumnBase3 = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("KontoId", kontoIdColumnBase3); + var nazwaColumnBase44 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("Nazwa", nazwaColumnBase44); + var sklepIdColumnBase30 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("SklepId", sklepIdColumnBase30); + var sklepKontoIdColumnBase0 = new ColumnBase("SklepKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("SklepKontoId", sklepKontoIdColumnBase0); + var sklepKontrIdColumnBase3 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase3); + var stanColumnBase0 = new ColumnBase("Stan", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("Stan", stanColumnBase0); + var stanPoczColumnBase0 = new ColumnBase("StanPocz", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("StanPocz", stanPoczColumnBase0); + var typKontaColumnBase0 = new ColumnBase("TypKonta", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("TypKonta", typKontaColumnBase0); + var zmianaColumnBase42 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("Zmiana", zmianaColumnBase42); + var zmianaStanuColumnBase0 = new ColumnBase("ZmianaStanu", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.Columns.Add("ZmianaStanu", zmianaStanuColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase = new TableMappingBase(sklepKontoLoj, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKontoLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase, false); + defaultTableMappings185.Add(blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase30, sklepKontoLoj.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontoIdColumnBase0, sklepKontoLoj.FindProperty("SklepKontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywneColumnBase4, sklepKontoLoj.FindProperty("Aktywne")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKontoIdColumnBase0, sklepKontoLoj.FindProperty("CentrKontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase3, sklepKontoLoj.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase44, sklepKontoLoj.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase3, sklepKontoLoj.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanColumnBase0, sklepKontoLoj.FindProperty("Stan")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanPoczColumnBase0, sklepKontoLoj.FindProperty("StanPocz")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKontaColumnBase0, sklepKontoLoj.FindProperty("TypKonta")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase42, sklepKontoLoj.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaStanuColumnBase0, sklepKontoLoj.FindProperty("ZmianaStanu")!, blinkBackofficeServicesPcmDbEntitiesSklepKontoLojMappingBase); + + var tableMappings185 = new List(); + sklepKontoLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings185); + var sklepKontoLojTable = new Table("SklepKontoLoj", null, relationalModel); + var sklepIdColumn30 = new Column("SklepId", "numeric(9,0)", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("SklepId", sklepIdColumn30); + var sklepKontoIdColumn0 = new Column("SklepKontoId", "numeric(9,0)", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("SklepKontoId", sklepKontoIdColumn0); + var aktywneColumn4 = new Column("Aktywne", "smallint", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("Aktywne", aktywneColumn4); + var centrKontoIdColumn0 = new Column("CentrKontoId", "numeric(9,0)", sklepKontoLojTable) + { + IsNullable = true + }; + sklepKontoLojTable.Columns.Add("CentrKontoId", centrKontoIdColumn0); + var kontoIdColumn3 = new Column("KontoId", "numeric(9,0)", sklepKontoLojTable) + { + IsNullable = true + }; + sklepKontoLojTable.Columns.Add("KontoId", kontoIdColumn3); + var nazwaColumn44 = new Column("Nazwa", "varchar(40)", sklepKontoLojTable) + { + IsNullable = true + }; + sklepKontoLojTable.Columns.Add("Nazwa", nazwaColumn44); + var sklepKontrIdColumn3 = new Column("SklepKontrId", "numeric(9,0)", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("SklepKontrId", sklepKontrIdColumn3); + var stanColumn0 = new Column("Stan", "decimal(15,4)", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("Stan", stanColumn0); + var stanPoczColumn0 = new Column("StanPocz", "decimal(15,4)", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("StanPocz", stanPoczColumn0); + var typKontaColumn0 = new Column("TypKonta", "smallint", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("TypKonta", typKontaColumn0); + var zmianaColumn42 = new Column("Zmiana", "datetime", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("Zmiana", zmianaColumn42); + var zmianaStanuColumn0 = new Column("ZmianaStanu", "datetime", sklepKontoLojTable); + sklepKontoLojTable.Columns.Add("ZmianaStanu", zmianaStanuColumn0); + var pK_SKLEPKONTOLOJ = new UniqueConstraint("PK_SKLEPKONTOLOJ", sklepKontoLojTable, new[] { sklepIdColumn30, sklepKontoIdColumn0 }); + sklepKontoLojTable.PrimaryKey = pK_SKLEPKONTOLOJ; + var pK_SKLEPKONTOLOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + new[] { "SklepId", "SklepKontoId" }); + pK_SKLEPKONTOLOJ.MappedKeys.Add(pK_SKLEPKONTOLOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPKONTOLOJUc).Add(pK_SKLEPKONTOLOJ); + sklepKontoLojTable.UniqueConstraints.Add("PK_SKLEPKONTOLOJ", pK_SKLEPKONTOLOJ); + var idx_SCentrKontoId = new TableIndex( + "idx_SCentrKontoId", sklepKontoLojTable, new[] { centrKontoIdColumn0 }, false); + var idx_SCentrKontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + "idx_SCentrKontoId"); + idx_SCentrKontoId.MappedIndexes.Add(idx_SCentrKontoIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SCentrKontoIdIx).Add(idx_SCentrKontoId); + sklepKontoLojTable.Indexes.Add("idx_SCentrKontoId", idx_SCentrKontoId); + var idx_SKLoj_KLoj = new TableIndex( + "idx_SKLoj_KLoj", sklepKontoLojTable, new[] { kontoIdColumn3 }, false); + var idx_SKLoj_KLojIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + "idx_SKLoj_KLoj"); + idx_SKLoj_KLoj.MappedIndexes.Add(idx_SKLoj_KLojIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKLoj_KLojIx).Add(idx_SKLoj_KLoj); + sklepKontoLojTable.Indexes.Add("idx_SKLoj_KLoj", idx_SKLoj_KLoj); + var idx_SKLoj_SKontrId = new TableIndex( + "idx_SKLoj_SKontrId", sklepKontoLojTable, new[] { sklepIdColumn30, sklepKontrIdColumn3 }, false); + var idx_SKLoj_SKontrIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + "idx_SKLoj_SKontrId"); + idx_SKLoj_SKontrId.MappedIndexes.Add(idx_SKLoj_SKontrIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKLoj_SKontrIdIx).Add(idx_SKLoj_SKontrId); + sklepKontoLojTable.Indexes.Add("idx_SKLoj_SKontrId", idx_SKLoj_SKontrId); + var idx_SKLoj_Zmiana = new TableIndex( + "idx_SKLoj_Zmiana", sklepKontoLojTable, new[] { zmianaColumn42 }, false); + var idx_SKLoj_ZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + "idx_SKLoj_Zmiana"); + idx_SKLoj_Zmiana.MappedIndexes.Add(idx_SKLoj_ZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKLoj_ZmianaIx).Add(idx_SKLoj_Zmiana); + sklepKontoLojTable.Indexes.Add("idx_SKLoj_Zmiana", idx_SKLoj_Zmiana); + var idx_SKLoj_ZmStanu = new TableIndex( + "idx_SKLoj_ZmStanu", sklepKontoLojTable, new[] { zmianaStanuColumn0 }, false); + var idx_SKLoj_ZmStanuIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + "idx_SKLoj_ZmStanu"); + idx_SKLoj_ZmStanu.MappedIndexes.Add(idx_SKLoj_ZmStanuIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKLoj_ZmStanuIx).Add(idx_SKLoj_ZmStanu); + sklepKontoLojTable.Indexes.Add("idx_SKLoj_ZmStanu", idx_SKLoj_ZmStanu); + relationalModel.Tables.Add(("SklepKontoLoj", null), sklepKontoLojTable); + var sklepKontoLojTableMapping = new TableMapping(sklepKontoLoj, sklepKontoLojTable, true); + sklepKontoLojTable.AddTypeMapping(sklepKontoLojTableMapping, false); + tableMappings185.Add(sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn30, sklepKontoLoj.FindProperty("SklepId")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(sklepKontoIdColumn0, sklepKontoLoj.FindProperty("SklepKontoId")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(aktywneColumn4, sklepKontoLoj.FindProperty("Aktywne")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(centrKontoIdColumn0, sklepKontoLoj.FindProperty("CentrKontoId")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn3, sklepKontoLoj.FindProperty("KontoId")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn44, sklepKontoLoj.FindProperty("Nazwa")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn3, sklepKontoLoj.FindProperty("SklepKontrId")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(stanColumn0, sklepKontoLoj.FindProperty("Stan")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(stanPoczColumn0, sklepKontoLoj.FindProperty("StanPocz")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(typKontaColumn0, sklepKontoLoj.FindProperty("TypKonta")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn42, sklepKontoLoj.FindProperty("Zmiana")!, sklepKontoLojTableMapping); + RelationalModel.CreateColumnMapping(zmianaStanuColumn0, sklepKontoLoj.FindProperty("ZmianaStanu")!, sklepKontoLojTableMapping); + + var sklepKontr = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKontr")!; + + var defaultTableMappings186 = new List>(); + sklepKontr.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings186); + var blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", null, relationalModel); + var aktywnyColumnBase35 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Aktywny", aktywnyColumnBase35); + var akwizytorColumnBase = new ColumnBase("Akwizytor", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Akwizytor", akwizytorColumnBase); + var bankColumnBase0 = new ColumnBase("Bank", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Bank", bankColumnBase0); + var centrKontrIdColumnBase0 = new ColumnBase("CentrKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("CentrKontrId", centrKontrIdColumnBase0); + var czasRealZamColumnBase0 = new ColumnBase("CzasRealZam", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("CzasRealZam", czasRealZamColumnBase0); + var dostawcaColumnBase0 = new ColumnBase("Dostawca", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Dostawca", dostawcaColumnBase0); + var eMailColumnBase1 = new ColumnBase("EMail", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("EMail", eMailColumnBase1); + var faxColumnBase0 = new ColumnBase("Fax", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Fax", faxColumnBase0); + var formaPlatDostColumnBase0 = new ColumnBase("FormaPlatDost", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("FormaPlatDost", formaPlatDostColumnBase0); + var formaPlatOdbColumnBase0 = new ColumnBase("FormaPlatOdb", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("FormaPlatOdb", formaPlatOdbColumnBase0); + var indeksCentrColumnBase0 = new ColumnBase("IndeksCentr", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("IndeksCentr", indeksCentrColumnBase0); + var kartaAktywnaColumnBase0 = new ColumnBase("KartaAktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("KartaAktywna", kartaAktywnaColumnBase0); + var kodColumnBase12 = new ColumnBase("Kod", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Kod", kodColumnBase12); + var kodKartyColumnBase3 = new ColumnBase("KodKarty", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("KodKarty", kodKartyColumnBase3); + var kodKontrColumnBase0 = new ColumnBase("KodKontr", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("KodKontr", kodKontrColumnBase0); + var kodKrajuColumnBase = new ColumnBase("KodKraju", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("KodKraju", kodKrajuColumnBase); + var kontoColumnBase0 = new ColumnBase("Konto", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Konto", kontoColumnBase0); + var kontrIdColumnBase18 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("KontrId", kontrIdColumnBase18); + var maxKredytColumnBase0 = new ColumnBase("MaxKredyt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("MaxKredyt", maxKredytColumnBase0); + var maxPoTermPlatColumnBase0 = new ColumnBase("MaxPoTermPlat", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("MaxPoTermPlat", maxPoTermPlatColumnBase0); + var miastoColumnBase0 = new ColumnBase("Miasto", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Miasto", miastoColumnBase0); + var nIPColumnBase1 = new ColumnBase("NIP", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("NIP", nIPColumnBase1); + var naPrzelewie1ColumnBase0 = new ColumnBase("NaPrzelewie1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("NaPrzelewie1", naPrzelewie1ColumnBase0); + var naPrzelewie2ColumnBase0 = new ColumnBase("NaPrzelewie2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("NaPrzelewie2", naPrzelewie2ColumnBase0); + var nazwaColumnBase45 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Nazwa", nazwaColumnBase45); + var nrAnalitykiColumnBase0 = new ColumnBase("NrAnalityki", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("NrAnalityki", nrAnalitykiColumnBase0); + var nrDomuColumnBase0 = new ColumnBase("NrDomu", "varchar(9)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("NrDomu", nrDomuColumnBase0); + var nrLokaluColumnBase0 = new ColumnBase("NrLokalu", "varchar(9)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("NrLokalu", nrLokaluColumnBase0); + var odbiorcaColumnBase0 = new ColumnBase("Odbiorca", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Odbiorca", odbiorcaColumnBase0); + var osobaColumnBase0 = new ColumnBase("Osoba", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Osoba", osobaColumnBase0); + var pocztaColumnBase0 = new ColumnBase("Poczta", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Poczta", pocztaColumnBase0); + var poziomRabatuColumnBase0 = new ColumnBase("PoziomRabatu", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("PoziomRabatu", poziomRabatuColumnBase0); + var producentColumnBase0 = new ColumnBase("Producent", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Producent", producentColumnBase0); + var prowizjaColumnBase0 = new ColumnBase("Prowizja", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Prowizja", prowizjaColumnBase0); + var rabatDostColumnBase0 = new ColumnBase("RabatDost", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("RabatDost", rabatDostColumnBase0); + var rabatOdbColumnBase0 = new ColumnBase("RabatOdb", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("RabatOdb", rabatOdbColumnBase0); + var rezerwa1ColumnBase0 = new ColumnBase("Rezerwa1", "varchar(80)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Rezerwa1", rezerwa1ColumnBase0); + var rezerwa2ColumnBase0 = new ColumnBase("Rezerwa2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Rezerwa2", rezerwa2ColumnBase0); + var sklepIdColumnBase31 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("SklepId", sklepIdColumnBase31); + var sklepKontrIdColumnBase4 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase4); + var skrotColumnBase3 = new ColumnBase("Skrot", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Skrot", skrotColumnBase3); + var stalyColumnBase0 = new ColumnBase("Staly", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Staly", stalyColumnBase0); + var telefonColumnBase0 = new ColumnBase("Telefon", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Telefon", telefonColumnBase0); + var termPlatDostColumnBase0 = new ColumnBase("TermPlatDost", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("TermPlatDost", termPlatDostColumnBase0); + var termPlatOdbColumnBase0 = new ColumnBase("TermPlatOdb", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("TermPlatOdb", termPlatOdbColumnBase0); + var termWaznKartyColumnBase0 = new ColumnBase("TermWaznKarty", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("TermWaznKarty", termWaznKartyColumnBase0); + var ulicaColumnBase0 = new ColumnBase("Ulica", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Ulica", ulicaColumnBase0); + var zakPracChronColumnBase0 = new ColumnBase("ZakPracChron", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("ZakPracChron", zakPracChronColumnBase0); + var zmianaColumnBase43 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.Columns.Add("Zmiana", zmianaColumnBase43); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase = new TableMappingBase(sklepKontr, blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKontrTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase, false); + defaultTableMappings186.Add(blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase31, sklepKontr.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase4, sklepKontr.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase35, sklepKontr.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akwizytorColumnBase, sklepKontr.FindProperty("Akwizytor")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bankColumnBase0, sklepKontr.FindProperty("Bank")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrKontrIdColumnBase0, sklepKontr.FindProperty("CentrKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czasRealZamColumnBase0, sklepKontr.FindProperty("CzasRealZam")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dostawcaColumnBase0, sklepKontr.FindProperty("Dostawca")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)eMailColumnBase1, sklepKontr.FindProperty("EMail")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)faxColumnBase0, sklepKontr.FindProperty("Fax")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaPlatDostColumnBase0, sklepKontr.FindProperty("FormaPlatDost")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaPlatOdbColumnBase0, sklepKontr.FindProperty("FormaPlatOdb")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeksCentrColumnBase0, sklepKontr.FindProperty("IndeksCentr")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kartaAktywnaColumnBase0, sklepKontr.FindProperty("KartaAktywna")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase12, sklepKontr.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKartyColumnBase3, sklepKontr.FindProperty("KodKarty")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKontrColumnBase0, sklepKontr.FindProperty("KodKontr")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKrajuColumnBase, sklepKontr.FindProperty("KodKraju")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoColumnBase0, sklepKontr.FindProperty("Konto")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase18, sklepKontr.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)maxKredytColumnBase0, sklepKontr.FindProperty("MaxKredyt")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)maxPoTermPlatColumnBase0, sklepKontr.FindProperty("MaxPoTermPlat")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)miastoColumnBase0, sklepKontr.FindProperty("Miasto")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nIPColumnBase1, sklepKontr.FindProperty("NIP")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)naPrzelewie1ColumnBase0, sklepKontr.FindProperty("NaPrzelewie1")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)naPrzelewie2ColumnBase0, sklepKontr.FindProperty("NaPrzelewie2")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase45, sklepKontr.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrAnalitykiColumnBase0, sklepKontr.FindProperty("NrAnalityki")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDomuColumnBase0, sklepKontr.FindProperty("NrDomu")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrLokaluColumnBase0, sklepKontr.FindProperty("NrLokalu")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odbiorcaColumnBase0, sklepKontr.FindProperty("Odbiorca")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)osobaColumnBase0, sklepKontr.FindProperty("Osoba")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pocztaColumnBase0, sklepKontr.FindProperty("Poczta")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomRabatuColumnBase0, sklepKontr.FindProperty("PoziomRabatu")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)producentColumnBase0, sklepKontr.FindProperty("Producent")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prowizjaColumnBase0, sklepKontr.FindProperty("Prowizja")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatDostColumnBase0, sklepKontr.FindProperty("RabatDost")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatOdbColumnBase0, sklepKontr.FindProperty("RabatOdb")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa1ColumnBase0, sklepKontr.FindProperty("Rezerwa1")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa2ColumnBase0, sklepKontr.FindProperty("Rezerwa2")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase3, sklepKontr.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stalyColumnBase0, sklepKontr.FindProperty("Staly")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)telefonColumnBase0, sklepKontr.FindProperty("Telefon")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termPlatDostColumnBase0, sklepKontr.FindProperty("TermPlatDost")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termPlatOdbColumnBase0, sklepKontr.FindProperty("TermPlatOdb")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termWaznKartyColumnBase0, sklepKontr.FindProperty("TermWaznKarty")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ulicaColumnBase0, sklepKontr.FindProperty("Ulica")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zakPracChronColumnBase0, sklepKontr.FindProperty("ZakPracChron")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase43, sklepKontr.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrMappingBase); + + var tableMappings186 = new List(); + sklepKontr.SetRuntimeAnnotation("Relational:TableMappings", tableMappings186); + var sklepKontrTable = new Table("SklepKontr", null, relationalModel); + var sklepIdColumn31 = new Column("SklepId", "numeric(9,0)", sklepKontrTable); + sklepKontrTable.Columns.Add("SklepId", sklepIdColumn31); + var sklepKontrIdColumn4 = new Column("SklepKontrId", "numeric(9,0)", sklepKontrTable); + sklepKontrTable.Columns.Add("SklepKontrId", sklepKontrIdColumn4); + var aktywnyColumn35 = new Column("Aktywny", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("Aktywny", aktywnyColumn35); + var akwizytorColumn = new Column("Akwizytor", "varchar(60)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("Akwizytor", akwizytorColumn); + var bankColumn0 = new Column("Bank", "varchar(255)", sklepKontrTable); + sklepKontrTable.Columns.Add("Bank", bankColumn0); + var centrKontrIdColumn0 = new Column("CentrKontrId", "numeric(9,0)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("CentrKontrId", centrKontrIdColumn0); + var czasRealZamColumn0 = new Column("CzasRealZam", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("CzasRealZam", czasRealZamColumn0); + var dostawcaColumn0 = new Column("Dostawca", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("Dostawca", dostawcaColumn0); + var eMailColumn1 = new Column("EMail", "varchar(120)", sklepKontrTable); + sklepKontrTable.Columns.Add("EMail", eMailColumn1); + var faxColumn0 = new Column("Fax", "varchar(60)", sklepKontrTable); + sklepKontrTable.Columns.Add("Fax", faxColumn0); + var formaPlatDostColumn0 = new Column("FormaPlatDost", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("FormaPlatDost", formaPlatDostColumn0); + var formaPlatOdbColumn0 = new Column("FormaPlatOdb", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("FormaPlatOdb", formaPlatOdbColumn0); + var indeksCentrColumn0 = new Column("IndeksCentr", "varchar(40)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("IndeksCentr", indeksCentrColumn0); + var kartaAktywnaColumn0 = new Column("KartaAktywna", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("KartaAktywna", kartaAktywnaColumn0); + var kodColumn12 = new Column("Kod", "varchar(10)", sklepKontrTable); + sklepKontrTable.Columns.Add("Kod", kodColumn12); + var kodKartyColumn3 = new Column("KodKarty", "varchar(20)", sklepKontrTable); + sklepKontrTable.Columns.Add("KodKarty", kodKartyColumn3); + var kodKontrColumn0 = new Column("KodKontr", "varchar(20)", sklepKontrTable); + sklepKontrTable.Columns.Add("KodKontr", kodKontrColumn0); + var kodKrajuColumn = new Column("KodKraju", "varchar(10)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("KodKraju", kodKrajuColumn); + var kontoColumn0 = new Column("Konto", "varchar(60)", sklepKontrTable); + sklepKontrTable.Columns.Add("Konto", kontoColumn0); + var kontrIdColumn18 = new Column("KontrId", "numeric(9,0)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("KontrId", kontrIdColumn18); + var maxKredytColumn0 = new Column("MaxKredyt", "decimal(15,4)", sklepKontrTable); + sklepKontrTable.Columns.Add("MaxKredyt", maxKredytColumn0); + var maxPoTermPlatColumn0 = new Column("MaxPoTermPlat", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("MaxPoTermPlat", maxPoTermPlatColumn0); + var miastoColumn0 = new Column("Miasto", "varchar(40)", sklepKontrTable); + sklepKontrTable.Columns.Add("Miasto", miastoColumn0); + var nIPColumn1 = new Column("NIP", "varchar(40)", sklepKontrTable); + sklepKontrTable.Columns.Add("NIP", nIPColumn1); + var naPrzelewie1Column0 = new Column("NaPrzelewie1", "varchar(40)", sklepKontrTable); + sklepKontrTable.Columns.Add("NaPrzelewie1", naPrzelewie1Column0); + var naPrzelewie2Column0 = new Column("NaPrzelewie2", "varchar(40)", sklepKontrTable); + sklepKontrTable.Columns.Add("NaPrzelewie2", naPrzelewie2Column0); + var nazwaColumn45 = new Column("Nazwa", "varchar(255)", sklepKontrTable); + sklepKontrTable.Columns.Add("Nazwa", nazwaColumn45); + var nrAnalitykiColumn0 = new Column("NrAnalityki", "varchar(20)", sklepKontrTable); + sklepKontrTable.Columns.Add("NrAnalityki", nrAnalitykiColumn0); + var nrDomuColumn0 = new Column("NrDomu", "varchar(9)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("NrDomu", nrDomuColumn0); + var nrLokaluColumn0 = new Column("NrLokalu", "varchar(9)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("NrLokalu", nrLokaluColumn0); + var odbiorcaColumn0 = new Column("Odbiorca", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("Odbiorca", odbiorcaColumn0); + var osobaColumn0 = new Column("Osoba", "smallint", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("Osoba", osobaColumn0); + var pocztaColumn0 = new Column("Poczta", "varchar(40)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("Poczta", pocztaColumn0); + var poziomRabatuColumn0 = new Column("PoziomRabatu", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("PoziomRabatu", poziomRabatuColumn0); + var producentColumn0 = new Column("Producent", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("Producent", producentColumn0); + var prowizjaColumn0 = new Column("Prowizja", "decimal(10,4)", sklepKontrTable) + { + IsNullable = true + }; + sklepKontrTable.Columns.Add("Prowizja", prowizjaColumn0); + var rabatDostColumn0 = new Column("RabatDost", "decimal(10,4)", sklepKontrTable); + sklepKontrTable.Columns.Add("RabatDost", rabatDostColumn0); + var rabatOdbColumn0 = new Column("RabatOdb", "decimal(10,4)", sklepKontrTable); + sklepKontrTable.Columns.Add("RabatOdb", rabatOdbColumn0); + var rezerwa1Column0 = new Column("Rezerwa1", "varchar(80)", sklepKontrTable); + sklepKontrTable.Columns.Add("Rezerwa1", rezerwa1Column0); + var rezerwa2Column0 = new Column("Rezerwa2", "varchar(40)", sklepKontrTable); + sklepKontrTable.Columns.Add("Rezerwa2", rezerwa2Column0); + var skrotColumn3 = new Column("Skrot", "varchar(40)", sklepKontrTable); + sklepKontrTable.Columns.Add("Skrot", skrotColumn3); + var stalyColumn0 = new Column("Staly", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("Staly", stalyColumn0); + var telefonColumn0 = new Column("Telefon", "varchar(60)", sklepKontrTable); + sklepKontrTable.Columns.Add("Telefon", telefonColumn0); + var termPlatDostColumn0 = new Column("TermPlatDost", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("TermPlatDost", termPlatDostColumn0); + var termPlatOdbColumn0 = new Column("TermPlatOdb", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("TermPlatOdb", termPlatOdbColumn0); + var termWaznKartyColumn0 = new Column("TermWaznKarty", "datetime", sklepKontrTable); + sklepKontrTable.Columns.Add("TermWaznKarty", termWaznKartyColumn0); + var ulicaColumn0 = new Column("Ulica", "varchar(60)", sklepKontrTable); + sklepKontrTable.Columns.Add("Ulica", ulicaColumn0); + var zakPracChronColumn0 = new Column("ZakPracChron", "smallint", sklepKontrTable); + sklepKontrTable.Columns.Add("ZakPracChron", zakPracChronColumn0); + var zmianaColumn43 = new Column("Zmiana", "datetime", sklepKontrTable); + sklepKontrTable.Columns.Add("Zmiana", zmianaColumn43); + var pK_SKLEPKONTR = new UniqueConstraint("PK_SKLEPKONTR", sklepKontrTable, new[] { sklepIdColumn31, sklepKontrIdColumn4 }); + sklepKontrTable.PrimaryKey = pK_SKLEPKONTR; + var pK_SKLEPKONTRUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + pK_SKLEPKONTR.MappedKeys.Add(pK_SKLEPKONTRUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPKONTRUc).Add(pK_SKLEPKONTR); + sklepKontrTable.UniqueConstraints.Add("PK_SKLEPKONTR", pK_SKLEPKONTR); + var idx_SklepKthKth = new TableIndex( + "idx_SklepKthKth", sklepKontrTable, new[] { kontrIdColumn18 }, false); + var idx_SklepKthKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + "idx_SklepKthKth"); + idx_SklepKthKth.MappedIndexes.Add(idx_SklepKthKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepKthKthIx).Add(idx_SklepKthKth); + sklepKontrTable.Indexes.Add("idx_SklepKthKth", idx_SklepKthKth); + var idx_SklepKthSkKth = new TableIndex( + "idx_SklepKthSkKth", sklepKontrTable, new[] { sklepIdColumn31, kontrIdColumn18 }, false); + var idx_SklepKthSkKthIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + "idx_SklepKthSkKth"); + idx_SklepKthSkKth.MappedIndexes.Add(idx_SklepKthSkKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepKthSkKthIx).Add(idx_SklepKthSkKth); + sklepKontrTable.Indexes.Add("idx_SklepKthSkKth", idx_SklepKthSkKth); + var idx_SklepKthZmiana = new TableIndex( + "idx_SklepKthZmiana", sklepKontrTable, new[] { zmianaColumn43 }, false); + var idx_SklepKthZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + "idx_SklepKthZmiana"); + idx_SklepKthZmiana.MappedIndexes.Add(idx_SklepKthZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepKthZmianaIx).Add(idx_SklepKthZmiana); + sklepKontrTable.Indexes.Add("idx_SklepKthZmiana", idx_SklepKthZmiana); + relationalModel.Tables.Add(("SklepKontr", null), sklepKontrTable); + var sklepKontrTableMapping = new TableMapping(sklepKontr, sklepKontrTable, true); + sklepKontrTable.AddTypeMapping(sklepKontrTableMapping, false); + tableMappings186.Add(sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn31, sklepKontr.FindProperty("SklepId")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn4, sklepKontr.FindProperty("SklepKontrId")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn35, sklepKontr.FindProperty("Aktywny")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(akwizytorColumn, sklepKontr.FindProperty("Akwizytor")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(bankColumn0, sklepKontr.FindProperty("Bank")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(centrKontrIdColumn0, sklepKontr.FindProperty("CentrKontrId")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(czasRealZamColumn0, sklepKontr.FindProperty("CzasRealZam")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(dostawcaColumn0, sklepKontr.FindProperty("Dostawca")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(eMailColumn1, sklepKontr.FindProperty("EMail")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(faxColumn0, sklepKontr.FindProperty("Fax")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(formaPlatDostColumn0, sklepKontr.FindProperty("FormaPlatDost")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(formaPlatOdbColumn0, sklepKontr.FindProperty("FormaPlatOdb")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(indeksCentrColumn0, sklepKontr.FindProperty("IndeksCentr")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(kartaAktywnaColumn0, sklepKontr.FindProperty("KartaAktywna")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(kodColumn12, sklepKontr.FindProperty("Kod")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(kodKartyColumn3, sklepKontr.FindProperty("KodKarty")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(kodKontrColumn0, sklepKontr.FindProperty("KodKontr")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(kodKrajuColumn, sklepKontr.FindProperty("KodKraju")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(kontoColumn0, sklepKontr.FindProperty("Konto")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn18, sklepKontr.FindProperty("KontrId")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(maxKredytColumn0, sklepKontr.FindProperty("MaxKredyt")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(maxPoTermPlatColumn0, sklepKontr.FindProperty("MaxPoTermPlat")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(miastoColumn0, sklepKontr.FindProperty("Miasto")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(nIPColumn1, sklepKontr.FindProperty("NIP")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(naPrzelewie1Column0, sklepKontr.FindProperty("NaPrzelewie1")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(naPrzelewie2Column0, sklepKontr.FindProperty("NaPrzelewie2")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn45, sklepKontr.FindProperty("Nazwa")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(nrAnalitykiColumn0, sklepKontr.FindProperty("NrAnalityki")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(nrDomuColumn0, sklepKontr.FindProperty("NrDomu")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(nrLokaluColumn0, sklepKontr.FindProperty("NrLokalu")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(odbiorcaColumn0, sklepKontr.FindProperty("Odbiorca")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(osobaColumn0, sklepKontr.FindProperty("Osoba")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(pocztaColumn0, sklepKontr.FindProperty("Poczta")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(poziomRabatuColumn0, sklepKontr.FindProperty("PoziomRabatu")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(producentColumn0, sklepKontr.FindProperty("Producent")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(prowizjaColumn0, sklepKontr.FindProperty("Prowizja")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(rabatDostColumn0, sklepKontr.FindProperty("RabatDost")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(rabatOdbColumn0, sklepKontr.FindProperty("RabatOdb")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(rezerwa1Column0, sklepKontr.FindProperty("Rezerwa1")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(rezerwa2Column0, sklepKontr.FindProperty("Rezerwa2")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn3, sklepKontr.FindProperty("Skrot")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(stalyColumn0, sklepKontr.FindProperty("Staly")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(telefonColumn0, sklepKontr.FindProperty("Telefon")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(termPlatDostColumn0, sklepKontr.FindProperty("TermPlatDost")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(termPlatOdbColumn0, sklepKontr.FindProperty("TermPlatOdb")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(termWaznKartyColumn0, sklepKontr.FindProperty("TermWaznKarty")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(ulicaColumn0, sklepKontr.FindProperty("Ulica")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(zakPracChronColumn0, sklepKontr.FindProperty("ZakPracChron")!, sklepKontrTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn43, sklepKontr.FindProperty("Zmiana")!, sklepKontrTableMapping); + + var sklepKontrOpis = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKontrOpis")!; + + var defaultTableMappings187 = new List>(); + sklepKontrOpis.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings187); + var blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKontrOpis", null, relationalModel); + var sklepIdColumnBase32 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase.Columns.Add("SklepId", sklepIdColumnBase32); + var sklepKontrIdColumnBase5 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase5); + var tekstColumnBase14 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase.Columns.Add("Tekst", tekstColumnBase14); + var znaczenieColumnBase21 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase.Columns.Add("Znaczenie", znaczenieColumnBase21); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKontrOpis", blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisMappingBase = new TableMappingBase(sklepKontrOpis, blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisMappingBase, false); + defaultTableMappings187.Add(blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase32, sklepKontrOpis.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase5, sklepKontrOpis.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase21, sklepKontrOpis.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase14, sklepKontrOpis.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrOpisMappingBase); + + var tableMappings187 = new List(); + sklepKontrOpis.SetRuntimeAnnotation("Relational:TableMappings", tableMappings187); + var sklepKontrOpisTable = new Table("SklepKontrOpis", null, relationalModel); + var sklepIdColumn32 = new Column("SklepId", "numeric(9,0)", sklepKontrOpisTable); + sklepKontrOpisTable.Columns.Add("SklepId", sklepIdColumn32); + var sklepKontrIdColumn5 = new Column("SklepKontrId", "numeric(9,0)", sklepKontrOpisTable); + sklepKontrOpisTable.Columns.Add("SklepKontrId", sklepKontrIdColumn5); + var znaczenieColumn21 = new Column("Znaczenie", "smallint", sklepKontrOpisTable); + sklepKontrOpisTable.Columns.Add("Znaczenie", znaczenieColumn21); + var tekstColumn14 = new Column("Tekst", "varchar(255)", sklepKontrOpisTable); + sklepKontrOpisTable.Columns.Add("Tekst", tekstColumn14); + var pK_SKLEPKONTROPIS = new UniqueConstraint("PK_SKLEPKONTROPIS", sklepKontrOpisTable, new[] { sklepIdColumn32, sklepKontrIdColumn5, znaczenieColumn21 }); + sklepKontrOpisTable.PrimaryKey = pK_SKLEPKONTROPIS; + var pK_SKLEPKONTROPISUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontrOpis", + new[] { "SklepId", "SklepKontrId", "Znaczenie" }); + pK_SKLEPKONTROPIS.MappedKeys.Add(pK_SKLEPKONTROPISUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPKONTROPISUc).Add(pK_SKLEPKONTROPIS); + sklepKontrOpisTable.UniqueConstraints.Add("PK_SKLEPKONTROPIS", pK_SKLEPKONTROPIS); + relationalModel.Tables.Add(("SklepKontrOpis", null), sklepKontrOpisTable); + var sklepKontrOpisTableMapping = new TableMapping(sklepKontrOpis, sklepKontrOpisTable, true); + sklepKontrOpisTable.AddTypeMapping(sklepKontrOpisTableMapping, false); + tableMappings187.Add(sklepKontrOpisTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn32, sklepKontrOpis.FindProperty("SklepId")!, sklepKontrOpisTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn5, sklepKontrOpis.FindProperty("SklepKontrId")!, sklepKontrOpisTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn21, sklepKontrOpis.FindProperty("Znaczenie")!, sklepKontrOpisTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn14, sklepKontrOpis.FindProperty("Tekst")!, sklepKontrOpisTableMapping); + + var sklepKontrSklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKontrSklep")!; + + var defaultTableMappings188 = new List>(); + sklepKontrSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings188); + var blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKontrSklep", null, relationalModel); + var dataBOColumnBase0 = new ColumnBase("DataBO", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("DataBO", dataBOColumnBase0); + var kodKrajuColumnBase0 = new ColumnBase("KodKraju", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("KodKraju", kodKrajuColumnBase0); + var kolejnyWDniuBOColumnBase0 = new ColumnBase("KolejnyWDniuBO", "int", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("KolejnyWDniuBO", kolejnyWDniuBOColumnBase0); + var nrSeryjnyColumnBase0 = new ColumnBase("NrSeryjny", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("NrSeryjny", nrSeryjnyColumnBase0); + var nrSklepuColumnBase0 = new ColumnBase("NrSklepu", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("NrSklepu", nrSklepuColumnBase0); + var okrZamknietyColumnBase0 = new ColumnBase("OkrZamkniety", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("OkrZamkniety", okrZamknietyColumnBase0); + var ostEksportColumnBase0 = new ColumnBase("OstEksport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("OstEksport", ostEksportColumnBase0); + var ostImportColumnBase0 = new ColumnBase("OstImport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("OstImport", ostImportColumnBase0); + var pelnyImportColumnBase0 = new ColumnBase("PelnyImport", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("PelnyImport", pelnyImportColumnBase0); + var potwEksportColumnBase0 = new ColumnBase("PotwEksport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("PotwEksport", potwEksportColumnBase0); + var rolaColumnBase0 = new ColumnBase("Rola", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("Rola", rolaColumnBase0); + var sklepIdColumnBase33 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("SklepId", sklepIdColumnBase33); + var sklepKontrIdColumnBase6 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase6); + var sklepMagIdColumnBase3 = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase3); + var wymImportColumnBase0 = new ColumnBase("WymImport", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.Columns.Add("WymImport", wymImportColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKontrSklep", blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase = new TableMappingBase(sklepKontrSklep, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase, false); + defaultTableMappings188.Add(blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase33, sklepKontrSklep.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase6, sklepKontrSklep.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataBOColumnBase0, sklepKontrSklep.FindProperty("DataBO")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKrajuColumnBase0, sklepKontrSklep.FindProperty("KodKraju")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyWDniuBOColumnBase0, sklepKontrSklep.FindProperty("KolejnyWDniuBO")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrSeryjnyColumnBase0, sklepKontrSklep.FindProperty("NrSeryjny")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrSklepuColumnBase0, sklepKontrSklep.FindProperty("NrSklepu")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)okrZamknietyColumnBase0, sklepKontrSklep.FindProperty("OkrZamkniety")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ostEksportColumnBase0, sklepKontrSklep.FindProperty("OstEksport")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ostImportColumnBase0, sklepKontrSklep.FindProperty("OstImport")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pelnyImportColumnBase0, sklepKontrSklep.FindProperty("PelnyImport")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)potwEksportColumnBase0, sklepKontrSklep.FindProperty("PotwEksport")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaColumnBase0, sklepKontrSklep.FindProperty("Rola")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase3, sklepKontrSklep.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wymImportColumnBase0, sklepKontrSklep.FindProperty("WymImport")!, blinkBackofficeServicesPcmDbEntitiesSklepKontrSklepMappingBase); + + var tableMappings188 = new List(); + sklepKontrSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings188); + var sklepKontrSklepTable = new Table("SklepKontrSklep", null, relationalModel); + var sklepIdColumn33 = new Column("SklepId", "numeric(9,0)", sklepKontrSklepTable); + sklepKontrSklepTable.Columns.Add("SklepId", sklepIdColumn33); + var sklepKontrIdColumn6 = new Column("SklepKontrId", "numeric(9,0)", sklepKontrSklepTable); + sklepKontrSklepTable.Columns.Add("SklepKontrId", sklepKontrIdColumn6); + var dataBOColumn0 = new Column("DataBO", "datetime", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("DataBO", dataBOColumn0); + var kodKrajuColumn0 = new Column("KodKraju", "varchar(10)", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("KodKraju", kodKrajuColumn0); + var kolejnyWDniuBOColumn0 = new Column("KolejnyWDniuBO", "int", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("KolejnyWDniuBO", kolejnyWDniuBOColumn0); + var nrSeryjnyColumn0 = new Column("NrSeryjny", "varchar(40)", sklepKontrSklepTable); + sklepKontrSklepTable.Columns.Add("NrSeryjny", nrSeryjnyColumn0); + var nrSklepuColumn0 = new Column("NrSklepu", "smallint", sklepKontrSklepTable); + sklepKontrSklepTable.Columns.Add("NrSklepu", nrSklepuColumn0); + var okrZamknietyColumn0 = new Column("OkrZamkniety", "datetime", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("OkrZamkniety", okrZamknietyColumn0); + var ostEksportColumn0 = new Column("OstEksport", "datetime", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("OstEksport", ostEksportColumn0); + var ostImportColumn0 = new Column("OstImport", "datetime", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("OstImport", ostImportColumn0); + var pelnyImportColumn0 = new Column("PelnyImport", "smallint", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("PelnyImport", pelnyImportColumn0); + var potwEksportColumn0 = new Column("PotwEksport", "datetime", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("PotwEksport", potwEksportColumn0); + var rolaColumn0 = new Column("Rola", "smallint", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("Rola", rolaColumn0); + var sklepMagIdColumn3 = new Column("SklepMagId", "numeric(9,0)", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("SklepMagId", sklepMagIdColumn3); + var wymImportColumn0 = new Column("WymImport", "datetime", sklepKontrSklepTable) + { + IsNullable = true + }; + sklepKontrSklepTable.Columns.Add("WymImport", wymImportColumn0); + var pK_SKLKONTRSKL = new UniqueConstraint("PK_SKLKONTRSKL", sklepKontrSklepTable, new[] { sklepIdColumn33, sklepKontrIdColumn6 }); + sklepKontrSklepTable.PrimaryKey = pK_SKLKONTRSKL; + var pK_SKLKONTRSKLUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontrSklep", + new[] { "SklepId", "SklepKontrId" }); + pK_SKLKONTRSKL.MappedKeys.Add(pK_SKLKONTRSKLUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLKONTRSKLUc).Add(pK_SKLKONTRSKL); + sklepKontrSklepTable.UniqueConstraints.Add("PK_SKLKONTRSKL", pK_SKLKONTRSKL); + relationalModel.Tables.Add(("SklepKontrSklep", null), sklepKontrSklepTable); + var sklepKontrSklepTableMapping = new TableMapping(sklepKontrSklep, sklepKontrSklepTable, true); + sklepKontrSklepTable.AddTypeMapping(sklepKontrSklepTableMapping, false); + tableMappings188.Add(sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn33, sklepKontrSklep.FindProperty("SklepId")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn6, sklepKontrSklep.FindProperty("SklepKontrId")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(dataBOColumn0, sklepKontrSklep.FindProperty("DataBO")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(kodKrajuColumn0, sklepKontrSklep.FindProperty("KodKraju")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(kolejnyWDniuBOColumn0, sklepKontrSklep.FindProperty("KolejnyWDniuBO")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(nrSeryjnyColumn0, sklepKontrSklep.FindProperty("NrSeryjny")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(nrSklepuColumn0, sklepKontrSklep.FindProperty("NrSklepu")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(okrZamknietyColumn0, sklepKontrSklep.FindProperty("OkrZamkniety")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(ostEksportColumn0, sklepKontrSklep.FindProperty("OstEksport")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(ostImportColumn0, sklepKontrSklep.FindProperty("OstImport")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(pelnyImportColumn0, sklepKontrSklep.FindProperty("PelnyImport")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(potwEksportColumn0, sklepKontrSklep.FindProperty("PotwEksport")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(rolaColumn0, sklepKontrSklep.FindProperty("Rola")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn3, sklepKontrSklep.FindProperty("SklepMagId")!, sklepKontrSklepTableMapping); + RelationalModel.CreateColumnMapping(wymImportColumn0, sklepKontrSklep.FindProperty("WymImport")!, sklepKontrSklepTableMapping); + + var sklepKthTypOs = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs")!; + + var defaultTableMappings189 = new List>(); + sklepKthTypOs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings189); + var blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs", null, relationalModel); + var sklepIdColumnBase34 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase.Columns.Add("SklepId", sklepIdColumnBase34); + var sklepKontrIdColumnBase7 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase7); + var sklepTypOsIdColumnBase0 = new ColumnBase("SklepTypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase.Columns.Add("SklepTypOsId", sklepTypOsIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs", blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsMappingBase = new TableMappingBase(sklepKthTypOs, blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsMappingBase, false); + defaultTableMappings189.Add(blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase34, sklepKthTypOs.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase7, sklepKthTypOs.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTypOsIdColumnBase0, sklepKthTypOs.FindProperty("SklepTypOsId")!, blinkBackofficeServicesPcmDbEntitiesSklepKthTypOsMappingBase); + + var tableMappings189 = new List(); + sklepKthTypOs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings189); + var sklepKthTypOsTable = new Table("SklepKthTypOs", null, relationalModel); + var sklepIdColumn34 = new Column("SklepId", "numeric(9,0)", sklepKthTypOsTable); + sklepKthTypOsTable.Columns.Add("SklepId", sklepIdColumn34); + var sklepKontrIdColumn7 = new Column("SklepKontrId", "numeric(9,0)", sklepKthTypOsTable); + sklepKthTypOsTable.Columns.Add("SklepKontrId", sklepKontrIdColumn7); + var sklepTypOsIdColumn0 = new Column("SklepTypOsId", "numeric(9,0)", sklepKthTypOsTable); + sklepKthTypOsTable.Columns.Add("SklepTypOsId", sklepTypOsIdColumn0); + var pK_SKLEPKTHTYPOS = new UniqueConstraint("PK_SKLEPKTHTYPOS", sklepKthTypOsTable, new[] { sklepIdColumn34, sklepKontrIdColumn7, sklepTypOsIdColumn0 }); + sklepKthTypOsTable.PrimaryKey = pK_SKLEPKTHTYPOS; + var pK_SKLEPKTHTYPOSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs", + new[] { "SklepId", "SklepKontrId", "SklepTypOsId" }); + pK_SKLEPKTHTYPOS.MappedKeys.Add(pK_SKLEPKTHTYPOSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPKTHTYPOSUc).Add(pK_SKLEPKTHTYPOS); + sklepKthTypOsTable.UniqueConstraints.Add("PK_SKLEPKTHTYPOS", pK_SKLEPKTHTYPOS); + var idx_SKKTHTYPOS_SKTYPOS = new TableIndex( + "idx_SKKTHTYPOS_SKTYPOS", sklepKthTypOsTable, new[] { sklepIdColumn34, sklepTypOsIdColumn0 }, false); + var idx_SKKTHTYPOS_SKTYPOSIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs", + "idx_SKKTHTYPOS_SKTYPOS"); + idx_SKKTHTYPOS_SKTYPOS.MappedIndexes.Add(idx_SKKTHTYPOS_SKTYPOSIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKKTHTYPOS_SKTYPOSIx).Add(idx_SKKTHTYPOS_SKTYPOS); + sklepKthTypOsTable.Indexes.Add("idx_SKKTHTYPOS_SKTYPOS", idx_SKKTHTYPOS_SKTYPOS); + relationalModel.Tables.Add(("SklepKthTypOs", null), sklepKthTypOsTable); + var sklepKthTypOsTableMapping = new TableMapping(sklepKthTypOs, sklepKthTypOsTable, true); + sklepKthTypOsTable.AddTypeMapping(sklepKthTypOsTableMapping, false); + tableMappings189.Add(sklepKthTypOsTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn34, sklepKthTypOs.FindProperty("SklepId")!, sklepKthTypOsTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn7, sklepKthTypOs.FindProperty("SklepKontrId")!, sklepKthTypOsTableMapping); + RelationalModel.CreateColumnMapping(sklepTypOsIdColumn0, sklepKthTypOs.FindProperty("SklepTypOsId")!, sklepKthTypOsTableMapping); + + var sklepMagazyn = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn")!; + + var defaultTableMappings190 = new List>(); + sklepMagazyn.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings190); + var blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", null, relationalModel); + var nazwaColumnBase46 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase.Columns.Add("Nazwa", nazwaColumnBase46); + var numerColumnBase8 = new ColumnBase("Numer", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase.Columns.Add("Numer", numerColumnBase8); + var sklepIdColumnBase35 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase.Columns.Add("SklepId", sklepIdColumnBase35); + var sklepMagIdColumnBase4 = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepMagazynMappingBase = new TableMappingBase(sklepMagazyn, blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepMagazynTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepMagazynMappingBase, false); + defaultTableMappings190.Add(blinkBackofficeServicesPcmDbEntitiesSklepMagazynMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase35, sklepMagazyn.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepMagazynMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase4, sklepMagazyn.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepMagazynMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase46, sklepMagazyn.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepMagazynMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase8, sklepMagazyn.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesSklepMagazynMappingBase); + + var tableMappings190 = new List(); + sklepMagazyn.SetRuntimeAnnotation("Relational:TableMappings", tableMappings190); + var sklepMagazynTable = new Table("SklepMagazyn", null, relationalModel); + var sklepIdColumn35 = new Column("SklepId", "numeric(9,0)", sklepMagazynTable); + sklepMagazynTable.Columns.Add("SklepId", sklepIdColumn35); + var sklepMagIdColumn4 = new Column("SklepMagId", "numeric(9,0)", sklepMagazynTable); + sklepMagazynTable.Columns.Add("SklepMagId", sklepMagIdColumn4); + var nazwaColumn46 = new Column("Nazwa", "varchar(40)", sklepMagazynTable); + sklepMagazynTable.Columns.Add("Nazwa", nazwaColumn46); + var numerColumn8 = new Column("Numer", "smallint", sklepMagazynTable); + sklepMagazynTable.Columns.Add("Numer", numerColumn8); + var pK_SKLEPMAGAZYN = new UniqueConstraint("PK_SKLEPMAGAZYN", sklepMagazynTable, new[] { sklepIdColumn35, sklepMagIdColumn4 }); + sklepMagazynTable.PrimaryKey = pK_SKLEPMAGAZYN; + var pK_SKLEPMAGAZYNUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + new[] { "SklepId", "SklepMagId" }); + pK_SKLEPMAGAZYN.MappedKeys.Add(pK_SKLEPMAGAZYNUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPMAGAZYNUc).Add(pK_SKLEPMAGAZYN); + sklepMagazynTable.UniqueConstraints.Add("PK_SKLEPMAGAZYN", pK_SKLEPMAGAZYN); + relationalModel.Tables.Add(("SklepMagazyn", null), sklepMagazynTable); + var sklepMagazynTableMapping = new TableMapping(sklepMagazyn, sklepMagazynTable, true); + sklepMagazynTable.AddTypeMapping(sklepMagazynTableMapping, false); + tableMappings190.Add(sklepMagazynTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn35, sklepMagazyn.FindProperty("SklepId")!, sklepMagazynTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn4, sklepMagazyn.FindProperty("SklepMagId")!, sklepMagazynTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn46, sklepMagazyn.FindProperty("Nazwa")!, sklepMagazynTableMapping); + RelationalModel.CreateColumnMapping(numerColumn8, sklepMagazyn.FindProperty("Numer")!, sklepMagazynTableMapping); + + var sklepNotatki = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepNotatki")!; + + var defaultTableMappings191 = new List>(); + sklepNotatki.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings191); + var blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepNotatki", null, relationalModel); + var kolejnoscColumnBase33 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase33); + var koniecLiniiColumnBase0 = new ColumnBase("KoniecLinii", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase.Columns.Add("KoniecLinii", koniecLiniiColumnBase0); + var sklepIdColumnBase36 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase.Columns.Add("SklepId", sklepIdColumnBase36); + var sklepTowIdColumnBase1 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase1); + var tekstColumnBase15 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase.Columns.Add("Tekst", tekstColumnBase15); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepNotatki", blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase = new TableMappingBase(sklepNotatki, blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepNotatkiTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase, false); + defaultTableMappings191.Add(blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase33, sklepNotatki.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase36, sklepNotatki.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase1, sklepNotatki.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)koniecLiniiColumnBase0, sklepNotatki.FindProperty("KoniecLinii")!, blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase15, sklepNotatki.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepNotatkiMappingBase); + + var tableMappings191 = new List(); + sklepNotatki.SetRuntimeAnnotation("Relational:TableMappings", tableMappings191); + var sklepNotatkiTable = new Table("SklepNotatki", null, relationalModel); + var sklepIdColumn36 = new Column("SklepId", "numeric(9,0)", sklepNotatkiTable); + sklepNotatkiTable.Columns.Add("SklepId", sklepIdColumn36); + var sklepTowIdColumn1 = new Column("SklepTowId", "numeric(9,0)", sklepNotatkiTable); + sklepNotatkiTable.Columns.Add("SklepTowId", sklepTowIdColumn1); + var kolejnoscColumn33 = new Column("Kolejnosc", "smallint", sklepNotatkiTable); + sklepNotatkiTable.Columns.Add("Kolejnosc", kolejnoscColumn33); + var koniecLiniiColumn0 = new Column("KoniecLinii", "smallint", sklepNotatkiTable); + sklepNotatkiTable.Columns.Add("KoniecLinii", koniecLiniiColumn0); + var tekstColumn15 = new Column("Tekst", "varchar(255)", sklepNotatkiTable); + sklepNotatkiTable.Columns.Add("Tekst", tekstColumn15); + var pK_SKLEPNOTATKI = new UniqueConstraint("PK_SKLEPNOTATKI", sklepNotatkiTable, new[] { sklepIdColumn36, sklepTowIdColumn1, kolejnoscColumn33 }); + sklepNotatkiTable.PrimaryKey = pK_SKLEPNOTATKI; + var pK_SKLEPNOTATKIUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNotatki", + new[] { "SklepId", "SklepTowId", "Kolejnosc" }); + pK_SKLEPNOTATKI.MappedKeys.Add(pK_SKLEPNOTATKIUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPNOTATKIUc).Add(pK_SKLEPNOTATKI); + sklepNotatkiTable.UniqueConstraints.Add("PK_SKLEPNOTATKI", pK_SKLEPNOTATKI); + relationalModel.Tables.Add(("SklepNotatki", null), sklepNotatkiTable); + var sklepNotatkiTableMapping = new TableMapping(sklepNotatki, sklepNotatkiTable, true); + sklepNotatkiTable.AddTypeMapping(sklepNotatkiTableMapping, false); + tableMappings191.Add(sklepNotatkiTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn33, sklepNotatki.FindProperty("Kolejnosc")!, sklepNotatkiTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn36, sklepNotatki.FindProperty("SklepId")!, sklepNotatkiTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn1, sklepNotatki.FindProperty("SklepTowId")!, sklepNotatkiTableMapping); + RelationalModel.CreateColumnMapping(koniecLiniiColumn0, sklepNotatki.FindProperty("KoniecLinii")!, sklepNotatkiTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn15, sklepNotatki.FindProperty("Tekst")!, sklepNotatkiTableMapping); + + var sklepNrRej = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej")!; + + var defaultTableMappings192 = new List>(); + sklepNrRej.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings192); + var blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej", null, relationalModel); + var nrFormatColumnBase0 = new ColumnBase("NrFormat", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase.Columns.Add("NrFormat", nrFormatColumnBase0); + var nrWpisanyColumnBase0 = new ColumnBase("NrWpisany", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase.Columns.Add("NrWpisany", nrWpisanyColumnBase0); + var sklepIdColumnBase37 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase.Columns.Add("SklepId", sklepIdColumnBase37); + var sklepKontrIdColumnBase8 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase8); + var wyborKartColumnBase0 = new ColumnBase("WyborKart", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase.Columns.Add("WyborKart", wyborKartColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej", blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase = new TableMappingBase(sklepNrRej, blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase, false); + defaultTableMappings192.Add(blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrFormatColumnBase0, sklepNrRej.FindProperty("NrFormat")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase37, sklepNrRej.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase8, sklepNrRej.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrWpisanyColumnBase0, sklepNrRej.FindProperty("NrWpisany")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wyborKartColumnBase0, sklepNrRej.FindProperty("WyborKart")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejMappingBase); + + var tableMappings192 = new List(); + sklepNrRej.SetRuntimeAnnotation("Relational:TableMappings", tableMappings192); + var sklepNrRejTable = new Table("SklepNrRej", null, relationalModel); + var sklepIdColumn37 = new Column("SklepId", "numeric(9,0)", sklepNrRejTable); + sklepNrRejTable.Columns.Add("SklepId", sklepIdColumn37); + var sklepKontrIdColumn8 = new Column("SklepKontrId", "numeric(9,0)", sklepNrRejTable); + sklepNrRejTable.Columns.Add("SklepKontrId", sklepKontrIdColumn8); + var nrFormatColumn0 = new Column("NrFormat", "varchar(60)", sklepNrRejTable); + sklepNrRejTable.Columns.Add("NrFormat", nrFormatColumn0); + var nrWpisanyColumn0 = new Column("NrWpisany", "varchar(60)", sklepNrRejTable); + sklepNrRejTable.Columns.Add("NrWpisany", nrWpisanyColumn0); + var wyborKartColumn0 = new Column("WyborKart", "smallint", sklepNrRejTable); + sklepNrRejTable.Columns.Add("WyborKart", wyborKartColumn0); + var pK_SKLEPNRREJ = new UniqueConstraint("PK_SKLEPNRREJ", sklepNrRejTable, new[] { sklepIdColumn37, sklepKontrIdColumn8, nrFormatColumn0 }); + sklepNrRejTable.PrimaryKey = pK_SKLEPNRREJ; + var pK_SKLEPNRREJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej", + new[] { "SklepId", "SklepKontrId", "NrFormat" }); + pK_SKLEPNRREJ.MappedKeys.Add(pK_SKLEPNRREJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPNRREJUc).Add(pK_SKLEPNRREJ); + sklepNrRejTable.UniqueConstraints.Add("PK_SKLEPNRREJ", pK_SKLEPNRREJ); + var idx_SkNumerRej = new TableIndex( + "idx_SkNumerRej", sklepNrRejTable, new[] { nrFormatColumn0, sklepIdColumn37, sklepKontrIdColumn8 }, false); + var idx_SkNumerRejIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej", + "idx_SkNumerRej"); + idx_SkNumerRej.MappedIndexes.Add(idx_SkNumerRejIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkNumerRejIx).Add(idx_SkNumerRej); + sklepNrRejTable.Indexes.Add("idx_SkNumerRej", idx_SkNumerRej); + relationalModel.Tables.Add(("SklepNrRej", null), sklepNrRejTable); + var sklepNrRejTableMapping = new TableMapping(sklepNrRej, sklepNrRejTable, true); + sklepNrRejTable.AddTypeMapping(sklepNrRejTableMapping, false); + tableMappings192.Add(sklepNrRejTableMapping); + RelationalModel.CreateColumnMapping(nrFormatColumn0, sklepNrRej.FindProperty("NrFormat")!, sklepNrRejTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn37, sklepNrRej.FindProperty("SklepId")!, sklepNrRejTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn8, sklepNrRej.FindProperty("SklepKontrId")!, sklepNrRejTableMapping); + RelationalModel.CreateColumnMapping(nrWpisanyColumn0, sklepNrRej.FindProperty("NrWpisany")!, sklepNrRejTableMapping); + RelationalModel.CreateColumnMapping(wyborKartColumn0, sklepNrRej.FindProperty("WyborKart")!, sklepNrRejTableMapping); + + var sklepNrRejKarta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta")!; + + var defaultTableMappings193 = new List>(); + sklepNrRejKarta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings193); + var blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta", null, relationalModel); + var nrFormatColumnBase1 = new ColumnBase("NrFormat", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase.Columns.Add("NrFormat", nrFormatColumnBase1); + var sklepIdColumnBase38 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase.Columns.Add("SklepId", sklepIdColumnBase38); + var sklepKartaIdColumnBase0 = new ColumnBase("SklepKartaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase.Columns.Add("SklepKartaId", sklepKartaIdColumnBase0); + var sklepKontrIdColumnBase9 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase9); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta", blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaMappingBase = new TableMappingBase(sklepNrRejKarta, blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaMappingBase, false); + defaultTableMappings193.Add(blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrFormatColumnBase1, sklepNrRejKarta.FindProperty("NrFormat")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase38, sklepNrRejKarta.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKartaIdColumnBase0, sklepNrRejKarta.FindProperty("SklepKartaId")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase9, sklepNrRejKarta.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepNrRejKartaMappingBase); + + var tableMappings193 = new List(); + sklepNrRejKarta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings193); + var sklepNrRejKartaTable = new Table("SklepNrRejKarta", null, relationalModel); + var sklepIdColumn38 = new Column("SklepId", "numeric(9,0)", sklepNrRejKartaTable); + sklepNrRejKartaTable.Columns.Add("SklepId", sklepIdColumn38); + var sklepKontrIdColumn9 = new Column("SklepKontrId", "numeric(9,0)", sklepNrRejKartaTable); + sklepNrRejKartaTable.Columns.Add("SklepKontrId", sklepKontrIdColumn9); + var nrFormatColumn1 = new Column("NrFormat", "varchar(60)", sklepNrRejKartaTable); + sklepNrRejKartaTable.Columns.Add("NrFormat", nrFormatColumn1); + var sklepKartaIdColumn0 = new Column("SklepKartaId", "numeric(9,0)", sklepNrRejKartaTable); + sklepNrRejKartaTable.Columns.Add("SklepKartaId", sklepKartaIdColumn0); + var pK_SKLEPNRREJKARTA = new UniqueConstraint("PK_SKLEPNRREJKARTA", sklepNrRejKartaTable, new[] { sklepIdColumn38, sklepKontrIdColumn9, nrFormatColumn1, sklepKartaIdColumn0 }); + sklepNrRejKartaTable.PrimaryKey = pK_SKLEPNRREJKARTA; + var pK_SKLEPNRREJKARTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta", + new[] { "SklepId", "SklepKontrId", "NrFormat", "SklepKartaId" }); + pK_SKLEPNRREJKARTA.MappedKeys.Add(pK_SKLEPNRREJKARTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPNRREJKARTAUc).Add(pK_SKLEPNRREJKARTA); + sklepNrRejKartaTable.UniqueConstraints.Add("PK_SKLEPNRREJKARTA", pK_SKLEPNRREJKARTA); + var idx_SkNrRejKartaId = new TableIndex( + "idx_SkNrRejKartaId", sklepNrRejKartaTable, new[] { sklepIdColumn38, sklepKartaIdColumn0, sklepKontrIdColumn9, nrFormatColumn1 }, false); + var idx_SkNrRejKartaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta", + "idx_SkNrRejKartaId"); + idx_SkNrRejKartaId.MappedIndexes.Add(idx_SkNrRejKartaIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkNrRejKartaIdIx).Add(idx_SkNrRejKartaId); + sklepNrRejKartaTable.Indexes.Add("idx_SkNrRejKartaId", idx_SkNrRejKartaId); + relationalModel.Tables.Add(("SklepNrRejKarta", null), sklepNrRejKartaTable); + var sklepNrRejKartaTableMapping = new TableMapping(sklepNrRejKarta, sklepNrRejKartaTable, true); + sklepNrRejKartaTable.AddTypeMapping(sklepNrRejKartaTableMapping, false); + tableMappings193.Add(sklepNrRejKartaTableMapping); + RelationalModel.CreateColumnMapping(nrFormatColumn1, sklepNrRejKarta.FindProperty("NrFormat")!, sklepNrRejKartaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn38, sklepNrRejKarta.FindProperty("SklepId")!, sklepNrRejKartaTableMapping); + RelationalModel.CreateColumnMapping(sklepKartaIdColumn0, sklepNrRejKarta.FindProperty("SklepKartaId")!, sklepNrRejKartaTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn9, sklepNrRejKarta.FindProperty("SklepKontrId")!, sklepNrRejKartaTableMapping); + + var sklepOplata = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepOplata")!; + + var defaultTableMappings194 = new List>(); + sklepOplata.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings194); + var blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepOplata", null, relationalModel); + var aktywnyColumnBase36 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("Aktywny", aktywnyColumnBase36); + var dataDoColumnBase3 = new ColumnBase("DataDo", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("DataDo", dataDoColumnBase3); + var dataOdColumnBase3 = new ColumnBase("DataOd", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("DataOd", dataOdColumnBase3); + var komentarzColumnBase1 = new ColumnBase("Komentarz", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("Komentarz", komentarzColumnBase1); + var kwotaColumnBase7 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("Kwota", kwotaColumnBase7); + var nazwaColumnBase47 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("Nazwa", nazwaColumnBase47); + var oplataIdColumnBase0 = new ColumnBase("OplataId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("OplataId", oplataIdColumnBase0); + var rodzajColumnBase7 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("Rodzaj", rodzajColumnBase7); + var sklepIdColumnBase39 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("SklepId", sklepIdColumnBase39); + var sklepKBIdColumnBase1 = new ColumnBase("SklepKBId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("SklepKBId", sklepKBIdColumnBase1); + var sklepOplataIdColumnBase = new ColumnBase("SklepOplataId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("SklepOplataId", sklepOplataIdColumnBase); + var stawkaProcColumnBase0 = new ColumnBase("StawkaProc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("StawkaProc", stawkaProcColumnBase0); + var typColumnBase28 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("Typ", typColumnBase28); + var zmianaColumnBase44 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.Columns.Add("Zmiana", zmianaColumnBase44); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepOplata", blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase = new TableMappingBase(sklepOplata, blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepOplataTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase, false); + defaultTableMappings194.Add(blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase39, sklepOplata.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepOplataIdColumnBase, sklepOplata.FindProperty("SklepOplataId")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase36, sklepOplata.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDoColumnBase3, sklepOplata.FindProperty("DataDo")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataOdColumnBase3, sklepOplata.FindProperty("DataOd")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)komentarzColumnBase1, sklepOplata.FindProperty("Komentarz")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase7, sklepOplata.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase47, sklepOplata.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)oplataIdColumnBase0, sklepOplata.FindProperty("OplataId")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase7, sklepOplata.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKBIdColumnBase1, sklepOplata.FindProperty("SklepKBId")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaProcColumnBase0, sklepOplata.FindProperty("StawkaProc")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase28, sklepOplata.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase44, sklepOplata.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepOplataMappingBase); + + var tableMappings194 = new List(); + sklepOplata.SetRuntimeAnnotation("Relational:TableMappings", tableMappings194); + var sklepOplataTable = new Table("SklepOplata", null, relationalModel); + var sklepIdColumn39 = new Column("SklepId", "numeric(9,0)", sklepOplataTable); + sklepOplataTable.Columns.Add("SklepId", sklepIdColumn39); + var sklepOplataIdColumn = new Column("SklepOplataId", "numeric(9,0)", sklepOplataTable); + sklepOplataTable.Columns.Add("SklepOplataId", sklepOplataIdColumn); + var aktywnyColumn36 = new Column("Aktywny", "smallint", sklepOplataTable); + sklepOplataTable.Columns.Add("Aktywny", aktywnyColumn36); + var dataDoColumn3 = new Column("DataDo", "datetime", sklepOplataTable) + { + IsNullable = true + }; + sklepOplataTable.Columns.Add("DataDo", dataDoColumn3); + var dataOdColumn3 = new Column("DataOd", "datetime", sklepOplataTable) + { + IsNullable = true + }; + sklepOplataTable.Columns.Add("DataOd", dataOdColumn3); + var komentarzColumn1 = new Column("Komentarz", "varchar(255)", sklepOplataTable) + { + IsNullable = true + }; + sklepOplataTable.Columns.Add("Komentarz", komentarzColumn1); + var kwotaColumn7 = new Column("Kwota", "decimal(15,4)", sklepOplataTable) + { + IsNullable = true + }; + sklepOplataTable.Columns.Add("Kwota", kwotaColumn7); + var nazwaColumn47 = new Column("Nazwa", "varchar(120)", sklepOplataTable); + sklepOplataTable.Columns.Add("Nazwa", nazwaColumn47); + var oplataIdColumn0 = new Column("OplataId", "numeric(9,0)", sklepOplataTable) + { + IsNullable = true + }; + sklepOplataTable.Columns.Add("OplataId", oplataIdColumn0); + var rodzajColumn7 = new Column("Rodzaj", "smallint", sklepOplataTable); + sklepOplataTable.Columns.Add("Rodzaj", rodzajColumn7); + var sklepKBIdColumn1 = new Column("SklepKBId", "numeric(9,0)", sklepOplataTable) + { + IsNullable = true + }; + sklepOplataTable.Columns.Add("SklepKBId", sklepKBIdColumn1); + var stawkaProcColumn0 = new Column("StawkaProc", "decimal(15,4)", sklepOplataTable) + { + IsNullable = true + }; + sklepOplataTable.Columns.Add("StawkaProc", stawkaProcColumn0); + var typColumn28 = new Column("Typ", "smallint", sklepOplataTable); + sklepOplataTable.Columns.Add("Typ", typColumn28); + var zmianaColumn44 = new Column("Zmiana", "datetime", sklepOplataTable); + sklepOplataTable.Columns.Add("Zmiana", zmianaColumn44); + var pK_SklepOplata = new UniqueConstraint("PK_SklepOplata", sklepOplataTable, new[] { sklepIdColumn39, sklepOplataIdColumn }); + sklepOplataTable.PrimaryKey = pK_SklepOplata; + var pK_SklepOplataUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepOplata", + new[] { "SklepId", "SklepOplataId" }); + pK_SklepOplata.MappedKeys.Add(pK_SklepOplataUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepOplataUc).Add(pK_SklepOplata); + sklepOplataTable.UniqueConstraints.Add("PK_SklepOplata", pK_SklepOplata); + relationalModel.Tables.Add(("SklepOplata", null), sklepOplataTable); + var sklepOplataTableMapping = new TableMapping(sklepOplata, sklepOplataTable, true); + sklepOplataTable.AddTypeMapping(sklepOplataTableMapping, false); + tableMappings194.Add(sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn39, sklepOplata.FindProperty("SklepId")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(sklepOplataIdColumn, sklepOplata.FindProperty("SklepOplataId")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn36, sklepOplata.FindProperty("Aktywny")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(dataDoColumn3, sklepOplata.FindProperty("DataDo")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(dataOdColumn3, sklepOplata.FindProperty("DataOd")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(komentarzColumn1, sklepOplata.FindProperty("Komentarz")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn7, sklepOplata.FindProperty("Kwota")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn47, sklepOplata.FindProperty("Nazwa")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(oplataIdColumn0, sklepOplata.FindProperty("OplataId")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn7, sklepOplata.FindProperty("Rodzaj")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(sklepKBIdColumn1, sklepOplata.FindProperty("SklepKBId")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(stawkaProcColumn0, sklepOplata.FindProperty("StawkaProc")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(typColumn28, sklepOplata.FindProperty("Typ")!, sklepOplataTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn44, sklepOplata.FindProperty("Zmiana")!, sklepOplataTableMapping); + + var sklepPanel = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPanel")!; + + var defaultTableMappings195 = new List>(); + sklepPanel.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings195); + var blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", null, relationalModel); + var aktywnyColumnBase37 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("Aktywny", aktywnyColumnBase37); + var hColumnBase0 = new ColumnBase("H", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("H", hColumnBase0); + var lColumnBase0 = new ColumnBase("L", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("L", lColumnBase0); + var nazwaColumnBase48 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("Nazwa", nazwaColumnBase48); + var panelIdColumnBase1 = new ColumnBase("PanelId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("PanelId", panelIdColumnBase1); + var param1ColumnBase8 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("Param1", param1ColumnBase8); + var rodzajColumnBase8 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("Rodzaj", rodzajColumnBase8); + var sklepIdColumnBase40 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("SklepId", sklepIdColumnBase40); + var sklepPanelIdColumnBase = new ColumnBase("SklepPanelId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("SklepPanelId", sklepPanelIdColumnBase); + var sklepUzIdColumnBase2 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase2); + var tColumnBase0 = new ColumnBase("T", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("T", tColumnBase0); + var typAplikacjiColumnBase1 = new ColumnBase("TypAplikacji", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("TypAplikacji", typAplikacjiColumnBase1); + var wColumnBase0 = new ColumnBase("W", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("W", wColumnBase0); + var zmianaColumnBase45 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.Columns.Add("Zmiana", zmianaColumnBase45); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase = new TableMappingBase(sklepPanel, blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPanelTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase, false); + defaultTableMappings195.Add(blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase40, sklepPanel.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepPanelIdColumnBase, sklepPanel.FindProperty("SklepPanelId")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase37, sklepPanel.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hColumnBase0, sklepPanel.FindProperty("H")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)lColumnBase0, sklepPanel.FindProperty("L")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase48, sklepPanel.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)panelIdColumnBase1, sklepPanel.FindProperty("PanelId")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase8, sklepPanel.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase8, sklepPanel.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase2, sklepPanel.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tColumnBase0, sklepPanel.FindProperty("T")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typAplikacjiColumnBase1, sklepPanel.FindProperty("TypAplikacji")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wColumnBase0, sklepPanel.FindProperty("W")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase45, sklepPanel.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelMappingBase); + + var tableMappings195 = new List(); + sklepPanel.SetRuntimeAnnotation("Relational:TableMappings", tableMappings195); + var sklepPanelTable = new Table("SklepPanel", null, relationalModel); + var sklepIdColumn40 = new Column("SklepId", "numeric(9,0)", sklepPanelTable); + sklepPanelTable.Columns.Add("SklepId", sklepIdColumn40); + var sklepPanelIdColumn = new Column("SklepPanelId", "numeric(9,0)", sklepPanelTable); + sklepPanelTable.Columns.Add("SklepPanelId", sklepPanelIdColumn); + var aktywnyColumn37 = new Column("Aktywny", "smallint", sklepPanelTable); + sklepPanelTable.Columns.Add("Aktywny", aktywnyColumn37); + var hColumn0 = new Column("H", "smallint", sklepPanelTable) + { + IsNullable = true + }; + sklepPanelTable.Columns.Add("H", hColumn0); + var lColumn0 = new Column("L", "smallint", sklepPanelTable) + { + IsNullable = true + }; + sklepPanelTable.Columns.Add("L", lColumn0); + var nazwaColumn48 = new Column("Nazwa", "varchar(255)", sklepPanelTable); + sklepPanelTable.Columns.Add("Nazwa", nazwaColumn48); + var panelIdColumn1 = new Column("PanelId", "numeric(9,0)", sklepPanelTable) + { + IsNullable = true + }; + sklepPanelTable.Columns.Add("PanelId", panelIdColumn1); + var param1Column8 = new Column("Param1", "int", sklepPanelTable) + { + IsNullable = true + }; + sklepPanelTable.Columns.Add("Param1", param1Column8); + var rodzajColumn8 = new Column("Rodzaj", "smallint", sklepPanelTable); + sklepPanelTable.Columns.Add("Rodzaj", rodzajColumn8); + var sklepUzIdColumn2 = new Column("SklepUzId", "numeric(9,0)", sklepPanelTable) + { + IsNullable = true + }; + sklepPanelTable.Columns.Add("SklepUzId", sklepUzIdColumn2); + var tColumn0 = new Column("T", "smallint", sklepPanelTable) + { + IsNullable = true + }; + sklepPanelTable.Columns.Add("T", tColumn0); + var typAplikacjiColumn1 = new Column("TypAplikacji", "smallint", sklepPanelTable); + sklepPanelTable.Columns.Add("TypAplikacji", typAplikacjiColumn1); + var wColumn0 = new Column("W", "smallint", sklepPanelTable) + { + IsNullable = true + }; + sklepPanelTable.Columns.Add("W", wColumn0); + var zmianaColumn45 = new Column("Zmiana", "datetime", sklepPanelTable); + sklepPanelTable.Columns.Add("Zmiana", zmianaColumn45); + var pK_SKLEP_PANEL = new UniqueConstraint("PK_SKLEP_PANEL", sklepPanelTable, new[] { sklepIdColumn40, sklepPanelIdColumn }); + sklepPanelTable.PrimaryKey = pK_SKLEP_PANEL; + var pK_SKLEP_PANELUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", + new[] { "SklepId", "SklepPanelId" }); + pK_SKLEP_PANEL.MappedKeys.Add(pK_SKLEP_PANELUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEP_PANELUc).Add(pK_SKLEP_PANEL); + sklepPanelTable.UniqueConstraints.Add("PK_SKLEP_PANEL", pK_SKLEP_PANEL); + var iX_SklepPanel_PanelId = new TableIndex( + "IX_SklepPanel_PanelId", sklepPanelTable, new[] { panelIdColumn1 }, false); + var iX_SklepPanel_PanelIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", + new[] { "PanelId" }); + iX_SklepPanel_PanelId.MappedIndexes.Add(iX_SklepPanel_PanelIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepPanel_PanelIdIx).Add(iX_SklepPanel_PanelId); + sklepPanelTable.Indexes.Add("IX_SklepPanel_PanelId", iX_SklepPanel_PanelId); + var iX_SklepPanel_SklepId_SklepUzId = new TableIndex( + "IX_SklepPanel_SklepId_SklepUzId", sklepPanelTable, new[] { sklepIdColumn40, sklepUzIdColumn2 }, false); + var iX_SklepPanel_SklepId_SklepUzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", + new[] { "SklepId", "SklepUzId" }); + iX_SklepPanel_SklepId_SklepUzId.MappedIndexes.Add(iX_SklepPanel_SklepId_SklepUzIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepPanel_SklepId_SklepUzIdIx).Add(iX_SklepPanel_SklepId_SklepUzId); + sklepPanelTable.Indexes.Add("IX_SklepPanel_SklepId_SklepUzId", iX_SklepPanel_SklepId_SklepUzId); + relationalModel.Tables.Add(("SklepPanel", null), sklepPanelTable); + var sklepPanelTableMapping = new TableMapping(sklepPanel, sklepPanelTable, true); + sklepPanelTable.AddTypeMapping(sklepPanelTableMapping, false); + tableMappings195.Add(sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn40, sklepPanel.FindProperty("SklepId")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(sklepPanelIdColumn, sklepPanel.FindProperty("SklepPanelId")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn37, sklepPanel.FindProperty("Aktywny")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(hColumn0, sklepPanel.FindProperty("H")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(lColumn0, sklepPanel.FindProperty("L")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn48, sklepPanel.FindProperty("Nazwa")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(panelIdColumn1, sklepPanel.FindProperty("PanelId")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(param1Column8, sklepPanel.FindProperty("Param1")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn8, sklepPanel.FindProperty("Rodzaj")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn2, sklepPanel.FindProperty("SklepUzId")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(tColumn0, sklepPanel.FindProperty("T")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(typAplikacjiColumn1, sklepPanel.FindProperty("TypAplikacji")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(wColumn0, sklepPanel.FindProperty("W")!, sklepPanelTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn45, sklepPanel.FindProperty("Zmiana")!, sklepPanelTableMapping); + + var sklepPanelParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPanelParam")!; + + var defaultTableMappings196 = new List>(); + sklepPanelParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings196); + var blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPanelParam", null, relationalModel); + var parNazwaColumnBase5 = new ColumnBase("ParNazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase.Columns.Add("ParNazwa", parNazwaColumnBase5); + var parWartoscColumnBase4 = new ColumnBase("ParWartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase.Columns.Add("ParWartosc", parWartoscColumnBase4); + var sklepIdColumnBase41 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase.Columns.Add("SklepId", sklepIdColumnBase41); + var sklepPanelIdColumnBase0 = new ColumnBase("SklepPanelId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase.Columns.Add("SklepPanelId", sklepPanelIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPanelParam", blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPanelParamMappingBase = new TableMappingBase(sklepPanelParam, blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPanelParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPanelParamMappingBase, false); + defaultTableMappings196.Add(blinkBackofficeServicesPcmDbEntitiesSklepPanelParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase5, sklepPanelParam.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase41, sklepPanelParam.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepPanelIdColumnBase0, sklepPanelParam.FindProperty("SklepPanelId")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parWartoscColumnBase4, sklepPanelParam.FindProperty("ParWartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPanelParamMappingBase); + + var tableMappings196 = new List(); + sklepPanelParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings196); + var sklepPanelParamTable = new Table("SklepPanelParam", null, relationalModel); + var sklepIdColumn41 = new Column("SklepId", "numeric(9,0)", sklepPanelParamTable); + sklepPanelParamTable.Columns.Add("SklepId", sklepIdColumn41); + var sklepPanelIdColumn0 = new Column("SklepPanelId", "numeric(9,0)", sklepPanelParamTable); + sklepPanelParamTable.Columns.Add("SklepPanelId", sklepPanelIdColumn0); + var parNazwaColumn5 = new Column("ParNazwa", "varchar(40)", sklepPanelParamTable); + sklepPanelParamTable.Columns.Add("ParNazwa", parNazwaColumn5); + var parWartoscColumn4 = new Column("ParWartosc", "varchar(255)", sklepPanelParamTable); + sklepPanelParamTable.Columns.Add("ParWartosc", parWartoscColumn4); + var pK_SKLEP_PANEL_PARAM = new UniqueConstraint("PK_SKLEP_PANEL_PARAM", sklepPanelParamTable, new[] { sklepIdColumn41, sklepPanelIdColumn0, parNazwaColumn5 }); + sklepPanelParamTable.PrimaryKey = pK_SKLEP_PANEL_PARAM; + var pK_SKLEP_PANEL_PARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanelParam", + new[] { "SklepId", "SklepPanelId", "ParNazwa" }); + pK_SKLEP_PANEL_PARAM.MappedKeys.Add(pK_SKLEP_PANEL_PARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEP_PANEL_PARAMUc).Add(pK_SKLEP_PANEL_PARAM); + sklepPanelParamTable.UniqueConstraints.Add("PK_SKLEP_PANEL_PARAM", pK_SKLEP_PANEL_PARAM); + relationalModel.Tables.Add(("SklepPanelParam", null), sklepPanelParamTable); + var sklepPanelParamTableMapping = new TableMapping(sklepPanelParam, sklepPanelParamTable, true); + sklepPanelParamTable.AddTypeMapping(sklepPanelParamTableMapping, false); + tableMappings196.Add(sklepPanelParamTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn5, sklepPanelParam.FindProperty("ParNazwa")!, sklepPanelParamTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn41, sklepPanelParam.FindProperty("SklepId")!, sklepPanelParamTableMapping); + RelationalModel.CreateColumnMapping(sklepPanelIdColumn0, sklepPanelParam.FindProperty("SklepPanelId")!, sklepPanelParamTableMapping); + RelationalModel.CreateColumnMapping(parWartoscColumn4, sklepPanelParam.FindProperty("ParWartosc")!, sklepPanelParamTableMapping); + + var sklepParBon = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepParBon")!; + + var defaultTableMappings197 = new List>(); + sklepParBon.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings197); + var blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepParBon", null, relationalModel); + var kolejnoscColumnBase34 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase34); + var kwotaColumnBase8 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase.Columns.Add("Kwota", kwotaColumnBase8); + var numerColumnBase9 = new ColumnBase("Numer", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase.Columns.Add("Numer", numerColumnBase9); + var sklepIdColumnBase42 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase.Columns.Add("SklepId", sklepIdColumnBase42); + var sklepParIdColumnBase = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase.Columns.Add("SklepParId", sklepParIdColumnBase); + var typColumnBase29 = new ColumnBase("Typ", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase.Columns.Add("Typ", typColumnBase29); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepParBon", blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase = new TableMappingBase(sklepParBon, blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepParBonTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase, false); + defaultTableMappings197.Add(blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase34, sklepParBon.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase42, sklepParBon.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase, sklepParBon.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase8, sklepParBon.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase9, sklepParBon.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase29, sklepParBon.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepParBonMappingBase); + + var tableMappings197 = new List(); + sklepParBon.SetRuntimeAnnotation("Relational:TableMappings", tableMappings197); + var sklepParBonTable = new Table("SklepParBon", null, relationalModel); + var sklepIdColumn42 = new Column("SklepId", "numeric(9,0)", sklepParBonTable); + sklepParBonTable.Columns.Add("SklepId", sklepIdColumn42); + var sklepParIdColumn = new Column("SklepParId", "numeric(9,0)", sklepParBonTable); + sklepParBonTable.Columns.Add("SklepParId", sklepParIdColumn); + var kolejnoscColumn34 = new Column("Kolejnosc", "smallint", sklepParBonTable); + sklepParBonTable.Columns.Add("Kolejnosc", kolejnoscColumn34); + var kwotaColumn8 = new Column("Kwota", "decimal(15,4)", sklepParBonTable); + sklepParBonTable.Columns.Add("Kwota", kwotaColumn8); + var numerColumn9 = new Column("Numer", "varchar(20)", sklepParBonTable); + sklepParBonTable.Columns.Add("Numer", numerColumn9); + var typColumn29 = new Column("Typ", "varchar(10)", sklepParBonTable); + sklepParBonTable.Columns.Add("Typ", typColumn29); + var pK_SKLEPPARBON = new UniqueConstraint("PK_SKLEPPARBON", sklepParBonTable, new[] { sklepIdColumn42, sklepParIdColumn, kolejnoscColumn34 }); + sklepParBonTable.PrimaryKey = pK_SKLEPPARBON; + var pK_SKLEPPARBONUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParBon", + new[] { "SklepId", "SklepParId", "Kolejnosc" }); + pK_SKLEPPARBON.MappedKeys.Add(pK_SKLEPPARBONUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPARBONUc).Add(pK_SKLEPPARBON); + sklepParBonTable.UniqueConstraints.Add("PK_SKLEPPARBON", pK_SKLEPPARBON); + relationalModel.Tables.Add(("SklepParBon", null), sklepParBonTable); + var sklepParBonTableMapping = new TableMapping(sklepParBon, sklepParBonTable, true); + sklepParBonTable.AddTypeMapping(sklepParBonTableMapping, false); + tableMappings197.Add(sklepParBonTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn34, sklepParBon.FindProperty("Kolejnosc")!, sklepParBonTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn42, sklepParBon.FindProperty("SklepId")!, sklepParBonTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn, sklepParBon.FindProperty("SklepParId")!, sklepParBonTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn8, sklepParBon.FindProperty("Kwota")!, sklepParBonTableMapping); + RelationalModel.CreateColumnMapping(numerColumn9, sklepParBon.FindProperty("Numer")!, sklepParBonTableMapping); + RelationalModel.CreateColumnMapping(typColumn29, sklepParBon.FindProperty("Typ")!, sklepParBonTableMapping); + + var sklepParPunkty = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepParPunkty")!; + + var defaultTableMappings198 = new List>(); + sklepParPunkty.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings198); + var blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepParPunkty", null, relationalModel); + var gdzieColumnBase0 = new ColumnBase("Gdzie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase.Columns.Add("Gdzie", gdzieColumnBase0); + var kiedyColumnBase3 = new ColumnBase("Kiedy", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase.Columns.Add("Kiedy", kiedyColumnBase3); + var kwotaColumnBase9 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase.Columns.Add("Kwota", kwotaColumnBase9); + var sklepIdColumnBase43 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase.Columns.Add("SklepId", sklepIdColumnBase43); + var sklepParIdColumnBase0 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase.Columns.Add("SklepParId", sklepParIdColumnBase0); + var typColumnBase30 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase.Columns.Add("Typ", typColumnBase30); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepParPunkty", blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase = new TableMappingBase(sklepParPunkty, blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepParPunktyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase, false); + defaultTableMappings198.Add(blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)gdzieColumnBase0, sklepParPunkty.FindProperty("Gdzie")!, blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase43, sklepParPunkty.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase0, sklepParPunkty.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase30, sklepParPunkty.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase3, sklepParPunkty.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase9, sklepParPunkty.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesSklepParPunktyMappingBase); + + var tableMappings198 = new List(); + sklepParPunkty.SetRuntimeAnnotation("Relational:TableMappings", tableMappings198); + var sklepParPunktyTable = new Table("SklepParPunkty", null, relationalModel); + var sklepIdColumn43 = new Column("SklepId", "numeric(9,0)", sklepParPunktyTable); + sklepParPunktyTable.Columns.Add("SklepId", sklepIdColumn43); + var sklepParIdColumn0 = new Column("SklepParId", "numeric(9,0)", sklepParPunktyTable); + sklepParPunktyTable.Columns.Add("SklepParId", sklepParIdColumn0); + var typColumn30 = new Column("Typ", "smallint", sklepParPunktyTable); + sklepParPunktyTable.Columns.Add("Typ", typColumn30); + var gdzieColumn0 = new Column("Gdzie", "smallint", sklepParPunktyTable); + sklepParPunktyTable.Columns.Add("Gdzie", gdzieColumn0); + var kiedyColumn3 = new Column("Kiedy", "datetime", sklepParPunktyTable); + sklepParPunktyTable.Columns.Add("Kiedy", kiedyColumn3); + var kwotaColumn9 = new Column("Kwota", "decimal(15,4)", sklepParPunktyTable); + sklepParPunktyTable.Columns.Add("Kwota", kwotaColumn9); + var pK_SKLEPPARPUNKTY = new UniqueConstraint("PK_SKLEPPARPUNKTY", sklepParPunktyTable, new[] { sklepIdColumn43, sklepParIdColumn0, typColumn30, gdzieColumn0 }); + sklepParPunktyTable.PrimaryKey = pK_SKLEPPARPUNKTY; + var pK_SKLEPPARPUNKTYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParPunkty", + new[] { "SklepId", "SklepParId", "Typ", "Gdzie" }); + pK_SKLEPPARPUNKTY.MappedKeys.Add(pK_SKLEPPARPUNKTYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPARPUNKTYUc).Add(pK_SKLEPPARPUNKTY); + sklepParPunktyTable.UniqueConstraints.Add("PK_SKLEPPARPUNKTY", pK_SKLEPPARPUNKTY); + relationalModel.Tables.Add(("SklepParPunkty", null), sklepParPunktyTable); + var sklepParPunktyTableMapping = new TableMapping(sklepParPunkty, sklepParPunktyTable, true); + sklepParPunktyTable.AddTypeMapping(sklepParPunktyTableMapping, false); + tableMappings198.Add(sklepParPunktyTableMapping); + RelationalModel.CreateColumnMapping(gdzieColumn0, sklepParPunkty.FindProperty("Gdzie")!, sklepParPunktyTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn43, sklepParPunkty.FindProperty("SklepId")!, sklepParPunktyTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn0, sklepParPunkty.FindProperty("SklepParId")!, sklepParPunktyTableMapping); + RelationalModel.CreateColumnMapping(typColumn30, sklepParPunkty.FindProperty("Typ")!, sklepParPunktyTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn3, sklepParPunkty.FindProperty("Kiedy")!, sklepParPunktyTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn9, sklepParPunkty.FindProperty("Kwota")!, sklepParPunktyTableMapping); + + var sklepParWaluta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta")!; + + var defaultTableMappings199 = new List>(); + sklepParWaluta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings199); + var blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta", null, relationalModel); + var kursColumnBase8 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase.Columns.Add("Kurs", kursColumnBase8); + var parKwotaColumnBase0 = new ColumnBase("ParKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase.Columns.Add("ParKwota", parKwotaColumnBase0); + var sklepIdColumnBase44 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase.Columns.Add("SklepId", sklepIdColumnBase44); + var sklepParIdColumnBase1 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase.Columns.Add("SklepParId", sklepParIdColumnBase1); + var sklepWalIdColumnBase4 = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase4); + var walKwotaColumnBase2 = new ColumnBase("WalKwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase.Columns.Add("WalKwota", walKwotaColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta", blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase = new TableMappingBase(sklepParWaluta, blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepParWalutaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase, false); + defaultTableMappings199.Add(blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase44, sklepParWaluta.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase1, sklepParWaluta.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase4, sklepParWaluta.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase8, sklepParWaluta.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parKwotaColumnBase0, sklepParWaluta.FindProperty("ParKwota")!, blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walKwotaColumnBase2, sklepParWaluta.FindProperty("WalKwota")!, blinkBackofficeServicesPcmDbEntitiesSklepParWalutaMappingBase); + + var tableMappings199 = new List(); + sklepParWaluta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings199); + var sklepParWalutaTable = new Table("SklepParWaluta", null, relationalModel); + var sklepIdColumn44 = new Column("SklepId", "numeric(9,0)", sklepParWalutaTable); + sklepParWalutaTable.Columns.Add("SklepId", sklepIdColumn44); + var sklepParIdColumn1 = new Column("SklepParId", "numeric(9,0)", sklepParWalutaTable); + sklepParWalutaTable.Columns.Add("SklepParId", sklepParIdColumn1); + var sklepWalIdColumn4 = new Column("SklepWalId", "numeric(9,0)", sklepParWalutaTable); + sklepParWalutaTable.Columns.Add("SklepWalId", sklepWalIdColumn4); + var kursColumn8 = new Column("Kurs", "decimal(15,4)", sklepParWalutaTable); + sklepParWalutaTable.Columns.Add("Kurs", kursColumn8); + var parKwotaColumn0 = new Column("ParKwota", "decimal(15,4)", sklepParWalutaTable); + sklepParWalutaTable.Columns.Add("ParKwota", parKwotaColumn0); + var walKwotaColumn2 = new Column("WalKwota", "decimal(15,4)", sklepParWalutaTable); + sklepParWalutaTable.Columns.Add("WalKwota", walKwotaColumn2); + var pK_SKLEPPARWALUTA = new UniqueConstraint("PK_SKLEPPARWALUTA", sklepParWalutaTable, new[] { sklepIdColumn44, sklepParIdColumn1, sklepWalIdColumn4 }); + sklepParWalutaTable.PrimaryKey = pK_SKLEPPARWALUTA; + var pK_SKLEPPARWALUTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta", + new[] { "SklepId", "SklepParId", "SklepWalId" }); + pK_SKLEPPARWALUTA.MappedKeys.Add(pK_SKLEPPARWALUTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPARWALUTAUc).Add(pK_SKLEPPARWALUTA); + sklepParWalutaTable.UniqueConstraints.Add("PK_SKLEPPARWALUTA", pK_SKLEPPARWALUTA); + var idx_SkWalPar = new TableIndex( + "idx_SkWalPar", sklepParWalutaTable, new[] { sklepIdColumn44, sklepWalIdColumn4 }, false); + var idx_SkWalParIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta", + "idx_SkWalPar"); + idx_SkWalPar.MappedIndexes.Add(idx_SkWalParIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkWalParIx).Add(idx_SkWalPar); + sklepParWalutaTable.Indexes.Add("idx_SkWalPar", idx_SkWalPar); + relationalModel.Tables.Add(("SklepParWaluta", null), sklepParWalutaTable); + var sklepParWalutaTableMapping = new TableMapping(sklepParWaluta, sklepParWalutaTable, true); + sklepParWalutaTable.AddTypeMapping(sklepParWalutaTableMapping, false); + tableMappings199.Add(sklepParWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn44, sklepParWaluta.FindProperty("SklepId")!, sklepParWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn1, sklepParWaluta.FindProperty("SklepParId")!, sklepParWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn4, sklepParWaluta.FindProperty("SklepWalId")!, sklepParWalutaTableMapping); + RelationalModel.CreateColumnMapping(kursColumn8, sklepParWaluta.FindProperty("Kurs")!, sklepParWalutaTableMapping); + RelationalModel.CreateColumnMapping(parKwotaColumn0, sklepParWaluta.FindProperty("ParKwota")!, sklepParWalutaTableMapping); + RelationalModel.CreateColumnMapping(walKwotaColumn2, sklepParWaluta.FindProperty("WalKwota")!, sklepParWalutaTableMapping); + + var sklepParagon = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepParagon")!; + + var defaultTableMappings200 = new List>(); + sklepParagon.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings200); + var blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", null, relationalModel); + var aktywnyColumnBase38 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Aktywny", aktywnyColumnBase38); + var bonyColumnBase0 = new ColumnBase("Bony", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Bony", bonyColumnBase0); + var bruttoColumnBase0 = new ColumnBase("Brutto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Brutto", bruttoColumnBase0); + var cechyParColumnBase0 = new ColumnBase("CechyPar", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("CechyPar", cechyParColumnBase0); + var centrEksportFKColumnBase0 = new ColumnBase("CentrEksportFK", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("CentrEksportFK", centrEksportFKColumnBase0); + var czekColumnBase0 = new ColumnBase("Czek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Czek", czekColumnBase0); + var dataCzasColumnBase1 = new ColumnBase("DataCzas", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("DataCzas", dataCzasColumnBase1); + var dodFPlatColumnBase0 = new ColumnBase("DodFPlat", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("DodFPlat", dodFPlatColumnBase0); + var eksportFKColumnBase2 = new ColumnBase("EksportFK", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("EksportFK", eksportFKColumnBase2); + var gotowkaColumnBase0 = new ColumnBase("Gotowka", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Gotowka", gotowkaColumnBase0); + var grupyGTUColumnBase0 = new ColumnBase("GrupyGTU", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("GrupyGTU", grupyGTUColumnBase0); + var iloscPozColumnBase0 = new ColumnBase("IloscPoz", "int", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("IloscPoz", iloscPozColumnBase0); + var inneFPlatColumnBase0 = new ColumnBase("InneFPlat", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("InneFPlat", inneFPlatColumnBase0); + var kartaColumnBase0 = new ColumnBase("Karta", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Karta", kartaColumnBase0); + var kasjerColumnBase0 = new ColumnBase("Kasjer", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Kasjer", kasjerColumnBase0); + var kodKartyColumnBase4 = new ColumnBase("KodKarty", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("KodKarty", kodKartyColumnBase4); + var kursColumnBase9 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Kurs", kursColumnBase9); + var nIPColumnBase2 = new ColumnBase("NIP", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("NIP", nIPColumnBase2); + var opakWydColumnBase0 = new ColumnBase("OpakWyd", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("OpakWyd", opakWydColumnBase0); + var opakZwrColumnBase0 = new ColumnBase("OpakZwr", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("OpakZwr", opakZwrColumnBase0); + var podmiotPowiazanyColumnBase0 = new ColumnBase("PodmiotPowiazany", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("PodmiotPowiazany", podmiotPowiazanyColumnBase0); + var przelewColumnBase0 = new ColumnBase("Przelew", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Przelew", przelewColumnBase0); + var rabatColumnBase0 = new ColumnBase("Rabat", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Rabat", rabatColumnBase0); + var sklepIdColumnBase45 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("SklepId", sklepIdColumnBase45); + var sklepKasaIdColumnBase2 = new ColumnBase("SklepKasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("SklepKasaId", sklepKasaIdColumnBase2); + var sklepParIdColumnBase2 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("SklepParId", sklepParIdColumnBase2); + var sklepWalIdColumnBase5 = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase5); + var typParColumnBase1 = new ColumnBase("TypPar", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("TypPar", typParColumnBase1); + var walutyColumnBase0 = new ColumnBase("Waluty", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Waluty", walutyColumnBase0); + var zmianaColumnBase46 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.Columns.Add("Zmiana", zmianaColumnBase46); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase = new TableMappingBase(sklepParagon, blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepParagonTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase, false); + defaultTableMappings200.Add(blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase45, sklepParagon.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase2, sklepParagon.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase38, sklepParagon.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bonyColumnBase0, sklepParagon.FindProperty("Bony")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bruttoColumnBase0, sklepParagon.FindProperty("Brutto")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cechyParColumnBase0, sklepParagon.FindProperty("CechyPar")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrEksportFKColumnBase0, sklepParagon.FindProperty("CentrEksportFK")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czekColumnBase0, sklepParagon.FindProperty("Czek")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasColumnBase1, sklepParagon.FindProperty("DataCzas")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodFPlatColumnBase0, sklepParagon.FindProperty("DodFPlat")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)eksportFKColumnBase2, sklepParagon.FindProperty("EksportFK")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)gotowkaColumnBase0, sklepParagon.FindProperty("Gotowka")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupyGTUColumnBase0, sklepParagon.FindProperty("GrupyGTU")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscPozColumnBase0, sklepParagon.FindProperty("IloscPoz")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)inneFPlatColumnBase0, sklepParagon.FindProperty("InneFPlat")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kartaColumnBase0, sklepParagon.FindProperty("Karta")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasjerColumnBase0, sklepParagon.FindProperty("Kasjer")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKartyColumnBase4, sklepParagon.FindProperty("KodKarty")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase9, sklepParagon.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nIPColumnBase2, sklepParagon.FindProperty("NIP")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opakWydColumnBase0, sklepParagon.FindProperty("OpakWyd")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opakZwrColumnBase0, sklepParagon.FindProperty("OpakZwr")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podmiotPowiazanyColumnBase0, sklepParagon.FindProperty("PodmiotPowiazany")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przelewColumnBase0, sklepParagon.FindProperty("Przelew")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatColumnBase0, sklepParagon.FindProperty("Rabat")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKasaIdColumnBase2, sklepParagon.FindProperty("SklepKasaId")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase5, sklepParagon.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typParColumnBase1, sklepParagon.FindProperty("TypPar")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walutyColumnBase0, sklepParagon.FindProperty("Waluty")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase46, sklepParagon.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepParagonMappingBase); + + var tableMappings200 = new List(); + sklepParagon.SetRuntimeAnnotation("Relational:TableMappings", tableMappings200); + var sklepParagonTable = new Table("SklepParagon", null, relationalModel); + var sklepIdColumn45 = new Column("SklepId", "numeric(9,0)", sklepParagonTable); + sklepParagonTable.Columns.Add("SklepId", sklepIdColumn45); + var sklepParIdColumn2 = new Column("SklepParId", "numeric(9,0)", sklepParagonTable); + sklepParagonTable.Columns.Add("SklepParId", sklepParIdColumn2); + var aktywnyColumn38 = new Column("Aktywny", "smallint", sklepParagonTable); + sklepParagonTable.Columns.Add("Aktywny", aktywnyColumn38); + var bonyColumn0 = new Column("Bony", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("Bony", bonyColumn0); + var bruttoColumn0 = new Column("Brutto", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("Brutto", bruttoColumn0); + var cechyParColumn0 = new Column("CechyPar", "varchar(40)", sklepParagonTable); + sklepParagonTable.Columns.Add("CechyPar", cechyParColumn0); + var centrEksportFKColumn0 = new Column("CentrEksportFK", "smallint", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("CentrEksportFK", centrEksportFKColumn0); + var czekColumn0 = new Column("Czek", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("Czek", czekColumn0); + var dataCzasColumn1 = new Column("DataCzas", "datetime", sklepParagonTable); + sklepParagonTable.Columns.Add("DataCzas", dataCzasColumn1); + var dodFPlatColumn0 = new Column("DodFPlat", "decimal(15,4)", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("DodFPlat", dodFPlatColumn0); + var eksportFKColumn2 = new Column("EksportFK", "smallint", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("EksportFK", eksportFKColumn2); + var gotowkaColumn0 = new Column("Gotowka", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("Gotowka", gotowkaColumn0); + var grupyGTUColumn0 = new Column("GrupyGTU", "varchar(255)", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("GrupyGTU", grupyGTUColumn0); + var iloscPozColumn0 = new Column("IloscPoz", "int", sklepParagonTable); + sklepParagonTable.Columns.Add("IloscPoz", iloscPozColumn0); + var inneFPlatColumn0 = new Column("InneFPlat", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("InneFPlat", inneFPlatColumn0); + var kartaColumn0 = new Column("Karta", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("Karta", kartaColumn0); + var kasjerColumn0 = new Column("Kasjer", "varchar(40)", sklepParagonTable); + sklepParagonTable.Columns.Add("Kasjer", kasjerColumn0); + var kodKartyColumn4 = new Column("KodKarty", "varchar(20)", sklepParagonTable); + sklepParagonTable.Columns.Add("KodKarty", kodKartyColumn4); + var kursColumn9 = new Column("Kurs", "decimal(15,4)", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("Kurs", kursColumn9); + var nIPColumn2 = new Column("NIP", "varchar(40)", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("NIP", nIPColumn2); + var opakWydColumn0 = new Column("OpakWyd", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("OpakWyd", opakWydColumn0); + var opakZwrColumn0 = new Column("OpakZwr", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("OpakZwr", opakZwrColumn0); + var podmiotPowiazanyColumn0 = new Column("PodmiotPowiazany", "smallint", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("PodmiotPowiazany", podmiotPowiazanyColumn0); + var przelewColumn0 = new Column("Przelew", "decimal(15,4)", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("Przelew", przelewColumn0); + var rabatColumn0 = new Column("Rabat", "decimal(15,4)", sklepParagonTable); + sklepParagonTable.Columns.Add("Rabat", rabatColumn0); + var sklepKasaIdColumn2 = new Column("SklepKasaId", "numeric(9,0)", sklepParagonTable); + sklepParagonTable.Columns.Add("SklepKasaId", sklepKasaIdColumn2); + var sklepWalIdColumn5 = new Column("SklepWalId", "numeric(9,0)", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("SklepWalId", sklepWalIdColumn5); + var typParColumn1 = new Column("TypPar", "smallint", sklepParagonTable); + sklepParagonTable.Columns.Add("TypPar", typParColumn1); + var walutyColumn0 = new Column("Waluty", "decimal(15,4)", sklepParagonTable) + { + IsNullable = true + }; + sklepParagonTable.Columns.Add("Waluty", walutyColumn0); + var zmianaColumn46 = new Column("Zmiana", "datetime", sklepParagonTable); + sklepParagonTable.Columns.Add("Zmiana", zmianaColumn46); + var pK_SKLEPPARAGON = new UniqueConstraint("PK_SKLEPPARAGON", sklepParagonTable, new[] { sklepIdColumn45, sklepParIdColumn2 }); + sklepParagonTable.PrimaryKey = pK_SKLEPPARAGON; + var pK_SKLEPPARAGONUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepParId" }); + pK_SKLEPPARAGON.MappedKeys.Add(pK_SKLEPPARAGONUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPARAGONUc).Add(pK_SKLEPPARAGON); + sklepParagonTable.UniqueConstraints.Add("PK_SKLEPPARAGON", pK_SKLEPPARAGON); + var idx_SklepParDataCzas = new TableIndex( + "idx_SklepParDataCzas", sklepParagonTable, new[] { sklepIdColumn45, dataCzasColumn1 }, false); + var idx_SklepParDataCzasIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + "idx_SklepParDataCzas"); + idx_SklepParDataCzas.MappedIndexes.Add(idx_SklepParDataCzasIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepParDataCzasIx).Add(idx_SklepParDataCzas); + sklepParagonTable.Indexes.Add("idx_SklepParDataCzas", idx_SklepParDataCzas); + var idx_SkParKasa = new TableIndex( + "idx_SkParKasa", sklepParagonTable, new[] { sklepIdColumn45, sklepKasaIdColumn2 }, false); + var idx_SkParKasaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + "idx_SkParKasa"); + idx_SkParKasa.MappedIndexes.Add(idx_SkParKasaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkParKasaIx).Add(idx_SkParKasa); + sklepParagonTable.Indexes.Add("idx_SkParKasa", idx_SkParKasa); + var idx_SkParKasjer = new TableIndex( + "idx_SkParKasjer", sklepParagonTable, new[] { sklepIdColumn45, kasjerColumn0 }, false); + var idx_SkParKasjerIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + "idx_SkParKasjer"); + idx_SkParKasjer.MappedIndexes.Add(idx_SkParKasjerIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkParKasjerIx).Add(idx_SkParKasjer); + sklepParagonTable.Indexes.Add("idx_SkParKasjer", idx_SkParKasjer); + var idx_SkParWal = new TableIndex( + "idx_SkParWal", sklepParagonTable, new[] { sklepIdColumn45, sklepWalIdColumn5 }, false); + var idx_SkParWalIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + "idx_SkParWal"); + idx_SkParWal.MappedIndexes.Add(idx_SkParWalIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkParWalIx).Add(idx_SkParWal); + sklepParagonTable.Indexes.Add("idx_SkParWal", idx_SkParWal); + var idx_SkParZmiana = new TableIndex( + "idx_SkParZmiana", sklepParagonTable, new[] { zmianaColumn46 }, false); + var idx_SkParZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + "idx_SkParZmiana"); + idx_SkParZmiana.MappedIndexes.Add(idx_SkParZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkParZmianaIx).Add(idx_SkParZmiana); + sklepParagonTable.Indexes.Add("idx_SkParZmiana", idx_SkParZmiana); + relationalModel.Tables.Add(("SklepParagon", null), sklepParagonTable); + var sklepParagonTableMapping = new TableMapping(sklepParagon, sklepParagonTable, true); + sklepParagonTable.AddTypeMapping(sklepParagonTableMapping, false); + tableMappings200.Add(sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn45, sklepParagon.FindProperty("SklepId")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn2, sklepParagon.FindProperty("SklepParId")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn38, sklepParagon.FindProperty("Aktywny")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(bonyColumn0, sklepParagon.FindProperty("Bony")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(bruttoColumn0, sklepParagon.FindProperty("Brutto")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(cechyParColumn0, sklepParagon.FindProperty("CechyPar")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(centrEksportFKColumn0, sklepParagon.FindProperty("CentrEksportFK")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(czekColumn0, sklepParagon.FindProperty("Czek")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(dataCzasColumn1, sklepParagon.FindProperty("DataCzas")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(dodFPlatColumn0, sklepParagon.FindProperty("DodFPlat")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(eksportFKColumn2, sklepParagon.FindProperty("EksportFK")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(gotowkaColumn0, sklepParagon.FindProperty("Gotowka")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(grupyGTUColumn0, sklepParagon.FindProperty("GrupyGTU")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(iloscPozColumn0, sklepParagon.FindProperty("IloscPoz")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(inneFPlatColumn0, sklepParagon.FindProperty("InneFPlat")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(kartaColumn0, sklepParagon.FindProperty("Karta")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(kasjerColumn0, sklepParagon.FindProperty("Kasjer")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(kodKartyColumn4, sklepParagon.FindProperty("KodKarty")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(kursColumn9, sklepParagon.FindProperty("Kurs")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(nIPColumn2, sklepParagon.FindProperty("NIP")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(opakWydColumn0, sklepParagon.FindProperty("OpakWyd")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(opakZwrColumn0, sklepParagon.FindProperty("OpakZwr")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(podmiotPowiazanyColumn0, sklepParagon.FindProperty("PodmiotPowiazany")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(przelewColumn0, sklepParagon.FindProperty("Przelew")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(rabatColumn0, sklepParagon.FindProperty("Rabat")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(sklepKasaIdColumn2, sklepParagon.FindProperty("SklepKasaId")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn5, sklepParagon.FindProperty("SklepWalId")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(typParColumn1, sklepParagon.FindProperty("TypPar")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(walutyColumn0, sklepParagon.FindProperty("Waluty")!, sklepParagonTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn46, sklepParagon.FindProperty("Zmiana")!, sklepParagonTableMapping); + + var sklepPartia = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPartia")!; + + var defaultTableMappings201 = new List>(); + sklepPartia.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings201); + var blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", null, relationalModel); + var cecha1ColumnBase0 = new ColumnBase("Cecha1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("Cecha1", cecha1ColumnBase0); + var cecha2ColumnBase0 = new ColumnBase("Cecha2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("Cecha2", cecha2ColumnBase0); + var dataWaznColumnBase1 = new ColumnBase("DataWazn", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("DataWazn", dataWaznColumnBase1); + var kolejnoscColumnBase35 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase35); + var pozostaloColumnBase1 = new ColumnBase("Pozostalo", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("Pozostalo", pozostaloColumnBase1); + var sklepDokIdColumnBase4 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase4); + var sklepIdColumnBase46 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("SklepId", sklepIdColumnBase46); + var sklepTowIdColumnBase2 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase2); + var typPartiiColumnBase0 = new ColumnBase("TypPartii", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.Columns.Add("TypPartii", typPartiiColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase = new TableMappingBase(sklepPartia, blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPartiaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase, false); + defaultTableMappings201.Add(blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase35, sklepPartia.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase4, sklepPartia.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase46, sklepPartia.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cecha1ColumnBase0, sklepPartia.FindProperty("Cecha1")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cecha2ColumnBase0, sklepPartia.FindProperty("Cecha2")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataWaznColumnBase1, sklepPartia.FindProperty("DataWazn")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pozostaloColumnBase1, sklepPartia.FindProperty("Pozostalo")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase2, sklepPartia.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typPartiiColumnBase0, sklepPartia.FindProperty("TypPartii")!, blinkBackofficeServicesPcmDbEntitiesSklepPartiaMappingBase); + + var tableMappings201 = new List(); + sklepPartia.SetRuntimeAnnotation("Relational:TableMappings", tableMappings201); + var sklepPartiaTable = new Table("SklepPartia", null, relationalModel); + var sklepIdColumn46 = new Column("SklepId", "numeric(9,0)", sklepPartiaTable); + sklepPartiaTable.Columns.Add("SklepId", sklepIdColumn46); + var sklepDokIdColumn4 = new Column("SklepDokId", "numeric(9,0)", sklepPartiaTable); + sklepPartiaTable.Columns.Add("SklepDokId", sklepDokIdColumn4); + var kolejnoscColumn35 = new Column("Kolejnosc", "int", sklepPartiaTable); + sklepPartiaTable.Columns.Add("Kolejnosc", kolejnoscColumn35); + var cecha1Column0 = new Column("Cecha1", "varchar(40)", sklepPartiaTable) + { + IsNullable = true + }; + sklepPartiaTable.Columns.Add("Cecha1", cecha1Column0); + var cecha2Column0 = new Column("Cecha2", "varchar(40)", sklepPartiaTable) + { + IsNullable = true + }; + sklepPartiaTable.Columns.Add("Cecha2", cecha2Column0); + var dataWaznColumn1 = new Column("DataWazn", "datetime", sklepPartiaTable) + { + IsNullable = true + }; + sklepPartiaTable.Columns.Add("DataWazn", dataWaznColumn1); + var pozostaloColumn1 = new Column("Pozostalo", "decimal(15,4)", sklepPartiaTable); + sklepPartiaTable.Columns.Add("Pozostalo", pozostaloColumn1); + var sklepTowIdColumn2 = new Column("SklepTowId", "numeric(9,0)", sklepPartiaTable); + sklepPartiaTable.Columns.Add("SklepTowId", sklepTowIdColumn2); + var typPartiiColumn0 = new Column("TypPartii", "smallint", sklepPartiaTable); + sklepPartiaTable.Columns.Add("TypPartii", typPartiiColumn0); + var pK_SKLEPPARTIA = new UniqueConstraint("PK_SKLEPPARTIA", sklepPartiaTable, new[] { sklepIdColumn46, sklepDokIdColumn4, kolejnoscColumn35 }); + sklepPartiaTable.PrimaryKey = pK_SKLEPPARTIA; + var pK_SKLEPPARTIAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + pK_SKLEPPARTIA.MappedKeys.Add(pK_SKLEPPARTIAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPARTIAUc).Add(pK_SKLEPPARTIA); + sklepPartiaTable.UniqueConstraints.Add("PK_SKLEPPARTIA", pK_SKLEPPARTIA); + var idx_SkPrtTypTowIle = new TableIndex( + "idx_SkPrtTypTowIle", sklepPartiaTable, new[] { typPartiiColumn0, sklepIdColumn46, sklepTowIdColumn2, pozostaloColumn1 }, false); + var idx_SkPrtTypTowIleIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", + "idx_SkPrtTypTowIle"); + idx_SkPrtTypTowIle.MappedIndexes.Add(idx_SkPrtTypTowIleIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkPrtTypTowIleIx).Add(idx_SkPrtTypTowIle); + sklepPartiaTable.Indexes.Add("idx_SkPrtTypTowIle", idx_SkPrtTypTowIle); + var iX_SklepPartia_SklepId_SklepTowId = new TableIndex( + "IX_SklepPartia_SklepId_SklepTowId", sklepPartiaTable, new[] { sklepIdColumn46, sklepTowIdColumn2 }, false); + var iX_SklepPartia_SklepId_SklepTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", + new[] { "SklepId", "SklepTowId" }); + iX_SklepPartia_SklepId_SklepTowId.MappedIndexes.Add(iX_SklepPartia_SklepId_SklepTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepPartia_SklepId_SklepTowIdIx).Add(iX_SklepPartia_SklepId_SklepTowId); + sklepPartiaTable.Indexes.Add("IX_SklepPartia_SklepId_SklepTowId", iX_SklepPartia_SklepId_SklepTowId); + relationalModel.Tables.Add(("SklepPartia", null), sklepPartiaTable); + var sklepPartiaTableMapping = new TableMapping(sklepPartia, sklepPartiaTable, true); + sklepPartiaTable.AddTypeMapping(sklepPartiaTableMapping, false); + tableMappings201.Add(sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn35, sklepPartia.FindProperty("Kolejnosc")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn4, sklepPartia.FindProperty("SklepDokId")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn46, sklepPartia.FindProperty("SklepId")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(cecha1Column0, sklepPartia.FindProperty("Cecha1")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(cecha2Column0, sklepPartia.FindProperty("Cecha2")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(dataWaznColumn1, sklepPartia.FindProperty("DataWazn")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(pozostaloColumn1, sklepPartia.FindProperty("Pozostalo")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn2, sklepPartia.FindProperty("SklepTowId")!, sklepPartiaTableMapping); + RelationalModel.CreateColumnMapping(typPartiiColumn0, sklepPartia.FindProperty("TypPartii")!, sklepPartiaTableMapping); + + var sklepPowKontLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj")!; + + var defaultTableMappings202 = new List>(); + sklepPowKontLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings202); + var blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", null, relationalModel); + var rodzajPowColumnBase2 = new ColumnBase("RodzajPow", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase.Columns.Add("RodzajPow", rodzajPowColumnBase2); + var sklepIdColumnBase47 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase.Columns.Add("SklepId", sklepIdColumnBase47); + var sklepNoweKontoIdColumnBase = new ColumnBase("SklepNoweKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase.Columns.Add("SklepNoweKontoId", sklepNoweKontoIdColumnBase); + var sklepStareKontoIdColumnBase = new ColumnBase("SklepStareKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase.Columns.Add("SklepStareKontoId", sklepStareKontoIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojMappingBase = new TableMappingBase(sklepPowKontLoj, blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojMappingBase, false); + defaultTableMappings202.Add(blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajPowColumnBase2, sklepPowKontLoj.FindProperty("RodzajPow")!, blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase47, sklepPowKontLoj.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepNoweKontoIdColumnBase, sklepPowKontLoj.FindProperty("SklepNoweKontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepStareKontoIdColumnBase, sklepPowKontLoj.FindProperty("SklepStareKontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowKontLojMappingBase); + + var tableMappings202 = new List(); + sklepPowKontLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings202); + var sklepPowKontLojTable = new Table("SklepPowKontLoj", null, relationalModel); + var sklepIdColumn47 = new Column("SklepId", "numeric(9,0)", sklepPowKontLojTable); + sklepPowKontLojTable.Columns.Add("SklepId", sklepIdColumn47); + var sklepNoweKontoIdColumn = new Column("SklepNoweKontoId", "numeric(9,0)", sklepPowKontLojTable); + sklepPowKontLojTable.Columns.Add("SklepNoweKontoId", sklepNoweKontoIdColumn); + var rodzajPowColumn2 = new Column("RodzajPow", "smallint", sklepPowKontLojTable); + sklepPowKontLojTable.Columns.Add("RodzajPow", rodzajPowColumn2); + var sklepStareKontoIdColumn = new Column("SklepStareKontoId", "numeric(9,0)", sklepPowKontLojTable); + sklepPowKontLojTable.Columns.Add("SklepStareKontoId", sklepStareKontoIdColumn); + var pK_SKLEPPOWKONTLOJ = new UniqueConstraint("PK_SKLEPPOWKONTLOJ", sklepPowKontLojTable, new[] { sklepIdColumn47, sklepNoweKontoIdColumn, rodzajPowColumn2 }); + sklepPowKontLojTable.PrimaryKey = pK_SKLEPPOWKONTLOJ; + var pK_SKLEPPOWKONTLOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", + new[] { "SklepId", "SklepNoweKontoId", "RodzajPow" }); + pK_SKLEPPOWKONTLOJ.MappedKeys.Add(pK_SKLEPPOWKONTLOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPOWKONTLOJUc).Add(pK_SKLEPPOWKONTLOJ); + sklepPowKontLojTable.UniqueConstraints.Add("PK_SKLEPPOWKONTLOJ", pK_SKLEPPOWKONTLOJ); + var idx_PowStareSKLoj = new TableIndex( + "idx_PowStareSKLoj", sklepPowKontLojTable, new[] { sklepStareKontoIdColumn }, false); + var idx_PowStareSKLojIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", + "idx_PowStareSKLoj"); + idx_PowStareSKLoj.MappedIndexes.Add(idx_PowStareSKLojIx); + RelationalModel.GetOrCreateTableIndexes(idx_PowStareSKLojIx).Add(idx_PowStareSKLoj); + sklepPowKontLojTable.Indexes.Add("idx_PowStareSKLoj", idx_PowStareSKLoj); + var iX_SklepPowKontLoj_SklepId_SklepStareKontoId = new TableIndex( + "IX_SklepPowKontLoj_SklepId_SklepStareKontoId", sklepPowKontLojTable, new[] { sklepIdColumn47, sklepStareKontoIdColumn }, false); + var iX_SklepPowKontLoj_SklepId_SklepStareKontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", + new[] { "SklepId", "SklepStareKontoId" }); + iX_SklepPowKontLoj_SklepId_SklepStareKontoId.MappedIndexes.Add(iX_SklepPowKontLoj_SklepId_SklepStareKontoIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepPowKontLoj_SklepId_SklepStareKontoIdIx).Add(iX_SklepPowKontLoj_SklepId_SklepStareKontoId); + sklepPowKontLojTable.Indexes.Add("IX_SklepPowKontLoj_SklepId_SklepStareKontoId", iX_SklepPowKontLoj_SklepId_SklepStareKontoId); + relationalModel.Tables.Add(("SklepPowKontLoj", null), sklepPowKontLojTable); + var sklepPowKontLojTableMapping = new TableMapping(sklepPowKontLoj, sklepPowKontLojTable, true); + sklepPowKontLojTable.AddTypeMapping(sklepPowKontLojTableMapping, false); + tableMappings202.Add(sklepPowKontLojTableMapping); + RelationalModel.CreateColumnMapping(rodzajPowColumn2, sklepPowKontLoj.FindProperty("RodzajPow")!, sklepPowKontLojTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn47, sklepPowKontLoj.FindProperty("SklepId")!, sklepPowKontLojTableMapping); + RelationalModel.CreateColumnMapping(sklepNoweKontoIdColumn, sklepPowKontLoj.FindProperty("SklepNoweKontoId")!, sklepPowKontLojTableMapping); + RelationalModel.CreateColumnMapping(sklepStareKontoIdColumn, sklepPowKontLoj.FindProperty("SklepStareKontoId")!, sklepPowKontLojTableMapping); + + var sklepPowiazanieProm = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieProm")!; + + var defaultTableMappings203 = new List>(); + sklepPowiazanieProm.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings203); + var blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieProm", null, relationalModel); + var rodzajColumnBase9 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase.Columns.Add("Rodzaj", rodzajColumnBase9); + var sklepGrupaIdColumnBase0 = new ColumnBase("SklepGrupaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase.Columns.Add("SklepGrupaId", sklepGrupaIdColumnBase0); + var sklepIdColumnBase48 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase.Columns.Add("SklepId", sklepIdColumnBase48); + var sklepPromIdColumnBase = new ColumnBase("SklepPromId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase.Columns.Add("SklepPromId", sklepPromIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieProm", blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromMappingBase = new TableMappingBase(sklepPowiazanieProm, blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromMappingBase, false); + defaultTableMappings203.Add(blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase9, sklepPowiazanieProm.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepGrupaIdColumnBase0, sklepPowiazanieProm.FindProperty("SklepGrupaId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase48, sklepPowiazanieProm.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepPromIdColumnBase, sklepPowiazanieProm.FindProperty("SklepPromId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazaniePromMappingBase); + + var tableMappings203 = new List(); + sklepPowiazanieProm.SetRuntimeAnnotation("Relational:TableMappings", tableMappings203); + var sklepPowiazaniePromTable = new Table("SklepPowiazanieProm", null, relationalModel); + var sklepIdColumn48 = new Column("SklepId", "numeric(9,0)", sklepPowiazaniePromTable); + sklepPowiazaniePromTable.Columns.Add("SklepId", sklepIdColumn48); + var sklepPromIdColumn = new Column("SklepPromId", "numeric(9,0)", sklepPowiazaniePromTable); + sklepPowiazaniePromTable.Columns.Add("SklepPromId", sklepPromIdColumn); + var sklepGrupaIdColumn0 = new Column("SklepGrupaId", "numeric(9,0)", sklepPowiazaniePromTable); + sklepPowiazaniePromTable.Columns.Add("SklepGrupaId", sklepGrupaIdColumn0); + var rodzajColumn9 = new Column("Rodzaj", "smallint", sklepPowiazaniePromTable); + sklepPowiazaniePromTable.Columns.Add("Rodzaj", rodzajColumn9); + var pK_SklPowiazanieProm = new UniqueConstraint("PK_SklPowiazanieProm", sklepPowiazaniePromTable, new[] { sklepIdColumn48, sklepPromIdColumn, sklepGrupaIdColumn0, rodzajColumn9 }); + sklepPowiazaniePromTable.PrimaryKey = pK_SklPowiazanieProm; + var pK_SklPowiazaniePromUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieProm", + new[] { "SklepId", "SklepPromId", "SklepGrupaId", "Rodzaj" }); + pK_SklPowiazanieProm.MappedKeys.Add(pK_SklPowiazaniePromUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklPowiazaniePromUc).Add(pK_SklPowiazanieProm); + sklepPowiazaniePromTable.UniqueConstraints.Add("PK_SklPowiazanieProm", pK_SklPowiazanieProm); + var iX_SklepPowiazanieProm_SklepId_SklepGrupaId = new TableIndex( + "IX_SklepPowiazanieProm_SklepId_SklepGrupaId", sklepPowiazaniePromTable, new[] { sklepIdColumn48, sklepGrupaIdColumn0 }, false); + var iX_SklepPowiazanieProm_SklepId_SklepGrupaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieProm", + new[] { "SklepId", "SklepGrupaId" }); + iX_SklepPowiazanieProm_SklepId_SklepGrupaId.MappedIndexes.Add(iX_SklepPowiazanieProm_SklepId_SklepGrupaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepPowiazanieProm_SklepId_SklepGrupaIdIx).Add(iX_SklepPowiazanieProm_SklepId_SklepGrupaId); + sklepPowiazaniePromTable.Indexes.Add("IX_SklepPowiazanieProm_SklepId_SklepGrupaId", iX_SklepPowiazanieProm_SklepId_SklepGrupaId); + relationalModel.Tables.Add(("SklepPowiazanieProm", null), sklepPowiazaniePromTable); + var sklepPowiazaniePromTableMapping = new TableMapping(sklepPowiazanieProm, sklepPowiazaniePromTable, true); + sklepPowiazaniePromTable.AddTypeMapping(sklepPowiazaniePromTableMapping, false); + tableMappings203.Add(sklepPowiazaniePromTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn9, sklepPowiazanieProm.FindProperty("Rodzaj")!, sklepPowiazaniePromTableMapping); + RelationalModel.CreateColumnMapping(sklepGrupaIdColumn0, sklepPowiazanieProm.FindProperty("SklepGrupaId")!, sklepPowiazaniePromTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn48, sklepPowiazanieProm.FindProperty("SklepId")!, sklepPowiazaniePromTableMapping); + RelationalModel.CreateColumnMapping(sklepPromIdColumn, sklepPowiazanieProm.FindProperty("SklepPromId")!, sklepPowiazaniePromTableMapping); + + var sklepPowiazanieUz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieUz")!; + + var defaultTableMappings204 = new List>(); + sklepPowiazanieUz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings204); + var blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieUz", null, relationalModel); + var idColumnBase5 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase.Columns.Add("Id", idColumnBase5); + var rodzajPowColumnBase3 = new ColumnBase("RodzajPow", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase.Columns.Add("RodzajPow", rodzajPowColumnBase3); + var sklepIdColumnBase49 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase.Columns.Add("SklepId", sklepIdColumnBase49); + var sklepUzIdColumnBase3 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieUz", blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzMappingBase = new TableMappingBase(sklepPowiazanieUz, blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzMappingBase, false); + defaultTableMappings204.Add(blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase5, sklepPowiazanieUz.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajPowColumnBase3, sklepPowiazanieUz.FindProperty("RodzajPow")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase49, sklepPowiazanieUz.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase3, sklepPowiazanieUz.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepPowiazanieUzMappingBase); + + var tableMappings204 = new List(); + sklepPowiazanieUz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings204); + var sklepPowiazanieUzTable = new Table("SklepPowiazanieUz", null, relationalModel); + var sklepIdColumn49 = new Column("SklepId", "numeric(9,0)", sklepPowiazanieUzTable); + sklepPowiazanieUzTable.Columns.Add("SklepId", sklepIdColumn49); + var sklepUzIdColumn3 = new Column("SklepUzId", "numeric(9,0)", sklepPowiazanieUzTable); + sklepPowiazanieUzTable.Columns.Add("SklepUzId", sklepUzIdColumn3); + var rodzajPowColumn3 = new Column("RodzajPow", "smallint", sklepPowiazanieUzTable); + sklepPowiazanieUzTable.Columns.Add("RodzajPow", rodzajPowColumn3); + var idColumn5 = new Column("Id", "numeric(9,0)", sklepPowiazanieUzTable); + sklepPowiazanieUzTable.Columns.Add("Id", idColumn5); + var pK_SK_POW_UZ = new UniqueConstraint("PK_SK_POW_UZ", sklepPowiazanieUzTable, new[] { sklepIdColumn49, sklepUzIdColumn3, rodzajPowColumn3, idColumn5 }); + sklepPowiazanieUzTable.PrimaryKey = pK_SK_POW_UZ; + var pK_SK_POW_UZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieUz", + new[] { "SklepId", "SklepUzId", "RodzajPow", "Id" }); + pK_SK_POW_UZ.MappedKeys.Add(pK_SK_POW_UZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SK_POW_UZUc).Add(pK_SK_POW_UZ); + sklepPowiazanieUzTable.UniqueConstraints.Add("PK_SK_POW_UZ", pK_SK_POW_UZ); + relationalModel.Tables.Add(("SklepPowiazanieUz", null), sklepPowiazanieUzTable); + var sklepPowiazanieUzTableMapping = new TableMapping(sklepPowiazanieUz, sklepPowiazanieUzTable, true); + sklepPowiazanieUzTable.AddTypeMapping(sklepPowiazanieUzTableMapping, false); + tableMappings204.Add(sklepPowiazanieUzTableMapping); + RelationalModel.CreateColumnMapping(idColumn5, sklepPowiazanieUz.FindProperty("Id")!, sklepPowiazanieUzTableMapping); + RelationalModel.CreateColumnMapping(rodzajPowColumn3, sklepPowiazanieUz.FindProperty("RodzajPow")!, sklepPowiazanieUzTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn49, sklepPowiazanieUz.FindProperty("SklepId")!, sklepPowiazanieUzTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn3, sklepPowiazanieUz.FindProperty("SklepUzId")!, sklepPowiazanieUzTableMapping); + + var sklepPozAkcyza = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza")!; + + var defaultTableMappings205 = new List>(); + sklepPozAkcyza.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings205); + var blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza", null, relationalModel); + var kolejnoscColumnBase36 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase36); + var sklepDokIdColumnBase5 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase5); + var sklepGrAkcIdColumnBase0 = new ColumnBase("SklepGrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase.Columns.Add("SklepGrAkcId", sklepGrAkcIdColumnBase0); + var sklepIdColumnBase50 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase.Columns.Add("SklepId", sklepIdColumnBase50); + var wartoscColumnBase11 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase.Columns.Add("Wartosc", wartoscColumnBase11); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza", blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase = new TableMappingBase(sklepPozAkcyza, blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase, false); + defaultTableMappings205.Add(blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase36, sklepPozAkcyza.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase5, sklepPozAkcyza.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepGrAkcIdColumnBase0, sklepPozAkcyza.FindProperty("SklepGrAkcId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase50, sklepPozAkcyza.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase11, sklepPozAkcyza.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozAkcyzaMappingBase); + + var tableMappings205 = new List(); + sklepPozAkcyza.SetRuntimeAnnotation("Relational:TableMappings", tableMappings205); + var sklepPozAkcyzaTable = new Table("SklepPozAkcyza", null, relationalModel); + var sklepIdColumn50 = new Column("SklepId", "numeric(9,0)", sklepPozAkcyzaTable); + sklepPozAkcyzaTable.Columns.Add("SklepId", sklepIdColumn50); + var sklepDokIdColumn5 = new Column("SklepDokId", "numeric(9,0)", sklepPozAkcyzaTable); + sklepPozAkcyzaTable.Columns.Add("SklepDokId", sklepDokIdColumn5); + var kolejnoscColumn36 = new Column("Kolejnosc", "int", sklepPozAkcyzaTable); + sklepPozAkcyzaTable.Columns.Add("Kolejnosc", kolejnoscColumn36); + var sklepGrAkcIdColumn0 = new Column("SklepGrAkcId", "numeric(9,0)", sklepPozAkcyzaTable); + sklepPozAkcyzaTable.Columns.Add("SklepGrAkcId", sklepGrAkcIdColumn0); + var wartoscColumn11 = new Column("Wartosc", "decimal(15,4)", sklepPozAkcyzaTable); + sklepPozAkcyzaTable.Columns.Add("Wartosc", wartoscColumn11); + var pK_SKLEPPOZAKCYZA = new UniqueConstraint("PK_SKLEPPOZAKCYZA", sklepPozAkcyzaTable, new[] { sklepIdColumn50, sklepDokIdColumn5, kolejnoscColumn36, sklepGrAkcIdColumn0 }); + sklepPozAkcyzaTable.PrimaryKey = pK_SKLEPPOZAKCYZA; + var pK_SKLEPPOZAKCYZAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza", + new[] { "SklepId", "SklepDokId", "Kolejnosc", "SklepGrAkcId" }); + pK_SKLEPPOZAKCYZA.MappedKeys.Add(pK_SKLEPPOZAKCYZAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPOZAKCYZAUc).Add(pK_SKLEPPOZAKCYZA); + sklepPozAkcyzaTable.UniqueConstraints.Add("PK_SKLEPPOZAKCYZA", pK_SKLEPPOZAKCYZA); + var idx_SkPozAkcGr = new TableIndex( + "idx_SkPozAkcGr", sklepPozAkcyzaTable, new[] { sklepIdColumn50, sklepGrAkcIdColumn0 }, false); + var idx_SkPozAkcGrIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza", + "idx_SkPozAkcGr"); + idx_SkPozAkcGr.MappedIndexes.Add(idx_SkPozAkcGrIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkPozAkcGrIx).Add(idx_SkPozAkcGr); + sklepPozAkcyzaTable.Indexes.Add("idx_SkPozAkcGr", idx_SkPozAkcGr); + relationalModel.Tables.Add(("SklepPozAkcyza", null), sklepPozAkcyzaTable); + var sklepPozAkcyzaTableMapping = new TableMapping(sklepPozAkcyza, sklepPozAkcyzaTable, true); + sklepPozAkcyzaTable.AddTypeMapping(sklepPozAkcyzaTableMapping, false); + tableMappings205.Add(sklepPozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn36, sklepPozAkcyza.FindProperty("Kolejnosc")!, sklepPozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn5, sklepPozAkcyza.FindProperty("SklepDokId")!, sklepPozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(sklepGrAkcIdColumn0, sklepPozAkcyza.FindProperty("SklepGrAkcId")!, sklepPozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn50, sklepPozAkcyza.FindProperty("SklepId")!, sklepPozAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn11, sklepPozAkcyza.FindProperty("Wartosc")!, sklepPozAkcyzaTableMapping); + + var sklepPozDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok")!; + + var defaultTableMappings206 = new List>(); + sklepPozDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings206); + var blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", null, relationalModel); + var cenaDetColumnBase1 = new ColumnBase("CenaDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("CenaDet", cenaDetColumnBase1); + var cenaDomyslnaColumnBase0 = new ColumnBase("CenaDomyslna", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("CenaDomyslna", cenaDomyslnaColumnBase0); + var cenaMagColumnBase2 = new ColumnBase("CenaMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("CenaMag", cenaMagColumnBase2); + var cenaPoRabColumnBase0 = new ColumnBase("CenaPoRab", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("CenaPoRab", cenaPoRabColumnBase0); + var cenaPrzedRabColumnBase0 = new ColumnBase("CenaPrzedRab", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("CenaPrzedRab", cenaPrzedRabColumnBase0); + var ileWZgrzewceColumnBase2 = new ColumnBase("IleWZgrzewce", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("IleWZgrzewce", ileWZgrzewceColumnBase2); + var iloscMinusColumnBase1 = new ColumnBase("IloscMinus", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("IloscMinus", iloscMinusColumnBase1); + var iloscPlusColumnBase1 = new ColumnBase("IloscPlus", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("IloscPlus", iloscPlusColumnBase1); + var kolejnoscColumnBase37 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase37); + var metodaColumnBase0 = new ColumnBase("Metoda", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("Metoda", metodaColumnBase0); + var nettoColumnBase4 = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("Netto", nettoColumnBase4); + var nrPozycjiColumnBase1 = new ColumnBase("NrPozycji", "int", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("NrPozycji", nrPozycjiColumnBase1); + var podatekColumnBase4 = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("Podatek", podatekColumnBase4); + var poziomCenColumnBase5 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("PoziomCen", poziomCenColumnBase5); + var rabatProcColumnBase2 = new ColumnBase("RabatProc", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("RabatProc", rabatProcColumnBase2); + var sklepDokIdColumnBase6 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase6); + var sklepIdColumnBase51 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("SklepId", sklepIdColumnBase51); + var sklepTowIdColumnBase3 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase3); + var stawkaColumnBase8 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("Stawka", stawkaColumnBase8); + var stawkaDodColumnBase0 = new ColumnBase("StawkaDod", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("StawkaDod", stawkaDodColumnBase0); + var typPozColumnBase0 = new ColumnBase("TypPoz", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("TypPoz", typPozColumnBase0); + var typTowaruColumnBase2 = new ColumnBase("TypTowaru", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("TypTowaru", typTowaruColumnBase2); + var wartoscColumnBase12 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.Columns.Add("Wartosc", wartoscColumnBase12); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase = new TableMappingBase(sklepPozDok, blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPozDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase, false); + defaultTableMappings206.Add(blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase37, sklepPozDok.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase6, sklepPozDok.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase51, sklepPozDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDetColumnBase1, sklepPozDok.FindProperty("CenaDet")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDomyslnaColumnBase0, sklepPozDok.FindProperty("CenaDomyslna")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaMagColumnBase2, sklepPozDok.FindProperty("CenaMag")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaPoRabColumnBase0, sklepPozDok.FindProperty("CenaPoRab")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaPrzedRabColumnBase0, sklepPozDok.FindProperty("CenaPrzedRab")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWZgrzewceColumnBase2, sklepPozDok.FindProperty("IleWZgrzewce")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscMinusColumnBase1, sklepPozDok.FindProperty("IloscMinus")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscPlusColumnBase1, sklepPozDok.FindProperty("IloscPlus")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)metodaColumnBase0, sklepPozDok.FindProperty("Metoda")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase4, sklepPozDok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrPozycjiColumnBase1, sklepPozDok.FindProperty("NrPozycji")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase4, sklepPozDok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase5, sklepPozDok.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatProcColumnBase2, sklepPozDok.FindProperty("RabatProc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase3, sklepPozDok.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase8, sklepPozDok.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaDodColumnBase0, sklepPozDok.FindProperty("StawkaDod")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typPozColumnBase0, sklepPozDok.FindProperty("TypPoz")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typTowaruColumnBase2, sklepPozDok.FindProperty("TypTowaru")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase12, sklepPozDok.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozDokMappingBase); + + var tableMappings206 = new List(); + sklepPozDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings206); + var sklepPozDokTable = new Table("SklepPozDok", null, relationalModel); + var sklepIdColumn51 = new Column("SklepId", "numeric(9,0)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("SklepId", sklepIdColumn51); + var sklepDokIdColumn6 = new Column("SklepDokId", "numeric(9,0)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("SklepDokId", sklepDokIdColumn6); + var kolejnoscColumn37 = new Column("Kolejnosc", "int", sklepPozDokTable); + sklepPozDokTable.Columns.Add("Kolejnosc", kolejnoscColumn37); + var cenaDetColumn1 = new Column("CenaDet", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("CenaDet", cenaDetColumn1); + var cenaDomyslnaColumn0 = new Column("CenaDomyslna", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("CenaDomyslna", cenaDomyslnaColumn0); + var cenaMagColumn2 = new Column("CenaMag", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("CenaMag", cenaMagColumn2); + var cenaPoRabColumn0 = new Column("CenaPoRab", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("CenaPoRab", cenaPoRabColumn0); + var cenaPrzedRabColumn0 = new Column("CenaPrzedRab", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("CenaPrzedRab", cenaPrzedRabColumn0); + var ileWZgrzewceColumn2 = new Column("IleWZgrzewce", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("IleWZgrzewce", ileWZgrzewceColumn2); + var iloscMinusColumn1 = new Column("IloscMinus", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("IloscMinus", iloscMinusColumn1); + var iloscPlusColumn1 = new Column("IloscPlus", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("IloscPlus", iloscPlusColumn1); + var metodaColumn0 = new Column("Metoda", "smallint", sklepPozDokTable); + sklepPozDokTable.Columns.Add("Metoda", metodaColumn0); + var nettoColumn4 = new Column("Netto", "decimal(15,4)", sklepPozDokTable) + { + IsNullable = true + }; + sklepPozDokTable.Columns.Add("Netto", nettoColumn4); + var nrPozycjiColumn1 = new Column("NrPozycji", "int", sklepPozDokTable); + sklepPozDokTable.Columns.Add("NrPozycji", nrPozycjiColumn1); + var podatekColumn4 = new Column("Podatek", "decimal(15,4)", sklepPozDokTable) + { + IsNullable = true + }; + sklepPozDokTable.Columns.Add("Podatek", podatekColumn4); + var poziomCenColumn5 = new Column("PoziomCen", "smallint", sklepPozDokTable); + sklepPozDokTable.Columns.Add("PoziomCen", poziomCenColumn5); + var rabatProcColumn2 = new Column("RabatProc", "decimal(10,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("RabatProc", rabatProcColumn2); + var sklepTowIdColumn3 = new Column("SklepTowId", "numeric(9,0)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("SklepTowId", sklepTowIdColumn3); + var stawkaColumn8 = new Column("Stawka", "smallint", sklepPozDokTable); + sklepPozDokTable.Columns.Add("Stawka", stawkaColumn8); + var stawkaDodColumn0 = new Column("StawkaDod", "smallint", sklepPozDokTable) + { + IsNullable = true + }; + sklepPozDokTable.Columns.Add("StawkaDod", stawkaDodColumn0); + var typPozColumn0 = new Column("TypPoz", "smallint", sklepPozDokTable); + sklepPozDokTable.Columns.Add("TypPoz", typPozColumn0); + var typTowaruColumn2 = new Column("TypTowaru", "smallint", sklepPozDokTable); + sklepPozDokTable.Columns.Add("TypTowaru", typTowaruColumn2); + var wartoscColumn12 = new Column("Wartosc", "decimal(15,4)", sklepPozDokTable); + sklepPozDokTable.Columns.Add("Wartosc", wartoscColumn12); + var pK_SKLEPPOZDOK = new UniqueConstraint("PK_SKLEPPOZDOK", sklepPozDokTable, new[] { sklepIdColumn51, sklepDokIdColumn6, kolejnoscColumn37 }); + sklepPozDokTable.PrimaryKey = pK_SKLEPPOZDOK; + var pK_SKLEPPOZDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + pK_SKLEPPOZDOK.MappedKeys.Add(pK_SKLEPPOZDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPOZDOKUc).Add(pK_SKLEPPOZDOK); + sklepPozDokTable.UniqueConstraints.Add("PK_SKLEPPOZDOK", pK_SKLEPPOZDOK); + var idx_SklepPozDokNrPoz = new TableIndex( + "idx_SklepPozDokNrPoz", sklepPozDokTable, new[] { sklepIdColumn51, sklepDokIdColumn6, nrPozycjiColumn1 }, false); + var idx_SklepPozDokNrPozIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + "idx_SklepPozDokNrPoz"); + idx_SklepPozDokNrPoz.MappedIndexes.Add(idx_SklepPozDokNrPozIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepPozDokNrPozIx).Add(idx_SklepPozDokNrPoz); + sklepPozDokTable.Indexes.Add("idx_SklepPozDokNrPoz", idx_SklepPozDokNrPoz); + var idx_SklepPozDokTowId = new TableIndex( + "idx_SklepPozDokTowId", sklepPozDokTable, new[] { sklepIdColumn51, sklepTowIdColumn3 }, false); + var idx_SklepPozDokTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + "idx_SklepPozDokTowId"); + idx_SklepPozDokTowId.MappedIndexes.Add(idx_SklepPozDokTowIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepPozDokTowIdIx).Add(idx_SklepPozDokTowId); + sklepPozDokTable.Indexes.Add("idx_SklepPozDokTowId", idx_SklepPozDokTowId); + relationalModel.Tables.Add(("SklepPozDok", null), sklepPozDokTable); + var sklepPozDokTableMapping = new TableMapping(sklepPozDok, sklepPozDokTable, true); + sklepPozDokTable.AddTypeMapping(sklepPozDokTableMapping, false); + tableMappings206.Add(sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn37, sklepPozDok.FindProperty("Kolejnosc")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn6, sklepPozDok.FindProperty("SklepDokId")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn51, sklepPozDok.FindProperty("SklepId")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaDetColumn1, sklepPozDok.FindProperty("CenaDet")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaDomyslnaColumn0, sklepPozDok.FindProperty("CenaDomyslna")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaMagColumn2, sklepPozDok.FindProperty("CenaMag")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaPoRabColumn0, sklepPozDok.FindProperty("CenaPoRab")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(cenaPrzedRabColumn0, sklepPozDok.FindProperty("CenaPrzedRab")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(ileWZgrzewceColumn2, sklepPozDok.FindProperty("IleWZgrzewce")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(iloscMinusColumn1, sklepPozDok.FindProperty("IloscMinus")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(iloscPlusColumn1, sklepPozDok.FindProperty("IloscPlus")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(metodaColumn0, sklepPozDok.FindProperty("Metoda")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn4, sklepPozDok.FindProperty("Netto")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(nrPozycjiColumn1, sklepPozDok.FindProperty("NrPozycji")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn4, sklepPozDok.FindProperty("Podatek")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn5, sklepPozDok.FindProperty("PoziomCen")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(rabatProcColumn2, sklepPozDok.FindProperty("RabatProc")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn3, sklepPozDok.FindProperty("SklepTowId")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn8, sklepPozDok.FindProperty("Stawka")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaDodColumn0, sklepPozDok.FindProperty("StawkaDod")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(typPozColumn0, sklepPozDok.FindProperty("TypPoz")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(typTowaruColumn2, sklepPozDok.FindProperty("TypTowaru")!, sklepPozDokTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn12, sklepPozDok.FindProperty("Wartosc")!, sklepPozDokTableMapping); + + var sklepPozPar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar")!; + + var defaultTableMappings207 = new List>(); + sklepPozPar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings207); + var blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", null, relationalModel); + var grupaGTUColumnBase0 = new ColumnBase("GrupaGTU", "varchar(4)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("GrupaGTU", grupaGTUColumnBase0); + var iloscColumnBase4 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("Ilosc", iloscColumnBase4); + var kodColumnBase13 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("Kod", kodColumnBase13); + var kolejnoscColumnBase38 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase38); + var rabatKwotColumnBase0 = new ColumnBase("RabatKwot", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("RabatKwot", rabatKwotColumnBase0); + var sklepIdColumnBase52 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("SklepId", sklepIdColumnBase52); + var sklepParIdColumnBase3 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("SklepParId", sklepParIdColumnBase3); + var sklepTowIdColumnBase4 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase4); + var stawkaColumnBase9 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("Stawka", stawkaColumnBase9); + var typPozParColumnBase0 = new ColumnBase("TypPozPar", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("TypPozPar", typPozParColumnBase0); + var wartoscBruttoColumnBase0 = new ColumnBase("WartoscBrutto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.Columns.Add("WartoscBrutto", wartoscBruttoColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase = new TableMappingBase(sklepPozPar, blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPozParTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase, false); + defaultTableMappings207.Add(blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase38, sklepPozPar.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase52, sklepPozPar.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase3, sklepPozPar.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupaGTUColumnBase0, sklepPozPar.FindProperty("GrupaGTU")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase4, sklepPozPar.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase13, sklepPozPar.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rabatKwotColumnBase0, sklepPozPar.FindProperty("RabatKwot")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase4, sklepPozPar.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase9, sklepPozPar.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typPozParColumnBase0, sklepPozPar.FindProperty("TypPozPar")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscBruttoColumnBase0, sklepPozPar.FindProperty("WartoscBrutto")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParMappingBase); + + var tableMappings207 = new List(); + sklepPozPar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings207); + var sklepPozParTable = new Table("SklepPozPar", null, relationalModel); + var sklepIdColumn52 = new Column("SklepId", "numeric(9,0)", sklepPozParTable); + sklepPozParTable.Columns.Add("SklepId", sklepIdColumn52); + var sklepParIdColumn3 = new Column("SklepParId", "numeric(9,0)", sklepPozParTable); + sklepPozParTable.Columns.Add("SklepParId", sklepParIdColumn3); + var kolejnoscColumn38 = new Column("Kolejnosc", "int", sklepPozParTable); + sklepPozParTable.Columns.Add("Kolejnosc", kolejnoscColumn38); + var grupaGTUColumn0 = new Column("GrupaGTU", "varchar(4)", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("GrupaGTU", grupaGTUColumn0); + var iloscColumn4 = new Column("Ilosc", "decimal(15,4)", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("Ilosc", iloscColumn4); + var kodColumn13 = new Column("Kod", "varchar(20)", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("Kod", kodColumn13); + var rabatKwotColumn0 = new Column("RabatKwot", "decimal(15,4)", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("RabatKwot", rabatKwotColumn0); + var sklepTowIdColumn4 = new Column("SklepTowId", "numeric(9,0)", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("SklepTowId", sklepTowIdColumn4); + var stawkaColumn9 = new Column("Stawka", "smallint", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("Stawka", stawkaColumn9); + var typPozParColumn0 = new Column("TypPozPar", "smallint", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("TypPozPar", typPozParColumn0); + var wartoscBruttoColumn0 = new Column("WartoscBrutto", "decimal(15,4)", sklepPozParTable) + { + IsNullable = true + }; + sklepPozParTable.Columns.Add("WartoscBrutto", wartoscBruttoColumn0); + var pK_SKLEPPOZPAR = new UniqueConstraint("PK_SKLEPPOZPAR", sklepPozParTable, new[] { sklepIdColumn52, sklepParIdColumn3, kolejnoscColumn38 }); + sklepPozParTable.PrimaryKey = pK_SKLEPPOZPAR; + var pK_SKLEPPOZPARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + new[] { "SklepId", "SklepParId", "Kolejnosc" }); + pK_SKLEPPOZPAR.MappedKeys.Add(pK_SKLEPPOZPARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPOZPARUc).Add(pK_SKLEPPOZPAR); + sklepPozParTable.UniqueConstraints.Add("PK_SKLEPPOZPAR", pK_SKLEPPOZPAR); + var idx_SkPozParTow = new TableIndex( + "idx_SkPozParTow", sklepPozParTable, new[] { sklepIdColumn52, sklepTowIdColumn4 }, false); + var idx_SkPozParTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + "idx_SkPozParTow"); + idx_SkPozParTow.MappedIndexes.Add(idx_SkPozParTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkPozParTowIx).Add(idx_SkPozParTow); + sklepPozParTable.Indexes.Add("idx_SkPozParTow", idx_SkPozParTow); + relationalModel.Tables.Add(("SklepPozPar", null), sklepPozParTable); + var sklepPozParTableMapping = new TableMapping(sklepPozPar, sklepPozParTable, true); + sklepPozParTable.AddTypeMapping(sklepPozParTableMapping, false); + tableMappings207.Add(sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn38, sklepPozPar.FindProperty("Kolejnosc")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn52, sklepPozPar.FindProperty("SklepId")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn3, sklepPozPar.FindProperty("SklepParId")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(grupaGTUColumn0, sklepPozPar.FindProperty("GrupaGTU")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn4, sklepPozPar.FindProperty("Ilosc")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(kodColumn13, sklepPozPar.FindProperty("Kod")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(rabatKwotColumn0, sklepPozPar.FindProperty("RabatKwot")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn4, sklepPozPar.FindProperty("SklepTowId")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn9, sklepPozPar.FindProperty("Stawka")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(typPozParColumn0, sklepPozPar.FindProperty("TypPozPar")!, sklepPozParTableMapping); + RelationalModel.CreateColumnMapping(wartoscBruttoColumn0, sklepPozPar.FindProperty("WartoscBrutto")!, sklepPozParTableMapping); + + var sklepPozParSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPozParSzczeg")!; + + var defaultTableMappings208 = new List>(); + sklepPozParSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings208); + var blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPozParSzczeg", null, relationalModel); + var dodInfoColumnBase0 = new ColumnBase("DodInfo", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase.Columns.Add("DodInfo", dodInfoColumnBase0); + var kolejnoscColumnBase39 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase39); + var sklepIdColumnBase53 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase.Columns.Add("SklepId", sklepIdColumnBase53); + var sklepParIdColumnBase4 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase.Columns.Add("SklepParId", sklepParIdColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPozParSzczeg", blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegMappingBase = new TableMappingBase(sklepPozParSzczeg, blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegMappingBase, false); + defaultTableMappings208.Add(blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase39, sklepPozParSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase53, sklepPozParSzczeg.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase4, sklepPozParSzczeg.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodInfoColumnBase0, sklepPozParSzczeg.FindProperty("DodInfo")!, blinkBackofficeServicesPcmDbEntitiesSklepPozParSzczegMappingBase); + + var tableMappings208 = new List(); + sklepPozParSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings208); + var sklepPozParSzczegTable = new Table("SklepPozParSzczeg", null, relationalModel); + var sklepIdColumn53 = new Column("SklepId", "numeric(9,0)", sklepPozParSzczegTable); + sklepPozParSzczegTable.Columns.Add("SklepId", sklepIdColumn53); + var sklepParIdColumn4 = new Column("SklepParId", "numeric(9,0)", sklepPozParSzczegTable); + sklepPozParSzczegTable.Columns.Add("SklepParId", sklepParIdColumn4); + var kolejnoscColumn39 = new Column("Kolejnosc", "int", sklepPozParSzczegTable); + sklepPozParSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn39); + var dodInfoColumn0 = new Column("DodInfo", "varchar(40)", sklepPozParSzczegTable); + sklepPozParSzczegTable.Columns.Add("DodInfo", dodInfoColumn0); + var pK_SKLEPPOZPARSZCZEG = new UniqueConstraint("PK_SKLEPPOZPARSZCZEG", sklepPozParSzczegTable, new[] { sklepIdColumn53, sklepParIdColumn4, kolejnoscColumn39 }); + sklepPozParSzczegTable.PrimaryKey = pK_SKLEPPOZPARSZCZEG; + var pK_SKLEPPOZPARSZCZEGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozParSzczeg", + new[] { "SklepId", "SklepParId", "Kolejnosc" }); + pK_SKLEPPOZPARSZCZEG.MappedKeys.Add(pK_SKLEPPOZPARSZCZEGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPOZPARSZCZEGUc).Add(pK_SKLEPPOZPARSZCZEG); + sklepPozParSzczegTable.UniqueConstraints.Add("PK_SKLEPPOZPARSZCZEG", pK_SKLEPPOZPARSZCZEG); + relationalModel.Tables.Add(("SklepPozParSzczeg", null), sklepPozParSzczegTable); + var sklepPozParSzczegTableMapping = new TableMapping(sklepPozParSzczeg, sklepPozParSzczegTable, true); + sklepPozParSzczegTable.AddTypeMapping(sklepPozParSzczegTableMapping, false); + tableMappings208.Add(sklepPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn39, sklepPozParSzczeg.FindProperty("Kolejnosc")!, sklepPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn53, sklepPozParSzczeg.FindProperty("SklepId")!, sklepPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn4, sklepPozParSzczeg.FindProperty("SklepParId")!, sklepPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(dodInfoColumn0, sklepPozParSzczeg.FindProperty("DodInfo")!, sklepPozParSzczegTableMapping); + + var sklepProfil = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepProfil")!; + + var defaultTableMappings209 = new List>(); + sklepProfil.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings209); + var blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", null, relationalModel); + var aktywnyColumnBase39 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("Aktywny", aktywnyColumnBase39); + var nazwaColumnBase49 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("Nazwa", nazwaColumnBase49); + var profilIdColumnBase2 = new ColumnBase("ProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("ProfilId", profilIdColumnBase2); + var sklepIdColumnBase54 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("SklepId", sklepIdColumnBase54); + var sklepProfilIdColumnBase = new ColumnBase("SklepProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("SklepProfilId", sklepProfilIdColumnBase); + var typColumnBase31 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("Typ", typColumnBase31); + var utworzonyColumnBase1 = new ColumnBase("Utworzony", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("Utworzony", utworzonyColumnBase1); + var zmianaColumnBase47 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.Columns.Add("Zmiana", zmianaColumnBase47); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase = new TableMappingBase(sklepProfil, blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepProfilTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase, false); + defaultTableMappings209.Add(blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase54, sklepProfil.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepProfilIdColumnBase, sklepProfil.FindProperty("SklepProfilId")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase39, sklepProfil.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase49, sklepProfil.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)profilIdColumnBase2, sklepProfil.FindProperty("ProfilId")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase31, sklepProfil.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonyColumnBase1, sklepProfil.FindProperty("Utworzony")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase47, sklepProfil.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilMappingBase); + + var tableMappings209 = new List(); + sklepProfil.SetRuntimeAnnotation("Relational:TableMappings", tableMappings209); + var sklepProfilTable = new Table("SklepProfil", null, relationalModel); + var sklepIdColumn54 = new Column("SklepId", "numeric(9,0)", sklepProfilTable); + sklepProfilTable.Columns.Add("SklepId", sklepIdColumn54); + var sklepProfilIdColumn = new Column("SklepProfilId", "numeric(9,0)", sklepProfilTable); + sklepProfilTable.Columns.Add("SklepProfilId", sklepProfilIdColumn); + var aktywnyColumn39 = new Column("Aktywny", "smallint", sklepProfilTable) + { + IsNullable = true + }; + sklepProfilTable.Columns.Add("Aktywny", aktywnyColumn39); + var nazwaColumn49 = new Column("Nazwa", "varchar(40)", sklepProfilTable); + sklepProfilTable.Columns.Add("Nazwa", nazwaColumn49); + var profilIdColumn2 = new Column("ProfilId", "numeric(9,0)", sklepProfilTable) + { + IsNullable = true + }; + sklepProfilTable.Columns.Add("ProfilId", profilIdColumn2); + var typColumn31 = new Column("Typ", "smallint", sklepProfilTable); + sklepProfilTable.Columns.Add("Typ", typColumn31); + var utworzonyColumn1 = new Column("Utworzony", "datetime", sklepProfilTable) + { + IsNullable = true + }; + sklepProfilTable.Columns.Add("Utworzony", utworzonyColumn1); + var zmianaColumn47 = new Column("Zmiana", "datetime", sklepProfilTable) + { + IsNullable = true + }; + sklepProfilTable.Columns.Add("Zmiana", zmianaColumn47); + var pK_SKLEPPROFIL = new UniqueConstraint("PK_SKLEPPROFIL", sklepProfilTable, new[] { sklepIdColumn54, sklepProfilIdColumn }); + sklepProfilTable.PrimaryKey = pK_SKLEPPROFIL; + var pK_SKLEPPROFILUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", + new[] { "SklepId", "SklepProfilId" }); + pK_SKLEPPROFIL.MappedKeys.Add(pK_SKLEPPROFILUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPROFILUc).Add(pK_SKLEPPROFIL); + sklepProfilTable.UniqueConstraints.Add("PK_SKLEPPROFIL", pK_SKLEPPROFIL); + var iX_SklepProfil_ProfilId = new TableIndex( + "IX_SklepProfil_ProfilId", sklepProfilTable, new[] { profilIdColumn2 }, false); + var iX_SklepProfil_ProfilIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", + new[] { "ProfilId" }); + iX_SklepProfil_ProfilId.MappedIndexes.Add(iX_SklepProfil_ProfilIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepProfil_ProfilIdIx).Add(iX_SklepProfil_ProfilId); + sklepProfilTable.Indexes.Add("IX_SklepProfil_ProfilId", iX_SklepProfil_ProfilId); + relationalModel.Tables.Add(("SklepProfil", null), sklepProfilTable); + var sklepProfilTableMapping = new TableMapping(sklepProfil, sklepProfilTable, true); + sklepProfilTable.AddTypeMapping(sklepProfilTableMapping, false); + tableMappings209.Add(sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn54, sklepProfil.FindProperty("SklepId")!, sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(sklepProfilIdColumn, sklepProfil.FindProperty("SklepProfilId")!, sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn39, sklepProfil.FindProperty("Aktywny")!, sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn49, sklepProfil.FindProperty("Nazwa")!, sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(profilIdColumn2, sklepProfil.FindProperty("ProfilId")!, sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(typColumn31, sklepProfil.FindProperty("Typ")!, sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(utworzonyColumn1, sklepProfil.FindProperty("Utworzony")!, sklepProfilTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn47, sklepProfil.FindProperty("Zmiana")!, sklepProfilTableMapping); + + var sklepProfilKonfig = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepProfilKonfig")!; + + var defaultTableMappings210 = new List>(); + sklepProfilKonfig.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings210); + var blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepProfilKonfig", null, relationalModel); + var kolejnyColumnBase0 = new ColumnBase("Kolejny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("Kolejny", kolejnyColumnBase0); + var parGrupaColumnBase2 = new ColumnBase("ParGrupa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("ParGrupa", parGrupaColumnBase2); + var parNazwaColumnBase6 = new ColumnBase("ParNazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("ParNazwa", parNazwaColumnBase6); + var sklepIdColumnBase55 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("SklepId", sklepIdColumnBase55); + var sklepProfilIdColumnBase0 = new ColumnBase("SklepProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("SklepProfilId", sklepProfilIdColumnBase0); + var utworzonyColumnBase2 = new ColumnBase("Utworzony", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("Utworzony", utworzonyColumnBase2); + var wartoscColumnBase13 = new ColumnBase("Wartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("Wartosc", wartoscColumnBase13); + var zmianaColumnBase48 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.Columns.Add("Zmiana", zmianaColumnBase48); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepProfilKonfig", blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase = new TableMappingBase(sklepProfilKonfig, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase, false); + defaultTableMappings210.Add(blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyColumnBase0, sklepProfilKonfig.FindProperty("Kolejny")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parGrupaColumnBase2, sklepProfilKonfig.FindProperty("ParGrupa")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase6, sklepProfilKonfig.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase55, sklepProfilKonfig.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepProfilIdColumnBase0, sklepProfilKonfig.FindProperty("SklepProfilId")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonyColumnBase2, sklepProfilKonfig.FindProperty("Utworzony")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase13, sklepProfilKonfig.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase48, sklepProfilKonfig.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepProfilKonfigMappingBase); + + var tableMappings210 = new List(); + sklepProfilKonfig.SetRuntimeAnnotation("Relational:TableMappings", tableMappings210); + var sklepProfilKonfigTable = new Table("SklepProfilKonfig", null, relationalModel); + var sklepIdColumn55 = new Column("SklepId", "numeric(9,0)", sklepProfilKonfigTable); + sklepProfilKonfigTable.Columns.Add("SklepId", sklepIdColumn55); + var sklepProfilIdColumn0 = new Column("SklepProfilId", "numeric(9,0)", sklepProfilKonfigTable); + sklepProfilKonfigTable.Columns.Add("SklepProfilId", sklepProfilIdColumn0); + var parGrupaColumn2 = new Column("ParGrupa", "varchar(255)", sklepProfilKonfigTable); + sklepProfilKonfigTable.Columns.Add("ParGrupa", parGrupaColumn2); + var parNazwaColumn6 = new Column("ParNazwa", "varchar(255)", sklepProfilKonfigTable); + sklepProfilKonfigTable.Columns.Add("ParNazwa", parNazwaColumn6); + var kolejnyColumn0 = new Column("Kolejny", "smallint", sklepProfilKonfigTable); + sklepProfilKonfigTable.Columns.Add("Kolejny", kolejnyColumn0); + var utworzonyColumn2 = new Column("Utworzony", "datetime", sklepProfilKonfigTable) + { + IsNullable = true + }; + sklepProfilKonfigTable.Columns.Add("Utworzony", utworzonyColumn2); + var wartoscColumn13 = new Column("Wartosc", "varchar(255)", sklepProfilKonfigTable) + { + IsNullable = true + }; + sklepProfilKonfigTable.Columns.Add("Wartosc", wartoscColumn13); + var zmianaColumn48 = new Column("Zmiana", "datetime", sklepProfilKonfigTable) + { + IsNullable = true + }; + sklepProfilKonfigTable.Columns.Add("Zmiana", zmianaColumn48); + var pK_SKLEPPROFIL_KONFIG = new UniqueConstraint("PK_SKLEPPROFIL_KONFIG", sklepProfilKonfigTable, new[] { sklepIdColumn55, sklepProfilIdColumn0, parGrupaColumn2, parNazwaColumn6, kolejnyColumn0 }); + sklepProfilKonfigTable.PrimaryKey = pK_SKLEPPROFIL_KONFIG; + var pK_SKLEPPROFIL_KONFIGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfilKonfig", + new[] { "SklepId", "SklepProfilId", "ParGrupa", "ParNazwa", "Kolejny" }); + pK_SKLEPPROFIL_KONFIG.MappedKeys.Add(pK_SKLEPPROFIL_KONFIGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPROFIL_KONFIGUc).Add(pK_SKLEPPROFIL_KONFIG); + sklepProfilKonfigTable.UniqueConstraints.Add("PK_SKLEPPROFIL_KONFIG", pK_SKLEPPROFIL_KONFIG); + relationalModel.Tables.Add(("SklepProfilKonfig", null), sklepProfilKonfigTable); + var sklepProfilKonfigTableMapping = new TableMapping(sklepProfilKonfig, sklepProfilKonfigTable, true); + sklepProfilKonfigTable.AddTypeMapping(sklepProfilKonfigTableMapping, false); + tableMappings210.Add(sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(kolejnyColumn0, sklepProfilKonfig.FindProperty("Kolejny")!, sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(parGrupaColumn2, sklepProfilKonfig.FindProperty("ParGrupa")!, sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn6, sklepProfilKonfig.FindProperty("ParNazwa")!, sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn55, sklepProfilKonfig.FindProperty("SklepId")!, sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(sklepProfilIdColumn0, sklepProfilKonfig.FindProperty("SklepProfilId")!, sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(utworzonyColumn2, sklepProfilKonfig.FindProperty("Utworzony")!, sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn13, sklepProfilKonfig.FindProperty("Wartosc")!, sklepProfilKonfigTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn48, sklepProfilKonfig.FindProperty("Zmiana")!, sklepProfilKonfigTableMapping); + + var sklepPrtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag")!; + + var defaultTableMappings211 = new List>(); + sklepPrtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings211); + var blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", null, relationalModel); + var cenaSpDetColumnBase0 = new ColumnBase("CenaSpDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("CenaSpDet", cenaSpDetColumnBase0); + var cenaZakColumnBase2 = new ColumnBase("CenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("CenaZak", cenaZakColumnBase2); + var dataColumnBase7 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("Data", dataColumnBase7); + var dataWaznColumnBase2 = new ColumnBase("DataWazn", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("DataWazn", dataWaznColumnBase2); + var dostarczonoColumnBase0 = new ColumnBase("Dostarczono", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("Dostarczono", dostarczonoColumnBase0); + var kolejnyWDniuColumnBase2 = new ColumnBase("KolejnyWDniu", "int", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("KolejnyWDniu", kolejnyWDniuColumnBase2); + var nrDostawyColumnBase0 = new ColumnBase("NrDostawy", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("NrDostawy", nrDostawyColumnBase0); + var nrPartiiColumnBase0 = new ColumnBase("NrPartii", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("NrPartii", nrPartiiColumnBase0); + var nrPozycjiColumnBase2 = new ColumnBase("NrPozycji", "int", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("NrPozycji", nrPozycjiColumnBase2); + var pMIdColumnBase1 = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase1); + var pozostaloColumnBase2 = new ColumnBase("Pozostalo", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("Pozostalo", pozostaloColumnBase2); + var rezerwacjaColumnBase0 = new ColumnBase("Rezerwacja", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("Rezerwacja", rezerwacjaColumnBase0); + var sklepIdColumnBase56 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("SklepId", sklepIdColumnBase56); + var sklepKontrIdColumnBase10 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase10); + var sklepMagIdColumnBase5 = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase5); + var sklepTowIdColumnBase5 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase5); + var statusColumnBase6 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("Status", statusColumnBase6); + var stawkaColumnBase10 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("Stawka", stawkaColumnBase10); + var zmianaColumnBase49 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.Columns.Add("Zmiana", zmianaColumnBase49); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase = new TableMappingBase(sklepPrtMag, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase, false); + defaultTableMappings211.Add(blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase1, sklepPrtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase56, sklepPrtMag.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase5, sklepPrtMag.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaSpDetColumnBase0, sklepPrtMag.FindProperty("CenaSpDet")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakColumnBase2, sklepPrtMag.FindProperty("CenaZak")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase7, sklepPrtMag.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataWaznColumnBase2, sklepPrtMag.FindProperty("DataWazn")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dostarczonoColumnBase0, sklepPrtMag.FindProperty("Dostarczono")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnyWDniuColumnBase2, sklepPrtMag.FindProperty("KolejnyWDniu")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDostawyColumnBase0, sklepPrtMag.FindProperty("NrDostawy")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrPartiiColumnBase0, sklepPrtMag.FindProperty("NrPartii")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrPozycjiColumnBase2, sklepPrtMag.FindProperty("NrPozycji")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pozostaloColumnBase2, sklepPrtMag.FindProperty("Pozostalo")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwacjaColumnBase0, sklepPrtMag.FindProperty("Rezerwacja")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase10, sklepPrtMag.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase5, sklepPrtMag.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase6, sklepPrtMag.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase10, sklepPrtMag.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase49, sklepPrtMag.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepPrtMagMappingBase); + + var tableMappings211 = new List(); + sklepPrtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings211); + var sklepPrtMagTable = new Table("SklepPrtMag", null, relationalModel); + var sklepIdColumn56 = new Column("SklepId", "numeric(9,0)", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("SklepId", sklepIdColumn56); + var sklepTowIdColumn5 = new Column("SklepTowId", "numeric(9,0)", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("SklepTowId", sklepTowIdColumn5); + var pMIdColumn1 = new Column("PMId", "numeric(9,0)", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("PMId", pMIdColumn1); + var cenaSpDetColumn0 = new Column("CenaSpDet", "decimal(15,4)", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("CenaSpDet", cenaSpDetColumn0); + var cenaZakColumn2 = new Column("CenaZak", "decimal(15,4)", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("CenaZak", cenaZakColumn2); + var dataColumn7 = new Column("Data", "datetime", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("Data", dataColumn7); + var dataWaznColumn2 = new Column("DataWazn", "datetime", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("DataWazn", dataWaznColumn2); + var dostarczonoColumn0 = new Column("Dostarczono", "decimal(15,4)", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("Dostarczono", dostarczonoColumn0); + var kolejnyWDniuColumn2 = new Column("KolejnyWDniu", "int", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("KolejnyWDniu", kolejnyWDniuColumn2); + var nrDostawyColumn0 = new Column("NrDostawy", "varchar(60)", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("NrDostawy", nrDostawyColumn0); + var nrPartiiColumn0 = new Column("NrPartii", "varchar(60)", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("NrPartii", nrPartiiColumn0); + var nrPozycjiColumn2 = new Column("NrPozycji", "int", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("NrPozycji", nrPozycjiColumn2); + var pozostaloColumn2 = new Column("Pozostalo", "decimal(15,4)", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("Pozostalo", pozostaloColumn2); + var rezerwacjaColumn0 = new Column("Rezerwacja", "decimal(15,4)", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("Rezerwacja", rezerwacjaColumn0); + var sklepKontrIdColumn10 = new Column("SklepKontrId", "numeric(9,0)", sklepPrtMagTable) + { + IsNullable = true + }; + sklepPrtMagTable.Columns.Add("SklepKontrId", sklepKontrIdColumn10); + var sklepMagIdColumn5 = new Column("SklepMagId", "numeric(9,0)", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("SklepMagId", sklepMagIdColumn5); + var statusColumn6 = new Column("Status", "smallint", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("Status", statusColumn6); + var stawkaColumn10 = new Column("Stawka", "smallint", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("Stawka", stawkaColumn10); + var zmianaColumn49 = new Column("Zmiana", "datetime", sklepPrtMagTable); + sklepPrtMagTable.Columns.Add("Zmiana", zmianaColumn49); + var pK_SKLEPPRTMAG = new UniqueConstraint("PK_SKLEPPRTMAG", sklepPrtMagTable, new[] { sklepIdColumn56, sklepTowIdColumn5, pMIdColumn1 }); + sklepPrtMagTable.PrimaryKey = pK_SKLEPPRTMAG; + var pK_SKLEPPRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + new[] { "SklepId", "SklepTowId", "PMId" }); + pK_SKLEPPRTMAG.MappedKeys.Add(pK_SKLEPPRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPRTMAGUc).Add(pK_SKLEPPRTMAG); + sklepPrtMagTable.UniqueConstraints.Add("PK_SKLEPPRTMAG", pK_SKLEPPRTMAG); + var idx_SkPrtMagFifo = new TableIndex( + "idx_SkPrtMagFifo", sklepPrtMagTable, new[] { sklepIdColumn56, sklepTowIdColumn5, sklepMagIdColumn5, dataColumn7, kolejnyWDniuColumn2, pMIdColumn1 }, false); + var idx_SkPrtMagFifoIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + "idx_SkPrtMagFifo"); + idx_SkPrtMagFifo.MappedIndexes.Add(idx_SkPrtMagFifoIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkPrtMagFifoIx).Add(idx_SkPrtMagFifo); + sklepPrtMagTable.Indexes.Add("idx_SkPrtMagFifo", idx_SkPrtMagFifo); + var idx_SkPrtMagNrPrt = new TableIndex( + "idx_SkPrtMagNrPrt", sklepPrtMagTable, new[] { nrPartiiColumn0, sklepIdColumn56, sklepTowIdColumn5, pMIdColumn1 }, false); + var idx_SkPrtMagNrPrtIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + "idx_SkPrtMagNrPrt"); + idx_SkPrtMagNrPrt.MappedIndexes.Add(idx_SkPrtMagNrPrtIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkPrtMagNrPrtIx).Add(idx_SkPrtMagNrPrt); + sklepPrtMagTable.Indexes.Add("idx_SkPrtMagNrPrt", idx_SkPrtMagNrPrt); + var idx_SkPrtMagZmn = new TableIndex( + "idx_SkPrtMagZmn", sklepPrtMagTable, new[] { zmianaColumn49 }, false); + var idx_SkPrtMagZmnIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + "idx_SkPrtMagZmn"); + idx_SkPrtMagZmn.MappedIndexes.Add(idx_SkPrtMagZmnIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkPrtMagZmnIx).Add(idx_SkPrtMagZmn); + sklepPrtMagTable.Indexes.Add("idx_SkPrtMagZmn", idx_SkPrtMagZmn); + var iX_SklepPrtMag_SklepId_SklepMagId = new TableIndex( + "IX_SklepPrtMag_SklepId_SklepMagId", sklepPrtMagTable, new[] { sklepIdColumn56, sklepMagIdColumn5 }, false); + var iX_SklepPrtMag_SklepId_SklepMagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + new[] { "SklepId", "SklepMagId" }); + iX_SklepPrtMag_SklepId_SklepMagId.MappedIndexes.Add(iX_SklepPrtMag_SklepId_SklepMagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepPrtMag_SklepId_SklepMagIdIx).Add(iX_SklepPrtMag_SklepId_SklepMagId); + sklepPrtMagTable.Indexes.Add("IX_SklepPrtMag_SklepId_SklepMagId", iX_SklepPrtMag_SklepId_SklepMagId); + relationalModel.Tables.Add(("SklepPrtMag", null), sklepPrtMagTable); + var sklepPrtMagTableMapping = new TableMapping(sklepPrtMag, sklepPrtMagTable, true); + sklepPrtMagTable.AddTypeMapping(sklepPrtMagTableMapping, false); + tableMappings211.Add(sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn1, sklepPrtMag.FindProperty("PMId")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn56, sklepPrtMag.FindProperty("SklepId")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn5, sklepPrtMag.FindProperty("SklepTowId")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(cenaSpDetColumn0, sklepPrtMag.FindProperty("CenaSpDet")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(cenaZakColumn2, sklepPrtMag.FindProperty("CenaZak")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dataColumn7, sklepPrtMag.FindProperty("Data")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dataWaznColumn2, sklepPrtMag.FindProperty("DataWazn")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dostarczonoColumn0, sklepPrtMag.FindProperty("Dostarczono")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(kolejnyWDniuColumn2, sklepPrtMag.FindProperty("KolejnyWDniu")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(nrDostawyColumn0, sklepPrtMag.FindProperty("NrDostawy")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(nrPartiiColumn0, sklepPrtMag.FindProperty("NrPartii")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(nrPozycjiColumn2, sklepPrtMag.FindProperty("NrPozycji")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pozostaloColumn2, sklepPrtMag.FindProperty("Pozostalo")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(rezerwacjaColumn0, sklepPrtMag.FindProperty("Rezerwacja")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn10, sklepPrtMag.FindProperty("SklepKontrId")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn5, sklepPrtMag.FindProperty("SklepMagId")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(statusColumn6, sklepPrtMag.FindProperty("Status")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn10, sklepPrtMag.FindProperty("Stawka")!, sklepPrtMagTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn49, sklepPrtMag.FindProperty("Zmiana")!, sklepPrtMagTableMapping); + + var sklepRapWartPocz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz")!; + + var defaultTableMappings212 = new List>(); + sklepRapWartPocz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings212); + var blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz", null, relationalModel); + var aktywnyColumnBase40 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Aktywny", aktywnyColumnBase40); + var dataColumnBase8 = new ColumnBase("Data", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Data", dataColumnBase8); + var param1ColumnBase9 = new ColumnBase("Param1", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Param1", param1ColumnBase9); + var param2ColumnBase6 = new ColumnBase("Param2", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Param2", param2ColumnBase6); + var param3ColumnBase4 = new ColumnBase("Param3", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Param3", param3ColumnBase4); + var paramTxtColumnBase0 = new ColumnBase("ParamTxt", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("ParamTxt", paramTxtColumnBase0); + var sklepIdColumnBase57 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("SklepId", sklepIdColumnBase57); + var sklepRWPIdColumnBase = new ColumnBase("SklepRWPId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("SklepRWPId", sklepRWPIdColumnBase); + var typRapColumnBase0 = new ColumnBase("TypRap", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("TypRap", typRapColumnBase0); + var wersjaColumnBase3 = new ColumnBase("Wersja", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Wersja", wersjaColumnBase3); + var wykonanoColumnBase0 = new ColumnBase("Wykonano", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Wykonano", wykonanoColumnBase0); + var zmianaColumnBase50 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.Columns.Add("Zmiana", zmianaColumnBase50); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase = new TableMappingBase(sklepRapWartPocz, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase, false); + defaultTableMappings212.Add(blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase57, sklepRapWartPocz.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRWPIdColumnBase, sklepRapWartPocz.FindProperty("SklepRWPId")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase40, sklepRapWartPocz.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataColumnBase8, sklepRapWartPocz.FindProperty("Data")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase9, sklepRapWartPocz.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase6, sklepRapWartPocz.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase4, sklepRapWartPocz.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramTxtColumnBase0, sklepRapWartPocz.FindProperty("ParamTxt")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typRapColumnBase0, sklepRapWartPocz.FindProperty("TypRap")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase3, sklepRapWartPocz.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wykonanoColumnBase0, sklepRapWartPocz.FindProperty("Wykonano")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase50, sklepRapWartPocz.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczMappingBase); + + var tableMappings212 = new List(); + sklepRapWartPocz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings212); + var sklepRapWartPoczTable = new Table("SklepRapWartPocz", null, relationalModel); + var sklepIdColumn57 = new Column("SklepId", "numeric(9,0)", sklepRapWartPoczTable); + sklepRapWartPoczTable.Columns.Add("SklepId", sklepIdColumn57); + var sklepRWPIdColumn = new Column("SklepRWPId", "numeric(9,0)", sklepRapWartPoczTable); + sklepRapWartPoczTable.Columns.Add("SklepRWPId", sklepRWPIdColumn); + var aktywnyColumn40 = new Column("Aktywny", "smallint", sklepRapWartPoczTable); + sklepRapWartPoczTable.Columns.Add("Aktywny", aktywnyColumn40); + var dataColumn8 = new Column("Data", "datetime", sklepRapWartPoczTable); + sklepRapWartPoczTable.Columns.Add("Data", dataColumn8); + var param1Column9 = new Column("Param1", "smallint", sklepRapWartPoczTable) + { + IsNullable = true + }; + sklepRapWartPoczTable.Columns.Add("Param1", param1Column9); + var param2Column6 = new Column("Param2", "smallint", sklepRapWartPoczTable) + { + IsNullable = true + }; + sklepRapWartPoczTable.Columns.Add("Param2", param2Column6); + var param3Column4 = new Column("Param3", "smallint", sklepRapWartPoczTable) + { + IsNullable = true + }; + sklepRapWartPoczTable.Columns.Add("Param3", param3Column4); + var paramTxtColumn0 = new Column("ParamTxt", "varchar(120)", sklepRapWartPoczTable) + { + IsNullable = true + }; + sklepRapWartPoczTable.Columns.Add("ParamTxt", paramTxtColumn0); + var typRapColumn0 = new Column("TypRap", "smallint", sklepRapWartPoczTable); + sklepRapWartPoczTable.Columns.Add("TypRap", typRapColumn0); + var wersjaColumn3 = new Column("Wersja", "smallint", sklepRapWartPoczTable) + { + IsNullable = true + }; + sklepRapWartPoczTable.Columns.Add("Wersja", wersjaColumn3); + var wykonanoColumn0 = new Column("Wykonano", "datetime", sklepRapWartPoczTable); + sklepRapWartPoczTable.Columns.Add("Wykonano", wykonanoColumn0); + var zmianaColumn50 = new Column("Zmiana", "datetime", sklepRapWartPoczTable); + sklepRapWartPoczTable.Columns.Add("Zmiana", zmianaColumn50); + var pK_SKLEPRAPWARTPOCZ = new UniqueConstraint("PK_SKLEPRAPWARTPOCZ", sklepRapWartPoczTable, new[] { sklepIdColumn57, sklepRWPIdColumn }); + sklepRapWartPoczTable.PrimaryKey = pK_SKLEPRAPWARTPOCZ; + var pK_SKLEPRAPWARTPOCZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz", + new[] { "SklepId", "SklepRWPId" }); + pK_SKLEPRAPWARTPOCZ.MappedKeys.Add(pK_SKLEPRAPWARTPOCZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPRAPWARTPOCZUc).Add(pK_SKLEPRAPWARTPOCZ); + sklepRapWartPoczTable.UniqueConstraints.Add("PK_SKLEPRAPWARTPOCZ", pK_SKLEPRAPWARTPOCZ); + var idx_SRWP_TypRapData = new TableIndex( + "idx_SRWP_TypRapData", sklepRapWartPoczTable, new[] { sklepIdColumn57, typRapColumn0, dataColumn8 }, false); + var idx_SRWP_TypRapDataIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz", + "idx_SRWP_TypRapData"); + idx_SRWP_TypRapData.MappedIndexes.Add(idx_SRWP_TypRapDataIx); + RelationalModel.GetOrCreateTableIndexes(idx_SRWP_TypRapDataIx).Add(idx_SRWP_TypRapData); + sklepRapWartPoczTable.Indexes.Add("idx_SRWP_TypRapData", idx_SRWP_TypRapData); + relationalModel.Tables.Add(("SklepRapWartPocz", null), sklepRapWartPoczTable); + var sklepRapWartPoczTableMapping = new TableMapping(sklepRapWartPocz, sklepRapWartPoczTable, true); + sklepRapWartPoczTable.AddTypeMapping(sklepRapWartPoczTableMapping, false); + tableMappings212.Add(sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn57, sklepRapWartPocz.FindProperty("SklepId")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(sklepRWPIdColumn, sklepRapWartPocz.FindProperty("SklepRWPId")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn40, sklepRapWartPocz.FindProperty("Aktywny")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(dataColumn8, sklepRapWartPocz.FindProperty("Data")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(param1Column9, sklepRapWartPocz.FindProperty("Param1")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(param2Column6, sklepRapWartPocz.FindProperty("Param2")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(param3Column4, sklepRapWartPocz.FindProperty("Param3")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(paramTxtColumn0, sklepRapWartPocz.FindProperty("ParamTxt")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(typRapColumn0, sklepRapWartPocz.FindProperty("TypRap")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn3, sklepRapWartPocz.FindProperty("Wersja")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(wykonanoColumn0, sklepRapWartPocz.FindProperty("Wykonano")!, sklepRapWartPoczTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn50, sklepRapWartPocz.FindProperty("Zmiana")!, sklepRapWartPoczTableMapping); + + var sklepRapWartPoczDane = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane")!; + + var defaultTableMappings213 = new List>(); + sklepRapWartPoczDane.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings213); + var blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane", null, relationalModel); + var numerColumnBase10 = new ColumnBase("Numer", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase.Columns.Add("Numer", numerColumnBase10); + var sklepIdColumnBase58 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase.Columns.Add("SklepId", sklepIdColumnBase58); + var sklepMagIdColumnBase6 = new ColumnBase("SklepMagId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase.Columns.Add("SklepMagId", sklepMagIdColumnBase6); + var sklepRWPIdColumnBase0 = new ColumnBase("SklepRWPId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase.Columns.Add("SklepRWPId", sklepRWPIdColumnBase0); + var typColumnBase32 = new ColumnBase("Typ", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase.Columns.Add("Typ", typColumnBase32); + var wartoscColumnBase14 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase.Columns.Add("Wartosc", wartoscColumnBase14); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane", blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase = new TableMappingBase(sklepRapWartPoczDane, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase, false); + defaultTableMappings213.Add(blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)numerColumnBase10, sklepRapWartPoczDane.FindProperty("Numer")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase58, sklepRapWartPoczDane.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepMagIdColumnBase6, sklepRapWartPoczDane.FindProperty("SklepMagId")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRWPIdColumnBase0, sklepRapWartPoczDane.FindProperty("SklepRWPId")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase32, sklepRapWartPoczDane.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase14, sklepRapWartPoczDane.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRapWartPoczDaneMappingBase); + + var tableMappings213 = new List(); + sklepRapWartPoczDane.SetRuntimeAnnotation("Relational:TableMappings", tableMappings213); + var sklepRapWartPoczDaneTable = new Table("SklepRapWartPoczDane", null, relationalModel); + var sklepIdColumn58 = new Column("SklepId", "numeric(9,0)", sklepRapWartPoczDaneTable); + sklepRapWartPoczDaneTable.Columns.Add("SklepId", sklepIdColumn58); + var sklepRWPIdColumn0 = new Column("SklepRWPId", "numeric(9,0)", sklepRapWartPoczDaneTable); + sklepRapWartPoczDaneTable.Columns.Add("SklepRWPId", sklepRWPIdColumn0); + var sklepMagIdColumn6 = new Column("SklepMagId", "numeric(9,0)", sklepRapWartPoczDaneTable); + sklepRapWartPoczDaneTable.Columns.Add("SklepMagId", sklepMagIdColumn6); + var typColumn32 = new Column("Typ", "numeric(9,0)", sklepRapWartPoczDaneTable); + sklepRapWartPoczDaneTable.Columns.Add("Typ", typColumn32); + var numerColumn10 = new Column("Numer", "smallint", sklepRapWartPoczDaneTable); + sklepRapWartPoczDaneTable.Columns.Add("Numer", numerColumn10); + var wartoscColumn14 = new Column("Wartosc", "decimal(15,4)", sklepRapWartPoczDaneTable); + sklepRapWartPoczDaneTable.Columns.Add("Wartosc", wartoscColumn14); + var pK_SKLEPRAPWARTPOCZDANE = new UniqueConstraint("PK_SKLEPRAPWARTPOCZDANE", sklepRapWartPoczDaneTable, new[] { sklepIdColumn58, sklepRWPIdColumn0, sklepMagIdColumn6, typColumn32, numerColumn10 }); + sklepRapWartPoczDaneTable.PrimaryKey = pK_SKLEPRAPWARTPOCZDANE; + var pK_SKLEPRAPWARTPOCZDANEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane", + new[] { "SklepId", "SklepRWPId", "SklepMagId", "Typ", "Numer" }); + pK_SKLEPRAPWARTPOCZDANE.MappedKeys.Add(pK_SKLEPRAPWARTPOCZDANEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPRAPWARTPOCZDANEUc).Add(pK_SKLEPRAPWARTPOCZDANE); + sklepRapWartPoczDaneTable.UniqueConstraints.Add("PK_SKLEPRAPWARTPOCZDANE", pK_SKLEPRAPWARTPOCZDANE); + var iX_SklepRapWartPoczDane_SklepId_SklepMagId = new TableIndex( + "IX_SklepRapWartPoczDane_SklepId_SklepMagId", sklepRapWartPoczDaneTable, new[] { sklepIdColumn58, sklepMagIdColumn6 }, false); + var iX_SklepRapWartPoczDane_SklepId_SklepMagIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane", + new[] { "SklepId", "SklepMagId" }); + iX_SklepRapWartPoczDane_SklepId_SklepMagId.MappedIndexes.Add(iX_SklepRapWartPoczDane_SklepId_SklepMagIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepRapWartPoczDane_SklepId_SklepMagIdIx).Add(iX_SklepRapWartPoczDane_SklepId_SklepMagId); + sklepRapWartPoczDaneTable.Indexes.Add("IX_SklepRapWartPoczDane_SklepId_SklepMagId", iX_SklepRapWartPoczDane_SklepId_SklepMagId); + relationalModel.Tables.Add(("SklepRapWartPoczDane", null), sklepRapWartPoczDaneTable); + var sklepRapWartPoczDaneTableMapping = new TableMapping(sklepRapWartPoczDane, sklepRapWartPoczDaneTable, true); + sklepRapWartPoczDaneTable.AddTypeMapping(sklepRapWartPoczDaneTableMapping, false); + tableMappings213.Add(sklepRapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(numerColumn10, sklepRapWartPoczDane.FindProperty("Numer")!, sklepRapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn58, sklepRapWartPoczDane.FindProperty("SklepId")!, sklepRapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(sklepMagIdColumn6, sklepRapWartPoczDane.FindProperty("SklepMagId")!, sklepRapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(sklepRWPIdColumn0, sklepRapWartPoczDane.FindProperty("SklepRWPId")!, sklepRapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(typColumn32, sklepRapWartPoczDane.FindProperty("Typ")!, sklepRapWartPoczDaneTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn14, sklepRapWartPoczDane.FindProperty("Wartosc")!, sklepRapWartPoczDaneTableMapping); + + var sklepRegula = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegula")!; + + var defaultTableMappings214 = new List>(); + sklepRegula.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings214); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", null, relationalModel); + var aktywnyColumnBase41 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Aktywny", aktywnyColumnBase41); + var centrRegulaIdColumnBase0 = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase0); + var dataCzasDoColumnBase0 = new ColumnBase("DataCzasDo", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("DataCzasDo", dataCzasDoColumnBase0); + var dataCzasOdColumnBase0 = new ColumnBase("DataCzasOd", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("DataCzasOd", dataCzasOdColumnBase0); + var int1ColumnBase0 = new ColumnBase("Int1", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Int1", int1ColumnBase0); + var int2ColumnBase0 = new ColumnBase("Int2", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Int2", int2ColumnBase0); + var int3ColumnBase0 = new ColumnBase("Int3", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Int3", int3ColumnBase0); + var int4ColumnBase0 = new ColumnBase("Int4", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Int4", int4ColumnBase0); + var nazwaColumnBase50 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Nazwa", nazwaColumnBase50); + var number1ColumnBase0 = new ColumnBase("Number1", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Number1", number1ColumnBase0); + var number2ColumnBase0 = new ColumnBase("Number2", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Number2", number2ColumnBase0); + var number3ColumnBase0 = new ColumnBase("Number3", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Number3", number3ColumnBase0); + var number4ColumnBase0 = new ColumnBase("Number4", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Number4", number4ColumnBase0); + var priorytetColumnBase1 = new ColumnBase("Priorytet", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Priorytet", priorytetColumnBase1); + var sklepIdColumnBase59 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("SklepId", sklepIdColumnBase59); + var sklepRegulaIdColumnBase = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase); + var str1ColumnBase0 = new ColumnBase("Str1", "varchar(128)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Str1", str1ColumnBase0); + var str2ColumnBase0 = new ColumnBase("Str2", "varchar(128)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Str2", str2ColumnBase0); + var typColumnBase33 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Typ", typColumnBase33); + var typKartyColumnBase2 = new ColumnBase("TypKarty", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("TypKarty", typKartyColumnBase2); + var usunietoColumnBase0 = new ColumnBase("Usunieto", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Usunieto", usunietoColumnBase0); + var utworzonoColumnBase1 = new ColumnBase("Utworzono", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Utworzono", utworzonoColumnBase1); + var zmianaColumnBase51 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.Columns.Add("Zmiana", zmianaColumnBase51); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase = new TableMappingBase(sklepRegula, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase, false); + defaultTableMappings214.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase59, sklepRegula.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase, sklepRegula.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase41, sklepRegula.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase0, sklepRegula.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasDoColumnBase0, sklepRegula.FindProperty("DataCzasDo")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasOdColumnBase0, sklepRegula.FindProperty("DataCzasOd")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int1ColumnBase0, sklepRegula.FindProperty("Int1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int2ColumnBase0, sklepRegula.FindProperty("Int2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int3ColumnBase0, sklepRegula.FindProperty("Int3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int4ColumnBase0, sklepRegula.FindProperty("Int4")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase50, sklepRegula.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number1ColumnBase0, sklepRegula.FindProperty("Number1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number2ColumnBase0, sklepRegula.FindProperty("Number2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number3ColumnBase0, sklepRegula.FindProperty("Number3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)number4ColumnBase0, sklepRegula.FindProperty("Number4")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)priorytetColumnBase1, sklepRegula.FindProperty("Priorytet")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)str1ColumnBase0, sklepRegula.FindProperty("Str1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)str2ColumnBase0, sklepRegula.FindProperty("Str2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase33, sklepRegula.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKartyColumnBase2, sklepRegula.FindProperty("TypKarty")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)usunietoColumnBase0, sklepRegula.FindProperty("Usunieto")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonoColumnBase1, sklepRegula.FindProperty("Utworzono")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase51, sklepRegula.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaMappingBase); + + var tableMappings214 = new List(); + sklepRegula.SetRuntimeAnnotation("Relational:TableMappings", tableMappings214); + var sklepRegulaTable = new Table("SklepRegula", null, relationalModel); + var sklepIdColumn59 = new Column("SklepId", "numeric(9,0)", sklepRegulaTable); + sklepRegulaTable.Columns.Add("SklepId", sklepIdColumn59); + var sklepRegulaIdColumn = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaTable); + sklepRegulaTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn); + var aktywnyColumn41 = new Column("Aktywny", "smallint", sklepRegulaTable); + sklepRegulaTable.Columns.Add("Aktywny", aktywnyColumn41); + var centrRegulaIdColumn0 = new Column("CentrRegulaId", "numeric(9,0)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn0); + var dataCzasDoColumn0 = new Column("DataCzasDo", "datetime", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("DataCzasDo", dataCzasDoColumn0); + var dataCzasOdColumn0 = new Column("DataCzasOd", "datetime", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("DataCzasOd", dataCzasOdColumn0); + var int1Column0 = new Column("Int1", "int", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Int1", int1Column0); + var int2Column0 = new Column("Int2", "int", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Int2", int2Column0); + var int3Column0 = new Column("Int3", "int", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Int3", int3Column0); + var int4Column0 = new Column("Int4", "int", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Int4", int4Column0); + var nazwaColumn50 = new Column("Nazwa", "varchar(40)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Nazwa", nazwaColumn50); + var number1Column0 = new Column("Number1", "numeric(16,4)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Number1", number1Column0); + var number2Column0 = new Column("Number2", "numeric(16,4)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Number2", number2Column0); + var number3Column0 = new Column("Number3", "numeric(16,4)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Number3", number3Column0); + var number4Column0 = new Column("Number4", "numeric(16,4)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Number4", number4Column0); + var priorytetColumn1 = new Column("Priorytet", "smallint", sklepRegulaTable); + sklepRegulaTable.Columns.Add("Priorytet", priorytetColumn1); + var str1Column0 = new Column("Str1", "varchar(128)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Str1", str1Column0); + var str2Column0 = new Column("Str2", "varchar(128)", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Str2", str2Column0); + var typColumn33 = new Column("Typ", "smallint", sklepRegulaTable); + sklepRegulaTable.Columns.Add("Typ", typColumn33); + var typKartyColumn2 = new Column("TypKarty", "smallint", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("TypKarty", typKartyColumn2); + var usunietoColumn0 = new Column("Usunieto", "datetime", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Usunieto", usunietoColumn0); + var utworzonoColumn1 = new Column("Utworzono", "datetime", sklepRegulaTable) + { + IsNullable = true + }; + sklepRegulaTable.Columns.Add("Utworzono", utworzonoColumn1); + var zmianaColumn51 = new Column("Zmiana", "datetime", sklepRegulaTable); + sklepRegulaTable.Columns.Add("Zmiana", zmianaColumn51); + var pK_SKLEPREGULA = new UniqueConstraint("PK_SKLEPREGULA", sklepRegulaTable, new[] { sklepIdColumn59, sklepRegulaIdColumn }); + sklepRegulaTable.PrimaryKey = pK_SKLEPREGULA; + var pK_SKLEPREGULAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + new[] { "SklepId", "SklepRegulaId" }); + pK_SKLEPREGULA.MappedKeys.Add(pK_SKLEPREGULAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULAUc).Add(pK_SKLEPREGULA); + sklepRegulaTable.UniqueConstraints.Add("PK_SKLEPREGULA", pK_SKLEPREGULA); + relationalModel.Tables.Add(("SklepRegula", null), sklepRegulaTable); + var sklepRegulaTableMapping = new TableMapping(sklepRegula, sklepRegulaTable, true); + sklepRegulaTable.AddTypeMapping(sklepRegulaTableMapping, false); + tableMappings214.Add(sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn59, sklepRegula.FindProperty("SklepId")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn, sklepRegula.FindProperty("SklepRegulaId")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn41, sklepRegula.FindProperty("Aktywny")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn0, sklepRegula.FindProperty("CentrRegulaId")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(dataCzasDoColumn0, sklepRegula.FindProperty("DataCzasDo")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(dataCzasOdColumn0, sklepRegula.FindProperty("DataCzasOd")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(int1Column0, sklepRegula.FindProperty("Int1")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(int2Column0, sklepRegula.FindProperty("Int2")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(int3Column0, sklepRegula.FindProperty("Int3")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(int4Column0, sklepRegula.FindProperty("Int4")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn50, sklepRegula.FindProperty("Nazwa")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(number1Column0, sklepRegula.FindProperty("Number1")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(number2Column0, sklepRegula.FindProperty("Number2")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(number3Column0, sklepRegula.FindProperty("Number3")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(number4Column0, sklepRegula.FindProperty("Number4")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(priorytetColumn1, sklepRegula.FindProperty("Priorytet")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(str1Column0, sklepRegula.FindProperty("Str1")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(str2Column0, sklepRegula.FindProperty("Str2")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(typColumn33, sklepRegula.FindProperty("Typ")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(typKartyColumn2, sklepRegula.FindProperty("TypKarty")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(usunietoColumn0, sklepRegula.FindProperty("Usunieto")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(utworzonoColumn1, sklepRegula.FindProperty("Utworzono")!, sklepRegulaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn51, sklepRegula.FindProperty("Zmiana")!, sklepRegulaTableMapping); + + var sklepRegulaAsort = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaAsort")!; + + var defaultTableMappings215 = new List>(); + sklepRegulaAsort.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings215); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaAsort", null, relationalModel); + var sklepAsIdColumnBase = new ColumnBase("SklepAsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase.Columns.Add("SklepAsId", sklepAsIdColumnBase); + var sklepAsNazwaColumnBase = new ColumnBase("SklepAsNazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase.Columns.Add("SklepAsNazwa", sklepAsNazwaColumnBase); + var sklepIdColumnBase60 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase.Columns.Add("SklepId", sklepIdColumnBase60); + var sklepRegulaIdColumnBase0 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase0); + var znaczenieColumnBase22 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase.Columns.Add("Znaczenie", znaczenieColumnBase22); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaAsort", blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase = new TableMappingBase(sklepRegulaAsort, blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase, false); + defaultTableMappings215.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepAsIdColumnBase, sklepRegulaAsort.FindProperty("SklepAsId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase60, sklepRegulaAsort.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase0, sklepRegulaAsort.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase22, sklepRegulaAsort.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepAsNazwaColumnBase, sklepRegulaAsort.FindProperty("SklepAsNazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaAsortMappingBase); + + var tableMappings215 = new List(); + sklepRegulaAsort.SetRuntimeAnnotation("Relational:TableMappings", tableMappings215); + var sklepRegulaAsortTable = new Table("SklepRegulaAsort", null, relationalModel); + var sklepIdColumn60 = new Column("SklepId", "numeric(9,0)", sklepRegulaAsortTable); + sklepRegulaAsortTable.Columns.Add("SklepId", sklepIdColumn60); + var sklepRegulaIdColumn0 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaAsortTable); + sklepRegulaAsortTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn0); + var sklepAsIdColumn = new Column("SklepAsId", "numeric(9,0)", sklepRegulaAsortTable); + sklepRegulaAsortTable.Columns.Add("SklepAsId", sklepAsIdColumn); + var znaczenieColumn22 = new Column("Znaczenie", "smallint", sklepRegulaAsortTable); + sklepRegulaAsortTable.Columns.Add("Znaczenie", znaczenieColumn22); + var sklepAsNazwaColumn = new Column("SklepAsNazwa", "varchar(40)", sklepRegulaAsortTable); + sklepRegulaAsortTable.Columns.Add("SklepAsNazwa", sklepAsNazwaColumn); + var pK_SKLEPREGULAASORT = new UniqueConstraint("PK_SKLEPREGULAASORT", sklepRegulaAsortTable, new[] { sklepIdColumn60, sklepRegulaIdColumn0, sklepAsIdColumn, znaczenieColumn22 }); + sklepRegulaAsortTable.PrimaryKey = pK_SKLEPREGULAASORT; + var pK_SKLEPREGULAASORTUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaAsort", + new[] { "SklepId", "SklepRegulaId", "SklepAsId", "Znaczenie" }); + pK_SKLEPREGULAASORT.MappedKeys.Add(pK_SKLEPREGULAASORTUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULAASORTUc).Add(pK_SKLEPREGULAASORT); + sklepRegulaAsortTable.UniqueConstraints.Add("PK_SKLEPREGULAASORT", pK_SKLEPREGULAASORT); + relationalModel.Tables.Add(("SklepRegulaAsort", null), sklepRegulaAsortTable); + var sklepRegulaAsortTableMapping = new TableMapping(sklepRegulaAsort, sklepRegulaAsortTable, true); + sklepRegulaAsortTable.AddTypeMapping(sklepRegulaAsortTableMapping, false); + tableMappings215.Add(sklepRegulaAsortTableMapping); + RelationalModel.CreateColumnMapping(sklepAsIdColumn, sklepRegulaAsort.FindProperty("SklepAsId")!, sklepRegulaAsortTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn60, sklepRegulaAsort.FindProperty("SklepId")!, sklepRegulaAsortTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn0, sklepRegulaAsort.FindProperty("SklepRegulaId")!, sklepRegulaAsortTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn22, sklepRegulaAsort.FindProperty("Znaczenie")!, sklepRegulaAsortTableMapping); + RelationalModel.CreateColumnMapping(sklepAsNazwaColumn, sklepRegulaAsort.FindProperty("SklepAsNazwa")!, sklepRegulaAsortTableMapping); + + var sklepRegulaDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok")!; + + var defaultTableMappings216 = new List>(); + sklepRegulaDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings216); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", null, relationalModel); + var centrRegulaIdColumnBase1 = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase1); + var kolejnoscColumnBase40 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase40); + var kontoIdColumnBase4 = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("KontoId", kontoIdColumnBase4); + var opcjaColumnBase1 = new ColumnBase("Opcja", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("Opcja", opcjaColumnBase1); + var opcja2ColumnBase5 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("Opcja2", opcja2ColumnBase5); + var sklepDokIdColumnBase7 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase7); + var sklepIdColumnBase61 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("SklepId", sklepIdColumnBase61); + var sklepKontoIdColumnBase1 = new ColumnBase("SklepKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("SklepKontoId", sklepKontoIdColumnBase1); + var sklepRegulaIdColumnBase1 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase1); + var tekstColumnBase16 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("Tekst", tekstColumnBase16); + var typRegulyColumnBase1 = new ColumnBase("TypReguly", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("TypReguly", typRegulyColumnBase1); + var wartoscColumnBase15 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("Wartosc", wartoscColumnBase15); + var wartosc2ColumnBase4 = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase4); + var wartosc3ColumnBase3 = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase = new TableMappingBase(sklepRegulaDok, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase, false); + defaultTableMappings216.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase40, sklepRegulaDok.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase7, sklepRegulaDok.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase61, sklepRegulaDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase1, sklepRegulaDok.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase1, sklepRegulaDok.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase4, sklepRegulaDok.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaColumnBase1, sklepRegulaDok.FindProperty("Opcja")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase5, sklepRegulaDok.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontoIdColumnBase1, sklepRegulaDok.FindProperty("SklepKontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase16, sklepRegulaDok.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typRegulyColumnBase1, sklepRegulaDok.FindProperty("TypReguly")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase15, sklepRegulaDok.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase4, sklepRegulaDok.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase3, sklepRegulaDok.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokMappingBase); + + var tableMappings216 = new List(); + sklepRegulaDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings216); + var sklepRegulaDokTable = new Table("SklepRegulaDok", null, relationalModel); + var sklepIdColumn61 = new Column("SklepId", "numeric(9,0)", sklepRegulaDokTable); + sklepRegulaDokTable.Columns.Add("SklepId", sklepIdColumn61); + var sklepDokIdColumn7 = new Column("SklepDokId", "numeric(9,0)", sklepRegulaDokTable); + sklepRegulaDokTable.Columns.Add("SklepDokId", sklepDokIdColumn7); + var sklepRegulaIdColumn1 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaDokTable); + sklepRegulaDokTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn1); + var kolejnoscColumn40 = new Column("Kolejnosc", "int", sklepRegulaDokTable); + sklepRegulaDokTable.Columns.Add("Kolejnosc", kolejnoscColumn40); + var centrRegulaIdColumn1 = new Column("CentrRegulaId", "numeric(9,0)", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn1); + var kontoIdColumn4 = new Column("KontoId", "numeric(9,0)", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("KontoId", kontoIdColumn4); + var opcjaColumn1 = new Column("Opcja", "smallint", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("Opcja", opcjaColumn1); + var opcja2Column5 = new Column("Opcja2", "smallint", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("Opcja2", opcja2Column5); + var sklepKontoIdColumn1 = new Column("SklepKontoId", "numeric(9,0)", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("SklepKontoId", sklepKontoIdColumn1); + var tekstColumn16 = new Column("Tekst", "varchar(255)", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("Tekst", tekstColumn16); + var typRegulyColumn1 = new Column("TypReguly", "smallint", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("TypReguly", typRegulyColumn1); + var wartoscColumn15 = new Column("Wartosc", "decimal(15,4)", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("Wartosc", wartoscColumn15); + var wartosc2Column4 = new Column("Wartosc2", "decimal(15,4)", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("Wartosc2", wartosc2Column4); + var wartosc3Column3 = new Column("Wartosc3", "decimal(15,4)", sklepRegulaDokTable) + { + IsNullable = true + }; + sklepRegulaDokTable.Columns.Add("Wartosc3", wartosc3Column3); + var pK_SKLEPREGULADOK = new UniqueConstraint("PK_SKLEPREGULADOK", sklepRegulaDokTable, new[] { sklepIdColumn61, sklepDokIdColumn7, sklepRegulaIdColumn1, kolejnoscColumn40 }); + sklepRegulaDokTable.PrimaryKey = pK_SKLEPREGULADOK; + var pK_SKLEPREGULADOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", + new[] { "SklepId", "SklepDokId", "SklepRegulaId", "Kolejnosc" }); + pK_SKLEPREGULADOK.MappedKeys.Add(pK_SKLEPREGULADOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULADOKUc).Add(pK_SKLEPREGULADOK); + sklepRegulaDokTable.UniqueConstraints.Add("PK_SKLEPREGULADOK", pK_SKLEPREGULADOK); + var iX_SklepRegulaDok_KontoId = new TableIndex( + "IX_SklepRegulaDok_KontoId", sklepRegulaDokTable, new[] { kontoIdColumn4 }, false); + var iX_SklepRegulaDok_KontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", + new[] { "KontoId" }); + iX_SklepRegulaDok_KontoId.MappedIndexes.Add(iX_SklepRegulaDok_KontoIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepRegulaDok_KontoIdIx).Add(iX_SklepRegulaDok_KontoId); + sklepRegulaDokTable.Indexes.Add("IX_SklepRegulaDok_KontoId", iX_SklepRegulaDok_KontoId); + relationalModel.Tables.Add(("SklepRegulaDok", null), sklepRegulaDokTable); + var sklepRegulaDokTableMapping = new TableMapping(sklepRegulaDok, sklepRegulaDokTable, true); + sklepRegulaDokTable.AddTypeMapping(sklepRegulaDokTableMapping, false); + tableMappings216.Add(sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn40, sklepRegulaDok.FindProperty("Kolejnosc")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn7, sklepRegulaDok.FindProperty("SklepDokId")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn61, sklepRegulaDok.FindProperty("SklepId")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn1, sklepRegulaDok.FindProperty("SklepRegulaId")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn1, sklepRegulaDok.FindProperty("CentrRegulaId")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn4, sklepRegulaDok.FindProperty("KontoId")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(opcjaColumn1, sklepRegulaDok.FindProperty("Opcja")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column5, sklepRegulaDok.FindProperty("Opcja2")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(sklepKontoIdColumn1, sklepRegulaDok.FindProperty("SklepKontoId")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn16, sklepRegulaDok.FindProperty("Tekst")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(typRegulyColumn1, sklepRegulaDok.FindProperty("TypReguly")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn15, sklepRegulaDok.FindProperty("Wartosc")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column4, sklepRegulaDok.FindProperty("Wartosc2")!, sklepRegulaDokTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column3, sklepRegulaDok.FindProperty("Wartosc3")!, sklepRegulaDokTableMapping); + + var sklepRegulaDokSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDokSzczeg")!; + + var defaultTableMappings217 = new List>(); + sklepRegulaDokSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings217); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDokSzczeg", null, relationalModel); + var kolejnoscColumnBase41 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase41); + var param1ColumnBase10 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("Param1", param1ColumnBase10); + var param2ColumnBase7 = new ColumnBase("Param2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("Param2", param2ColumnBase7); + var param3ColumnBase5 = new ColumnBase("Param3", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("Param3", param3ColumnBase5); + var sklepDokIdColumnBase8 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase8); + var sklepIdColumnBase62 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("SklepId", sklepIdColumnBase62); + var sklepRegulaIdColumnBase2 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase2); + var znaczenieColumnBase23 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.Columns.Add("Znaczenie", znaczenieColumnBase23); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDokSzczeg", blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase = new TableMappingBase(sklepRegulaDokSzczeg, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase, false); + defaultTableMappings217.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase41, sklepRegulaDokSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase8, sklepRegulaDokSzczeg.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase62, sklepRegulaDokSzczeg.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase2, sklepRegulaDokSzczeg.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase23, sklepRegulaDokSzczeg.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase10, sklepRegulaDokSzczeg.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase7, sklepRegulaDokSzczeg.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase5, sklepRegulaDokSzczeg.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaDokSzczegMappingBase); + + var tableMappings217 = new List(); + sklepRegulaDokSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings217); + var sklepRegulaDokSzczegTable = new Table("SklepRegulaDokSzczeg", null, relationalModel); + var sklepIdColumn62 = new Column("SklepId", "numeric(9,0)", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("SklepId", sklepIdColumn62); + var sklepDokIdColumn8 = new Column("SklepDokId", "numeric(9,0)", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("SklepDokId", sklepDokIdColumn8); + var sklepRegulaIdColumn2 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn2); + var kolejnoscColumn41 = new Column("Kolejnosc", "int", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn41); + var znaczenieColumn23 = new Column("Znaczenie", "smallint", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("Znaczenie", znaczenieColumn23); + var param1Column10 = new Column("Param1", "int", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("Param1", param1Column10); + var param2Column7 = new Column("Param2", "decimal(15,4)", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("Param2", param2Column7); + var param3Column5 = new Column("Param3", "varchar(255)", sklepRegulaDokSzczegTable); + sklepRegulaDokSzczegTable.Columns.Add("Param3", param3Column5); + var pK_SKLREGULADOKSZCZEG = new UniqueConstraint("PK_SKLREGULADOKSZCZEG", sklepRegulaDokSzczegTable, new[] { sklepIdColumn62, sklepDokIdColumn8, sklepRegulaIdColumn2, kolejnoscColumn41, znaczenieColumn23 }); + sklepRegulaDokSzczegTable.PrimaryKey = pK_SKLREGULADOKSZCZEG; + var pK_SKLREGULADOKSZCZEGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDokSzczeg", + new[] { "SklepId", "SklepDokId", "SklepRegulaId", "Kolejnosc", "Znaczenie" }); + pK_SKLREGULADOKSZCZEG.MappedKeys.Add(pK_SKLREGULADOKSZCZEGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLREGULADOKSZCZEGUc).Add(pK_SKLREGULADOKSZCZEG); + sklepRegulaDokSzczegTable.UniqueConstraints.Add("PK_SKLREGULADOKSZCZEG", pK_SKLREGULADOKSZCZEG); + relationalModel.Tables.Add(("SklepRegulaDokSzczeg", null), sklepRegulaDokSzczegTable); + var sklepRegulaDokSzczegTableMapping = new TableMapping(sklepRegulaDokSzczeg, sklepRegulaDokSzczegTable, true); + sklepRegulaDokSzczegTable.AddTypeMapping(sklepRegulaDokSzczegTableMapping, false); + tableMappings217.Add(sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn41, sklepRegulaDokSzczeg.FindProperty("Kolejnosc")!, sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn8, sklepRegulaDokSzczeg.FindProperty("SklepDokId")!, sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn62, sklepRegulaDokSzczeg.FindProperty("SklepId")!, sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn2, sklepRegulaDokSzczeg.FindProperty("SklepRegulaId")!, sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn23, sklepRegulaDokSzczeg.FindProperty("Znaczenie")!, sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(param1Column10, sklepRegulaDokSzczeg.FindProperty("Param1")!, sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(param2Column7, sklepRegulaDokSzczeg.FindProperty("Param2")!, sklepRegulaDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(param3Column5, sklepRegulaDokSzczeg.FindProperty("Param3")!, sklepRegulaDokSzczegTableMapping); + + var sklepRegulaKod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaKod")!; + + var defaultTableMappings218 = new List>(); + sklepRegulaKod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings218); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaKod", null, relationalModel); + var cenaColumnBase3 = new ColumnBase("Cena", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("Cena", cenaColumnBase3); + var iloscColumnBase5 = new ColumnBase("Ilosc", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("Ilosc", iloscColumnBase5); + var informacjaColumnBase0 = new ColumnBase("Informacja", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("Informacja", informacjaColumnBase0); + var kodColumnBase14 = new ColumnBase("Kod", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("Kod", kodColumnBase14); + var nazwaTowaruColumnBase0 = new ColumnBase("NazwaTowaru", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("NazwaTowaru", nazwaTowaruColumnBase0); + var parametrColumnBase2 = new ColumnBase("Parametr", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("Parametr", parametrColumnBase2); + var sklepIdColumnBase63 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("SklepId", sklepIdColumnBase63); + var sklepRegulaIdColumnBase3 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase3); + var znaczenieColumnBase24 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.Columns.Add("Znaczenie", znaczenieColumnBase24); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaKod", blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase = new TableMappingBase(sklepRegulaKod, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase, false); + defaultTableMappings218.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase14, sklepRegulaKod.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase63, sklepRegulaKod.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase3, sklepRegulaKod.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase24, sklepRegulaKod.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase3, sklepRegulaKod.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase5, sklepRegulaKod.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)informacjaColumnBase0, sklepRegulaKod.FindProperty("Informacja")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaTowaruColumnBase0, sklepRegulaKod.FindProperty("NazwaTowaru")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parametrColumnBase2, sklepRegulaKod.FindProperty("Parametr")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaKodMappingBase); + + var tableMappings218 = new List(); + sklepRegulaKod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings218); + var sklepRegulaKodTable = new Table("SklepRegulaKod", null, relationalModel); + var sklepIdColumn63 = new Column("SklepId", "numeric(9,0)", sklepRegulaKodTable); + sklepRegulaKodTable.Columns.Add("SklepId", sklepIdColumn63); + var sklepRegulaIdColumn3 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaKodTable); + sklepRegulaKodTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn3); + var kodColumn14 = new Column("Kod", "varchar(40)", sklepRegulaKodTable); + sklepRegulaKodTable.Columns.Add("Kod", kodColumn14); + var znaczenieColumn24 = new Column("Znaczenie", "smallint", sklepRegulaKodTable); + sklepRegulaKodTable.Columns.Add("Znaczenie", znaczenieColumn24); + var cenaColumn3 = new Column("Cena", "numeric(16,4)", sklepRegulaKodTable) + { + IsNullable = true + }; + sklepRegulaKodTable.Columns.Add("Cena", cenaColumn3); + var iloscColumn5 = new Column("Ilosc", "numeric(16,4)", sklepRegulaKodTable) + { + IsNullable = true + }; + sklepRegulaKodTable.Columns.Add("Ilosc", iloscColumn5); + var informacjaColumn0 = new Column("Informacja", "varchar(40)", sklepRegulaKodTable) + { + IsNullable = true + }; + sklepRegulaKodTable.Columns.Add("Informacja", informacjaColumn0); + var nazwaTowaruColumn0 = new Column("NazwaTowaru", "varchar(255)", sklepRegulaKodTable) + { + IsNullable = true + }; + sklepRegulaKodTable.Columns.Add("NazwaTowaru", nazwaTowaruColumn0); + var parametrColumn2 = new Column("Parametr", "int", sklepRegulaKodTable) + { + IsNullable = true + }; + sklepRegulaKodTable.Columns.Add("Parametr", parametrColumn2); + var pK_SklepRegulaKod = new UniqueConstraint("PK_SklepRegulaKod", sklepRegulaKodTable, new[] { sklepIdColumn63, sklepRegulaIdColumn3, kodColumn14, znaczenieColumn24 }); + sklepRegulaKodTable.PrimaryKey = pK_SklepRegulaKod; + var pK_SklepRegulaKodUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaKod", + new[] { "SklepId", "SklepRegulaId", "Kod", "Znaczenie" }); + pK_SklepRegulaKod.MappedKeys.Add(pK_SklepRegulaKodUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepRegulaKodUc).Add(pK_SklepRegulaKod); + sklepRegulaKodTable.UniqueConstraints.Add("PK_SklepRegulaKod", pK_SklepRegulaKod); + relationalModel.Tables.Add(("SklepRegulaKod", null), sklepRegulaKodTable); + var sklepRegulaKodTableMapping = new TableMapping(sklepRegulaKod, sklepRegulaKodTable, true); + sklepRegulaKodTable.AddTypeMapping(sklepRegulaKodTableMapping, false); + tableMappings218.Add(sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(kodColumn14, sklepRegulaKod.FindProperty("Kod")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn63, sklepRegulaKod.FindProperty("SklepId")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn3, sklepRegulaKod.FindProperty("SklepRegulaId")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn24, sklepRegulaKod.FindProperty("Znaczenie")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn3, sklepRegulaKod.FindProperty("Cena")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn5, sklepRegulaKod.FindProperty("Ilosc")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(informacjaColumn0, sklepRegulaKod.FindProperty("Informacja")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(nazwaTowaruColumn0, sklepRegulaKod.FindProperty("NazwaTowaru")!, sklepRegulaKodTableMapping); + RelationalModel.CreateColumnMapping(parametrColumn2, sklepRegulaKod.FindProperty("Parametr")!, sklepRegulaKodTableMapping); + + var sklepRegulaPar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar")!; + + var defaultTableMappings219 = new List>(); + sklepRegulaPar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings219); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", null, relationalModel); + var centrRegulaIdColumnBase2 = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase2); + var kolejnoscColumnBase42 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase42); + var kontoIdColumnBase5 = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("KontoId", kontoIdColumnBase5); + var opcjaColumnBase2 = new ColumnBase("Opcja", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("Opcja", opcjaColumnBase2); + var opcja2ColumnBase6 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("Opcja2", opcja2ColumnBase6); + var sklepIdColumnBase64 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("SklepId", sklepIdColumnBase64); + var sklepKontoIdColumnBase2 = new ColumnBase("SklepKontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("SklepKontoId", sklepKontoIdColumnBase2); + var sklepParIdColumnBase5 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("SklepParId", sklepParIdColumnBase5); + var sklepRegulaIdColumnBase4 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase4); + var tekstColumnBase17 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("Tekst", tekstColumnBase17); + var typRegulyColumnBase2 = new ColumnBase("TypReguly", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("TypReguly", typRegulyColumnBase2); + var wartoscColumnBase16 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("Wartosc", wartoscColumnBase16); + var wartosc2ColumnBase5 = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase5); + var wartosc3ColumnBase4 = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase = new TableMappingBase(sklepRegulaPar, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase, false); + defaultTableMappings219.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase42, sklepRegulaPar.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase64, sklepRegulaPar.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase5, sklepRegulaPar.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase4, sklepRegulaPar.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase2, sklepRegulaPar.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase5, sklepRegulaPar.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaColumnBase2, sklepRegulaPar.FindProperty("Opcja")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase6, sklepRegulaPar.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontoIdColumnBase2, sklepRegulaPar.FindProperty("SklepKontoId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase17, sklepRegulaPar.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typRegulyColumnBase2, sklepRegulaPar.FindProperty("TypReguly")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase16, sklepRegulaPar.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase5, sklepRegulaPar.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase4, sklepRegulaPar.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParMappingBase); + + var tableMappings219 = new List(); + sklepRegulaPar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings219); + var sklepRegulaParTable = new Table("SklepRegulaPar", null, relationalModel); + var sklepIdColumn64 = new Column("SklepId", "numeric(9,0)", sklepRegulaParTable); + sklepRegulaParTable.Columns.Add("SklepId", sklepIdColumn64); + var sklepParIdColumn5 = new Column("SklepParId", "numeric(9,0)", sklepRegulaParTable); + sklepRegulaParTable.Columns.Add("SklepParId", sklepParIdColumn5); + var sklepRegulaIdColumn4 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaParTable); + sklepRegulaParTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn4); + var kolejnoscColumn42 = new Column("Kolejnosc", "int", sklepRegulaParTable); + sklepRegulaParTable.Columns.Add("Kolejnosc", kolejnoscColumn42); + var centrRegulaIdColumn2 = new Column("CentrRegulaId", "numeric(9,0)", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn2); + var kontoIdColumn5 = new Column("KontoId", "numeric(9,0)", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("KontoId", kontoIdColumn5); + var opcjaColumn2 = new Column("Opcja", "smallint", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("Opcja", opcjaColumn2); + var opcja2Column6 = new Column("Opcja2", "smallint", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("Opcja2", opcja2Column6); + var sklepKontoIdColumn2 = new Column("SklepKontoId", "numeric(9,0)", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("SklepKontoId", sklepKontoIdColumn2); + var tekstColumn17 = new Column("Tekst", "varchar(255)", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("Tekst", tekstColumn17); + var typRegulyColumn2 = new Column("TypReguly", "smallint", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("TypReguly", typRegulyColumn2); + var wartoscColumn16 = new Column("Wartosc", "decimal(15,4)", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("Wartosc", wartoscColumn16); + var wartosc2Column5 = new Column("Wartosc2", "decimal(15,4)", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("Wartosc2", wartosc2Column5); + var wartosc3Column4 = new Column("Wartosc3", "decimal(15,4)", sklepRegulaParTable) + { + IsNullable = true + }; + sklepRegulaParTable.Columns.Add("Wartosc3", wartosc3Column4); + var pK_SKLEPREGULAPAR = new UniqueConstraint("PK_SKLEPREGULAPAR", sklepRegulaParTable, new[] { sklepIdColumn64, sklepParIdColumn5, sklepRegulaIdColumn4, kolejnoscColumn42 }); + sklepRegulaParTable.PrimaryKey = pK_SKLEPREGULAPAR; + var pK_SKLEPREGULAPARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", + new[] { "SklepId", "SklepParId", "SklepRegulaId", "Kolejnosc" }); + pK_SKLEPREGULAPAR.MappedKeys.Add(pK_SKLEPREGULAPARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULAPARUc).Add(pK_SKLEPREGULAPAR); + sklepRegulaParTable.UniqueConstraints.Add("PK_SKLEPREGULAPAR", pK_SKLEPREGULAPAR); + var iX_SklepRegulaPar_KontoId = new TableIndex( + "IX_SklepRegulaPar_KontoId", sklepRegulaParTable, new[] { kontoIdColumn5 }, false); + var iX_SklepRegulaPar_KontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", + new[] { "KontoId" }); + iX_SklepRegulaPar_KontoId.MappedIndexes.Add(iX_SklepRegulaPar_KontoIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepRegulaPar_KontoIdIx).Add(iX_SklepRegulaPar_KontoId); + sklepRegulaParTable.Indexes.Add("IX_SklepRegulaPar_KontoId", iX_SklepRegulaPar_KontoId); + relationalModel.Tables.Add(("SklepRegulaPar", null), sklepRegulaParTable); + var sklepRegulaParTableMapping = new TableMapping(sklepRegulaPar, sklepRegulaParTable, true); + sklepRegulaParTable.AddTypeMapping(sklepRegulaParTableMapping, false); + tableMappings219.Add(sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn42, sklepRegulaPar.FindProperty("Kolejnosc")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn64, sklepRegulaPar.FindProperty("SklepId")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn5, sklepRegulaPar.FindProperty("SklepParId")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn4, sklepRegulaPar.FindProperty("SklepRegulaId")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn2, sklepRegulaPar.FindProperty("CentrRegulaId")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn5, sklepRegulaPar.FindProperty("KontoId")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(opcjaColumn2, sklepRegulaPar.FindProperty("Opcja")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column6, sklepRegulaPar.FindProperty("Opcja2")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(sklepKontoIdColumn2, sklepRegulaPar.FindProperty("SklepKontoId")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn17, sklepRegulaPar.FindProperty("Tekst")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(typRegulyColumn2, sklepRegulaPar.FindProperty("TypReguly")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn16, sklepRegulaPar.FindProperty("Wartosc")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column5, sklepRegulaPar.FindProperty("Wartosc2")!, sklepRegulaParTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column4, sklepRegulaPar.FindProperty("Wartosc3")!, sklepRegulaParTableMapping); + + var sklepRegulaParSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParSzczeg")!; + + var defaultTableMappings220 = new List>(); + sklepRegulaParSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings220); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParSzczeg", null, relationalModel); + var kolejnoscColumnBase43 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase43); + var param1ColumnBase11 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("Param1", param1ColumnBase11); + var param2ColumnBase8 = new ColumnBase("Param2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("Param2", param2ColumnBase8); + var param3ColumnBase6 = new ColumnBase("Param3", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("Param3", param3ColumnBase6); + var sklepIdColumnBase65 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("SklepId", sklepIdColumnBase65); + var sklepParIdColumnBase6 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("SklepParId", sklepParIdColumnBase6); + var sklepRegulaIdColumnBase5 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase5); + var znaczenieColumnBase25 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.Columns.Add("Znaczenie", znaczenieColumnBase25); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParSzczeg", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase = new TableMappingBase(sklepRegulaParSzczeg, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase, false); + defaultTableMappings220.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase43, sklepRegulaParSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase65, sklepRegulaParSzczeg.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase6, sklepRegulaParSzczeg.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase5, sklepRegulaParSzczeg.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase25, sklepRegulaParSzczeg.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase11, sklepRegulaParSzczeg.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase8, sklepRegulaParSzczeg.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param3ColumnBase6, sklepRegulaParSzczeg.FindProperty("Param3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParSzczegMappingBase); + + var tableMappings220 = new List(); + sklepRegulaParSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings220); + var sklepRegulaParSzczegTable = new Table("SklepRegulaParSzczeg", null, relationalModel); + var sklepIdColumn65 = new Column("SklepId", "numeric(9,0)", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("SklepId", sklepIdColumn65); + var sklepParIdColumn6 = new Column("SklepParId", "numeric(9,0)", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("SklepParId", sklepParIdColumn6); + var sklepRegulaIdColumn5 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn5); + var kolejnoscColumn43 = new Column("Kolejnosc", "int", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn43); + var znaczenieColumn25 = new Column("Znaczenie", "smallint", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("Znaczenie", znaczenieColumn25); + var param1Column11 = new Column("Param1", "int", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("Param1", param1Column11); + var param2Column8 = new Column("Param2", "decimal(15,4)", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("Param2", param2Column8); + var param3Column6 = new Column("Param3", "varchar(255)", sklepRegulaParSzczegTable); + sklepRegulaParSzczegTable.Columns.Add("Param3", param3Column6); + var pK_SKLREGULAPARSZCZEG = new UniqueConstraint("PK_SKLREGULAPARSZCZEG", sklepRegulaParSzczegTable, new[] { sklepIdColumn65, sklepParIdColumn6, sklepRegulaIdColumn5, kolejnoscColumn43, znaczenieColumn25 }); + sklepRegulaParSzczegTable.PrimaryKey = pK_SKLREGULAPARSZCZEG; + var pK_SKLREGULAPARSZCZEGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParSzczeg", + new[] { "SklepId", "SklepParId", "SklepRegulaId", "Kolejnosc", "Znaczenie" }); + pK_SKLREGULAPARSZCZEG.MappedKeys.Add(pK_SKLREGULAPARSZCZEGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLREGULAPARSZCZEGUc).Add(pK_SKLREGULAPARSZCZEG); + sklepRegulaParSzczegTable.UniqueConstraints.Add("PK_SKLREGULAPARSZCZEG", pK_SKLREGULAPARSZCZEG); + relationalModel.Tables.Add(("SklepRegulaParSzczeg", null), sklepRegulaParSzczegTable); + var sklepRegulaParSzczegTableMapping = new TableMapping(sklepRegulaParSzczeg, sklepRegulaParSzczegTable, true); + sklepRegulaParSzczegTable.AddTypeMapping(sklepRegulaParSzczegTableMapping, false); + tableMappings220.Add(sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn43, sklepRegulaParSzczeg.FindProperty("Kolejnosc")!, sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn65, sklepRegulaParSzczeg.FindProperty("SklepId")!, sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn6, sklepRegulaParSzczeg.FindProperty("SklepParId")!, sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn5, sklepRegulaParSzczeg.FindProperty("SklepRegulaId")!, sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn25, sklepRegulaParSzczeg.FindProperty("Znaczenie")!, sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(param1Column11, sklepRegulaParSzczeg.FindProperty("Param1")!, sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(param2Column8, sklepRegulaParSzczeg.FindProperty("Param2")!, sklepRegulaParSzczegTableMapping); + RelationalModel.CreateColumnMapping(param3Column6, sklepRegulaParSzczeg.FindProperty("Param3")!, sklepRegulaParSzczegTableMapping); + + var sklepRegulaParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParam")!; + + var defaultTableMappings221 = new List>(); + sklepRegulaParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings221); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParam", null, relationalModel); + var param1ColumnBase12 = new ColumnBase("Param1", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase.Columns.Add("Param1", param1ColumnBase12); + var param2ColumnBase9 = new ColumnBase("Param2", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase.Columns.Add("Param2", param2ColumnBase9); + var sklepIdColumnBase66 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase.Columns.Add("SklepId", sklepIdColumnBase66); + var sklepRegulaIdColumnBase6 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase6); + var znaczenieColumnBase26 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase.Columns.Add("Znaczenie", znaczenieColumnBase26); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParam", blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase = new TableMappingBase(sklepRegulaParam, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase, false); + defaultTableMappings221.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase66, sklepRegulaParam.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase6, sklepRegulaParam.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase26, sklepRegulaParam.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase12, sklepRegulaParam.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase9, sklepRegulaParam.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaParamMappingBase); + + var tableMappings221 = new List(); + sklepRegulaParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings221); + var sklepRegulaParamTable = new Table("SklepRegulaParam", null, relationalModel); + var sklepIdColumn66 = new Column("SklepId", "numeric(9,0)", sklepRegulaParamTable); + sklepRegulaParamTable.Columns.Add("SklepId", sklepIdColumn66); + var sklepRegulaIdColumn6 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaParamTable); + sklepRegulaParamTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn6); + var znaczenieColumn26 = new Column("Znaczenie", "smallint", sklepRegulaParamTable); + sklepRegulaParamTable.Columns.Add("Znaczenie", znaczenieColumn26); + var param1Column12 = new Column("Param1", "int", sklepRegulaParamTable) + { + IsNullable = true + }; + sklepRegulaParamTable.Columns.Add("Param1", param1Column12); + var param2Column9 = new Column("Param2", "varchar(255)", sklepRegulaParamTable) + { + IsNullable = true + }; + sklepRegulaParamTable.Columns.Add("Param2", param2Column9); + var pK_SKLEPREGULAPARAM = new UniqueConstraint("PK_SKLEPREGULAPARAM", sklepRegulaParamTable, new[] { sklepIdColumn66, sklepRegulaIdColumn6, znaczenieColumn26 }); + sklepRegulaParamTable.PrimaryKey = pK_SKLEPREGULAPARAM; + var pK_SKLEPREGULAPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParam", + new[] { "SklepId", "SklepRegulaId", "Znaczenie" }); + pK_SKLEPREGULAPARAM.MappedKeys.Add(pK_SKLEPREGULAPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULAPARAMUc).Add(pK_SKLEPREGULAPARAM); + sklepRegulaParamTable.UniqueConstraints.Add("PK_SKLEPREGULAPARAM", pK_SKLEPREGULAPARAM); + relationalModel.Tables.Add(("SklepRegulaParam", null), sklepRegulaParamTable); + var sklepRegulaParamTableMapping = new TableMapping(sklepRegulaParam, sklepRegulaParamTable, true); + sklepRegulaParamTable.AddTypeMapping(sklepRegulaParamTableMapping, false); + tableMappings221.Add(sklepRegulaParamTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn66, sklepRegulaParam.FindProperty("SklepId")!, sklepRegulaParamTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn6, sklepRegulaParam.FindProperty("SklepRegulaId")!, sklepRegulaParamTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn26, sklepRegulaParam.FindProperty("Znaczenie")!, sklepRegulaParamTableMapping); + RelationalModel.CreateColumnMapping(param1Column12, sklepRegulaParam.FindProperty("Param1")!, sklepRegulaParamTableMapping); + RelationalModel.CreateColumnMapping(param2Column9, sklepRegulaParam.FindProperty("Param2")!, sklepRegulaParamTableMapping); + + var sklepRegulaPozDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDok")!; + + var defaultTableMappings222 = new List>(); + sklepRegulaPozDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings222); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDok", null, relationalModel); + var centrRegulaIdColumnBase3 = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase3); + var kolejnoscColumnBase44 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase44); + var sklepDokIdColumnBase9 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase9); + var sklepIdColumnBase67 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("SklepId", sklepIdColumnBase67); + var sklepRegulaIdColumnBase7 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase7); + var tekstColumnBase18 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("Tekst", tekstColumnBase18); + var typColumnBase34 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("Typ", typColumnBase34); + var wartoscColumnBase17 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.Columns.Add("Wartosc", wartoscColumnBase17); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDok", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase = new TableMappingBase(sklepRegulaPozDok, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase, false); + defaultTableMappings222.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase44, sklepRegulaPozDok.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase9, sklepRegulaPozDok.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase67, sklepRegulaPozDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase7, sklepRegulaPozDok.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase34, sklepRegulaPozDok.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase3, sklepRegulaPozDok.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase18, sklepRegulaPozDok.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase17, sklepRegulaPozDok.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokMappingBase); + + var tableMappings222 = new List(); + sklepRegulaPozDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings222); + var sklepRegulaPozDokTable = new Table("SklepRegulaPozDok", null, relationalModel); + var sklepIdColumn67 = new Column("SklepId", "numeric(9,0)", sklepRegulaPozDokTable); + sklepRegulaPozDokTable.Columns.Add("SklepId", sklepIdColumn67); + var sklepDokIdColumn9 = new Column("SklepDokId", "numeric(9,0)", sklepRegulaPozDokTable); + sklepRegulaPozDokTable.Columns.Add("SklepDokId", sklepDokIdColumn9); + var kolejnoscColumn44 = new Column("Kolejnosc", "int", sklepRegulaPozDokTable); + sklepRegulaPozDokTable.Columns.Add("Kolejnosc", kolejnoscColumn44); + var sklepRegulaIdColumn7 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaPozDokTable); + sklepRegulaPozDokTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn7); + var typColumn34 = new Column("Typ", "smallint", sklepRegulaPozDokTable); + sklepRegulaPozDokTable.Columns.Add("Typ", typColumn34); + var centrRegulaIdColumn3 = new Column("CentrRegulaId", "numeric(9,0)", sklepRegulaPozDokTable) + { + IsNullable = true + }; + sklepRegulaPozDokTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn3); + var tekstColumn18 = new Column("Tekst", "varchar(255)", sklepRegulaPozDokTable) + { + IsNullable = true + }; + sklepRegulaPozDokTable.Columns.Add("Tekst", tekstColumn18); + var wartoscColumn17 = new Column("Wartosc", "decimal(15,4)", sklepRegulaPozDokTable) + { + IsNullable = true + }; + sklepRegulaPozDokTable.Columns.Add("Wartosc", wartoscColumn17); + var pK_SKLEPREGULAPOZDOK = new UniqueConstraint("PK_SKLEPREGULAPOZDOK", sklepRegulaPozDokTable, new[] { sklepIdColumn67, sklepDokIdColumn9, kolejnoscColumn44, sklepRegulaIdColumn7, typColumn34 }); + sklepRegulaPozDokTable.PrimaryKey = pK_SKLEPREGULAPOZDOK; + var pK_SKLEPREGULAPOZDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc", "SklepRegulaId", "Typ" }); + pK_SKLEPREGULAPOZDOK.MappedKeys.Add(pK_SKLEPREGULAPOZDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULAPOZDOKUc).Add(pK_SKLEPREGULAPOZDOK); + sklepRegulaPozDokTable.UniqueConstraints.Add("PK_SKLEPREGULAPOZDOK", pK_SKLEPREGULAPOZDOK); + relationalModel.Tables.Add(("SklepRegulaPozDok", null), sklepRegulaPozDokTable); + var sklepRegulaPozDokTableMapping = new TableMapping(sklepRegulaPozDok, sklepRegulaPozDokTable, true); + sklepRegulaPozDokTable.AddTypeMapping(sklepRegulaPozDokTableMapping, false); + tableMappings222.Add(sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn44, sklepRegulaPozDok.FindProperty("Kolejnosc")!, sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn9, sklepRegulaPozDok.FindProperty("SklepDokId")!, sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn67, sklepRegulaPozDok.FindProperty("SklepId")!, sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn7, sklepRegulaPozDok.FindProperty("SklepRegulaId")!, sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(typColumn34, sklepRegulaPozDok.FindProperty("Typ")!, sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn3, sklepRegulaPozDok.FindProperty("CentrRegulaId")!, sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn18, sklepRegulaPozDok.FindProperty("Tekst")!, sklepRegulaPozDokTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn17, sklepRegulaPozDok.FindProperty("Wartosc")!, sklepRegulaPozDokTableMapping); + + var sklepRegulaPozDokSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDokSzczeg")!; + + var defaultTableMappings223 = new List>(); + sklepRegulaPozDokSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings223); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDokSzczeg", null, relationalModel); + var centrRegulaIdColumnBase4 = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase4); + var kolejnoscColumnBase45 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase45); + var kolejnoscRegulaDokColumnBase0 = new ColumnBase("KolejnoscRegulaDok", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("KolejnoscRegulaDok", kolejnoscRegulaDokColumnBase0); + var opcja1ColumnBase3 = new ColumnBase("Opcja1", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Opcja1", opcja1ColumnBase3); + var opcja2ColumnBase7 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Opcja2", opcja2ColumnBase7); + var sklepDokIdColumnBase10 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase10); + var sklepIdColumnBase68 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("SklepId", sklepIdColumnBase68); + var sklepRegulaIdColumnBase8 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase8); + var tekstColumnBase19 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Tekst", tekstColumnBase19); + var typColumnBase35 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Typ", typColumnBase35); + var wartosc1ColumnBase2 = new ColumnBase("Wartosc1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Wartosc1", wartosc1ColumnBase2); + var wartosc2ColumnBase6 = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase6); + var wartosc3ColumnBase5 = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase5); + var wartosc4ColumnBase1 = new ColumnBase("Wartosc4", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.Columns.Add("Wartosc4", wartosc4ColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDokSzczeg", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase = new TableMappingBase(sklepRegulaPozDokSzczeg, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase, false); + defaultTableMappings223.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase45, sklepRegulaPozDokSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscRegulaDokColumnBase0, sklepRegulaPozDokSzczeg.FindProperty("KolejnoscRegulaDok")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase10, sklepRegulaPozDokSzczeg.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase68, sklepRegulaPozDokSzczeg.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase8, sklepRegulaPozDokSzczeg.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase35, sklepRegulaPozDokSzczeg.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase4, sklepRegulaPozDokSzczeg.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja1ColumnBase3, sklepRegulaPozDokSzczeg.FindProperty("Opcja1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase7, sklepRegulaPozDokSzczeg.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase19, sklepRegulaPozDokSzczeg.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc1ColumnBase2, sklepRegulaPozDokSzczeg.FindProperty("Wartosc1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase6, sklepRegulaPozDokSzczeg.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase5, sklepRegulaPozDokSzczeg.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc4ColumnBase1, sklepRegulaPozDokSzczeg.FindProperty("Wartosc4")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozDokSzczegMappingBase); + + var tableMappings223 = new List(); + sklepRegulaPozDokSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings223); + var sklepRegulaPozDokSzczegTable = new Table("SklepRegulaPozDokSzczeg", null, relationalModel); + var sklepIdColumn68 = new Column("SklepId", "numeric(9,0)", sklepRegulaPozDokSzczegTable); + sklepRegulaPozDokSzczegTable.Columns.Add("SklepId", sklepIdColumn68); + var sklepDokIdColumn10 = new Column("SklepDokId", "numeric(9,0)", sklepRegulaPozDokSzczegTable); + sklepRegulaPozDokSzczegTable.Columns.Add("SklepDokId", sklepDokIdColumn10); + var kolejnoscColumn45 = new Column("Kolejnosc", "int", sklepRegulaPozDokSzczegTable); + sklepRegulaPozDokSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn45); + var sklepRegulaIdColumn8 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaPozDokSzczegTable); + sklepRegulaPozDokSzczegTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn8); + var typColumn35 = new Column("Typ", "smallint", sklepRegulaPozDokSzczegTable); + sklepRegulaPozDokSzczegTable.Columns.Add("Typ", typColumn35); + var kolejnoscRegulaDokColumn0 = new Column("KolejnoscRegulaDok", "int", sklepRegulaPozDokSzczegTable); + sklepRegulaPozDokSzczegTable.Columns.Add("KolejnoscRegulaDok", kolejnoscRegulaDokColumn0); + var centrRegulaIdColumn4 = new Column("CentrRegulaId", "numeric(9,0)", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn4); + var opcja1Column3 = new Column("Opcja1", "smallint", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("Opcja1", opcja1Column3); + var opcja2Column7 = new Column("Opcja2", "smallint", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("Opcja2", opcja2Column7); + var tekstColumn19 = new Column("Tekst", "varchar(255)", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("Tekst", tekstColumn19); + var wartosc1Column2 = new Column("Wartosc1", "decimal(15,4)", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("Wartosc1", wartosc1Column2); + var wartosc2Column6 = new Column("Wartosc2", "decimal(15,4)", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("Wartosc2", wartosc2Column6); + var wartosc3Column5 = new Column("Wartosc3", "decimal(15,4)", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("Wartosc3", wartosc3Column5); + var wartosc4Column1 = new Column("Wartosc4", "decimal(15,4)", sklepRegulaPozDokSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozDokSzczegTable.Columns.Add("Wartosc4", wartosc4Column1); + var pK_SKLREGPOZDOKSZ = new UniqueConstraint("PK_SKLREGPOZDOKSZ", sklepRegulaPozDokSzczegTable, new[] { sklepIdColumn68, sklepDokIdColumn10, kolejnoscColumn45, sklepRegulaIdColumn8, typColumn35, kolejnoscRegulaDokColumn0 }); + sklepRegulaPozDokSzczegTable.PrimaryKey = pK_SKLREGPOZDOKSZ; + var pK_SKLREGPOZDOKSZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDokSzczeg", + new[] { "SklepId", "SklepDokId", "Kolejnosc", "SklepRegulaId", "Typ", "KolejnoscRegulaDok" }); + pK_SKLREGPOZDOKSZ.MappedKeys.Add(pK_SKLREGPOZDOKSZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLREGPOZDOKSZUc).Add(pK_SKLREGPOZDOKSZ); + sklepRegulaPozDokSzczegTable.UniqueConstraints.Add("PK_SKLREGPOZDOKSZ", pK_SKLREGPOZDOKSZ); + relationalModel.Tables.Add(("SklepRegulaPozDokSzczeg", null), sklepRegulaPozDokSzczegTable); + var sklepRegulaPozDokSzczegTableMapping = new TableMapping(sklepRegulaPozDokSzczeg, sklepRegulaPozDokSzczegTable, true); + sklepRegulaPozDokSzczegTable.AddTypeMapping(sklepRegulaPozDokSzczegTableMapping, false); + tableMappings223.Add(sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn45, sklepRegulaPozDokSzczeg.FindProperty("Kolejnosc")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscRegulaDokColumn0, sklepRegulaPozDokSzczeg.FindProperty("KolejnoscRegulaDok")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn10, sklepRegulaPozDokSzczeg.FindProperty("SklepDokId")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn68, sklepRegulaPozDokSzczeg.FindProperty("SklepId")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn8, sklepRegulaPozDokSzczeg.FindProperty("SklepRegulaId")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(typColumn35, sklepRegulaPozDokSzczeg.FindProperty("Typ")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn4, sklepRegulaPozDokSzczeg.FindProperty("CentrRegulaId")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja1Column3, sklepRegulaPozDokSzczeg.FindProperty("Opcja1")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column7, sklepRegulaPozDokSzczeg.FindProperty("Opcja2")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn19, sklepRegulaPozDokSzczeg.FindProperty("Tekst")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc1Column2, sklepRegulaPozDokSzczeg.FindProperty("Wartosc1")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column6, sklepRegulaPozDokSzczeg.FindProperty("Wartosc2")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column5, sklepRegulaPozDokSzczeg.FindProperty("Wartosc3")!, sklepRegulaPozDokSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc4Column1, sklepRegulaPozDokSzczeg.FindProperty("Wartosc4")!, sklepRegulaPozDokSzczegTableMapping); + + var sklepRegulaPozPar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozPar")!; + + var defaultTableMappings224 = new List>(); + sklepRegulaPozPar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings224); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozPar", null, relationalModel); + var centrRegulaIdColumnBase5 = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase5); + var kolejnoscColumnBase46 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase46); + var sklepIdColumnBase69 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("SklepId", sklepIdColumnBase69); + var sklepParIdColumnBase7 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("SklepParId", sklepParIdColumnBase7); + var sklepRegulaIdColumnBase9 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase9); + var tekstColumnBase20 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("Tekst", tekstColumnBase20); + var typColumnBase36 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("Typ", typColumnBase36); + var wartoscColumnBase18 = new ColumnBase("Wartosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.Columns.Add("Wartosc", wartoscColumnBase18); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozPar", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase = new TableMappingBase(sklepRegulaPozPar, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase, false); + defaultTableMappings224.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase46, sklepRegulaPozPar.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase69, sklepRegulaPozPar.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase7, sklepRegulaPozPar.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase9, sklepRegulaPozPar.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase36, sklepRegulaPozPar.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase5, sklepRegulaPozPar.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase20, sklepRegulaPozPar.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase18, sklepRegulaPozPar.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParMappingBase); + + var tableMappings224 = new List(); + sklepRegulaPozPar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings224); + var sklepRegulaPozParTable = new Table("SklepRegulaPozPar", null, relationalModel); + var sklepIdColumn69 = new Column("SklepId", "numeric(9,0)", sklepRegulaPozParTable); + sklepRegulaPozParTable.Columns.Add("SklepId", sklepIdColumn69); + var sklepParIdColumn7 = new Column("SklepParId", "numeric(9,0)", sklepRegulaPozParTable); + sklepRegulaPozParTable.Columns.Add("SklepParId", sklepParIdColumn7); + var kolejnoscColumn46 = new Column("Kolejnosc", "int", sklepRegulaPozParTable); + sklepRegulaPozParTable.Columns.Add("Kolejnosc", kolejnoscColumn46); + var sklepRegulaIdColumn9 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaPozParTable); + sklepRegulaPozParTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn9); + var typColumn36 = new Column("Typ", "smallint", sklepRegulaPozParTable); + sklepRegulaPozParTable.Columns.Add("Typ", typColumn36); + var centrRegulaIdColumn5 = new Column("CentrRegulaId", "numeric(9,0)", sklepRegulaPozParTable) + { + IsNullable = true + }; + sklepRegulaPozParTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn5); + var tekstColumn20 = new Column("Tekst", "varchar(255)", sklepRegulaPozParTable) + { + IsNullable = true + }; + sklepRegulaPozParTable.Columns.Add("Tekst", tekstColumn20); + var wartoscColumn18 = new Column("Wartosc", "decimal(15,4)", sklepRegulaPozParTable) + { + IsNullable = true + }; + sklepRegulaPozParTable.Columns.Add("Wartosc", wartoscColumn18); + var pK_SKLEPREGULAPOZPAR = new UniqueConstraint("PK_SKLEPREGULAPOZPAR", sklepRegulaPozParTable, new[] { sklepIdColumn69, sklepParIdColumn7, kolejnoscColumn46, sklepRegulaIdColumn9, typColumn36 }); + sklepRegulaPozParTable.PrimaryKey = pK_SKLEPREGULAPOZPAR; + var pK_SKLEPREGULAPOZPARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozPar", + new[] { "SklepId", "SklepParId", "Kolejnosc", "SklepRegulaId", "Typ" }); + pK_SKLEPREGULAPOZPAR.MappedKeys.Add(pK_SKLEPREGULAPOZPARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULAPOZPARUc).Add(pK_SKLEPREGULAPOZPAR); + sklepRegulaPozParTable.UniqueConstraints.Add("PK_SKLEPREGULAPOZPAR", pK_SKLEPREGULAPOZPAR); + relationalModel.Tables.Add(("SklepRegulaPozPar", null), sklepRegulaPozParTable); + var sklepRegulaPozParTableMapping = new TableMapping(sklepRegulaPozPar, sklepRegulaPozParTable, true); + sklepRegulaPozParTable.AddTypeMapping(sklepRegulaPozParTableMapping, false); + tableMappings224.Add(sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn46, sklepRegulaPozPar.FindProperty("Kolejnosc")!, sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn69, sklepRegulaPozPar.FindProperty("SklepId")!, sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn7, sklepRegulaPozPar.FindProperty("SklepParId")!, sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn9, sklepRegulaPozPar.FindProperty("SklepRegulaId")!, sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(typColumn36, sklepRegulaPozPar.FindProperty("Typ")!, sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn5, sklepRegulaPozPar.FindProperty("CentrRegulaId")!, sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn20, sklepRegulaPozPar.FindProperty("Tekst")!, sklepRegulaPozParTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn18, sklepRegulaPozPar.FindProperty("Wartosc")!, sklepRegulaPozParTableMapping); + + var sklepRegulaPozParSzczeg = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozParSzczeg")!; + + var defaultTableMappings225 = new List>(); + sklepRegulaPozParSzczeg.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings225); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozParSzczeg", null, relationalModel); + var centrRegulaIdColumnBase6 = new ColumnBase("CentrRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("CentrRegulaId", centrRegulaIdColumnBase6); + var kolejnoscColumnBase47 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase47); + var kolejnoscRegulaParColumnBase0 = new ColumnBase("KolejnoscRegulaPar", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("KolejnoscRegulaPar", kolejnoscRegulaParColumnBase0); + var opcja1ColumnBase4 = new ColumnBase("Opcja1", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Opcja1", opcja1ColumnBase4); + var opcja2ColumnBase8 = new ColumnBase("Opcja2", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Opcja2", opcja2ColumnBase8); + var sklepIdColumnBase70 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("SklepId", sklepIdColumnBase70); + var sklepParIdColumnBase8 = new ColumnBase("SklepParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("SklepParId", sklepParIdColumnBase8); + var sklepRegulaIdColumnBase10 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase10); + var tekstColumnBase21 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Tekst", tekstColumnBase21); + var typColumnBase37 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Typ", typColumnBase37); + var wartosc1ColumnBase3 = new ColumnBase("Wartosc1", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Wartosc1", wartosc1ColumnBase3); + var wartosc2ColumnBase7 = new ColumnBase("Wartosc2", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Wartosc2", wartosc2ColumnBase7); + var wartosc3ColumnBase6 = new ColumnBase("Wartosc3", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Wartosc3", wartosc3ColumnBase6); + var wartosc4ColumnBase2 = new ColumnBase("Wartosc4", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.Columns.Add("Wartosc4", wartosc4ColumnBase2); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozParSzczeg", blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase = new TableMappingBase(sklepRegulaPozParSzczeg, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase, false); + defaultTableMappings225.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase47, sklepRegulaPozParSzczeg.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscRegulaParColumnBase0, sklepRegulaPozParSzczeg.FindProperty("KolejnoscRegulaPar")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase70, sklepRegulaPozParSzczeg.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepParIdColumnBase8, sklepRegulaPozParSzczeg.FindProperty("SklepParId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase10, sklepRegulaPozParSzczeg.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase37, sklepRegulaPozParSzczeg.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRegulaIdColumnBase6, sklepRegulaPozParSzczeg.FindProperty("CentrRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja1ColumnBase4, sklepRegulaPozParSzczeg.FindProperty("Opcja1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcja2ColumnBase8, sklepRegulaPozParSzczeg.FindProperty("Opcja2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase21, sklepRegulaPozParSzczeg.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc1ColumnBase3, sklepRegulaPozParSzczeg.FindProperty("Wartosc1")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc2ColumnBase7, sklepRegulaPozParSzczeg.FindProperty("Wartosc2")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc3ColumnBase6, sklepRegulaPozParSzczeg.FindProperty("Wartosc3")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartosc4ColumnBase2, sklepRegulaPozParSzczeg.FindProperty("Wartosc4")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaPozParSzczegMappingBase); + + var tableMappings225 = new List(); + sklepRegulaPozParSzczeg.SetRuntimeAnnotation("Relational:TableMappings", tableMappings225); + var sklepRegulaPozParSzczegTable = new Table("SklepRegulaPozParSzczeg", null, relationalModel); + var sklepIdColumn70 = new Column("SklepId", "numeric(9,0)", sklepRegulaPozParSzczegTable); + sklepRegulaPozParSzczegTable.Columns.Add("SklepId", sklepIdColumn70); + var sklepParIdColumn8 = new Column("SklepParId", "numeric(9,0)", sklepRegulaPozParSzczegTable); + sklepRegulaPozParSzczegTable.Columns.Add("SklepParId", sklepParIdColumn8); + var kolejnoscColumn47 = new Column("Kolejnosc", "int", sklepRegulaPozParSzczegTable); + sklepRegulaPozParSzczegTable.Columns.Add("Kolejnosc", kolejnoscColumn47); + var sklepRegulaIdColumn10 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaPozParSzczegTable); + sklepRegulaPozParSzczegTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn10); + var typColumn37 = new Column("Typ", "smallint", sklepRegulaPozParSzczegTable); + sklepRegulaPozParSzczegTable.Columns.Add("Typ", typColumn37); + var kolejnoscRegulaParColumn0 = new Column("KolejnoscRegulaPar", "int", sklepRegulaPozParSzczegTable); + sklepRegulaPozParSzczegTable.Columns.Add("KolejnoscRegulaPar", kolejnoscRegulaParColumn0); + var centrRegulaIdColumn6 = new Column("CentrRegulaId", "numeric(9,0)", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("CentrRegulaId", centrRegulaIdColumn6); + var opcja1Column4 = new Column("Opcja1", "smallint", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("Opcja1", opcja1Column4); + var opcja2Column8 = new Column("Opcja2", "smallint", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("Opcja2", opcja2Column8); + var tekstColumn21 = new Column("Tekst", "varchar(255)", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("Tekst", tekstColumn21); + var wartosc1Column3 = new Column("Wartosc1", "decimal(15,4)", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("Wartosc1", wartosc1Column3); + var wartosc2Column7 = new Column("Wartosc2", "decimal(15,4)", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("Wartosc2", wartosc2Column7); + var wartosc3Column6 = new Column("Wartosc3", "decimal(15,4)", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("Wartosc3", wartosc3Column6); + var wartosc4Column2 = new Column("Wartosc4", "decimal(15,4)", sklepRegulaPozParSzczegTable) + { + IsNullable = true + }; + sklepRegulaPozParSzczegTable.Columns.Add("Wartosc4", wartosc4Column2); + var pK_SKLREGPOZPARSZ = new UniqueConstraint("PK_SKLREGPOZPARSZ", sklepRegulaPozParSzczegTable, new[] { sklepIdColumn70, sklepParIdColumn8, kolejnoscColumn47, sklepRegulaIdColumn10, typColumn37, kolejnoscRegulaParColumn0 }); + sklepRegulaPozParSzczegTable.PrimaryKey = pK_SKLREGPOZPARSZ; + var pK_SKLREGPOZPARSZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozParSzczeg", + new[] { "SklepId", "SklepParId", "Kolejnosc", "SklepRegulaId", "Typ", "KolejnoscRegulaPar" }); + pK_SKLREGPOZPARSZ.MappedKeys.Add(pK_SKLREGPOZPARSZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLREGPOZPARSZUc).Add(pK_SKLREGPOZPARSZ); + sklepRegulaPozParSzczegTable.UniqueConstraints.Add("PK_SKLREGPOZPARSZ", pK_SKLREGPOZPARSZ); + relationalModel.Tables.Add(("SklepRegulaPozParSzczeg", null), sklepRegulaPozParSzczegTable); + var sklepRegulaPozParSzczegTableMapping = new TableMapping(sklepRegulaPozParSzczeg, sklepRegulaPozParSzczegTable, true); + sklepRegulaPozParSzczegTable.AddTypeMapping(sklepRegulaPozParSzczegTableMapping, false); + tableMappings225.Add(sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn47, sklepRegulaPozParSzczeg.FindProperty("Kolejnosc")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscRegulaParColumn0, sklepRegulaPozParSzczeg.FindProperty("KolejnoscRegulaPar")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn70, sklepRegulaPozParSzczeg.FindProperty("SklepId")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepParIdColumn8, sklepRegulaPozParSzczeg.FindProperty("SklepParId")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn10, sklepRegulaPozParSzczeg.FindProperty("SklepRegulaId")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(typColumn37, sklepRegulaPozParSzczeg.FindProperty("Typ")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(centrRegulaIdColumn6, sklepRegulaPozParSzczeg.FindProperty("CentrRegulaId")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja1Column4, sklepRegulaPozParSzczeg.FindProperty("Opcja1")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(opcja2Column8, sklepRegulaPozParSzczeg.FindProperty("Opcja2")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn21, sklepRegulaPozParSzczeg.FindProperty("Tekst")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc1Column3, sklepRegulaPozParSzczeg.FindProperty("Wartosc1")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc2Column7, sklepRegulaPozParSzczeg.FindProperty("Wartosc2")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc3Column6, sklepRegulaPozParSzczeg.FindProperty("Wartosc3")!, sklepRegulaPozParSzczegTableMapping); + RelationalModel.CreateColumnMapping(wartosc4Column2, sklepRegulaPozParSzczeg.FindProperty("Wartosc4")!, sklepRegulaPozParSzczegTableMapping); + + var sklepRegulaTekst = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTekst")!; + + var defaultTableMappings226 = new List>(); + sklepRegulaTekst.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings226); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTekst", null, relationalModel); + var sklepIdColumnBase71 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase.Columns.Add("SklepId", sklepIdColumnBase71); + var sklepRegulaIdColumnBase11 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase11); + var tekstColumnBase22 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase.Columns.Add("Tekst", tekstColumnBase22); + var znaczenieColumnBase27 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase.Columns.Add("Znaczenie", znaczenieColumnBase27); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTekst", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstMappingBase = new TableMappingBase(sklepRegulaTekst, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstMappingBase, false); + defaultTableMappings226.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase71, sklepRegulaTekst.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase11, sklepRegulaTekst.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase27, sklepRegulaTekst.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase22, sklepRegulaTekst.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTekstMappingBase); + + var tableMappings226 = new List(); + sklepRegulaTekst.SetRuntimeAnnotation("Relational:TableMappings", tableMappings226); + var sklepRegulaTekstTable = new Table("SklepRegulaTekst", null, relationalModel); + var sklepIdColumn71 = new Column("SklepId", "numeric(9,0)", sklepRegulaTekstTable); + sklepRegulaTekstTable.Columns.Add("SklepId", sklepIdColumn71); + var sklepRegulaIdColumn11 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaTekstTable); + sklepRegulaTekstTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn11); + var znaczenieColumn27 = new Column("Znaczenie", "smallint", sklepRegulaTekstTable); + sklepRegulaTekstTable.Columns.Add("Znaczenie", znaczenieColumn27); + var tekstColumn22 = new Column("Tekst", "varchar(255)", sklepRegulaTekstTable); + sklepRegulaTekstTable.Columns.Add("Tekst", tekstColumn22); + var pK_SklepRegulaTekst = new UniqueConstraint("PK_SklepRegulaTekst", sklepRegulaTekstTable, new[] { sklepIdColumn71, sklepRegulaIdColumn11, znaczenieColumn27 }); + sklepRegulaTekstTable.PrimaryKey = pK_SklepRegulaTekst; + var pK_SklepRegulaTekstUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTekst", + new[] { "SklepId", "SklepRegulaId", "Znaczenie" }); + pK_SklepRegulaTekst.MappedKeys.Add(pK_SklepRegulaTekstUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepRegulaTekstUc).Add(pK_SklepRegulaTekst); + sklepRegulaTekstTable.UniqueConstraints.Add("PK_SklepRegulaTekst", pK_SklepRegulaTekst); + relationalModel.Tables.Add(("SklepRegulaTekst", null), sklepRegulaTekstTable); + var sklepRegulaTekstTableMapping = new TableMapping(sklepRegulaTekst, sklepRegulaTekstTable, true); + sklepRegulaTekstTable.AddTypeMapping(sklepRegulaTekstTableMapping, false); + tableMappings226.Add(sklepRegulaTekstTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn71, sklepRegulaTekst.FindProperty("SklepId")!, sklepRegulaTekstTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn11, sklepRegulaTekst.FindProperty("SklepRegulaId")!, sklepRegulaTekstTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn27, sklepRegulaTekst.FindProperty("Znaczenie")!, sklepRegulaTekstTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn22, sklepRegulaTekst.FindProperty("Tekst")!, sklepRegulaTekstTableMapping); + + var sklepRegulaTowar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar")!; + + var defaultTableMappings227 = new List>(); + sklepRegulaTowar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings227); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar", null, relationalModel); + var cenaColumnBase4 = new ColumnBase("Cena", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.Columns.Add("Cena", cenaColumnBase4); + var iloscColumnBase6 = new ColumnBase("Ilosc", "numeric(16,4)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.Columns.Add("Ilosc", iloscColumnBase6); + var parametrColumnBase3 = new ColumnBase("Parametr", "int", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.Columns.Add("Parametr", parametrColumnBase3); + var sklepIdColumnBase72 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.Columns.Add("SklepId", sklepIdColumnBase72); + var sklepRegulaIdColumnBase12 = new ColumnBase("SklepRegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.Columns.Add("SklepRegulaId", sklepRegulaIdColumnBase12); + var sklepTowIdColumnBase6 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase6); + var znaczenieColumnBase28 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.Columns.Add("Znaczenie", znaczenieColumnBase28); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar", blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase = new TableMappingBase(sklepRegulaTowar, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase, false); + defaultTableMappings227.Add(blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase72, sklepRegulaTowar.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRegulaIdColumnBase12, sklepRegulaTowar.FindProperty("SklepRegulaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase6, sklepRegulaTowar.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase28, sklepRegulaTowar.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase4, sklepRegulaTowar.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase6, sklepRegulaTowar.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parametrColumnBase3, sklepRegulaTowar.FindProperty("Parametr")!, blinkBackofficeServicesPcmDbEntitiesSklepRegulaTowarMappingBase); + + var tableMappings227 = new List(); + sklepRegulaTowar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings227); + var sklepRegulaTowarTable = new Table("SklepRegulaTowar", null, relationalModel); + var sklepIdColumn72 = new Column("SklepId", "numeric(9,0)", sklepRegulaTowarTable); + sklepRegulaTowarTable.Columns.Add("SklepId", sklepIdColumn72); + var sklepRegulaIdColumn12 = new Column("SklepRegulaId", "numeric(9,0)", sklepRegulaTowarTable); + sklepRegulaTowarTable.Columns.Add("SklepRegulaId", sklepRegulaIdColumn12); + var sklepTowIdColumn6 = new Column("SklepTowId", "numeric(9,0)", sklepRegulaTowarTable); + sklepRegulaTowarTable.Columns.Add("SklepTowId", sklepTowIdColumn6); + var znaczenieColumn28 = new Column("Znaczenie", "smallint", sklepRegulaTowarTable); + sklepRegulaTowarTable.Columns.Add("Znaczenie", znaczenieColumn28); + var cenaColumn4 = new Column("Cena", "numeric(16,4)", sklepRegulaTowarTable) + { + IsNullable = true + }; + sklepRegulaTowarTable.Columns.Add("Cena", cenaColumn4); + var iloscColumn6 = new Column("Ilosc", "numeric(16,4)", sklepRegulaTowarTable) + { + IsNullable = true + }; + sklepRegulaTowarTable.Columns.Add("Ilosc", iloscColumn6); + var parametrColumn3 = new Column("Parametr", "int", sklepRegulaTowarTable) + { + IsNullable = true + }; + sklepRegulaTowarTable.Columns.Add("Parametr", parametrColumn3); + var pK_SKLEPREGULATOWAR = new UniqueConstraint("PK_SKLEPREGULATOWAR", sklepRegulaTowarTable, new[] { sklepIdColumn72, sklepRegulaIdColumn12, sklepTowIdColumn6, znaczenieColumn28 }); + sklepRegulaTowarTable.PrimaryKey = pK_SKLEPREGULATOWAR; + var pK_SKLEPREGULATOWARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar", + new[] { "SklepId", "SklepRegulaId", "SklepTowId", "Znaczenie" }); + pK_SKLEPREGULATOWAR.MappedKeys.Add(pK_SKLEPREGULATOWARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPREGULATOWARUc).Add(pK_SKLEPREGULATOWAR); + sklepRegulaTowarTable.UniqueConstraints.Add("PK_SKLEPREGULATOWAR", pK_SKLEPREGULATOWAR); + var iX_SklepRegulaTowar_SklepId_SklepTowId = new TableIndex( + "IX_SklepRegulaTowar_SklepId_SklepTowId", sklepRegulaTowarTable, new[] { sklepIdColumn72, sklepTowIdColumn6 }, false); + var iX_SklepRegulaTowar_SklepId_SklepTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar", + new[] { "SklepId", "SklepTowId" }); + iX_SklepRegulaTowar_SklepId_SklepTowId.MappedIndexes.Add(iX_SklepRegulaTowar_SklepId_SklepTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepRegulaTowar_SklepId_SklepTowIdIx).Add(iX_SklepRegulaTowar_SklepId_SklepTowId); + sklepRegulaTowarTable.Indexes.Add("IX_SklepRegulaTowar_SklepId_SklepTowId", iX_SklepRegulaTowar_SklepId_SklepTowId); + relationalModel.Tables.Add(("SklepRegulaTowar", null), sklepRegulaTowarTable); + var sklepRegulaTowarTableMapping = new TableMapping(sklepRegulaTowar, sklepRegulaTowarTable, true); + sklepRegulaTowarTable.AddTypeMapping(sklepRegulaTowarTableMapping, false); + tableMappings227.Add(sklepRegulaTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn72, sklepRegulaTowar.FindProperty("SklepId")!, sklepRegulaTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepRegulaIdColumn12, sklepRegulaTowar.FindProperty("SklepRegulaId")!, sklepRegulaTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn6, sklepRegulaTowar.FindProperty("SklepTowId")!, sklepRegulaTowarTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn28, sklepRegulaTowar.FindProperty("Znaczenie")!, sklepRegulaTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn4, sklepRegulaTowar.FindProperty("Cena")!, sklepRegulaTowarTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn6, sklepRegulaTowar.FindProperty("Ilosc")!, sklepRegulaTowarTableMapping); + RelationalModel.CreateColumnMapping(parametrColumn3, sklepRegulaTowar.FindProperty("Parametr")!, sklepRegulaTowarTableMapping); + + var sklepRola = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRola")!; + + var defaultTableMappings228 = new List>(); + sklepRola.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings228); + var blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRola", null, relationalModel); + var aktywnaColumnBase2 = new ColumnBase("Aktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("Aktywna", aktywnaColumnBase2); + var centrRolaIdColumnBase0 = new ColumnBase("CentrRolaId", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("CentrRolaId", centrRolaIdColumnBase0); + var domyslnaColumnBase0 = new ColumnBase("Domyslna", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("Domyslna", domyslnaColumnBase0); + var nazwaColumnBase51 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("Nazwa", nazwaColumnBase51); + var priorytetColumnBase2 = new ColumnBase("Priorytet", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("Priorytet", priorytetColumnBase2); + var sklepIdColumnBase73 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("SklepId", sklepIdColumnBase73); + var sklepRolaIdColumnBase0 = new ColumnBase("SklepRolaId", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("SklepRolaId", sklepRolaIdColumnBase0); + var typColumnBase38 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("Typ", typColumnBase38); + var uprawnieniaZRoliColumnBase0 = new ColumnBase("UprawnieniaZRoli", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("UprawnieniaZRoli", uprawnieniaZRoliColumnBase0); + var zmianaColumnBase52 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.Columns.Add("Zmiana", zmianaColumnBase52); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRola", blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase = new TableMappingBase(sklepRola, blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRolaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase, false); + defaultTableMappings228.Add(blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase73, sklepRola.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRolaIdColumnBase0, sklepRola.FindProperty("SklepRolaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnaColumnBase2, sklepRola.FindProperty("Aktywna")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrRolaIdColumnBase0, sklepRola.FindProperty("CentrRolaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslnaColumnBase0, sklepRola.FindProperty("Domyslna")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase51, sklepRola.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)priorytetColumnBase2, sklepRola.FindProperty("Priorytet")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase38, sklepRola.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uprawnieniaZRoliColumnBase0, sklepRola.FindProperty("UprawnieniaZRoli")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase52, sklepRola.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaMappingBase); + + var tableMappings228 = new List(); + sklepRola.SetRuntimeAnnotation("Relational:TableMappings", tableMappings228); + var sklepRolaTable = new Table("SklepRola", null, relationalModel); + var sklepIdColumn73 = new Column("SklepId", "numeric(9,0)", sklepRolaTable); + sklepRolaTable.Columns.Add("SklepId", sklepIdColumn73); + var sklepRolaIdColumn0 = new Column("SklepRolaId", "smallint", sklepRolaTable); + sklepRolaTable.Columns.Add("SklepRolaId", sklepRolaIdColumn0); + var aktywnaColumn2 = new Column("Aktywna", "smallint", sklepRolaTable); + sklepRolaTable.Columns.Add("Aktywna", aktywnaColumn2); + var centrRolaIdColumn0 = new Column("CentrRolaId", "smallint", sklepRolaTable) + { + IsNullable = true + }; + sklepRolaTable.Columns.Add("CentrRolaId", centrRolaIdColumn0); + var domyslnaColumn0 = new Column("Domyslna", "smallint", sklepRolaTable) + { + IsNullable = true + }; + sklepRolaTable.Columns.Add("Domyslna", domyslnaColumn0); + var nazwaColumn51 = new Column("Nazwa", "varchar(255)", sklepRolaTable); + sklepRolaTable.Columns.Add("Nazwa", nazwaColumn51); + var priorytetColumn2 = new Column("Priorytet", "smallint", sklepRolaTable) + { + IsNullable = true + }; + sklepRolaTable.Columns.Add("Priorytet", priorytetColumn2); + var typColumn38 = new Column("Typ", "smallint", sklepRolaTable); + sklepRolaTable.Columns.Add("Typ", typColumn38); + var uprawnieniaZRoliColumn0 = new Column("UprawnieniaZRoli", "smallint", sklepRolaTable) + { + IsNullable = true + }; + sklepRolaTable.Columns.Add("UprawnieniaZRoli", uprawnieniaZRoliColumn0); + var zmianaColumn52 = new Column("Zmiana", "datetime", sklepRolaTable); + sklepRolaTable.Columns.Add("Zmiana", zmianaColumn52); + var pK_SKLEPROLA = new UniqueConstraint("PK_SKLEPROLA", sklepRolaTable, new[] { sklepIdColumn73, sklepRolaIdColumn0 }); + sklepRolaTable.PrimaryKey = pK_SKLEPROLA; + var pK_SKLEPROLAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRola", + new[] { "SklepId", "SklepRolaId" }); + pK_SKLEPROLA.MappedKeys.Add(pK_SKLEPROLAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPROLAUc).Add(pK_SKLEPROLA); + sklepRolaTable.UniqueConstraints.Add("PK_SKLEPROLA", pK_SKLEPROLA); + var iX_SklepRola_CentrRolaId = new TableIndex( + "IX_SklepRola_CentrRolaId", sklepRolaTable, new[] { centrRolaIdColumn0 }, false); + var iX_SklepRola_CentrRolaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRola", + new[] { "CentrRolaId" }); + iX_SklepRola_CentrRolaId.MappedIndexes.Add(iX_SklepRola_CentrRolaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepRola_CentrRolaIdIx).Add(iX_SklepRola_CentrRolaId); + sklepRolaTable.Indexes.Add("IX_SklepRola_CentrRolaId", iX_SklepRola_CentrRolaId); + relationalModel.Tables.Add(("SklepRola", null), sklepRolaTable); + var sklepRolaTableMapping = new TableMapping(sklepRola, sklepRolaTable, true); + sklepRolaTable.AddTypeMapping(sklepRolaTableMapping, false); + tableMappings228.Add(sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn73, sklepRola.FindProperty("SklepId")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(sklepRolaIdColumn0, sklepRola.FindProperty("SklepRolaId")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(aktywnaColumn2, sklepRola.FindProperty("Aktywna")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(centrRolaIdColumn0, sklepRola.FindProperty("CentrRolaId")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(domyslnaColumn0, sklepRola.FindProperty("Domyslna")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn51, sklepRola.FindProperty("Nazwa")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(priorytetColumn2, sklepRola.FindProperty("Priorytet")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(typColumn38, sklepRola.FindProperty("Typ")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(uprawnieniaZRoliColumn0, sklepRola.FindProperty("UprawnieniaZRoli")!, sklepRolaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn52, sklepRola.FindProperty("Zmiana")!, sklepRolaTableMapping); + + var sklepRolaUprawnienie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRolaUprawnienie")!; + + var defaultTableMappings229 = new List>(); + sklepRolaUprawnienie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings229); + var blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRolaUprawnienie", null, relationalModel); + var jestColumnBase0 = new ColumnBase("Jest", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase.Columns.Add("Jest", jestColumnBase0); + var rodzajColumnBase10 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase.Columns.Add("Rodzaj", rodzajColumnBase10); + var sklepIdColumnBase74 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase.Columns.Add("SklepId", sklepIdColumnBase74); + var sklepRolaIdColumnBase1 = new ColumnBase("SklepRolaId", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase.Columns.Add("SklepRolaId", sklepRolaIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRolaUprawnienie", blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieMappingBase = new TableMappingBase(sklepRolaUprawnienie, blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieMappingBase, false); + defaultTableMappings229.Add(blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase10, sklepRolaUprawnienie.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase74, sklepRolaUprawnienie.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepRolaIdColumnBase1, sklepRolaUprawnienie.FindProperty("SklepRolaId")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jestColumnBase0, sklepRolaUprawnienie.FindProperty("Jest")!, blinkBackofficeServicesPcmDbEntitiesSklepRolaUprawnienieMappingBase); + + var tableMappings229 = new List(); + sklepRolaUprawnienie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings229); + var sklepRolaUprawnienieTable = new Table("SklepRolaUprawnienie", null, relationalModel); + var sklepIdColumn74 = new Column("SklepId", "numeric(9,0)", sklepRolaUprawnienieTable); + sklepRolaUprawnienieTable.Columns.Add("SklepId", sklepIdColumn74); + var sklepRolaIdColumn1 = new Column("SklepRolaId", "smallint", sklepRolaUprawnienieTable); + sklepRolaUprawnienieTable.Columns.Add("SklepRolaId", sklepRolaIdColumn1); + var rodzajColumn10 = new Column("Rodzaj", "smallint", sklepRolaUprawnienieTable); + sklepRolaUprawnienieTable.Columns.Add("Rodzaj", rodzajColumn10); + var jestColumn0 = new Column("Jest", "smallint", sklepRolaUprawnienieTable) + { + IsNullable = true + }; + sklepRolaUprawnienieTable.Columns.Add("Jest", jestColumn0); + var pK_SKLROLAUPR = new UniqueConstraint("PK_SKLROLAUPR", sklepRolaUprawnienieTable, new[] { sklepIdColumn74, sklepRolaIdColumn1, rodzajColumn10 }); + sklepRolaUprawnienieTable.PrimaryKey = pK_SKLROLAUPR; + var pK_SKLROLAUPRUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRolaUprawnienie", + new[] { "SklepId", "SklepRolaId", "Rodzaj" }); + pK_SKLROLAUPR.MappedKeys.Add(pK_SKLROLAUPRUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLROLAUPRUc).Add(pK_SKLROLAUPR); + sklepRolaUprawnienieTable.UniqueConstraints.Add("PK_SKLROLAUPR", pK_SKLROLAUPR); + relationalModel.Tables.Add(("SklepRolaUprawnienie", null), sklepRolaUprawnienieTable); + var sklepRolaUprawnienieTableMapping = new TableMapping(sklepRolaUprawnienie, sklepRolaUprawnienieTable, true); + sklepRolaUprawnienieTable.AddTypeMapping(sklepRolaUprawnienieTableMapping, false); + tableMappings229.Add(sklepRolaUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn10, sklepRolaUprawnienie.FindProperty("Rodzaj")!, sklepRolaUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn74, sklepRolaUprawnienie.FindProperty("SklepId")!, sklepRolaUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(sklepRolaIdColumn1, sklepRolaUprawnienie.FindProperty("SklepRolaId")!, sklepRolaUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(jestColumn0, sklepRolaUprawnienie.FindProperty("Jest")!, sklepRolaUprawnienieTableMapping); + + var sklepRozPrtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag")!; + + var defaultTableMappings230 = new List>(); + sklepRozPrtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings230); + var blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag", null, relationalModel); + var dzienColumnBase6 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("Dzien", dzienColumnBase6); + var iloscPrtColumnBase0 = new ColumnBase("IloscPrt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("IloscPrt", iloscPrtColumnBase0); + var kolejnoscColumnBase48 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase48); + var pMIdColumnBase2 = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase2); + var sklepDokIdColumnBase11 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase11); + var sklepIdColumnBase75 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("SklepId", sklepIdColumnBase75); + var sklepTowIdColumnBase7 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase7); + var znaczenieColumnBase29 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.Columns.Add("Znaczenie", znaczenieColumnBase29); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag", blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase = new TableMappingBase(sklepRozPrtMag, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase, false); + defaultTableMappings230.Add(blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase48, sklepRozPrtMag.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase2, sklepRozPrtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase11, sklepRozPrtMag.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase75, sklepRozPrtMag.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase7, sklepRozPrtMag.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase29, sklepRozPrtMag.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase6, sklepRozPrtMag.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscPrtColumnBase0, sklepRozPrtMag.FindProperty("IloscPrt")!, blinkBackofficeServicesPcmDbEntitiesSklepRozPrtMagMappingBase); + + var tableMappings230 = new List(); + sklepRozPrtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings230); + var sklepRozPrtMagTable = new Table("SklepRozPrtMag", null, relationalModel); + var sklepIdColumn75 = new Column("SklepId", "numeric(9,0)", sklepRozPrtMagTable); + sklepRozPrtMagTable.Columns.Add("SklepId", sklepIdColumn75); + var sklepTowIdColumn7 = new Column("SklepTowId", "numeric(9,0)", sklepRozPrtMagTable); + sklepRozPrtMagTable.Columns.Add("SklepTowId", sklepTowIdColumn7); + var pMIdColumn2 = new Column("PMId", "numeric(9,0)", sklepRozPrtMagTable); + sklepRozPrtMagTable.Columns.Add("PMId", pMIdColumn2); + var znaczenieColumn29 = new Column("Znaczenie", "smallint", sklepRozPrtMagTable); + sklepRozPrtMagTable.Columns.Add("Znaczenie", znaczenieColumn29); + var sklepDokIdColumn11 = new Column("SklepDokId", "numeric(9,0)", sklepRozPrtMagTable); + sklepRozPrtMagTable.Columns.Add("SklepDokId", sklepDokIdColumn11); + var kolejnoscColumn48 = new Column("Kolejnosc", "int", sklepRozPrtMagTable); + sklepRozPrtMagTable.Columns.Add("Kolejnosc", kolejnoscColumn48); + var dzienColumn6 = new Column("Dzien", "datetime", sklepRozPrtMagTable) + { + IsNullable = true + }; + sklepRozPrtMagTable.Columns.Add("Dzien", dzienColumn6); + var iloscPrtColumn0 = new Column("IloscPrt", "decimal(15,4)", sklepRozPrtMagTable) + { + IsNullable = true + }; + sklepRozPrtMagTable.Columns.Add("IloscPrt", iloscPrtColumn0); + var pK_SKLEPROZPRTMAG = new UniqueConstraint("PK_SKLEPROZPRTMAG", sklepRozPrtMagTable, new[] { sklepIdColumn75, sklepTowIdColumn7, pMIdColumn2, znaczenieColumn29, sklepDokIdColumn11, kolejnoscColumn48 }); + sklepRozPrtMagTable.PrimaryKey = pK_SKLEPROZPRTMAG; + var pK_SKLEPROZPRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag", + new[] { "SklepId", "SklepTowId", "PMId", "Znaczenie", "SklepDokId", "Kolejnosc" }); + pK_SKLEPROZPRTMAG.MappedKeys.Add(pK_SKLEPROZPRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPROZPRTMAGUc).Add(pK_SKLEPROZPRTMAG); + sklepRozPrtMagTable.UniqueConstraints.Add("PK_SKLEPROZPRTMAG", pK_SKLEPROZPRTMAG); + var idx_SkRozPrtMagPoz = new TableIndex( + "idx_SkRozPrtMagPoz", sklepRozPrtMagTable, new[] { sklepIdColumn75, sklepDokIdColumn11, kolejnoscColumn48, znaczenieColumn29, pMIdColumn2 }, false); + var idx_SkRozPrtMagPozIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag", + "idx_SkRozPrtMagPoz"); + idx_SkRozPrtMagPoz.MappedIndexes.Add(idx_SkRozPrtMagPozIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkRozPrtMagPozIx).Add(idx_SkRozPrtMagPoz); + sklepRozPrtMagTable.Indexes.Add("idx_SkRozPrtMagPoz", idx_SkRozPrtMagPoz); + relationalModel.Tables.Add(("SklepRozPrtMag", null), sklepRozPrtMagTable); + var sklepRozPrtMagTableMapping = new TableMapping(sklepRozPrtMag, sklepRozPrtMagTable, true); + sklepRozPrtMagTable.AddTypeMapping(sklepRozPrtMagTableMapping, false); + tableMappings230.Add(sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn48, sklepRozPrtMag.FindProperty("Kolejnosc")!, sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn2, sklepRozPrtMag.FindProperty("PMId")!, sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn11, sklepRozPrtMag.FindProperty("SklepDokId")!, sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn75, sklepRozPrtMag.FindProperty("SklepId")!, sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn7, sklepRozPrtMag.FindProperty("SklepTowId")!, sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn29, sklepRozPrtMag.FindProperty("Znaczenie")!, sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn6, sklepRozPrtMag.FindProperty("Dzien")!, sklepRozPrtMagTableMapping); + RelationalModel.CreateColumnMapping(iloscPrtColumn0, sklepRozPrtMag.FindProperty("IloscPrt")!, sklepRozPrtMagTableMapping); + + var sklepRozbicieDodDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDodDok")!; + + var defaultTableMappings231 = new List>(); + sklepRozbicieDodDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings231); + var blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDodDok", null, relationalModel); + var nettoColumnBase5 = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("Netto", nettoColumnBase5); + var nettoDetColumnBase3 = new ColumnBase("NettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("NettoDet", nettoDetColumnBase3); + var nettoMagColumnBase3 = new ColumnBase("NettoMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("NettoMag", nettoMagColumnBase3); + var podatekColumnBase5 = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("Podatek", podatekColumnBase5); + var podatekDetColumnBase3 = new ColumnBase("PodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("PodatekDet", podatekDetColumnBase3); + var podatekMagColumnBase3 = new ColumnBase("PodatekMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("PodatekMag", podatekMagColumnBase3); + var sklepDokIdColumnBase12 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase12); + var sklepIdColumnBase76 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("SklepId", sklepIdColumnBase76); + var stawkaColumnBase11 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("Stawka", stawkaColumnBase11); + var znaczenieColumnBase30 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.Columns.Add("Znaczenie", znaczenieColumnBase30); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDodDok", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase = new TableMappingBase(sklepRozbicieDodDok, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase, false); + defaultTableMappings231.Add(blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase12, sklepRozbicieDodDok.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase76, sklepRozbicieDodDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase11, sklepRozbicieDodDok.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase30, sklepRozbicieDodDok.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase5, sklepRozbicieDodDok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetColumnBase3, sklepRozbicieDodDok.FindProperty("NettoDet")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagColumnBase3, sklepRozbicieDodDok.FindProperty("NettoMag")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase5, sklepRozbicieDodDok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetColumnBase3, sklepRozbicieDodDok.FindProperty("PodatekDet")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagColumnBase3, sklepRozbicieDodDok.FindProperty("PodatekMag")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDodDokMappingBase); + + var tableMappings231 = new List(); + sklepRozbicieDodDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings231); + var sklepRozbicieDodDokTable = new Table("SklepRozbicieDodDok", null, relationalModel); + var sklepIdColumn76 = new Column("SklepId", "numeric(9,0)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("SklepId", sklepIdColumn76); + var sklepDokIdColumn12 = new Column("SklepDokId", "numeric(9,0)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("SklepDokId", sklepDokIdColumn12); + var znaczenieColumn30 = new Column("Znaczenie", "smallint", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("Znaczenie", znaczenieColumn30); + var stawkaColumn11 = new Column("Stawka", "smallint", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("Stawka", stawkaColumn11); + var nettoColumn5 = new Column("Netto", "decimal(15,4)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("Netto", nettoColumn5); + var nettoDetColumn3 = new Column("NettoDet", "decimal(15,4)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("NettoDet", nettoDetColumn3); + var nettoMagColumn3 = new Column("NettoMag", "decimal(15,4)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("NettoMag", nettoMagColumn3); + var podatekColumn5 = new Column("Podatek", "decimal(15,4)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("Podatek", podatekColumn5); + var podatekDetColumn3 = new Column("PodatekDet", "decimal(15,4)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("PodatekDet", podatekDetColumn3); + var podatekMagColumn3 = new Column("PodatekMag", "decimal(15,4)", sklepRozbicieDodDokTable); + sklepRozbicieDodDokTable.Columns.Add("PodatekMag", podatekMagColumn3); + var pK_SKLROZBDODDOK = new UniqueConstraint("PK_SKLROZBDODDOK", sklepRozbicieDodDokTable, new[] { sklepIdColumn76, sklepDokIdColumn12, znaczenieColumn30, stawkaColumn11 }); + sklepRozbicieDodDokTable.PrimaryKey = pK_SKLROZBDODDOK; + var pK_SKLROZBDODDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDodDok", + new[] { "SklepId", "SklepDokId", "Znaczenie", "Stawka" }); + pK_SKLROZBDODDOK.MappedKeys.Add(pK_SKLROZBDODDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLROZBDODDOKUc).Add(pK_SKLROZBDODDOK); + sklepRozbicieDodDokTable.UniqueConstraints.Add("PK_SKLROZBDODDOK", pK_SKLROZBDODDOK); + relationalModel.Tables.Add(("SklepRozbicieDodDok", null), sklepRozbicieDodDokTable); + var sklepRozbicieDodDokTableMapping = new TableMapping(sklepRozbicieDodDok, sklepRozbicieDodDokTable, true); + sklepRozbicieDodDokTable.AddTypeMapping(sklepRozbicieDodDokTableMapping, false); + tableMappings231.Add(sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn12, sklepRozbicieDodDok.FindProperty("SklepDokId")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn76, sklepRozbicieDodDok.FindProperty("SklepId")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn11, sklepRozbicieDodDok.FindProperty("Stawka")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn30, sklepRozbicieDodDok.FindProperty("Znaczenie")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn5, sklepRozbicieDodDok.FindProperty("Netto")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetColumn3, sklepRozbicieDodDok.FindProperty("NettoDet")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagColumn3, sklepRozbicieDodDok.FindProperty("NettoMag")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn5, sklepRozbicieDodDok.FindProperty("Podatek")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetColumn3, sklepRozbicieDodDok.FindProperty("PodatekDet")!, sklepRozbicieDodDokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagColumn3, sklepRozbicieDodDok.FindProperty("PodatekMag")!, sklepRozbicieDodDokTableMapping); + + var sklepRozbicieDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDok")!; + + var defaultTableMappings232 = new List>(); + sklepRozbicieDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings232); + var blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDok", null, relationalModel); + var nettoColumnBase6 = new ColumnBase("Netto", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("Netto", nettoColumnBase6); + var nettoDetColumnBase4 = new ColumnBase("NettoDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("NettoDet", nettoDetColumnBase4); + var nettoMagColumnBase4 = new ColumnBase("NettoMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("NettoMag", nettoMagColumnBase4); + var podatekColumnBase6 = new ColumnBase("Podatek", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("Podatek", podatekColumnBase6); + var podatekDetColumnBase4 = new ColumnBase("PodatekDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("PodatekDet", podatekDetColumnBase4); + var podatekMagColumnBase4 = new ColumnBase("PodatekMag", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("PodatekMag", podatekMagColumnBase4); + var sklepDokIdColumnBase13 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase13); + var sklepIdColumnBase77 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("SklepId", sklepIdColumnBase77); + var stawkaColumnBase12 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.Columns.Add("Stawka", stawkaColumnBase12); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDok", blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase = new TableMappingBase(sklepRozbicieDok, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase, false); + defaultTableMappings232.Add(blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase13, sklepRozbicieDok.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase77, sklepRozbicieDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase12, sklepRozbicieDok.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoColumnBase6, sklepRozbicieDok.FindProperty("Netto")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoDetColumnBase4, sklepRozbicieDok.FindProperty("NettoDet")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nettoMagColumnBase4, sklepRozbicieDok.FindProperty("NettoMag")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekColumnBase6, sklepRozbicieDok.FindProperty("Podatek")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekDetColumnBase4, sklepRozbicieDok.FindProperty("PodatekDet")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)podatekMagColumnBase4, sklepRozbicieDok.FindProperty("PodatekMag")!, blinkBackofficeServicesPcmDbEntitiesSklepRozbicieDokMappingBase); + + var tableMappings232 = new List(); + sklepRozbicieDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings232); + var sklepRozbicieDokTable = new Table("SklepRozbicieDok", null, relationalModel); + var sklepIdColumn77 = new Column("SklepId", "numeric(9,0)", sklepRozbicieDokTable); + sklepRozbicieDokTable.Columns.Add("SklepId", sklepIdColumn77); + var sklepDokIdColumn13 = new Column("SklepDokId", "numeric(9,0)", sklepRozbicieDokTable); + sklepRozbicieDokTable.Columns.Add("SklepDokId", sklepDokIdColumn13); + var stawkaColumn12 = new Column("Stawka", "smallint", sklepRozbicieDokTable); + sklepRozbicieDokTable.Columns.Add("Stawka", stawkaColumn12); + var nettoColumn6 = new Column("Netto", "decimal(15,4)", sklepRozbicieDokTable); + sklepRozbicieDokTable.Columns.Add("Netto", nettoColumn6); + var nettoDetColumn4 = new Column("NettoDet", "decimal(15,4)", sklepRozbicieDokTable); + sklepRozbicieDokTable.Columns.Add("NettoDet", nettoDetColumn4); + var nettoMagColumn4 = new Column("NettoMag", "decimal(15,4)", sklepRozbicieDokTable) + { + IsNullable = true + }; + sklepRozbicieDokTable.Columns.Add("NettoMag", nettoMagColumn4); + var podatekColumn6 = new Column("Podatek", "decimal(15,4)", sklepRozbicieDokTable); + sklepRozbicieDokTable.Columns.Add("Podatek", podatekColumn6); + var podatekDetColumn4 = new Column("PodatekDet", "decimal(15,4)", sklepRozbicieDokTable); + sklepRozbicieDokTable.Columns.Add("PodatekDet", podatekDetColumn4); + var podatekMagColumn4 = new Column("PodatekMag", "decimal(15,4)", sklepRozbicieDokTable) + { + IsNullable = true + }; + sklepRozbicieDokTable.Columns.Add("PodatekMag", podatekMagColumn4); + var pK_SKLEPROZBICIEDOK = new UniqueConstraint("PK_SKLEPROZBICIEDOK", sklepRozbicieDokTable, new[] { sklepIdColumn77, sklepDokIdColumn13, stawkaColumn12 }); + sklepRozbicieDokTable.PrimaryKey = pK_SKLEPROZBICIEDOK; + var pK_SKLEPROZBICIEDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDok", + new[] { "SklepId", "SklepDokId", "Stawka" }); + pK_SKLEPROZBICIEDOK.MappedKeys.Add(pK_SKLEPROZBICIEDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPROZBICIEDOKUc).Add(pK_SKLEPROZBICIEDOK); + sklepRozbicieDokTable.UniqueConstraints.Add("PK_SKLEPROZBICIEDOK", pK_SKLEPROZBICIEDOK); + relationalModel.Tables.Add(("SklepRozbicieDok", null), sklepRozbicieDokTable); + var sklepRozbicieDokTableMapping = new TableMapping(sklepRozbicieDok, sklepRozbicieDokTable, true); + sklepRozbicieDokTable.AddTypeMapping(sklepRozbicieDokTableMapping, false); + tableMappings232.Add(sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn13, sklepRozbicieDok.FindProperty("SklepDokId")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn77, sklepRozbicieDok.FindProperty("SklepId")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn12, sklepRozbicieDok.FindProperty("Stawka")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(nettoColumn6, sklepRozbicieDok.FindProperty("Netto")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(nettoDetColumn4, sklepRozbicieDok.FindProperty("NettoDet")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(nettoMagColumn4, sklepRozbicieDok.FindProperty("NettoMag")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(podatekColumn6, sklepRozbicieDok.FindProperty("Podatek")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(podatekDetColumn4, sklepRozbicieDok.FindProperty("PodatekDet")!, sklepRozbicieDokTableMapping); + RelationalModel.CreateColumnMapping(podatekMagColumn4, sklepRozbicieDok.FindProperty("PodatekMag")!, sklepRozbicieDokTableMapping); + + var sklepRozlPartii = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii")!; + + var defaultTableMappings233 = new List>(); + sklepRozlPartii.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings233); + var blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii", null, relationalModel); + var prtKolejnoscColumnBase0 = new ColumnBase("PrtKolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase.Columns.Add("PrtKolejnosc", prtKolejnoscColumnBase0); + var prtSklepDokIdColumnBase = new ColumnBase("PrtSklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase.Columns.Add("PrtSklepDokId", prtSklepDokIdColumnBase); + var rozKolejnoscColumnBase0 = new ColumnBase("RozKolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase.Columns.Add("RozKolejnosc", rozKolejnoscColumnBase0); + var rozSklepDokIdColumnBase = new ColumnBase("RozSklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase.Columns.Add("RozSklepDokId", rozSklepDokIdColumnBase); + var rozliczenieColumnBase1 = new ColumnBase("Rozliczenie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase.Columns.Add("Rozliczenie", rozliczenieColumnBase1); + var sklepIdColumnBase78 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase.Columns.Add("SklepId", sklepIdColumnBase78); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii", blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase = new TableMappingBase(sklepRozlPartii, blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase, false); + defaultTableMappings233.Add(blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prtKolejnoscColumnBase0, sklepRozlPartii.FindProperty("PrtKolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prtSklepDokIdColumnBase, sklepRozlPartii.FindProperty("PrtSklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozKolejnoscColumnBase0, sklepRozlPartii.FindProperty("RozKolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozSklepDokIdColumnBase, sklepRozlPartii.FindProperty("RozSklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase78, sklepRozlPartii.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczenieColumnBase1, sklepRozlPartii.FindProperty("Rozliczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRozlPartiiMappingBase); + + var tableMappings233 = new List(); + sklepRozlPartii.SetRuntimeAnnotation("Relational:TableMappings", tableMappings233); + var sklepRozlPartiiTable = new Table("SklepRozlPartii", null, relationalModel); + var sklepIdColumn78 = new Column("SklepId", "numeric(9,0)", sklepRozlPartiiTable); + sklepRozlPartiiTable.Columns.Add("SklepId", sklepIdColumn78); + var rozSklepDokIdColumn = new Column("RozSklepDokId", "numeric(9,0)", sklepRozlPartiiTable); + sklepRozlPartiiTable.Columns.Add("RozSklepDokId", rozSklepDokIdColumn); + var rozKolejnoscColumn0 = new Column("RozKolejnosc", "int", sklepRozlPartiiTable); + sklepRozlPartiiTable.Columns.Add("RozKolejnosc", rozKolejnoscColumn0); + var prtSklepDokIdColumn = new Column("PrtSklepDokId", "numeric(9,0)", sklepRozlPartiiTable); + sklepRozlPartiiTable.Columns.Add("PrtSklepDokId", prtSklepDokIdColumn); + var prtKolejnoscColumn0 = new Column("PrtKolejnosc", "int", sklepRozlPartiiTable); + sklepRozlPartiiTable.Columns.Add("PrtKolejnosc", prtKolejnoscColumn0); + var rozliczenieColumn1 = new Column("Rozliczenie", "decimal(15,4)", sklepRozlPartiiTable); + sklepRozlPartiiTable.Columns.Add("Rozliczenie", rozliczenieColumn1); + var pK_SKLEPROZLPARTII = new UniqueConstraint("PK_SKLEPROZLPARTII", sklepRozlPartiiTable, new[] { sklepIdColumn78, rozSklepDokIdColumn, rozKolejnoscColumn0, prtSklepDokIdColumn, prtKolejnoscColumn0 }); + sklepRozlPartiiTable.PrimaryKey = pK_SKLEPROZLPARTII; + var pK_SKLEPROZLPARTIIUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii", + new[] { "SklepId", "RozSklepDokId", "RozKolejnosc", "PrtSklepDokId", "PrtKolejnosc" }); + pK_SKLEPROZLPARTII.MappedKeys.Add(pK_SKLEPROZLPARTIIUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPROZLPARTIIUc).Add(pK_SKLEPROZLPARTII); + sklepRozlPartiiTable.UniqueConstraints.Add("PK_SKLEPROZLPARTII", pK_SKLEPROZLPARTII); + var idx_SkRozPrt = new TableIndex( + "idx_SkRozPrt", sklepRozlPartiiTable, new[] { sklepIdColumn78, prtSklepDokIdColumn, prtKolejnoscColumn0 }, false); + var idx_SkRozPrtIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii", + "idx_SkRozPrt"); + idx_SkRozPrt.MappedIndexes.Add(idx_SkRozPrtIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkRozPrtIx).Add(idx_SkRozPrt); + sklepRozlPartiiTable.Indexes.Add("idx_SkRozPrt", idx_SkRozPrt); + relationalModel.Tables.Add(("SklepRozlPartii", null), sklepRozlPartiiTable); + var sklepRozlPartiiTableMapping = new TableMapping(sklepRozlPartii, sklepRozlPartiiTable, true); + sklepRozlPartiiTable.AddTypeMapping(sklepRozlPartiiTableMapping, false); + tableMappings233.Add(sklepRozlPartiiTableMapping); + RelationalModel.CreateColumnMapping(prtKolejnoscColumn0, sklepRozlPartii.FindProperty("PrtKolejnosc")!, sklepRozlPartiiTableMapping); + RelationalModel.CreateColumnMapping(prtSklepDokIdColumn, sklepRozlPartii.FindProperty("PrtSklepDokId")!, sklepRozlPartiiTableMapping); + RelationalModel.CreateColumnMapping(rozKolejnoscColumn0, sklepRozlPartii.FindProperty("RozKolejnosc")!, sklepRozlPartiiTableMapping); + RelationalModel.CreateColumnMapping(rozSklepDokIdColumn, sklepRozlPartii.FindProperty("RozSklepDokId")!, sklepRozlPartiiTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn78, sklepRozlPartii.FindProperty("SklepId")!, sklepRozlPartiiTableMapping); + RelationalModel.CreateColumnMapping(rozliczenieColumn1, sklepRozlPartii.FindProperty("Rozliczenie")!, sklepRozlPartiiTableMapping); + + var sklepRozlicza = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza")!; + + var defaultTableMappings234 = new List>(); + sklepRozlicza.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings234); + var blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza", null, relationalModel); + var kolejnoscColumnBase49 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase49); + var rozliczanySklepDokIdColumnBase = new ColumnBase("RozliczanySklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.Columns.Add("RozliczanySklepDokId", rozliczanySklepDokIdColumnBase); + var rozliczanySklepIdColumnBase = new ColumnBase("RozliczanySklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.Columns.Add("RozliczanySklepId", rozliczanySklepIdColumnBase); + var rozliczenieColumnBase2 = new ColumnBase("Rozliczenie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.Columns.Add("Rozliczenie", rozliczenieColumnBase2); + var rozliczeniePodatkuColumnBase0 = new ColumnBase("RozliczeniePodatku", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.Columns.Add("RozliczeniePodatku", rozliczeniePodatkuColumnBase0); + var sklepDokIdColumnBase14 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase14); + var sklepIdColumnBase79 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.Columns.Add("SklepId", sklepIdColumnBase79); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza", blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase = new TableMappingBase(sklepRozlicza, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepRozliczaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase, false); + defaultTableMappings234.Add(blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase49, sklepRozlicza.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase14, sklepRozlicza.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase79, sklepRozlicza.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczanySklepDokIdColumnBase, sklepRozlicza.FindProperty("RozliczanySklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczanySklepIdColumnBase, sklepRozlicza.FindProperty("RozliczanySklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczenieColumnBase2, sklepRozlicza.FindProperty("Rozliczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozliczeniePodatkuColumnBase0, sklepRozlicza.FindProperty("RozliczeniePodatku")!, blinkBackofficeServicesPcmDbEntitiesSklepRozliczaMappingBase); + + var tableMappings234 = new List(); + sklepRozlicza.SetRuntimeAnnotation("Relational:TableMappings", tableMappings234); + var sklepRozliczaTable = new Table("SklepRozlicza", null, relationalModel); + var sklepIdColumn79 = new Column("SklepId", "numeric(9,0)", sklepRozliczaTable); + sklepRozliczaTable.Columns.Add("SklepId", sklepIdColumn79); + var sklepDokIdColumn14 = new Column("SklepDokId", "numeric(9,0)", sklepRozliczaTable); + sklepRozliczaTable.Columns.Add("SklepDokId", sklepDokIdColumn14); + var kolejnoscColumn49 = new Column("Kolejnosc", "int", sklepRozliczaTable); + sklepRozliczaTable.Columns.Add("Kolejnosc", kolejnoscColumn49); + var rozliczanySklepDokIdColumn = new Column("RozliczanySklepDokId", "numeric(9,0)", sklepRozliczaTable); + sklepRozliczaTable.Columns.Add("RozliczanySklepDokId", rozliczanySklepDokIdColumn); + var rozliczanySklepIdColumn = new Column("RozliczanySklepId", "numeric(9,0)", sklepRozliczaTable); + sklepRozliczaTable.Columns.Add("RozliczanySklepId", rozliczanySklepIdColumn); + var rozliczenieColumn2 = new Column("Rozliczenie", "decimal(15,4)", sklepRozliczaTable); + sklepRozliczaTable.Columns.Add("Rozliczenie", rozliczenieColumn2); + var rozliczeniePodatkuColumn0 = new Column("RozliczeniePodatku", "decimal(15,4)", sklepRozliczaTable) + { + IsNullable = true + }; + sklepRozliczaTable.Columns.Add("RozliczeniePodatku", rozliczeniePodatkuColumn0); + var pK_SKLEPROZLICZA = new UniqueConstraint("PK_SKLEPROZLICZA", sklepRozliczaTable, new[] { sklepIdColumn79, sklepDokIdColumn14, kolejnoscColumn49 }); + sklepRozliczaTable.PrimaryKey = pK_SKLEPROZLICZA; + var pK_SKLEPROZLICZAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + pK_SKLEPROZLICZA.MappedKeys.Add(pK_SKLEPROZLICZAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPROZLICZAUc).Add(pK_SKLEPROZLICZA); + sklepRozliczaTable.UniqueConstraints.Add("PK_SKLEPROZLICZA", pK_SKLEPROZLICZA); + var idx_SkRozliczany = new TableIndex( + "idx_SkRozliczany", sklepRozliczaTable, new[] { rozliczanySklepIdColumn, rozliczanySklepDokIdColumn }, false); + var idx_SkRozliczanyIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza", + "idx_SkRozliczany"); + idx_SkRozliczany.MappedIndexes.Add(idx_SkRozliczanyIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkRozliczanyIx).Add(idx_SkRozliczany); + sklepRozliczaTable.Indexes.Add("idx_SkRozliczany", idx_SkRozliczany); + relationalModel.Tables.Add(("SklepRozlicza", null), sklepRozliczaTable); + var sklepRozliczaTableMapping = new TableMapping(sklepRozlicza, sklepRozliczaTable, true); + sklepRozliczaTable.AddTypeMapping(sklepRozliczaTableMapping, false); + tableMappings234.Add(sklepRozliczaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn49, sklepRozlicza.FindProperty("Kolejnosc")!, sklepRozliczaTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn14, sklepRozlicza.FindProperty("SklepDokId")!, sklepRozliczaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn79, sklepRozlicza.FindProperty("SklepId")!, sklepRozliczaTableMapping); + RelationalModel.CreateColumnMapping(rozliczanySklepDokIdColumn, sklepRozlicza.FindProperty("RozliczanySklepDokId")!, sklepRozliczaTableMapping); + RelationalModel.CreateColumnMapping(rozliczanySklepIdColumn, sklepRozlicza.FindProperty("RozliczanySklepId")!, sklepRozliczaTableMapping); + RelationalModel.CreateColumnMapping(rozliczenieColumn2, sklepRozlicza.FindProperty("Rozliczenie")!, sklepRozliczaTableMapping); + RelationalModel.CreateColumnMapping(rozliczeniePodatkuColumn0, sklepRozlicza.FindProperty("RozliczeniePodatku")!, sklepRozliczaTableMapping); + + var sklepSkladnikDefinicjiKodu = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikDefinicjiKodu")!; + + var defaultTableMappings235 = new List>(); + sklepSkladnikDefinicjiKodu.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings235); + var blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikDefinicjiKodu", null, relationalModel); + var dlugoscColumnBase0 = new ColumnBase("Dlugosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase.Columns.Add("Dlugosc", dlugoscColumnBase0); + var kolejnoscColumnBase50 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase50); + var rodzajColumnBase11 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase.Columns.Add("Rodzaj", rodzajColumnBase11); + var sklepDKIdColumnBase0 = new ColumnBase("SklepDKId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase.Columns.Add("SklepDKId", sklepDKIdColumnBase0); + var sklepIdColumnBase80 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase.Columns.Add("SklepId", sklepIdColumnBase80); + var tekstColumnBase23 = new ColumnBase("Tekst", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase.Columns.Add("Tekst", tekstColumnBase23); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikDefinicjiKodu", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase = new TableMappingBase(sklepSkladnikDefinicjiKodu, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase, false); + defaultTableMappings235.Add(blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase50, sklepSkladnikDefinicjiKodu.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDKIdColumnBase0, sklepSkladnikDefinicjiKodu.FindProperty("SklepDKId")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase80, sklepSkladnikDefinicjiKodu.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dlugoscColumnBase0, sklepSkladnikDefinicjiKodu.FindProperty("Dlugosc")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase11, sklepSkladnikDefinicjiKodu.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase23, sklepSkladnikDefinicjiKodu.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikDefinicjiKoduMappingBase); + + var tableMappings235 = new List(); + sklepSkladnikDefinicjiKodu.SetRuntimeAnnotation("Relational:TableMappings", tableMappings235); + var sklepSkladnikDefinicjiKoduTable = new Table("SklepSkladnikDefinicjiKodu", null, relationalModel); + var sklepIdColumn80 = new Column("SklepId", "numeric(9,0)", sklepSkladnikDefinicjiKoduTable); + sklepSkladnikDefinicjiKoduTable.Columns.Add("SklepId", sklepIdColumn80); + var sklepDKIdColumn0 = new Column("SklepDKId", "numeric(9,0)", sklepSkladnikDefinicjiKoduTable); + sklepSkladnikDefinicjiKoduTable.Columns.Add("SklepDKId", sklepDKIdColumn0); + var kolejnoscColumn50 = new Column("Kolejnosc", "smallint", sklepSkladnikDefinicjiKoduTable); + sklepSkladnikDefinicjiKoduTable.Columns.Add("Kolejnosc", kolejnoscColumn50); + var dlugoscColumn0 = new Column("Dlugosc", "smallint", sklepSkladnikDefinicjiKoduTable); + sklepSkladnikDefinicjiKoduTable.Columns.Add("Dlugosc", dlugoscColumn0); + var rodzajColumn11 = new Column("Rodzaj", "smallint", sklepSkladnikDefinicjiKoduTable); + sklepSkladnikDefinicjiKoduTable.Columns.Add("Rodzaj", rodzajColumn11); + var tekstColumn23 = new Column("Tekst", "varchar(40)", sklepSkladnikDefinicjiKoduTable) + { + IsNullable = true + }; + sklepSkladnikDefinicjiKoduTable.Columns.Add("Tekst", tekstColumn23); + var pK_SKSKLDEFKODU = new UniqueConstraint("PK_SKSKLDEFKODU", sklepSkladnikDefinicjiKoduTable, new[] { sklepIdColumn80, sklepDKIdColumn0, kolejnoscColumn50 }); + sklepSkladnikDefinicjiKoduTable.PrimaryKey = pK_SKSKLDEFKODU; + var pK_SKSKLDEFKODUUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikDefinicjiKodu", + new[] { "SklepId", "SklepDKId", "Kolejnosc" }); + pK_SKSKLDEFKODU.MappedKeys.Add(pK_SKSKLDEFKODUUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKSKLDEFKODUUc).Add(pK_SKSKLDEFKODU); + sklepSkladnikDefinicjiKoduTable.UniqueConstraints.Add("PK_SKSKLDEFKODU", pK_SKSKLDEFKODU); + relationalModel.Tables.Add(("SklepSkladnikDefinicjiKodu", null), sklepSkladnikDefinicjiKoduTable); + var sklepSkladnikDefinicjiKoduTableMapping = new TableMapping(sklepSkladnikDefinicjiKodu, sklepSkladnikDefinicjiKoduTable, true); + sklepSkladnikDefinicjiKoduTable.AddTypeMapping(sklepSkladnikDefinicjiKoduTableMapping, false); + tableMappings235.Add(sklepSkladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn50, sklepSkladnikDefinicjiKodu.FindProperty("Kolejnosc")!, sklepSkladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(sklepDKIdColumn0, sklepSkladnikDefinicjiKodu.FindProperty("SklepDKId")!, sklepSkladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn80, sklepSkladnikDefinicjiKodu.FindProperty("SklepId")!, sklepSkladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(dlugoscColumn0, sklepSkladnikDefinicjiKodu.FindProperty("Dlugosc")!, sklepSkladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn11, sklepSkladnikDefinicjiKodu.FindProperty("Rodzaj")!, sklepSkladnikDefinicjiKoduTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn23, sklepSkladnikDefinicjiKodu.FindProperty("Tekst")!, sklepSkladnikDefinicjiKoduTableMapping); + + var sklepSkladnikWzorca = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca")!; + + var defaultTableMappings236 = new List>(); + sklepSkladnikWzorca.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings236); + var blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", null, relationalModel); + var aktywnyColumnBase42 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("Aktywny", aktywnyColumnBase42); + var cenaColumnBase5 = new ColumnBase("Cena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("Cena", cenaColumnBase5); + var czyDodatekColumnBase0 = new ColumnBase("CzyDodatek", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("CzyDodatek", czyDodatekColumnBase0); + var iloscColumnBase7 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("Ilosc", iloscColumnBase7); + var kolejnoscColumnBase51 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase51); + var nazwaColumnBase52 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("Nazwa", nazwaColumnBase52); + var obowiazkowyColumnBase0 = new ColumnBase("Obowiazkowy", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("Obowiazkowy", obowiazkowyColumnBase0); + var rozneCenyColumnBase0 = new ColumnBase("RozneCeny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("RozneCeny", rozneCenyColumnBase0); + var skWzIdColumnBase0 = new ColumnBase("SkWzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("SkWzId", skWzIdColumnBase0); + var sklepIdColumnBase81 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("SklepId", sklepIdColumnBase81); + var sklepSkWzIdColumnBase = new ColumnBase("SklepSkWzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("SklepSkWzId", sklepSkWzIdColumnBase); + var sklepTowIdWzorcaColumnBase = new ColumnBase("SklepTowIdWzorca", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("SklepTowIdWzorca", sklepTowIdWzorcaColumnBase); + var wyborWieluColumnBase0 = new ColumnBase("WyborWielu", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("WyborWielu", wyborWieluColumnBase0); + var wyliczenieCenyColumnBase0 = new ColumnBase("WyliczenieCeny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("WyliczenieCeny", wyliczenieCenyColumnBase0); + var zmianaColumnBase53 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.Columns.Add("Zmiana", zmianaColumnBase53); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase = new TableMappingBase(sklepSkladnikWzorca, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase, false); + defaultTableMappings236.Add(blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase81, sklepSkladnikWzorca.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepSkWzIdColumnBase, sklepSkladnikWzorca.FindProperty("SklepSkWzId")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase42, sklepSkladnikWzorca.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase5, sklepSkladnikWzorca.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czyDodatekColumnBase0, sklepSkladnikWzorca.FindProperty("CzyDodatek")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase7, sklepSkladnikWzorca.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase51, sklepSkladnikWzorca.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase52, sklepSkladnikWzorca.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)obowiazkowyColumnBase0, sklepSkladnikWzorca.FindProperty("Obowiazkowy")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rozneCenyColumnBase0, sklepSkladnikWzorca.FindProperty("RozneCeny")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skWzIdColumnBase0, sklepSkladnikWzorca.FindProperty("SkWzId")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdWzorcaColumnBase, sklepSkladnikWzorca.FindProperty("SklepTowIdWzorca")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wyborWieluColumnBase0, sklepSkladnikWzorca.FindProperty("WyborWielu")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wyliczenieCenyColumnBase0, sklepSkladnikWzorca.FindProperty("WyliczenieCeny")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase53, sklepSkladnikWzorca.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepSkladnikWzorcaMappingBase); + + var tableMappings236 = new List(); + sklepSkladnikWzorca.SetRuntimeAnnotation("Relational:TableMappings", tableMappings236); + var sklepSkladnikWzorcaTable = new Table("SklepSkladnikWzorca", null, relationalModel); + var sklepIdColumn81 = new Column("SklepId", "numeric(9,0)", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("SklepId", sklepIdColumn81); + var sklepSkWzIdColumn = new Column("SklepSkWzId", "numeric(9,0)", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("SklepSkWzId", sklepSkWzIdColumn); + var aktywnyColumn42 = new Column("Aktywny", "smallint", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("Aktywny", aktywnyColumn42); + var cenaColumn5 = new Column("Cena", "decimal(15,4)", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("Cena", cenaColumn5); + var czyDodatekColumn0 = new Column("CzyDodatek", "smallint", sklepSkladnikWzorcaTable) + { + IsNullable = true + }; + sklepSkladnikWzorcaTable.Columns.Add("CzyDodatek", czyDodatekColumn0); + var iloscColumn7 = new Column("Ilosc", "decimal(15,4)", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("Ilosc", iloscColumn7); + var kolejnoscColumn51 = new Column("Kolejnosc", "smallint", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("Kolejnosc", kolejnoscColumn51); + var nazwaColumn52 = new Column("Nazwa", "varchar(60)", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("Nazwa", nazwaColumn52); + var obowiazkowyColumn0 = new Column("Obowiazkowy", "smallint", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("Obowiazkowy", obowiazkowyColumn0); + var rozneCenyColumn0 = new Column("RozneCeny", "smallint", sklepSkladnikWzorcaTable) + { + IsNullable = true + }; + sklepSkladnikWzorcaTable.Columns.Add("RozneCeny", rozneCenyColumn0); + var skWzIdColumn0 = new Column("SkWzId", "numeric(9,0)", sklepSkladnikWzorcaTable) + { + IsNullable = true + }; + sklepSkladnikWzorcaTable.Columns.Add("SkWzId", skWzIdColumn0); + var sklepTowIdWzorcaColumn = new Column("SklepTowIdWzorca", "numeric(9,0)", sklepSkladnikWzorcaTable) + { + IsNullable = true + }; + sklepSkladnikWzorcaTable.Columns.Add("SklepTowIdWzorca", sklepTowIdWzorcaColumn); + var wyborWieluColumn0 = new Column("WyborWielu", "smallint", sklepSkladnikWzorcaTable) + { + IsNullable = true + }; + sklepSkladnikWzorcaTable.Columns.Add("WyborWielu", wyborWieluColumn0); + var wyliczenieCenyColumn0 = new Column("WyliczenieCeny", "smallint", sklepSkladnikWzorcaTable) + { + IsNullable = true + }; + sklepSkladnikWzorcaTable.Columns.Add("WyliczenieCeny", wyliczenieCenyColumn0); + var zmianaColumn53 = new Column("Zmiana", "datetime", sklepSkladnikWzorcaTable); + sklepSkladnikWzorcaTable.Columns.Add("Zmiana", zmianaColumn53); + var pK_SKLEPSKLADNIKWZORCA = new UniqueConstraint("PK_SKLEPSKLADNIKWZORCA", sklepSkladnikWzorcaTable, new[] { sklepIdColumn81, sklepSkWzIdColumn }); + sklepSkladnikWzorcaTable.PrimaryKey = pK_SKLEPSKLADNIKWZORCA; + var pK_SKLEPSKLADNIKWZORCAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", + new[] { "SklepId", "SklepSkWzId" }); + pK_SKLEPSKLADNIKWZORCA.MappedKeys.Add(pK_SKLEPSKLADNIKWZORCAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPSKLADNIKWZORCAUc).Add(pK_SKLEPSKLADNIKWZORCA); + sklepSkladnikWzorcaTable.UniqueConstraints.Add("PK_SKLEPSKLADNIKWZORCA", pK_SKLEPSKLADNIKWZORCA); + var idx_SkSkladnikWzorca_SkTowIdWzorca = new TableIndex( + "idx_SkSkladnikWzorca_SkTowIdWzorca", sklepSkladnikWzorcaTable, new[] { sklepTowIdWzorcaColumn, kolejnoscColumn51 }, false); + var idx_SkSkladnikWzorca_SkTowIdWzorcaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", + "idx_SkSkladnikWzorca_SkTowIdWzorca"); + idx_SkSkladnikWzorca_SkTowIdWzorca.MappedIndexes.Add(idx_SkSkladnikWzorca_SkTowIdWzorcaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkSkladnikWzorca_SkTowIdWzorcaIx).Add(idx_SkSkladnikWzorca_SkTowIdWzorca); + sklepSkladnikWzorcaTable.Indexes.Add("idx_SkSkladnikWzorca_SkTowIdWzorca", idx_SkSkladnikWzorca_SkTowIdWzorca); + var iX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorca = new TableIndex( + "IX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorca", sklepSkladnikWzorcaTable, new[] { sklepIdColumn81, sklepTowIdWzorcaColumn }, false); + var iX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorcaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", + new[] { "SklepId", "SklepTowIdWzorca" }); + iX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorca.MappedIndexes.Add(iX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorcaIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorcaIx).Add(iX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorca); + sklepSkladnikWzorcaTable.Indexes.Add("IX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorca", iX_SklepSkladnikWzorca_SklepId_SklepTowIdWzorca); + relationalModel.Tables.Add(("SklepSkladnikWzorca", null), sklepSkladnikWzorcaTable); + var sklepSkladnikWzorcaTableMapping = new TableMapping(sklepSkladnikWzorca, sklepSkladnikWzorcaTable, true); + sklepSkladnikWzorcaTable.AddTypeMapping(sklepSkladnikWzorcaTableMapping, false); + tableMappings236.Add(sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn81, sklepSkladnikWzorca.FindProperty("SklepId")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(sklepSkWzIdColumn, sklepSkladnikWzorca.FindProperty("SklepSkWzId")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn42, sklepSkladnikWzorca.FindProperty("Aktywny")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn5, sklepSkladnikWzorca.FindProperty("Cena")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(czyDodatekColumn0, sklepSkladnikWzorca.FindProperty("CzyDodatek")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn7, sklepSkladnikWzorca.FindProperty("Ilosc")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn51, sklepSkladnikWzorca.FindProperty("Kolejnosc")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn52, sklepSkladnikWzorca.FindProperty("Nazwa")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(obowiazkowyColumn0, sklepSkladnikWzorca.FindProperty("Obowiazkowy")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(rozneCenyColumn0, sklepSkladnikWzorca.FindProperty("RozneCeny")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(skWzIdColumn0, sklepSkladnikWzorca.FindProperty("SkWzId")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdWzorcaColumn, sklepSkladnikWzorca.FindProperty("SklepTowIdWzorca")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(wyborWieluColumn0, sklepSkladnikWzorca.FindProperty("WyborWielu")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(wyliczenieCenyColumn0, sklepSkladnikWzorca.FindProperty("WyliczenieCeny")!, sklepSkladnikWzorcaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn53, sklepSkladnikWzorca.FindProperty("Zmiana")!, sklepSkladnikWzorcaTableMapping); + + var sklepStanPrtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag")!; + + var defaultTableMappings237 = new List>(); + sklepStanPrtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings237); + var blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag", null, relationalModel); + var dzienColumnBase7 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase.Columns.Add("Dzien", dzienColumnBase7); + var pMIdColumnBase3 = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase3); + var sklepIdColumnBase82 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase.Columns.Add("SklepId", sklepIdColumnBase82); + var sklepTowIdColumnBase8 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase8); + var stanPrtColumnBase = new ColumnBase("StanPrt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase.Columns.Add("StanPrt", stanPrtColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag", blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase = new TableMappingBase(sklepStanPrtMag, blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase, false); + defaultTableMappings237.Add(blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase7, sklepStanPrtMag.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase3, sklepStanPrtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase82, sklepStanPrtMag.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase8, sklepStanPrtMag.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanPrtColumnBase, sklepStanPrtMag.FindProperty("StanPrt")!, blinkBackofficeServicesPcmDbEntitiesSklepStanPrtMagMappingBase); + + var tableMappings237 = new List(); + sklepStanPrtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings237); + var sklepStanPrtMagTable = new Table("SklepStanPrtMag", null, relationalModel); + var sklepIdColumn82 = new Column("SklepId", "numeric(9,0)", sklepStanPrtMagTable); + sklepStanPrtMagTable.Columns.Add("SklepId", sklepIdColumn82); + var dzienColumn7 = new Column("Dzien", "datetime", sklepStanPrtMagTable); + sklepStanPrtMagTable.Columns.Add("Dzien", dzienColumn7); + var sklepTowIdColumn8 = new Column("SklepTowId", "numeric(9,0)", sklepStanPrtMagTable); + sklepStanPrtMagTable.Columns.Add("SklepTowId", sklepTowIdColumn8); + var pMIdColumn3 = new Column("PMId", "numeric(9,0)", sklepStanPrtMagTable); + sklepStanPrtMagTable.Columns.Add("PMId", pMIdColumn3); + var stanPrtColumn = new Column("StanPrt", "decimal(15,4)", sklepStanPrtMagTable); + sklepStanPrtMagTable.Columns.Add("StanPrt", stanPrtColumn); + var pK_SKLEPSTANPRTMAG = new UniqueConstraint("PK_SKLEPSTANPRTMAG", sklepStanPrtMagTable, new[] { sklepIdColumn82, dzienColumn7, sklepTowIdColumn8, pMIdColumn3 }); + sklepStanPrtMagTable.PrimaryKey = pK_SKLEPSTANPRTMAG; + var pK_SKLEPSTANPRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag", + new[] { "SklepId", "Dzien", "SklepTowId", "PMId" }); + pK_SKLEPSTANPRTMAG.MappedKeys.Add(pK_SKLEPSTANPRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPSTANPRTMAGUc).Add(pK_SKLEPSTANPRTMAG); + sklepStanPrtMagTable.UniqueConstraints.Add("PK_SKLEPSTANPRTMAG", pK_SKLEPSTANPRTMAG); + var idx_SkStanPrt = new TableIndex( + "idx_SkStanPrt", sklepStanPrtMagTable, new[] { sklepIdColumn82, sklepTowIdColumn8, pMIdColumn3, dzienColumn7 }, false); + var idx_SkStanPrtIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag", + "idx_SkStanPrt"); + idx_SkStanPrt.MappedIndexes.Add(idx_SkStanPrtIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkStanPrtIx).Add(idx_SkStanPrt); + sklepStanPrtMagTable.Indexes.Add("idx_SkStanPrt", idx_SkStanPrt); + relationalModel.Tables.Add(("SklepStanPrtMag", null), sklepStanPrtMagTable); + var sklepStanPrtMagTableMapping = new TableMapping(sklepStanPrtMag, sklepStanPrtMagTable, true); + sklepStanPrtMagTable.AddTypeMapping(sklepStanPrtMagTableMapping, false); + tableMappings237.Add(sklepStanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn7, sklepStanPrtMag.FindProperty("Dzien")!, sklepStanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn3, sklepStanPrtMag.FindProperty("PMId")!, sklepStanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn82, sklepStanPrtMag.FindProperty("SklepId")!, sklepStanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn8, sklepStanPrtMag.FindProperty("SklepTowId")!, sklepStanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(stanPrtColumn, sklepStanPrtMag.FindProperty("StanPrt")!, sklepStanPrtMagTableMapping); + + var sklepSzczegPrtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepSzczegPrtMag")!; + + var defaultTableMappings238 = new List>(); + sklepSzczegPrtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings238); + var blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepSzczegPrtMag", null, relationalModel); + var pMIdColumnBase4 = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase4); + var sklepIdColumnBase83 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase.Columns.Add("SklepId", sklepIdColumnBase83); + var sklepTowIdColumnBase9 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase9); + var tekstColumnBase24 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase.Columns.Add("Tekst", tekstColumnBase24); + var typDanychColumnBase0 = new ColumnBase("TypDanych", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase.Columns.Add("TypDanych", typDanychColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepSzczegPrtMag", blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase = new TableMappingBase(sklepSzczegPrtMag, blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase, false); + defaultTableMappings238.Add(blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase4, sklepSzczegPrtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase83, sklepSzczegPrtMag.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase9, sklepSzczegPrtMag.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typDanychColumnBase0, sklepSzczegPrtMag.FindProperty("TypDanych")!, blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase24, sklepSzczegPrtMag.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepSzczegPrtMagMappingBase); + + var tableMappings238 = new List(); + sklepSzczegPrtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings238); + var sklepSzczegPrtMagTable = new Table("SklepSzczegPrtMag", null, relationalModel); + var sklepIdColumn83 = new Column("SklepId", "numeric(9,0)", sklepSzczegPrtMagTable); + sklepSzczegPrtMagTable.Columns.Add("SklepId", sklepIdColumn83); + var sklepTowIdColumn9 = new Column("SklepTowId", "numeric(9,0)", sklepSzczegPrtMagTable); + sklepSzczegPrtMagTable.Columns.Add("SklepTowId", sklepTowIdColumn9); + var pMIdColumn4 = new Column("PMId", "numeric(9,0)", sklepSzczegPrtMagTable); + sklepSzczegPrtMagTable.Columns.Add("PMId", pMIdColumn4); + var typDanychColumn0 = new Column("TypDanych", "smallint", sklepSzczegPrtMagTable); + sklepSzczegPrtMagTable.Columns.Add("TypDanych", typDanychColumn0); + var tekstColumn24 = new Column("Tekst", "varchar(255)", sklepSzczegPrtMagTable); + sklepSzczegPrtMagTable.Columns.Add("Tekst", tekstColumn24); + var pK_SKLEPSZCZEGPRTMAG = new UniqueConstraint("PK_SKLEPSZCZEGPRTMAG", sklepSzczegPrtMagTable, new[] { sklepIdColumn83, sklepTowIdColumn9, pMIdColumn4, typDanychColumn0 }); + sklepSzczegPrtMagTable.PrimaryKey = pK_SKLEPSZCZEGPRTMAG; + var pK_SKLEPSZCZEGPRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSzczegPrtMag", + new[] { "SklepId", "SklepTowId", "PMId", "TypDanych" }); + pK_SKLEPSZCZEGPRTMAG.MappedKeys.Add(pK_SKLEPSZCZEGPRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPSZCZEGPRTMAGUc).Add(pK_SKLEPSZCZEGPRTMAG); + sklepSzczegPrtMagTable.UniqueConstraints.Add("PK_SKLEPSZCZEGPRTMAG", pK_SKLEPSZCZEGPRTMAG); + relationalModel.Tables.Add(("SklepSzczegPrtMag", null), sklepSzczegPrtMagTable); + var sklepSzczegPrtMagTableMapping = new TableMapping(sklepSzczegPrtMag, sklepSzczegPrtMagTable, true); + sklepSzczegPrtMagTable.AddTypeMapping(sklepSzczegPrtMagTableMapping, false); + tableMappings238.Add(sklepSzczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn4, sklepSzczegPrtMag.FindProperty("PMId")!, sklepSzczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn83, sklepSzczegPrtMag.FindProperty("SklepId")!, sklepSzczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn9, sklepSzczegPrtMag.FindProperty("SklepTowId")!, sklepSzczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(typDanychColumn0, sklepSzczegPrtMag.FindProperty("TypDanych")!, sklepSzczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn24, sklepSzczegPrtMag.FindProperty("Tekst")!, sklepSzczegPrtMagTableMapping); + + var sklepTekstDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstDok")!; + + var defaultTableMappings239 = new List>(); + sklepTekstDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings239); + var blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstDok", null, relationalModel); + var sklepDokIdColumnBase15 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase15); + var sklepIdColumnBase84 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase.Columns.Add("SklepId", sklepIdColumnBase84); + var tekstColumnBase25 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase.Columns.Add("Tekst", tekstColumnBase25); + var znaczenieColumnBase31 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase.Columns.Add("Znaczenie", znaczenieColumnBase31); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstDok", blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTekstDokMappingBase = new TableMappingBase(sklepTekstDok, blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTekstDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTekstDokMappingBase, false); + defaultTableMappings239.Add(blinkBackofficeServicesPcmDbEntitiesSklepTekstDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase15, sklepTekstDok.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase84, sklepTekstDok.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase31, sklepTekstDok.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase25, sklepTekstDok.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstDokMappingBase); + + var tableMappings239 = new List(); + sklepTekstDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings239); + var sklepTekstDokTable = new Table("SklepTekstDok", null, relationalModel); + var sklepIdColumn84 = new Column("SklepId", "numeric(9,0)", sklepTekstDokTable); + sklepTekstDokTable.Columns.Add("SklepId", sklepIdColumn84); + var sklepDokIdColumn15 = new Column("SklepDokId", "numeric(9,0)", sklepTekstDokTable); + sklepTekstDokTable.Columns.Add("SklepDokId", sklepDokIdColumn15); + var znaczenieColumn31 = new Column("Znaczenie", "smallint", sklepTekstDokTable); + sklepTekstDokTable.Columns.Add("Znaczenie", znaczenieColumn31); + var tekstColumn25 = new Column("Tekst", "varchar(255)", sklepTekstDokTable); + sklepTekstDokTable.Columns.Add("Tekst", tekstColumn25); + var pK_SKLEPTEKSTDOK = new UniqueConstraint("PK_SKLEPTEKSTDOK", sklepTekstDokTable, new[] { sklepIdColumn84, sklepDokIdColumn15, znaczenieColumn31 }); + sklepTekstDokTable.PrimaryKey = pK_SKLEPTEKSTDOK; + var pK_SKLEPTEKSTDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstDok", + new[] { "SklepId", "SklepDokId", "Znaczenie" }); + pK_SKLEPTEKSTDOK.MappedKeys.Add(pK_SKLEPTEKSTDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTEKSTDOKUc).Add(pK_SKLEPTEKSTDOK); + sklepTekstDokTable.UniqueConstraints.Add("PK_SKLEPTEKSTDOK", pK_SKLEPTEKSTDOK); + relationalModel.Tables.Add(("SklepTekstDok", null), sklepTekstDokTable); + var sklepTekstDokTableMapping = new TableMapping(sklepTekstDok, sklepTekstDokTable, true); + sklepTekstDokTable.AddTypeMapping(sklepTekstDokTableMapping, false); + tableMappings239.Add(sklepTekstDokTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn15, sklepTekstDok.FindProperty("SklepDokId")!, sklepTekstDokTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn84, sklepTekstDok.FindProperty("SklepId")!, sklepTekstDokTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn31, sklepTekstDok.FindProperty("Znaczenie")!, sklepTekstDokTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn25, sklepTekstDok.FindProperty("Tekst")!, sklepTekstDokTableMapping); + + var sklepTekstPoz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstPoz")!; + + var defaultTableMappings240 = new List>(); + sklepTekstPoz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings240); + var blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstPoz", null, relationalModel); + var kolejnoscColumnBase52 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase52); + var sklepDokIdColumnBase16 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase16); + var sklepIdColumnBase85 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase.Columns.Add("SklepId", sklepIdColumnBase85); + var tekstColumnBase26 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase.Columns.Add("Tekst", tekstColumnBase26); + var znaczenieColumnBase32 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase.Columns.Add("Znaczenie", znaczenieColumnBase32); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstPoz", blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase = new TableMappingBase(sklepTekstPoz, blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTekstPozTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase, false); + defaultTableMappings240.Add(blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase52, sklepTekstPoz.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase16, sklepTekstPoz.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase85, sklepTekstPoz.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase32, sklepTekstPoz.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase26, sklepTekstPoz.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstPozMappingBase); + + var tableMappings240 = new List(); + sklepTekstPoz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings240); + var sklepTekstPozTable = new Table("SklepTekstPoz", null, relationalModel); + var sklepIdColumn85 = new Column("SklepId", "numeric(9,0)", sklepTekstPozTable); + sklepTekstPozTable.Columns.Add("SklepId", sklepIdColumn85); + var sklepDokIdColumn16 = new Column("SklepDokId", "numeric(9,0)", sklepTekstPozTable); + sklepTekstPozTable.Columns.Add("SklepDokId", sklepDokIdColumn16); + var kolejnoscColumn52 = new Column("Kolejnosc", "int", sklepTekstPozTable); + sklepTekstPozTable.Columns.Add("Kolejnosc", kolejnoscColumn52); + var znaczenieColumn32 = new Column("Znaczenie", "smallint", sklepTekstPozTable); + sklepTekstPozTable.Columns.Add("Znaczenie", znaczenieColumn32); + var tekstColumn26 = new Column("Tekst", "varchar(255)", sklepTekstPozTable); + sklepTekstPozTable.Columns.Add("Tekst", tekstColumn26); + var pK_SKLEPTEKSTPOZ = new UniqueConstraint("PK_SKLEPTEKSTPOZ", sklepTekstPozTable, new[] { sklepIdColumn85, sklepDokIdColumn16, kolejnoscColumn52, znaczenieColumn32 }); + sklepTekstPozTable.PrimaryKey = pK_SKLEPTEKSTPOZ; + var pK_SKLEPTEKSTPOZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstPoz", + new[] { "SklepId", "SklepDokId", "Kolejnosc", "Znaczenie" }); + pK_SKLEPTEKSTPOZ.MappedKeys.Add(pK_SKLEPTEKSTPOZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTEKSTPOZUc).Add(pK_SKLEPTEKSTPOZ); + sklepTekstPozTable.UniqueConstraints.Add("PK_SKLEPTEKSTPOZ", pK_SKLEPTEKSTPOZ); + relationalModel.Tables.Add(("SklepTekstPoz", null), sklepTekstPozTable); + var sklepTekstPozTableMapping = new TableMapping(sklepTekstPoz, sklepTekstPozTable, true); + sklepTekstPozTable.AddTypeMapping(sklepTekstPozTableMapping, false); + tableMappings240.Add(sklepTekstPozTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn52, sklepTekstPoz.FindProperty("Kolejnosc")!, sklepTekstPozTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn16, sklepTekstPoz.FindProperty("SklepDokId")!, sklepTekstPozTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn85, sklepTekstPoz.FindProperty("SklepId")!, sklepTekstPozTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn32, sklepTekstPoz.FindProperty("Znaczenie")!, sklepTekstPozTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn26, sklepTekstPoz.FindProperty("Tekst")!, sklepTekstPozTableMapping); + + var sklepTekstZgody = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstZgody")!; + + var defaultTableMappings241 = new List>(); + sklepTekstZgody.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings241); + var blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstZgody", null, relationalModel); + var kolejnoscColumnBase53 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase53); + var sklepIdColumnBase86 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase.Columns.Add("SklepId", sklepIdColumnBase86); + var sklepZgIdColumnBase0 = new ColumnBase("SklepZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase.Columns.Add("SklepZgId", sklepZgIdColumnBase0); + var tekstColumnBase27 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase.Columns.Add("Tekst", tekstColumnBase27); + var wersjaColumnBase4 = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase.Columns.Add("Wersja", wersjaColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTekstZgody", blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase = new TableMappingBase(sklepTekstZgody, blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase, false); + defaultTableMappings241.Add(blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase53, sklepTekstZgody.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase86, sklepTekstZgody.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZgIdColumnBase0, sklepTekstZgody.FindProperty("SklepZgId")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase4, sklepTekstZgody.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase27, sklepTekstZgody.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepTekstZgodyMappingBase); + + var tableMappings241 = new List(); + sklepTekstZgody.SetRuntimeAnnotation("Relational:TableMappings", tableMappings241); + var sklepTekstZgodyTable = new Table("SklepTekstZgody", null, relationalModel); + var sklepIdColumn86 = new Column("SklepId", "numeric(9,0)", sklepTekstZgodyTable); + sklepTekstZgodyTable.Columns.Add("SklepId", sklepIdColumn86); + var sklepZgIdColumn0 = new Column("SklepZgId", "numeric(9,0)", sklepTekstZgodyTable); + sklepTekstZgodyTable.Columns.Add("SklepZgId", sklepZgIdColumn0); + var wersjaColumn4 = new Column("Wersja", "varchar(20)", sklepTekstZgodyTable); + sklepTekstZgodyTable.Columns.Add("Wersja", wersjaColumn4); + var kolejnoscColumn53 = new Column("Kolejnosc", "int", sklepTekstZgodyTable); + sklepTekstZgodyTable.Columns.Add("Kolejnosc", kolejnoscColumn53); + var tekstColumn27 = new Column("Tekst", "varchar(255)", sklepTekstZgodyTable); + sklepTekstZgodyTable.Columns.Add("Tekst", tekstColumn27); + var pK_SKLEPTEKSTZGODY = new UniqueConstraint("PK_SKLEPTEKSTZGODY", sklepTekstZgodyTable, new[] { sklepIdColumn86, sklepZgIdColumn0, wersjaColumn4, kolejnoscColumn53 }); + sklepTekstZgodyTable.PrimaryKey = pK_SKLEPTEKSTZGODY; + var pK_SKLEPTEKSTZGODYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstZgody", + new[] { "SklepId", "SklepZgId", "Wersja", "Kolejnosc" }); + pK_SKLEPTEKSTZGODY.MappedKeys.Add(pK_SKLEPTEKSTZGODYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTEKSTZGODYUc).Add(pK_SKLEPTEKSTZGODY); + sklepTekstZgodyTable.UniqueConstraints.Add("PK_SKLEPTEKSTZGODY", pK_SKLEPTEKSTZGODY); + relationalModel.Tables.Add(("SklepTekstZgody", null), sklepTekstZgodyTable); + var sklepTekstZgodyTableMapping = new TableMapping(sklepTekstZgody, sklepTekstZgodyTable, true); + sklepTekstZgodyTable.AddTypeMapping(sklepTekstZgodyTableMapping, false); + tableMappings241.Add(sklepTekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn53, sklepTekstZgody.FindProperty("Kolejnosc")!, sklepTekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn86, sklepTekstZgody.FindProperty("SklepId")!, sklepTekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(sklepZgIdColumn0, sklepTekstZgody.FindProperty("SklepZgId")!, sklepTekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn4, sklepTekstZgody.FindProperty("Wersja")!, sklepTekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn27, sklepTekstZgody.FindProperty("Tekst")!, sklepTekstZgodyTableMapping); + + var sklepTowAkcyza = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza")!; + + var defaultTableMappings242 = new List>(); + sklepTowAkcyza.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings242); + var blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza", null, relationalModel); + var cenaMaxColumnBase = new ColumnBase("CenaMax", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("CenaMax", cenaMaxColumnBase); + var ileAkcJMColumnBase = new ColumnBase("IleAkcJM", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("IleAkcJM", ileAkcJMColumnBase); + var kodCNColumnBase = new ColumnBase("KodCN", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("KodCN", kodCNColumnBase); + var kolejnoscColumnBase54 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase54); + var skladColumnBase = new ColumnBase("Sklad", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("Sklad", skladColumnBase); + var sklepGrAkcIdColumnBase1 = new ColumnBase("SklepGrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("SklepGrAkcId", sklepGrAkcIdColumnBase1); + var sklepIdColumnBase87 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("SklepId", sklepIdColumnBase87); + var sklepTowIdColumnBase10 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase10); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza", blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase = new TableMappingBase(sklepTowAkcyza, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase, false); + defaultTableMappings242.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase54, sklepTowAkcyza.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase87, sklepTowAkcyza.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase10, sklepTowAkcyza.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaMaxColumnBase, sklepTowAkcyza.FindProperty("CenaMax")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileAkcJMColumnBase, sklepTowAkcyza.FindProperty("IleAkcJM")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodCNColumnBase, sklepTowAkcyza.FindProperty("KodCN")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skladColumnBase, sklepTowAkcyza.FindProperty("Sklad")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepGrAkcIdColumnBase1, sklepTowAkcyza.FindProperty("SklepGrAkcId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowAkcyzaMappingBase); + + var tableMappings242 = new List(); + sklepTowAkcyza.SetRuntimeAnnotation("Relational:TableMappings", tableMappings242); + var sklepTowAkcyzaTable = new Table("SklepTowAkcyza", null, relationalModel); + var sklepIdColumn87 = new Column("SklepId", "numeric(9,0)", sklepTowAkcyzaTable); + sklepTowAkcyzaTable.Columns.Add("SklepId", sklepIdColumn87); + var sklepTowIdColumn10 = new Column("SklepTowId", "numeric(9,0)", sklepTowAkcyzaTable); + sklepTowAkcyzaTable.Columns.Add("SklepTowId", sklepTowIdColumn10); + var kolejnoscColumn54 = new Column("Kolejnosc", "smallint", sklepTowAkcyzaTable); + sklepTowAkcyzaTable.Columns.Add("Kolejnosc", kolejnoscColumn54); + var cenaMaxColumn = new Column("CenaMax", "decimal(15,4)", sklepTowAkcyzaTable) + { + IsNullable = true + }; + sklepTowAkcyzaTable.Columns.Add("CenaMax", cenaMaxColumn); + var ileAkcJMColumn = new Column("IleAkcJM", "decimal(15,4)", sklepTowAkcyzaTable) + { + IsNullable = true + }; + sklepTowAkcyzaTable.Columns.Add("IleAkcJM", ileAkcJMColumn); + var kodCNColumn = new Column("KodCN", "varchar(20)", sklepTowAkcyzaTable) + { + IsNullable = true + }; + sklepTowAkcyzaTable.Columns.Add("KodCN", kodCNColumn); + var skladColumn = new Column("Sklad", "decimal(15,4)", sklepTowAkcyzaTable) + { + IsNullable = true + }; + sklepTowAkcyzaTable.Columns.Add("Sklad", skladColumn); + var sklepGrAkcIdColumn1 = new Column("SklepGrAkcId", "numeric(9,0)", sklepTowAkcyzaTable); + sklepTowAkcyzaTable.Columns.Add("SklepGrAkcId", sklepGrAkcIdColumn1); + var pK_SKLEPTOWAKCYZA = new UniqueConstraint("PK_SKLEPTOWAKCYZA", sklepTowAkcyzaTable, new[] { sklepIdColumn87, sklepTowIdColumn10, kolejnoscColumn54 }); + sklepTowAkcyzaTable.PrimaryKey = pK_SKLEPTOWAKCYZA; + var pK_SKLEPTOWAKCYZAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza", + new[] { "SklepId", "SklepTowId", "Kolejnosc" }); + pK_SKLEPTOWAKCYZA.MappedKeys.Add(pK_SKLEPTOWAKCYZAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWAKCYZAUc).Add(pK_SKLEPTOWAKCYZA); + sklepTowAkcyzaTable.UniqueConstraints.Add("PK_SKLEPTOWAKCYZA", pK_SKLEPTOWAKCYZA); + var idx_SkTowAkcGr = new TableIndex( + "idx_SkTowAkcGr", sklepTowAkcyzaTable, new[] { sklepIdColumn87, sklepGrAkcIdColumn1 }, false); + var idx_SkTowAkcGrIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza", + "idx_SkTowAkcGr"); + idx_SkTowAkcGr.MappedIndexes.Add(idx_SkTowAkcGrIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkTowAkcGrIx).Add(idx_SkTowAkcGr); + sklepTowAkcyzaTable.Indexes.Add("idx_SkTowAkcGr", idx_SkTowAkcGr); + relationalModel.Tables.Add(("SklepTowAkcyza", null), sklepTowAkcyzaTable); + var sklepTowAkcyzaTableMapping = new TableMapping(sklepTowAkcyza, sklepTowAkcyzaTable, true); + sklepTowAkcyzaTable.AddTypeMapping(sklepTowAkcyzaTableMapping, false); + tableMappings242.Add(sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn54, sklepTowAkcyza.FindProperty("Kolejnosc")!, sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn87, sklepTowAkcyza.FindProperty("SklepId")!, sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn10, sklepTowAkcyza.FindProperty("SklepTowId")!, sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(cenaMaxColumn, sklepTowAkcyza.FindProperty("CenaMax")!, sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(ileAkcJMColumn, sklepTowAkcyza.FindProperty("IleAkcJM")!, sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(kodCNColumn, sklepTowAkcyza.FindProperty("KodCN")!, sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(skladColumn, sklepTowAkcyza.FindProperty("Sklad")!, sklepTowAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(sklepGrAkcIdColumn1, sklepTowAkcyza.FindProperty("SklepGrAkcId")!, sklepTowAkcyzaTableMapping); + + var sklepTowDodatek = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek")!; + + var defaultTableMappings243 = new List>(); + sklepTowDodatek.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings243); + var blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek", null, relationalModel); + var cenaColumnBase6 = new ColumnBase("Cena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("Cena", cenaColumnBase6); + var dodSklepTowIdColumnBase = new ColumnBase("DodSklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("DodSklepTowId", dodSklepTowIdColumnBase); + var domyslnyColumnBase = new ColumnBase("Domyslny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("Domyslny", domyslnyColumnBase); + var iloscColumnBase8 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("Ilosc", iloscColumnBase8); + var kolejnoscColumnBase55 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase55); + var obowiazkowyColumnBase1 = new ColumnBase("Obowiazkowy", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("Obowiazkowy", obowiazkowyColumnBase1); + var param1ColumnBase13 = new ColumnBase("Param1", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("Param1", param1ColumnBase13); + var sklepIdColumnBase88 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("SklepId", sklepIdColumnBase88); + var sklepTowIdColumnBase11 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase11); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek", blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase = new TableMappingBase(sklepTowDodatek, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase, false); + defaultTableMappings243.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase55, sklepTowDodatek.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase88, sklepTowDodatek.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase11, sklepTowDodatek.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase6, sklepTowDodatek.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodSklepTowIdColumnBase, sklepTowDodatek.FindProperty("DodSklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslnyColumnBase, sklepTowDodatek.FindProperty("Domyslny")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase8, sklepTowDodatek.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)obowiazkowyColumnBase1, sklepTowDodatek.FindProperty("Obowiazkowy")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase13, sklepTowDodatek.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesSklepTowDodatekMappingBase); + + var tableMappings243 = new List(); + sklepTowDodatek.SetRuntimeAnnotation("Relational:TableMappings", tableMappings243); + var sklepTowDodatekTable = new Table("SklepTowDodatek", null, relationalModel); + var sklepIdColumn88 = new Column("SklepId", "numeric(9,0)", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("SklepId", sklepIdColumn88); + var sklepTowIdColumn11 = new Column("SklepTowId", "numeric(9,0)", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("SklepTowId", sklepTowIdColumn11); + var kolejnoscColumn55 = new Column("Kolejnosc", "smallint", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("Kolejnosc", kolejnoscColumn55); + var cenaColumn6 = new Column("Cena", "decimal(15,4)", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("Cena", cenaColumn6); + var dodSklepTowIdColumn = new Column("DodSklepTowId", "numeric(9,0)", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("DodSklepTowId", dodSklepTowIdColumn); + var domyslnyColumn = new Column("Domyslny", "smallint", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("Domyslny", domyslnyColumn); + var iloscColumn8 = new Column("Ilosc", "decimal(15,4)", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("Ilosc", iloscColumn8); + var obowiazkowyColumn1 = new Column("Obowiazkowy", "smallint", sklepTowDodatekTable); + sklepTowDodatekTable.Columns.Add("Obowiazkowy", obowiazkowyColumn1); + var param1Column13 = new Column("Param1", "smallint", sklepTowDodatekTable) + { + IsNullable = true + }; + sklepTowDodatekTable.Columns.Add("Param1", param1Column13); + var pK_SKLEPTOWDODATEK = new UniqueConstraint("PK_SKLEPTOWDODATEK", sklepTowDodatekTable, new[] { sklepIdColumn88, sklepTowIdColumn11, kolejnoscColumn55 }); + sklepTowDodatekTable.PrimaryKey = pK_SKLEPTOWDODATEK; + var pK_SKLEPTOWDODATEKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek", + new[] { "SklepId", "SklepTowId", "Kolejnosc" }); + pK_SKLEPTOWDODATEK.MappedKeys.Add(pK_SKLEPTOWDODATEKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWDODATEKUc).Add(pK_SKLEPTOWDODATEK); + sklepTowDodatekTable.UniqueConstraints.Add("PK_SKLEPTOWDODATEK", pK_SKLEPTOWDODATEK); + var iX_SklepTowDodatek_SklepId_DodSklepTowId = new TableIndex( + "IX_SklepTowDodatek_SklepId_DodSklepTowId", sklepTowDodatekTable, new[] { sklepIdColumn88, dodSklepTowIdColumn }, false); + var iX_SklepTowDodatek_SklepId_DodSklepTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek", + new[] { "SklepId", "DodSklepTowId" }); + iX_SklepTowDodatek_SklepId_DodSklepTowId.MappedIndexes.Add(iX_SklepTowDodatek_SklepId_DodSklepTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepTowDodatek_SklepId_DodSklepTowIdIx).Add(iX_SklepTowDodatek_SklepId_DodSklepTowId); + sklepTowDodatekTable.Indexes.Add("IX_SklepTowDodatek_SklepId_DodSklepTowId", iX_SklepTowDodatek_SklepId_DodSklepTowId); + relationalModel.Tables.Add(("SklepTowDodatek", null), sklepTowDodatekTable); + var sklepTowDodatekTableMapping = new TableMapping(sklepTowDodatek, sklepTowDodatekTable, true); + sklepTowDodatekTable.AddTypeMapping(sklepTowDodatekTableMapping, false); + tableMappings243.Add(sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn55, sklepTowDodatek.FindProperty("Kolejnosc")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn88, sklepTowDodatek.FindProperty("SklepId")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn11, sklepTowDodatek.FindProperty("SklepTowId")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn6, sklepTowDodatek.FindProperty("Cena")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(dodSklepTowIdColumn, sklepTowDodatek.FindProperty("DodSklepTowId")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(domyslnyColumn, sklepTowDodatek.FindProperty("Domyslny")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn8, sklepTowDodatek.FindProperty("Ilosc")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(obowiazkowyColumn1, sklepTowDodatek.FindProperty("Obowiazkowy")!, sklepTowDodatekTableMapping); + RelationalModel.CreateColumnMapping(param1Column13, sklepTowDodatek.FindProperty("Param1")!, sklepTowDodatekTableMapping); + + var sklepTowIntParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowIntParam")!; + + var defaultTableMappings244 = new List>(); + sklepTowIntParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings244); + var blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowIntParam", null, relationalModel); + var paramColumnBase1 = new ColumnBase("Param", "int", blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase.Columns.Add("Param", paramColumnBase1); + var sklepIdColumnBase89 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase.Columns.Add("SklepId", sklepIdColumnBase89); + var sklepTowIdColumnBase12 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase12); + var znaczenieColumnBase33 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase.Columns.Add("Znaczenie", znaczenieColumnBase33); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowIntParam", blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamMappingBase = new TableMappingBase(sklepTowIntParam, blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamMappingBase, false); + defaultTableMappings244.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase89, sklepTowIntParam.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase12, sklepTowIntParam.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase33, sklepTowIntParam.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramColumnBase1, sklepTowIntParam.FindProperty("Param")!, blinkBackofficeServicesPcmDbEntitiesSklepTowIntParamMappingBase); + + var tableMappings244 = new List(); + sklepTowIntParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings244); + var sklepTowIntParamTable = new Table("SklepTowIntParam", null, relationalModel); + var sklepIdColumn89 = new Column("SklepId", "numeric(9,0)", sklepTowIntParamTable); + sklepTowIntParamTable.Columns.Add("SklepId", sklepIdColumn89); + var sklepTowIdColumn12 = new Column("SklepTowId", "numeric(9,0)", sklepTowIntParamTable); + sklepTowIntParamTable.Columns.Add("SklepTowId", sklepTowIdColumn12); + var znaczenieColumn33 = new Column("Znaczenie", "smallint", sklepTowIntParamTable); + sklepTowIntParamTable.Columns.Add("Znaczenie", znaczenieColumn33); + var paramColumn1 = new Column("Param", "int", sklepTowIntParamTable); + sklepTowIntParamTable.Columns.Add("Param", paramColumn1); + var pK_SKLEPTOWINTPARAM = new UniqueConstraint("PK_SKLEPTOWINTPARAM", sklepTowIntParamTable, new[] { sklepIdColumn89, sklepTowIdColumn12, znaczenieColumn33 }); + sklepTowIntParamTable.PrimaryKey = pK_SKLEPTOWINTPARAM; + var pK_SKLEPTOWINTPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowIntParam", + new[] { "SklepId", "SklepTowId", "Znaczenie" }); + pK_SKLEPTOWINTPARAM.MappedKeys.Add(pK_SKLEPTOWINTPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWINTPARAMUc).Add(pK_SKLEPTOWINTPARAM); + sklepTowIntParamTable.UniqueConstraints.Add("PK_SKLEPTOWINTPARAM", pK_SKLEPTOWINTPARAM); + relationalModel.Tables.Add(("SklepTowIntParam", null), sklepTowIntParamTable); + var sklepTowIntParamTableMapping = new TableMapping(sklepTowIntParam, sklepTowIntParamTable, true); + sklepTowIntParamTable.AddTypeMapping(sklepTowIntParamTableMapping, false); + tableMappings244.Add(sklepTowIntParamTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn89, sklepTowIntParam.FindProperty("SklepId")!, sklepTowIntParamTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn12, sklepTowIntParam.FindProperty("SklepTowId")!, sklepTowIntParamTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn33, sklepTowIntParam.FindProperty("Znaczenie")!, sklepTowIntParamTableMapping); + RelationalModel.CreateColumnMapping(paramColumn1, sklepTowIntParam.FindProperty("Param")!, sklepTowIntParamTableMapping); + + var sklepTowKod = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowKod")!; + + var defaultTableMappings245 = new List>(); + sklepTowKod.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings245); + var blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowKod", null, relationalModel); + var ileWKodzieColumnBase1 = new ColumnBase("IleWKodzie", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("IleWKodzie", ileWKodzieColumnBase1); + var kodColumnBase15 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("Kod", kodColumnBase15); + var kodCentralnyColumnBase0 = new ColumnBase("KodCentralny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("KodCentralny", kodCentralnyColumnBase0); + var kolejnoscColumnBase56 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase56); + var poziomCenColumnBase6 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("PoziomCen", poziomCenColumnBase6); + var prefPLUColumnBase0 = new ColumnBase("PrefPLU", "int", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("PrefPLU", prefPLUColumnBase0); + var sklepIdColumnBase90 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("SklepId", sklepIdColumnBase90); + var sklepTowIdColumnBase13 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase13); + var skrotColumnBase4 = new ColumnBase("Skrot", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("Skrot", skrotColumnBase4); + var typKoduColumnBase1 = new ColumnBase("TypKodu", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.Columns.Add("TypKodu", typKoduColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowKod", blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase = new TableMappingBase(sklepTowKod, blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowKodTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase, false); + defaultTableMappings245.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase56, sklepTowKod.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase90, sklepTowKod.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase13, sklepTowKod.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWKodzieColumnBase1, sklepTowKod.FindProperty("IleWKodzie")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase15, sklepTowKod.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodCentralnyColumnBase0, sklepTowKod.FindProperty("KodCentralny")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase6, sklepTowKod.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prefPLUColumnBase0, sklepTowKod.FindProperty("PrefPLU")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase4, sklepTowKod.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typKoduColumnBase1, sklepTowKod.FindProperty("TypKodu")!, blinkBackofficeServicesPcmDbEntitiesSklepTowKodMappingBase); + + var tableMappings245 = new List(); + sklepTowKod.SetRuntimeAnnotation("Relational:TableMappings", tableMappings245); + var sklepTowKodTable = new Table("SklepTowKod", null, relationalModel); + var sklepIdColumn90 = new Column("SklepId", "numeric(9,0)", sklepTowKodTable); + sklepTowKodTable.Columns.Add("SklepId", sklepIdColumn90); + var sklepTowIdColumn13 = new Column("SklepTowId", "numeric(9,0)", sklepTowKodTable); + sklepTowKodTable.Columns.Add("SklepTowId", sklepTowIdColumn13); + var kolejnoscColumn56 = new Column("Kolejnosc", "smallint", sklepTowKodTable); + sklepTowKodTable.Columns.Add("Kolejnosc", kolejnoscColumn56); + var ileWKodzieColumn1 = new Column("IleWKodzie", "decimal(15,4)", sklepTowKodTable) + { + IsNullable = true + }; + sklepTowKodTable.Columns.Add("IleWKodzie", ileWKodzieColumn1); + var kodColumn15 = new Column("Kod", "varchar(20)", sklepTowKodTable); + sklepTowKodTable.Columns.Add("Kod", kodColumn15); + var kodCentralnyColumn0 = new Column("KodCentralny", "smallint", sklepTowKodTable) + { + IsNullable = true + }; + sklepTowKodTable.Columns.Add("KodCentralny", kodCentralnyColumn0); + var poziomCenColumn6 = new Column("PoziomCen", "smallint", sklepTowKodTable) + { + IsNullable = true + }; + sklepTowKodTable.Columns.Add("PoziomCen", poziomCenColumn6); + var prefPLUColumn0 = new Column("PrefPLU", "int", sklepTowKodTable) + { + IsNullable = true + }; + sklepTowKodTable.Columns.Add("PrefPLU", prefPLUColumn0); + var skrotColumn4 = new Column("Skrot", "varchar(120)", sklepTowKodTable) + { + IsNullable = true + }; + sklepTowKodTable.Columns.Add("Skrot", skrotColumn4); + var typKoduColumn1 = new Column("TypKodu", "smallint", sklepTowKodTable); + sklepTowKodTable.Columns.Add("TypKodu", typKoduColumn1); + var pK_SKLEPTOWKOD = new UniqueConstraint("PK_SKLEPTOWKOD", sklepTowKodTable, new[] { sklepIdColumn90, sklepTowIdColumn13, kolejnoscColumn56 }); + sklepTowKodTable.PrimaryKey = pK_SKLEPTOWKOD; + var pK_SKLEPTOWKODUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowKod", + new[] { "SklepId", "SklepTowId", "Kolejnosc" }); + pK_SKLEPTOWKOD.MappedKeys.Add(pK_SKLEPTOWKODUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWKODUc).Add(pK_SKLEPTOWKOD); + sklepTowKodTable.UniqueConstraints.Add("PK_SKLEPTOWKOD", pK_SKLEPTOWKOD); + var idx_SklepKod = new TableIndex( + "idx_SklepKod", sklepTowKodTable, new[] { kodColumn15 }, false); + var idx_SklepKodIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowKod", + "idx_SklepKod"); + idx_SklepKod.MappedIndexes.Add(idx_SklepKodIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepKodIx).Add(idx_SklepKod); + sklepTowKodTable.Indexes.Add("idx_SklepKod", idx_SklepKod); + relationalModel.Tables.Add(("SklepTowKod", null), sklepTowKodTable); + var sklepTowKodTableMapping = new TableMapping(sklepTowKod, sklepTowKodTable, true); + sklepTowKodTable.AddTypeMapping(sklepTowKodTableMapping, false); + tableMappings245.Add(sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn56, sklepTowKod.FindProperty("Kolejnosc")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn90, sklepTowKod.FindProperty("SklepId")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn13, sklepTowKod.FindProperty("SklepTowId")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(ileWKodzieColumn1, sklepTowKod.FindProperty("IleWKodzie")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(kodColumn15, sklepTowKod.FindProperty("Kod")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(kodCentralnyColumn0, sklepTowKod.FindProperty("KodCentralny")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn6, sklepTowKod.FindProperty("PoziomCen")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(prefPLUColumn0, sklepTowKod.FindProperty("PrefPLU")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn4, sklepTowKod.FindProperty("Skrot")!, sklepTowKodTableMapping); + RelationalModel.CreateColumnMapping(typKoduColumn1, sklepTowKod.FindProperty("TypKodu")!, sklepTowKodTableMapping); + + var sklepTowParWiseBase = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase")!; + + var defaultTableMappings246 = new List>(); + sklepTowParWiseBase.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings246); + var blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase", null, relationalModel); + var parIdColumnBase14 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase.Columns.Add("ParId", parIdColumnBase14); + var sklepIdColumnBase91 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase.Columns.Add("SklepId", sklepIdColumnBase91); + var sklepTowIdColumnBase14 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase14); + var sklepZasobIdColumnBase0 = new ColumnBase("SklepZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase.Columns.Add("SklepZasobId", sklepZasobIdColumnBase0); + var tekstColumnBase28 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase.Columns.Add("Tekst", tekstColumnBase28); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase", blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase = new TableMappingBase(sklepTowParWiseBase, blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase, false); + defaultTableMappings246.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase14, sklepTowParWiseBase.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase91, sklepTowParWiseBase.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase14, sklepTowParWiseBase.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZasobIdColumnBase0, sklepTowParWiseBase.FindProperty("SklepZasobId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase28, sklepTowParWiseBase.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepTowParWiseBaseMappingBase); + + var tableMappings246 = new List(); + sklepTowParWiseBase.SetRuntimeAnnotation("Relational:TableMappings", tableMappings246); + var sklepTowParWiseBaseTable = new Table("SklepTowParWiseBase", null, relationalModel); + var sklepIdColumn91 = new Column("SklepId", "numeric(9,0)", sklepTowParWiseBaseTable); + sklepTowParWiseBaseTable.Columns.Add("SklepId", sklepIdColumn91); + var sklepTowIdColumn14 = new Column("SklepTowId", "numeric(9,0)", sklepTowParWiseBaseTable); + sklepTowParWiseBaseTable.Columns.Add("SklepTowId", sklepTowIdColumn14); + var parIdColumn14 = new Column("ParId", "numeric(9,0)", sklepTowParWiseBaseTable); + sklepTowParWiseBaseTable.Columns.Add("ParId", parIdColumn14); + var sklepZasobIdColumn0 = new Column("SklepZasobId", "numeric(9,0)", sklepTowParWiseBaseTable) + { + IsNullable = true + }; + sklepTowParWiseBaseTable.Columns.Add("SklepZasobId", sklepZasobIdColumn0); + var tekstColumn28 = new Column("Tekst", "varchar(255)", sklepTowParWiseBaseTable) + { + IsNullable = true + }; + sklepTowParWiseBaseTable.Columns.Add("Tekst", tekstColumn28); + var pK_SklepTowParWiseBase = new UniqueConstraint("PK_SklepTowParWiseBase", sklepTowParWiseBaseTable, new[] { sklepIdColumn91, sklepTowIdColumn14, parIdColumn14 }); + sklepTowParWiseBaseTable.PrimaryKey = pK_SklepTowParWiseBase; + var pK_SklepTowParWiseBaseUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase", + new[] { "SklepId", "SklepTowId", "ParId" }); + pK_SklepTowParWiseBase.MappedKeys.Add(pK_SklepTowParWiseBaseUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepTowParWiseBaseUc).Add(pK_SklepTowParWiseBase); + sklepTowParWiseBaseTable.UniqueConstraints.Add("PK_SklepTowParWiseBase", pK_SklepTowParWiseBase); + var idx_SklepTowParWB_ParId = new TableIndex( + "idx_SklepTowParWB_ParId", sklepTowParWiseBaseTable, new[] { parIdColumn14 }, false); + var idx_SklepTowParWB_ParIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase", + "idx_SklepTowParWB_ParId"); + idx_SklepTowParWB_ParId.MappedIndexes.Add(idx_SklepTowParWB_ParIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepTowParWB_ParIdIx).Add(idx_SklepTowParWB_ParId); + sklepTowParWiseBaseTable.Indexes.Add("idx_SklepTowParWB_ParId", idx_SklepTowParWB_ParId); + relationalModel.Tables.Add(("SklepTowParWiseBase", null), sklepTowParWiseBaseTable); + var sklepTowParWiseBaseTableMapping = new TableMapping(sklepTowParWiseBase, sklepTowParWiseBaseTable, true); + sklepTowParWiseBaseTable.AddTypeMapping(sklepTowParWiseBaseTableMapping, false); + tableMappings246.Add(sklepTowParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn14, sklepTowParWiseBase.FindProperty("ParId")!, sklepTowParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn91, sklepTowParWiseBase.FindProperty("SklepId")!, sklepTowParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn14, sklepTowParWiseBase.FindProperty("SklepTowId")!, sklepTowParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(sklepZasobIdColumn0, sklepTowParWiseBase.FindProperty("SklepZasobId")!, sklepTowParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn28, sklepTowParWiseBase.FindProperty("Tekst")!, sklepTowParWiseBaseTableMapping); + + var sklepTowPowiazanie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie")!; + + var defaultTableMappings247 = new List>(); + sklepTowPowiazanie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings247); + var blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie", null, relationalModel); + var powSklepTowIdColumnBase = new ColumnBase("PowSklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase.Columns.Add("PowSklepTowId", powSklepTowIdColumnBase); + var sklepIdColumnBase92 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase.Columns.Add("SklepId", sklepIdColumnBase92); + var sklepTowIdColumnBase15 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase15); + var znaczenieColumnBase34 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase.Columns.Add("Znaczenie", znaczenieColumnBase34); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie", blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieMappingBase = new TableMappingBase(sklepTowPowiazanie, blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieMappingBase, false); + defaultTableMappings247.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase92, sklepTowPowiazanie.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase15, sklepTowPowiazanie.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase34, sklepTowPowiazanie.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powSklepTowIdColumnBase, sklepTowPowiazanie.FindProperty("PowSklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowPowiazanieMappingBase); + + var tableMappings247 = new List(); + sklepTowPowiazanie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings247); + var sklepTowPowiazanieTable = new Table("SklepTowPowiazanie", null, relationalModel); + var sklepIdColumn92 = new Column("SklepId", "numeric(9,0)", sklepTowPowiazanieTable); + sklepTowPowiazanieTable.Columns.Add("SklepId", sklepIdColumn92); + var sklepTowIdColumn15 = new Column("SklepTowId", "numeric(9,0)", sklepTowPowiazanieTable); + sklepTowPowiazanieTable.Columns.Add("SklepTowId", sklepTowIdColumn15); + var znaczenieColumn34 = new Column("Znaczenie", "smallint", sklepTowPowiazanieTable); + sklepTowPowiazanieTable.Columns.Add("Znaczenie", znaczenieColumn34); + var powSklepTowIdColumn = new Column("PowSklepTowId", "numeric(9,0)", sklepTowPowiazanieTable); + sklepTowPowiazanieTable.Columns.Add("PowSklepTowId", powSklepTowIdColumn); + var pK_SKLEPTOWPOWIAZANIE = new UniqueConstraint("PK_SKLEPTOWPOWIAZANIE", sklepTowPowiazanieTable, new[] { sklepIdColumn92, sklepTowIdColumn15, znaczenieColumn34 }); + sklepTowPowiazanieTable.PrimaryKey = pK_SKLEPTOWPOWIAZANIE; + var pK_SKLEPTOWPOWIAZANIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie", + new[] { "SklepId", "SklepTowId", "Znaczenie" }); + pK_SKLEPTOWPOWIAZANIE.MappedKeys.Add(pK_SKLEPTOWPOWIAZANIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWPOWIAZANIEUc).Add(pK_SKLEPTOWPOWIAZANIE); + sklepTowPowiazanieTable.UniqueConstraints.Add("PK_SKLEPTOWPOWIAZANIE", pK_SKLEPTOWPOWIAZANIE); + var iX_SklepTowPowiazanie_SklepId_PowSklepTowId = new TableIndex( + "IX_SklepTowPowiazanie_SklepId_PowSklepTowId", sklepTowPowiazanieTable, new[] { sklepIdColumn92, powSklepTowIdColumn }, false); + var iX_SklepTowPowiazanie_SklepId_PowSklepTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie", + new[] { "SklepId", "PowSklepTowId" }); + iX_SklepTowPowiazanie_SklepId_PowSklepTowId.MappedIndexes.Add(iX_SklepTowPowiazanie_SklepId_PowSklepTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepTowPowiazanie_SklepId_PowSklepTowIdIx).Add(iX_SklepTowPowiazanie_SklepId_PowSklepTowId); + sklepTowPowiazanieTable.Indexes.Add("IX_SklepTowPowiazanie_SklepId_PowSklepTowId", iX_SklepTowPowiazanie_SklepId_PowSklepTowId); + relationalModel.Tables.Add(("SklepTowPowiazanie", null), sklepTowPowiazanieTable); + var sklepTowPowiazanieTableMapping = new TableMapping(sklepTowPowiazanie, sklepTowPowiazanieTable, true); + sklepTowPowiazanieTable.AddTypeMapping(sklepTowPowiazanieTableMapping, false); + tableMappings247.Add(sklepTowPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn92, sklepTowPowiazanie.FindProperty("SklepId")!, sklepTowPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn15, sklepTowPowiazanie.FindProperty("SklepTowId")!, sklepTowPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn34, sklepTowPowiazanie.FindProperty("Znaczenie")!, sklepTowPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(powSklepTowIdColumn, sklepTowPowiazanie.FindProperty("PowSklepTowId")!, sklepTowPowiazanieTableMapping); + + var sklepTowStraty = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowStraty")!; + + var defaultTableMappings248 = new List>(); + sklepTowStraty.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings248); + var blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowStraty", null, relationalModel); + var idxRodzStratColumnBase = new ColumnBase("IdxRodzStrat", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase.Columns.Add("IdxRodzStrat", idxRodzStratColumnBase); + var normaStratColumnBase = new ColumnBase("NormaStrat", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase.Columns.Add("NormaStrat", normaStratColumnBase); + var odliczanieColumnBase = new ColumnBase("Odliczanie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase.Columns.Add("Odliczanie", odliczanieColumnBase); + var sklepIdColumnBase93 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase.Columns.Add("SklepId", sklepIdColumnBase93); + var sklepTowIdColumnBase16 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase16); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowStraty", blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase = new TableMappingBase(sklepTowStraty, blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowStratyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase, false); + defaultTableMappings248.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idxRodzStratColumnBase, sklepTowStraty.FindProperty("IdxRodzStrat")!, blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase93, sklepTowStraty.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase16, sklepTowStraty.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)normaStratColumnBase, sklepTowStraty.FindProperty("NormaStrat")!, blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odliczanieColumnBase, sklepTowStraty.FindProperty("Odliczanie")!, blinkBackofficeServicesPcmDbEntitiesSklepTowStratyMappingBase); + + var tableMappings248 = new List(); + sklepTowStraty.SetRuntimeAnnotation("Relational:TableMappings", tableMappings248); + var sklepTowStratyTable = new Table("SklepTowStraty", null, relationalModel); + var sklepIdColumn93 = new Column("SklepId", "numeric(9,0)", sklepTowStratyTable); + sklepTowStratyTable.Columns.Add("SklepId", sklepIdColumn93); + var sklepTowIdColumn16 = new Column("SklepTowId", "numeric(9,0)", sklepTowStratyTable); + sklepTowStratyTable.Columns.Add("SklepTowId", sklepTowIdColumn16); + var idxRodzStratColumn = new Column("IdxRodzStrat", "smallint", sklepTowStratyTable); + sklepTowStratyTable.Columns.Add("IdxRodzStrat", idxRodzStratColumn); + var normaStratColumn = new Column("NormaStrat", "decimal(10,4)", sklepTowStratyTable) + { + IsNullable = true + }; + sklepTowStratyTable.Columns.Add("NormaStrat", normaStratColumn); + var odliczanieColumn = new Column("Odliczanie", "smallint", sklepTowStratyTable) + { + IsNullable = true + }; + sklepTowStratyTable.Columns.Add("Odliczanie", odliczanieColumn); + var pK_SKLEPTOWSTRATY = new UniqueConstraint("PK_SKLEPTOWSTRATY", sklepTowStratyTable, new[] { sklepIdColumn93, sklepTowIdColumn16, idxRodzStratColumn }); + sklepTowStratyTable.PrimaryKey = pK_SKLEPTOWSTRATY; + var pK_SKLEPTOWSTRATYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowStraty", + new[] { "SklepId", "SklepTowId", "IdxRodzStrat" }); + pK_SKLEPTOWSTRATY.MappedKeys.Add(pK_SKLEPTOWSTRATYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWSTRATYUc).Add(pK_SKLEPTOWSTRATY); + sklepTowStratyTable.UniqueConstraints.Add("PK_SKLEPTOWSTRATY", pK_SKLEPTOWSTRATY); + relationalModel.Tables.Add(("SklepTowStraty", null), sklepTowStratyTable); + var sklepTowStratyTableMapping = new TableMapping(sklepTowStraty, sklepTowStratyTable, true); + sklepTowStratyTable.AddTypeMapping(sklepTowStratyTableMapping, false); + tableMappings248.Add(sklepTowStratyTableMapping); + RelationalModel.CreateColumnMapping(idxRodzStratColumn, sklepTowStraty.FindProperty("IdxRodzStrat")!, sklepTowStratyTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn93, sklepTowStraty.FindProperty("SklepId")!, sklepTowStratyTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn16, sklepTowStraty.FindProperty("SklepTowId")!, sklepTowStratyTableMapping); + RelationalModel.CreateColumnMapping(normaStratColumn, sklepTowStraty.FindProperty("NormaStrat")!, sklepTowStratyTableMapping); + RelationalModel.CreateColumnMapping(odliczanieColumn, sklepTowStraty.FindProperty("Odliczanie")!, sklepTowStratyTableMapping); + + var sklepTowZamiennik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik")!; + + var defaultTableMappings249 = new List>(); + sklepTowZamiennik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings249); + var blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik", null, relationalModel); + var sklepIdColumnBase94 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase.Columns.Add("SklepId", sklepIdColumnBase94); + var sklepTowIdColumnBase17 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase17); + var sklepZmIdColumnBase = new ColumnBase("SklepZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase.Columns.Add("SklepZmId", sklepZmIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik", blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikMappingBase = new TableMappingBase(sklepTowZamiennik, blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikMappingBase, false); + defaultTableMappings249.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase94, sklepTowZamiennik.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase17, sklepTowZamiennik.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZmIdColumnBase, sklepTowZamiennik.FindProperty("SklepZmId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowZamiennikMappingBase); + + var tableMappings249 = new List(); + sklepTowZamiennik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings249); + var sklepTowZamiennikTable = new Table("SklepTowZamiennik", null, relationalModel); + var sklepIdColumn94 = new Column("SklepId", "numeric(9,0)", sklepTowZamiennikTable); + sklepTowZamiennikTable.Columns.Add("SklepId", sklepIdColumn94); + var sklepTowIdColumn17 = new Column("SklepTowId", "numeric(9,0)", sklepTowZamiennikTable); + sklepTowZamiennikTable.Columns.Add("SklepTowId", sklepTowIdColumn17); + var sklepZmIdColumn = new Column("SklepZmId", "numeric(9,0)", sklepTowZamiennikTable); + sklepTowZamiennikTable.Columns.Add("SklepZmId", sklepZmIdColumn); + var pK_SKLEPTOWZAMIENNIK = new UniqueConstraint("PK_SKLEPTOWZAMIENNIK", sklepTowZamiennikTable, new[] { sklepIdColumn94, sklepTowIdColumn17 }); + sklepTowZamiennikTable.PrimaryKey = pK_SKLEPTOWZAMIENNIK; + var pK_SKLEPTOWZAMIENNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik", + new[] { "SklepId", "SklepTowId" }); + pK_SKLEPTOWZAMIENNIK.MappedKeys.Add(pK_SKLEPTOWZAMIENNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWZAMIENNIKUc).Add(pK_SKLEPTOWZAMIENNIK); + sklepTowZamiennikTable.UniqueConstraints.Add("PK_SKLEPTOWZAMIENNIK", pK_SKLEPTOWZAMIENNIK); + var iX_SklepTowZamiennik_SklepId_SklepZmId = new TableIndex( + "IX_SklepTowZamiennik_SklepId_SklepZmId", sklepTowZamiennikTable, new[] { sklepIdColumn94, sklepZmIdColumn }, false); + var iX_SklepTowZamiennik_SklepId_SklepZmIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik", + new[] { "SklepId", "SklepZmId" }); + iX_SklepTowZamiennik_SklepId_SklepZmId.MappedIndexes.Add(iX_SklepTowZamiennik_SklepId_SklepZmIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepTowZamiennik_SklepId_SklepZmIdIx).Add(iX_SklepTowZamiennik_SklepId_SklepZmId); + sklepTowZamiennikTable.Indexes.Add("IX_SklepTowZamiennik_SklepId_SklepZmId", iX_SklepTowZamiennik_SklepId_SklepZmId); + relationalModel.Tables.Add(("SklepTowZamiennik", null), sklepTowZamiennikTable); + var sklepTowZamiennikTableMapping = new TableMapping(sklepTowZamiennik, sklepTowZamiennikTable, true); + sklepTowZamiennikTable.AddTypeMapping(sklepTowZamiennikTableMapping, false); + tableMappings249.Add(sklepTowZamiennikTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn94, sklepTowZamiennik.FindProperty("SklepId")!, sklepTowZamiennikTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn17, sklepTowZamiennik.FindProperty("SklepTowId")!, sklepTowZamiennikTableMapping); + RelationalModel.CreateColumnMapping(sklepZmIdColumn, sklepTowZamiennik.FindProperty("SklepZmId")!, sklepTowZamiennikTableMapping); + + var sklepTowZdjecia = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowZdjecia")!; + + var defaultTableMappings250 = new List>(); + sklepTowZdjecia.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings250); + var blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowZdjecia", null, relationalModel); + var kolejnoscColumnBase57 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase57); + var sklepIdColumnBase95 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase.Columns.Add("SklepId", sklepIdColumnBase95); + var sklepTowIdColumnBase18 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase18); + var sklepZasobIdColumnBase1 = new ColumnBase("SklepZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase.Columns.Add("SklepZasobId", sklepZasobIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowZdjecia", blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaMappingBase = new TableMappingBase(sklepTowZdjecia, blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaMappingBase, false); + defaultTableMappings250.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase57, sklepTowZdjecia.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase95, sklepTowZdjecia.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase18, sklepTowZdjecia.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZasobIdColumnBase1, sklepTowZdjecia.FindProperty("SklepZasobId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowZdjeciaMappingBase); + + var tableMappings250 = new List(); + sklepTowZdjecia.SetRuntimeAnnotation("Relational:TableMappings", tableMappings250); + var sklepTowZdjeciaTable = new Table("SklepTowZdjecia", null, relationalModel); + var sklepIdColumn95 = new Column("SklepId", "numeric(9,0)", sklepTowZdjeciaTable); + sklepTowZdjeciaTable.Columns.Add("SklepId", sklepIdColumn95); + var sklepTowIdColumn18 = new Column("SklepTowId", "numeric(9,0)", sklepTowZdjeciaTable); + sklepTowZdjeciaTable.Columns.Add("SklepTowId", sklepTowIdColumn18); + var kolejnoscColumn57 = new Column("Kolejnosc", "smallint", sklepTowZdjeciaTable); + sklepTowZdjeciaTable.Columns.Add("Kolejnosc", kolejnoscColumn57); + var sklepZasobIdColumn1 = new Column("SklepZasobId", "numeric(9,0)", sklepTowZdjeciaTable); + sklepTowZdjeciaTable.Columns.Add("SklepZasobId", sklepZasobIdColumn1); + var pK_SklepTowZdjecia = new UniqueConstraint("PK_SklepTowZdjecia", sklepTowZdjeciaTable, new[] { sklepIdColumn95, sklepTowIdColumn18, kolejnoscColumn57 }); + sklepTowZdjeciaTable.PrimaryKey = pK_SklepTowZdjecia; + var pK_SklepTowZdjeciaUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZdjecia", + new[] { "SklepId", "SklepTowId", "Kolejnosc" }); + pK_SklepTowZdjecia.MappedKeys.Add(pK_SklepTowZdjeciaUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepTowZdjeciaUc).Add(pK_SklepTowZdjecia); + sklepTowZdjeciaTable.UniqueConstraints.Add("PK_SklepTowZdjecia", pK_SklepTowZdjecia); + relationalModel.Tables.Add(("SklepTowZdjecia", null), sklepTowZdjeciaTable); + var sklepTowZdjeciaTableMapping = new TableMapping(sklepTowZdjecia, sklepTowZdjeciaTable, true); + sklepTowZdjeciaTable.AddTypeMapping(sklepTowZdjeciaTableMapping, false); + tableMappings250.Add(sklepTowZdjeciaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn57, sklepTowZdjecia.FindProperty("Kolejnosc")!, sklepTowZdjeciaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn95, sklepTowZdjecia.FindProperty("SklepId")!, sklepTowZdjeciaTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn18, sklepTowZdjecia.FindProperty("SklepTowId")!, sklepTowZdjeciaTableMapping); + RelationalModel.CreateColumnMapping(sklepZasobIdColumn1, sklepTowZdjecia.FindProperty("SklepZasobId")!, sklepTowZdjeciaTableMapping); + + var sklepTowar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowar")!; + + var defaultTableMappings251 = new List>(); + sklepTowar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings251); + var blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", null, relationalModel); + var akcyzowyColumnBase = new ColumnBase("Akcyzowy", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Akcyzowy", akcyzowyColumnBase); + var aktywnyColumnBase43 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Aktywny", aktywnyColumnBase43); + var asortymentColumnBase0 = new ColumnBase("Asortyment", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Asortyment", asortymentColumnBase0); + var cKUColumnBase0 = new ColumnBase("CKU", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CKU", cKUColumnBase0); + var cena5ColumnBase0 = new ColumnBase("Cena5", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Cena5", cena5ColumnBase0); + var cena6ColumnBase0 = new ColumnBase("Cena6", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Cena6", cena6ColumnBase0); + var cenaDetColumnBase2 = new ColumnBase("CenaDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CenaDet", cenaDetColumnBase2); + var cenaDodColumnBase0 = new ColumnBase("CenaDod", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CenaDod", cenaDodColumnBase0); + var cenaEwColumnBase = new ColumnBase("CenaEw", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CenaEw", cenaEwColumnBase); + var cenaHurtColumnBase0 = new ColumnBase("CenaHurt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CenaHurt", cenaHurtColumnBase0); + var cenaNocColumnBase0 = new ColumnBase("CenaNoc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CenaNoc", cenaNocColumnBase0); + var cenaOtwartaColumnBase0 = new ColumnBase("CenaOtwarta", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CenaOtwarta", cenaOtwartaColumnBase0); + var centrTowIdColumnBase = new ColumnBase("CentrTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("CentrTowId", centrTowIdColumnBase); + var glebokoscColumnBase = new ColumnBase("Glebokosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Glebokosc", glebokoscColumnBase); + var grupaGTUColumnBase1 = new ColumnBase("GrupaGTU", "varchar(3)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("GrupaGTU", grupaGTUColumnBase1); + var hurtRabatColumnBase0 = new ColumnBase("HurtRabat", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("HurtRabat", hurtRabatColumnBase0); + var ileWCalosciColumnBase = new ColumnBase("IleWCalosci", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("IleWCalosci", ileWCalosciColumnBase); + var ileWOpakColumnBase0 = new ColumnBase("IleWOpak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("IleWOpak", ileWOpakColumnBase0); + var ileWZgrzewceColumnBase3 = new ColumnBase("IleWZgrzewce", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("IleWZgrzewce", ileWZgrzewceColumnBase3); + var indeks1ColumnBase0 = new ColumnBase("Indeks1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Indeks1", indeks1ColumnBase0); + var indeks2ColumnBase0 = new ColumnBase("Indeks2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Indeks2", indeks2ColumnBase0); + var jMColumnBase0 = new ColumnBase("JM", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("JM", jMColumnBase0); + var kategoriaColumnBase1 = new ColumnBase("Kategoria", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Kategoria", kategoriaColumnBase1); + var kodCNColumnBase0 = new ColumnBase("KodCN", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("KodCN", kodCNColumnBase0); + var kodKrajuPochodzeniaColumnBase = new ColumnBase("KodKrajuPochodzenia", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("KodKrajuPochodzenia", kodKrajuPochodzeniaColumnBase); + var kodSklepuColumnBase = new ColumnBase("KodSklepu", "varchar(30)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("KodSklepu", kodSklepuColumnBase); + var marzaColumnBase0 = new ColumnBase("Marza", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Marza", marzaColumnBase0); + var maxCenaZakColumnBase = new ColumnBase("MaxCenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("MaxCenaZak", maxCenaZakColumnBase); + var minCenaSpColumnBase = new ColumnBase("MinCenaSp", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("MinCenaSp", minCenaSpColumnBase); + var nazwaColumnBase53 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Nazwa", nazwaColumnBase53); + var nocNarzutColumnBase0 = new ColumnBase("NocNarzut", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("NocNarzut", nocNarzutColumnBase0); + var nowoscOdColumnBase = new ColumnBase("NowoscOd", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("NowoscOd", nowoscOdColumnBase); + var nowoscPrzezColumnBase = new ColumnBase("NowoscPrzez", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("NowoscPrzez", nowoscPrzezColumnBase); + var nrDrukarkiColumnBase = new ColumnBase("NrDrukarki", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("NrDrukarki", nrDrukarkiColumnBase); + var obslugaPartiiColumnBase = new ColumnBase("ObslugaPartii", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("ObslugaPartii", obslugaPartiiColumnBase); + var opcjaMarzyColumnBase0 = new ColumnBase("OpcjaMarzy", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("OpcjaMarzy", opcjaMarzyColumnBase0); + var opcjaNarzutuColumnBase0 = new ColumnBase("OpcjaNarzutu", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("OpcjaNarzutu", opcjaNarzutuColumnBase0); + var opcjaRabatuColumnBase0 = new ColumnBase("OpcjaRabatu", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("OpcjaRabatu", opcjaRabatuColumnBase0); + var opis1ColumnBase2 = new ColumnBase("Opis1", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Opis1", opis1ColumnBase2); + var opis2ColumnBase2 = new ColumnBase("Opis2", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Opis2", opis2ColumnBase2); + var opis3ColumnBase0 = new ColumnBase("Opis3", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Opis3", opis3ColumnBase0); + var opis4ColumnBase0 = new ColumnBase("Opis4", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Opis4", opis4ColumnBase0); + var precyzjaColumnBase0 = new ColumnBase("Precyzja", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Precyzja", precyzjaColumnBase0); + var progPromocjiColumnBase0 = new ColumnBase("ProgPromocji", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("ProgPromocji", progPromocjiColumnBase0); + var przeliczJMColumnBase = new ColumnBase("PrzeliczJM", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("PrzeliczJM", przeliczJMColumnBase); + var przeznaczenieColumnBase = new ColumnBase("Przeznaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Przeznaczenie", przeznaczenieColumnBase); + var rezerwa1ColumnBase1 = new ColumnBase("Rezerwa1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Rezerwa1", rezerwa1ColumnBase1); + var rezerwa2ColumnBase1 = new ColumnBase("Rezerwa2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Rezerwa2", rezerwa2ColumnBase1); + var sklepArtIdColumnBase0 = new ColumnBase("SklepArtId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("SklepArtId", sklepArtIdColumnBase0); + var sklepIdColumnBase96 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("SklepId", sklepIdColumnBase96); + var sklepOpakIdColumnBase = new ColumnBase("SklepOpakId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("SklepOpakId", sklepOpakIdColumnBase); + var sklepProducentColumnBase = new ColumnBase("SklepProducent", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("SklepProducent", sklepProducentColumnBase); + var sklepTowIdColumnBase19 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase19); + var sledzPartiiColumnBase = new ColumnBase("SledzPartii", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("SledzPartii", sledzPartiiColumnBase); + var statusZamColumnBase1 = new ColumnBase("StatusZam", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("StatusZam", statusZamColumnBase1); + var stawkaColumnBase13 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Stawka", stawkaColumnBase13); + var szerokoscColumnBase = new ColumnBase("Szerokosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Szerokosc", szerokoscColumnBase); + var tandemColumnBase0 = new ColumnBase("Tandem", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Tandem", tandemColumnBase0); + var termWaznColumnBase0 = new ColumnBase("TermWazn", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("TermWazn", termWaznColumnBase0); + var towIdColumnBase20 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("TowId", towIdColumnBase20); + var typTowaruColumnBase3 = new ColumnBase("TypTowaru", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("TypTowaru", typTowaruColumnBase3); + var ukrycNaKasieColumnBase = new ColumnBase("UkrycNaKasie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("UkrycNaKasie", ukrycNaKasieColumnBase); + var wagaColumnBase = new ColumnBase("Waga", "int", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Waga", wagaColumnBase); + var wysokoscColumnBase = new ColumnBase("Wysokosc", "int", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Wysokosc", wysokoscColumnBase); + var wysylacNaSklepInternetowyColumnBase = new ColumnBase("WysylacNaSklepInternetowy", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("WysylacNaSklepInternetowy", wysylacNaSklepInternetowyColumnBase); + var zmianaColumnBase54 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Zmiana", zmianaColumnBase54); + var zywnoscColumnBase = new ColumnBase("Zywnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.Columns.Add("Zywnosc", zywnoscColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase = new TableMappingBase(sklepTowar, blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowarTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase, false); + defaultTableMappings251.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase96, sklepTowar.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase19, sklepTowar.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akcyzowyColumnBase, sklepTowar.FindProperty("Akcyzowy")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase43, sklepTowar.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asortymentColumnBase0, sklepTowar.FindProperty("Asortyment")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cKUColumnBase0, sklepTowar.FindProperty("CKU")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena5ColumnBase0, sklepTowar.FindProperty("Cena5")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena6ColumnBase0, sklepTowar.FindProperty("Cena6")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDetColumnBase2, sklepTowar.FindProperty("CenaDet")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDodColumnBase0, sklepTowar.FindProperty("CenaDod")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaEwColumnBase, sklepTowar.FindProperty("CenaEw")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaHurtColumnBase0, sklepTowar.FindProperty("CenaHurt")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaNocColumnBase0, sklepTowar.FindProperty("CenaNoc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaOtwartaColumnBase0, sklepTowar.FindProperty("CenaOtwarta")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrTowIdColumnBase, sklepTowar.FindProperty("CentrTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)glebokoscColumnBase, sklepTowar.FindProperty("Glebokosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupaGTUColumnBase1, sklepTowar.FindProperty("GrupaGTU")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hurtRabatColumnBase0, sklepTowar.FindProperty("HurtRabat")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWCalosciColumnBase, sklepTowar.FindProperty("IleWCalosci")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWOpakColumnBase0, sklepTowar.FindProperty("IleWOpak")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWZgrzewceColumnBase3, sklepTowar.FindProperty("IleWZgrzewce")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks1ColumnBase0, sklepTowar.FindProperty("Indeks1")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks2ColumnBase0, sklepTowar.FindProperty("Indeks2")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jMColumnBase0, sklepTowar.FindProperty("JM")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kategoriaColumnBase1, sklepTowar.FindProperty("Kategoria")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodCNColumnBase0, sklepTowar.FindProperty("KodCN")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKrajuPochodzeniaColumnBase, sklepTowar.FindProperty("KodKrajuPochodzenia")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodSklepuColumnBase, sklepTowar.FindProperty("KodSklepu")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)marzaColumnBase0, sklepTowar.FindProperty("Marza")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)maxCenaZakColumnBase, sklepTowar.FindProperty("MaxCenaZak")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minCenaSpColumnBase, sklepTowar.FindProperty("MinCenaSp")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase53, sklepTowar.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nocNarzutColumnBase0, sklepTowar.FindProperty("NocNarzut")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nowoscOdColumnBase, sklepTowar.FindProperty("NowoscOd")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nowoscPrzezColumnBase, sklepTowar.FindProperty("NowoscPrzez")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDrukarkiColumnBase, sklepTowar.FindProperty("NrDrukarki")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)obslugaPartiiColumnBase, sklepTowar.FindProperty("ObslugaPartii")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaMarzyColumnBase0, sklepTowar.FindProperty("OpcjaMarzy")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaNarzutuColumnBase0, sklepTowar.FindProperty("OpcjaNarzutu")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaRabatuColumnBase0, sklepTowar.FindProperty("OpcjaRabatu")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis1ColumnBase2, sklepTowar.FindProperty("Opis1")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis2ColumnBase2, sklepTowar.FindProperty("Opis2")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis3ColumnBase0, sklepTowar.FindProperty("Opis3")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis4ColumnBase0, sklepTowar.FindProperty("Opis4")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)precyzjaColumnBase0, sklepTowar.FindProperty("Precyzja")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)progPromocjiColumnBase0, sklepTowar.FindProperty("ProgPromocji")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przeliczJMColumnBase, sklepTowar.FindProperty("PrzeliczJM")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przeznaczenieColumnBase, sklepTowar.FindProperty("Przeznaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa1ColumnBase1, sklepTowar.FindProperty("Rezerwa1")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa2ColumnBase1, sklepTowar.FindProperty("Rezerwa2")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepArtIdColumnBase0, sklepTowar.FindProperty("SklepArtId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepOpakIdColumnBase, sklepTowar.FindProperty("SklepOpakId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepProducentColumnBase, sklepTowar.FindProperty("SklepProducent")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sledzPartiiColumnBase, sklepTowar.FindProperty("SledzPartii")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusZamColumnBase1, sklepTowar.FindProperty("StatusZam")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase13, sklepTowar.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)szerokoscColumnBase, sklepTowar.FindProperty("Szerokosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tandemColumnBase0, sklepTowar.FindProperty("Tandem")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termWaznColumnBase0, sklepTowar.FindProperty("TermWazn")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase20, sklepTowar.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typTowaruColumnBase3, sklepTowar.FindProperty("TypTowaru")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ukrycNaKasieColumnBase, sklepTowar.FindProperty("UkrycNaKasie")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wagaColumnBase, sklepTowar.FindProperty("Waga")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wysokoscColumnBase, sklepTowar.FindProperty("Wysokosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wysylacNaSklepInternetowyColumnBase, sklepTowar.FindProperty("WysylacNaSklepInternetowy")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase54, sklepTowar.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zywnoscColumnBase, sklepTowar.FindProperty("Zywnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarMappingBase); + + var tableMappings251 = new List(); + sklepTowar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings251); + var sklepTowarTable = new Table("SklepTowar", null, relationalModel); + var sklepIdColumn96 = new Column("SklepId", "numeric(9,0)", sklepTowarTable); + sklepTowarTable.Columns.Add("SklepId", sklepIdColumn96); + var sklepTowIdColumn19 = new Column("SklepTowId", "numeric(9,0)", sklepTowarTable); + sklepTowarTable.Columns.Add("SklepTowId", sklepTowIdColumn19); + var akcyzowyColumn = new Column("Akcyzowy", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("Akcyzowy", akcyzowyColumn); + var aktywnyColumn43 = new Column("Aktywny", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("Aktywny", aktywnyColumn43); + var asortymentColumn0 = new Column("Asortyment", "varchar(40)", sklepTowarTable); + sklepTowarTable.Columns.Add("Asortyment", asortymentColumn0); + var cKUColumn0 = new Column("CKU", "varchar(20)", sklepTowarTable); + sklepTowarTable.Columns.Add("CKU", cKUColumn0); + var cena5Column0 = new Column("Cena5", "decimal(15,4)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("Cena5", cena5Column0); + var cena6Column0 = new Column("Cena6", "decimal(15,4)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("Cena6", cena6Column0); + var cenaDetColumn2 = new Column("CenaDet", "decimal(15,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("CenaDet", cenaDetColumn2); + var cenaDodColumn0 = new Column("CenaDod", "decimal(15,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("CenaDod", cenaDodColumn0); + var cenaEwColumn = new Column("CenaEw", "decimal(15,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("CenaEw", cenaEwColumn); + var cenaHurtColumn0 = new Column("CenaHurt", "decimal(15,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("CenaHurt", cenaHurtColumn0); + var cenaNocColumn0 = new Column("CenaNoc", "decimal(15,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("CenaNoc", cenaNocColumn0); + var cenaOtwartaColumn0 = new Column("CenaOtwarta", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("CenaOtwarta", cenaOtwartaColumn0); + var centrTowIdColumn = new Column("CentrTowId", "numeric(9,0)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("CentrTowId", centrTowIdColumn); + var glebokoscColumn = new Column("Glebokosc", "int", sklepTowarTable); + sklepTowarTable.Columns.Add("Glebokosc", glebokoscColumn); + var grupaGTUColumn1 = new Column("GrupaGTU", "varchar(3)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("GrupaGTU", grupaGTUColumn1); + var hurtRabatColumn0 = new Column("HurtRabat", "decimal(10,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("HurtRabat", hurtRabatColumn0); + var ileWCalosciColumn = new Column("IleWCalosci", "decimal(15,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("IleWCalosci", ileWCalosciColumn); + var ileWOpakColumn0 = new Column("IleWOpak", "decimal(15,4)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("IleWOpak", ileWOpakColumn0); + var ileWZgrzewceColumn3 = new Column("IleWZgrzewce", "decimal(15,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("IleWZgrzewce", ileWZgrzewceColumn3); + var indeks1Column0 = new Column("Indeks1", "varchar(40)", sklepTowarTable); + sklepTowarTable.Columns.Add("Indeks1", indeks1Column0); + var indeks2Column0 = new Column("Indeks2", "varchar(40)", sklepTowarTable); + sklepTowarTable.Columns.Add("Indeks2", indeks2Column0); + var jMColumn0 = new Column("JM", "varchar(10)", sklepTowarTable); + sklepTowarTable.Columns.Add("JM", jMColumn0); + var kategoriaColumn1 = new Column("Kategoria", "varchar(40)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("Kategoria", kategoriaColumn1); + var kodCNColumn0 = new Column("KodCN", "varchar(20)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("KodCN", kodCNColumn0); + var kodKrajuPochodzeniaColumn = new Column("KodKrajuPochodzenia", "varchar(10)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("KodKrajuPochodzenia", kodKrajuPochodzeniaColumn); + var kodSklepuColumn = new Column("KodSklepu", "varchar(30)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("KodSklepu", kodSklepuColumn); + var marzaColumn0 = new Column("Marza", "decimal(10,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("Marza", marzaColumn0); + var maxCenaZakColumn = new Column("MaxCenaZak", "decimal(15,4)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("MaxCenaZak", maxCenaZakColumn); + var minCenaSpColumn = new Column("MinCenaSp", "decimal(15,4)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("MinCenaSp", minCenaSpColumn); + var nazwaColumn53 = new Column("Nazwa", "varchar(255)", sklepTowarTable); + sklepTowarTable.Columns.Add("Nazwa", nazwaColumn53); + var nocNarzutColumn0 = new Column("NocNarzut", "decimal(10,4)", sklepTowarTable); + sklepTowarTable.Columns.Add("NocNarzut", nocNarzutColumn0); + var nowoscOdColumn = new Column("NowoscOd", "datetime", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("NowoscOd", nowoscOdColumn); + var nowoscPrzezColumn = new Column("NowoscPrzez", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("NowoscPrzez", nowoscPrzezColumn); + var nrDrukarkiColumn = new Column("NrDrukarki", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("NrDrukarki", nrDrukarkiColumn); + var obslugaPartiiColumn = new Column("ObslugaPartii", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("ObslugaPartii", obslugaPartiiColumn); + var opcjaMarzyColumn0 = new Column("OpcjaMarzy", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("OpcjaMarzy", opcjaMarzyColumn0); + var opcjaNarzutuColumn0 = new Column("OpcjaNarzutu", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("OpcjaNarzutu", opcjaNarzutuColumn0); + var opcjaRabatuColumn0 = new Column("OpcjaRabatu", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("OpcjaRabatu", opcjaRabatuColumn0); + var opis1Column2 = new Column("Opis1", "varchar(60)", sklepTowarTable); + sklepTowarTable.Columns.Add("Opis1", opis1Column2); + var opis2Column2 = new Column("Opis2", "varchar(60)", sklepTowarTable); + sklepTowarTable.Columns.Add("Opis2", opis2Column2); + var opis3Column0 = new Column("Opis3", "varchar(60)", sklepTowarTable); + sklepTowarTable.Columns.Add("Opis3", opis3Column0); + var opis4Column0 = new Column("Opis4", "varchar(60)", sklepTowarTable); + sklepTowarTable.Columns.Add("Opis4", opis4Column0); + var precyzjaColumn0 = new Column("Precyzja", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("Precyzja", precyzjaColumn0); + var progPromocjiColumn0 = new Column("ProgPromocji", "decimal(15,4)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("ProgPromocji", progPromocjiColumn0); + var przeliczJMColumn = new Column("PrzeliczJM", "varchar(20)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("PrzeliczJM", przeliczJMColumn); + var przeznaczenieColumn = new Column("Przeznaczenie", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("Przeznaczenie", przeznaczenieColumn); + var rezerwa1Column1 = new Column("Rezerwa1", "varchar(40)", sklepTowarTable); + sklepTowarTable.Columns.Add("Rezerwa1", rezerwa1Column1); + var rezerwa2Column1 = new Column("Rezerwa2", "varchar(40)", sklepTowarTable); + sklepTowarTable.Columns.Add("Rezerwa2", rezerwa2Column1); + var sklepArtIdColumn0 = new Column("SklepArtId", "numeric(9,0)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("SklepArtId", sklepArtIdColumn0); + var sklepOpakIdColumn = new Column("SklepOpakId", "numeric(9,0)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("SklepOpakId", sklepOpakIdColumn); + var sklepProducentColumn = new Column("SklepProducent", "numeric(9,0)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("SklepProducent", sklepProducentColumn); + var sledzPartiiColumn = new Column("SledzPartii", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("SledzPartii", sledzPartiiColumn); + var statusZamColumn1 = new Column("StatusZam", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("StatusZam", statusZamColumn1); + var stawkaColumn13 = new Column("Stawka", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("Stawka", stawkaColumn13); + var szerokoscColumn = new Column("Szerokosc", "int", sklepTowarTable); + sklepTowarTable.Columns.Add("Szerokosc", szerokoscColumn); + var tandemColumn0 = new Column("Tandem", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("Tandem", tandemColumn0); + var termWaznColumn0 = new Column("TermWazn", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("TermWazn", termWaznColumn0); + var towIdColumn20 = new Column("TowId", "numeric(9,0)", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("TowId", towIdColumn20); + var typTowaruColumn3 = new Column("TypTowaru", "smallint", sklepTowarTable); + sklepTowarTable.Columns.Add("TypTowaru", typTowaruColumn3); + var ukrycNaKasieColumn = new Column("UkrycNaKasie", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("UkrycNaKasie", ukrycNaKasieColumn); + var wagaColumn = new Column("Waga", "int", sklepTowarTable); + sklepTowarTable.Columns.Add("Waga", wagaColumn); + var wysokoscColumn = new Column("Wysokosc", "int", sklepTowarTable); + sklepTowarTable.Columns.Add("Wysokosc", wysokoscColumn); + var wysylacNaSklepInternetowyColumn = new Column("WysylacNaSklepInternetowy", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("WysylacNaSklepInternetowy", wysylacNaSklepInternetowyColumn); + var zmianaColumn54 = new Column("Zmiana", "datetime", sklepTowarTable); + sklepTowarTable.Columns.Add("Zmiana", zmianaColumn54); + var zywnoscColumn = new Column("Zywnosc", "smallint", sklepTowarTable) + { + IsNullable = true + }; + sklepTowarTable.Columns.Add("Zywnosc", zywnoscColumn); + var pK_SKLEPTOWAR = new UniqueConstraint("PK_SKLEPTOWAR", sklepTowarTable, new[] { sklepIdColumn96, sklepTowIdColumn19 }); + sklepTowarTable.PrimaryKey = pK_SKLEPTOWAR; + var pK_SKLEPTOWARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + pK_SKLEPTOWAR.MappedKeys.Add(pK_SKLEPTOWARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWARUc).Add(pK_SKLEPTOWAR); + sklepTowarTable.UniqueConstraints.Add("PK_SKLEPTOWAR", pK_SKLEPTOWAR); + var idx_SklepTowArt = new TableIndex( + "idx_SklepTowArt", sklepTowarTable, new[] { sklepIdColumn96, sklepArtIdColumn0 }, false); + var idx_SklepTowArtIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + "idx_SklepTowArt"); + idx_SklepTowArt.MappedIndexes.Add(idx_SklepTowArtIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepTowArtIx).Add(idx_SklepTowArt); + sklepTowarTable.Indexes.Add("idx_SklepTowArt", idx_SklepTowArt); + var idx_SklepTowProd = new TableIndex( + "idx_SklepTowProd", sklepTowarTable, new[] { sklepIdColumn96, sklepProducentColumn }, false); + var idx_SklepTowProdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + "idx_SklepTowProd"); + idx_SklepTowProd.MappedIndexes.Add(idx_SklepTowProdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepTowProdIx).Add(idx_SklepTowProd); + sklepTowarTable.Indexes.Add("idx_SklepTowProd", idx_SklepTowProd); + var idx_SklepTowSkTow = new TableIndex( + "idx_SklepTowSkTow", sklepTowarTable, new[] { sklepIdColumn96, towIdColumn20 }, false); + var idx_SklepTowSkTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + "idx_SklepTowSkTow"); + idx_SklepTowSkTow.MappedIndexes.Add(idx_SklepTowSkTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepTowSkTowIx).Add(idx_SklepTowSkTow); + sklepTowarTable.Indexes.Add("idx_SklepTowSkTow", idx_SklepTowSkTow); + var idx_SklepTowTow = new TableIndex( + "idx_SklepTowTow", sklepTowarTable, new[] { towIdColumn20 }, false); + var idx_SklepTowTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + "idx_SklepTowTow"); + idx_SklepTowTow.MappedIndexes.Add(idx_SklepTowTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepTowTowIx).Add(idx_SklepTowTow); + sklepTowarTable.Indexes.Add("idx_SklepTowTow", idx_SklepTowTow); + var idx_SklepTowZmiana = new TableIndex( + "idx_SklepTowZmiana", sklepTowarTable, new[] { zmianaColumn54 }, false); + var idx_SklepTowZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + "idx_SklepTowZmiana"); + idx_SklepTowZmiana.MappedIndexes.Add(idx_SklepTowZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepTowZmianaIx).Add(idx_SklepTowZmiana); + sklepTowarTable.Indexes.Add("idx_SklepTowZmiana", idx_SklepTowZmiana); + relationalModel.Tables.Add(("SklepTowar", null), sklepTowarTable); + var sklepTowarTableMapping = new TableMapping(sklepTowar, sklepTowarTable, true); + sklepTowarTable.AddTypeMapping(sklepTowarTableMapping, false); + tableMappings251.Add(sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn96, sklepTowar.FindProperty("SklepId")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn19, sklepTowar.FindProperty("SklepTowId")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(akcyzowyColumn, sklepTowar.FindProperty("Akcyzowy")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn43, sklepTowar.FindProperty("Aktywny")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(asortymentColumn0, sklepTowar.FindProperty("Asortyment")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cKUColumn0, sklepTowar.FindProperty("CKU")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cena5Column0, sklepTowar.FindProperty("Cena5")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cena6Column0, sklepTowar.FindProperty("Cena6")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaDetColumn2, sklepTowar.FindProperty("CenaDet")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaDodColumn0, sklepTowar.FindProperty("CenaDod")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaEwColumn, sklepTowar.FindProperty("CenaEw")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaHurtColumn0, sklepTowar.FindProperty("CenaHurt")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaNocColumn0, sklepTowar.FindProperty("CenaNoc")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(cenaOtwartaColumn0, sklepTowar.FindProperty("CenaOtwarta")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(centrTowIdColumn, sklepTowar.FindProperty("CentrTowId")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(glebokoscColumn, sklepTowar.FindProperty("Glebokosc")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(grupaGTUColumn1, sklepTowar.FindProperty("GrupaGTU")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(hurtRabatColumn0, sklepTowar.FindProperty("HurtRabat")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(ileWCalosciColumn, sklepTowar.FindProperty("IleWCalosci")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(ileWOpakColumn0, sklepTowar.FindProperty("IleWOpak")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(ileWZgrzewceColumn3, sklepTowar.FindProperty("IleWZgrzewce")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(indeks1Column0, sklepTowar.FindProperty("Indeks1")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(indeks2Column0, sklepTowar.FindProperty("Indeks2")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(jMColumn0, sklepTowar.FindProperty("JM")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(kategoriaColumn1, sklepTowar.FindProperty("Kategoria")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(kodCNColumn0, sklepTowar.FindProperty("KodCN")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(kodKrajuPochodzeniaColumn, sklepTowar.FindProperty("KodKrajuPochodzenia")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(kodSklepuColumn, sklepTowar.FindProperty("KodSklepu")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(marzaColumn0, sklepTowar.FindProperty("Marza")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(maxCenaZakColumn, sklepTowar.FindProperty("MaxCenaZak")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(minCenaSpColumn, sklepTowar.FindProperty("MinCenaSp")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn53, sklepTowar.FindProperty("Nazwa")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(nocNarzutColumn0, sklepTowar.FindProperty("NocNarzut")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(nowoscOdColumn, sklepTowar.FindProperty("NowoscOd")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(nowoscPrzezColumn, sklepTowar.FindProperty("NowoscPrzez")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(nrDrukarkiColumn, sklepTowar.FindProperty("NrDrukarki")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(obslugaPartiiColumn, sklepTowar.FindProperty("ObslugaPartii")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(opcjaMarzyColumn0, sklepTowar.FindProperty("OpcjaMarzy")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(opcjaNarzutuColumn0, sklepTowar.FindProperty("OpcjaNarzutu")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(opcjaRabatuColumn0, sklepTowar.FindProperty("OpcjaRabatu")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(opis1Column2, sklepTowar.FindProperty("Opis1")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(opis2Column2, sklepTowar.FindProperty("Opis2")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(opis3Column0, sklepTowar.FindProperty("Opis3")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(opis4Column0, sklepTowar.FindProperty("Opis4")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(precyzjaColumn0, sklepTowar.FindProperty("Precyzja")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(progPromocjiColumn0, sklepTowar.FindProperty("ProgPromocji")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(przeliczJMColumn, sklepTowar.FindProperty("PrzeliczJM")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(przeznaczenieColumn, sklepTowar.FindProperty("Przeznaczenie")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(rezerwa1Column1, sklepTowar.FindProperty("Rezerwa1")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(rezerwa2Column1, sklepTowar.FindProperty("Rezerwa2")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepArtIdColumn0, sklepTowar.FindProperty("SklepArtId")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepOpakIdColumn, sklepTowar.FindProperty("SklepOpakId")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(sklepProducentColumn, sklepTowar.FindProperty("SklepProducent")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(sledzPartiiColumn, sklepTowar.FindProperty("SledzPartii")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(statusZamColumn1, sklepTowar.FindProperty("StatusZam")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn13, sklepTowar.FindProperty("Stawka")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(szerokoscColumn, sklepTowar.FindProperty("Szerokosc")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(tandemColumn0, sklepTowar.FindProperty("Tandem")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(termWaznColumn0, sklepTowar.FindProperty("TermWazn")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn20, sklepTowar.FindProperty("TowId")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(typTowaruColumn3, sklepTowar.FindProperty("TypTowaru")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(ukrycNaKasieColumn, sklepTowar.FindProperty("UkrycNaKasie")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(wagaColumn, sklepTowar.FindProperty("Waga")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(wysokoscColumn, sklepTowar.FindProperty("Wysokosc")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(wysylacNaSklepInternetowyColumn, sklepTowar.FindProperty("WysylacNaSklepInternetowy")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn54, sklepTowar.FindProperty("Zmiana")!, sklepTowarTableMapping); + RelationalModel.CreateColumnMapping(zywnoscColumn, sklepTowar.FindProperty("Zywnosc")!, sklepTowarTableMapping); + + var sklepTowarSkladnika = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika")!; + + var defaultTableMappings252 = new List>(); + sklepTowarSkladnika.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings252); + var blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika", null, relationalModel); + var cenaColumnBase7 = new ColumnBase("Cena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("Cena", cenaColumnBase7); + var cenaZKartyTowColumnBase = new ColumnBase("CenaZKartyTow", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("CenaZKartyTow", cenaZKartyTowColumnBase); + var domyslnyColumnBase0 = new ColumnBase("Domyslny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("Domyslny", domyslnyColumnBase0); + var iloscColumnBase9 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("Ilosc", iloscColumnBase9); + var kolejnoscColumnBase58 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase58); + var sklepIdColumnBase97 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("SklepId", sklepIdColumnBase97); + var sklepSkWzIdColumnBase0 = new ColumnBase("SklepSkWzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("SklepSkWzId", sklepSkWzIdColumnBase0); + var sklepTowIdColumnBase20 = new ColumnBase("SklepTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.Columns.Add("SklepTowId", sklepTowIdColumnBase20); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika", blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase = new TableMappingBase(sklepTowarSkladnika, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase, false); + defaultTableMappings252.Add(blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase97, sklepTowarSkladnika.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepSkWzIdColumnBase0, sklepTowarSkladnika.FindProperty("SklepSkWzId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIdColumnBase20, sklepTowarSkladnika.FindProperty("SklepTowId")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase7, sklepTowarSkladnika.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZKartyTowColumnBase, sklepTowarSkladnika.FindProperty("CenaZKartyTow")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslnyColumnBase0, sklepTowarSkladnika.FindProperty("Domyslny")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase9, sklepTowarSkladnika.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase58, sklepTowarSkladnika.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTowarSkladnikaMappingBase); + + var tableMappings252 = new List(); + sklepTowarSkladnika.SetRuntimeAnnotation("Relational:TableMappings", tableMappings252); + var sklepTowarSkladnikaTable = new Table("SklepTowarSkladnika", null, relationalModel); + var sklepIdColumn97 = new Column("SklepId", "numeric(9,0)", sklepTowarSkladnikaTable); + sklepTowarSkladnikaTable.Columns.Add("SklepId", sklepIdColumn97); + var sklepSkWzIdColumn0 = new Column("SklepSkWzId", "numeric(9,0)", sklepTowarSkladnikaTable); + sklepTowarSkladnikaTable.Columns.Add("SklepSkWzId", sklepSkWzIdColumn0); + var sklepTowIdColumn20 = new Column("SklepTowId", "numeric(9,0)", sklepTowarSkladnikaTable); + sklepTowarSkladnikaTable.Columns.Add("SklepTowId", sklepTowIdColumn20); + var cenaColumn7 = new Column("Cena", "decimal(15,4)", sklepTowarSkladnikaTable) + { + IsNullable = true + }; + sklepTowarSkladnikaTable.Columns.Add("Cena", cenaColumn7); + var cenaZKartyTowColumn = new Column("CenaZKartyTow", "smallint", sklepTowarSkladnikaTable) + { + IsNullable = true + }; + sklepTowarSkladnikaTable.Columns.Add("CenaZKartyTow", cenaZKartyTowColumn); + var domyslnyColumn0 = new Column("Domyslny", "smallint", sklepTowarSkladnikaTable) + { + IsNullable = true + }; + sklepTowarSkladnikaTable.Columns.Add("Domyslny", domyslnyColumn0); + var iloscColumn9 = new Column("Ilosc", "decimal(15,4)", sklepTowarSkladnikaTable) + { + IsNullable = true + }; + sklepTowarSkladnikaTable.Columns.Add("Ilosc", iloscColumn9); + var kolejnoscColumn58 = new Column("Kolejnosc", "smallint", sklepTowarSkladnikaTable); + sklepTowarSkladnikaTable.Columns.Add("Kolejnosc", kolejnoscColumn58); + var pK_SKLEPTOWARSKLADNIKA = new UniqueConstraint("PK_SKLEPTOWARSKLADNIKA", sklepTowarSkladnikaTable, new[] { sklepIdColumn97, sklepSkWzIdColumn0, sklepTowIdColumn20 }); + sklepTowarSkladnikaTable.PrimaryKey = pK_SKLEPTOWARSKLADNIKA; + var pK_SKLEPTOWARSKLADNIKAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika", + new[] { "SklepId", "SklepSkWzId", "SklepTowId" }); + pK_SKLEPTOWARSKLADNIKA.MappedKeys.Add(pK_SKLEPTOWARSKLADNIKAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTOWARSKLADNIKAUc).Add(pK_SKLEPTOWARSKLADNIKA); + sklepTowarSkladnikaTable.UniqueConstraints.Add("PK_SKLEPTOWARSKLADNIKA", pK_SKLEPTOWARSKLADNIKA); + var iX_SklepTowarSkladnika_SklepId_SklepTowId = new TableIndex( + "IX_SklepTowarSkladnika_SklepId_SklepTowId", sklepTowarSkladnikaTable, new[] { sklepIdColumn97, sklepTowIdColumn20 }, false); + var iX_SklepTowarSkladnika_SklepId_SklepTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika", + new[] { "SklepId", "SklepTowId" }); + iX_SklepTowarSkladnika_SklepId_SklepTowId.MappedIndexes.Add(iX_SklepTowarSkladnika_SklepId_SklepTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepTowarSkladnika_SklepId_SklepTowIdIx).Add(iX_SklepTowarSkladnika_SklepId_SklepTowId); + sklepTowarSkladnikaTable.Indexes.Add("IX_SklepTowarSkladnika_SklepId_SklepTowId", iX_SklepTowarSkladnika_SklepId_SklepTowId); + relationalModel.Tables.Add(("SklepTowarSkladnika", null), sklepTowarSkladnikaTable); + var sklepTowarSkladnikaTableMapping = new TableMapping(sklepTowarSkladnika, sklepTowarSkladnikaTable, true); + sklepTowarSkladnikaTable.AddTypeMapping(sklepTowarSkladnikaTableMapping, false); + tableMappings252.Add(sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn97, sklepTowarSkladnika.FindProperty("SklepId")!, sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(sklepSkWzIdColumn0, sklepTowarSkladnika.FindProperty("SklepSkWzId")!, sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIdColumn20, sklepTowarSkladnika.FindProperty("SklepTowId")!, sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn7, sklepTowarSkladnika.FindProperty("Cena")!, sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(cenaZKartyTowColumn, sklepTowarSkladnika.FindProperty("CenaZKartyTow")!, sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(domyslnyColumn0, sklepTowarSkladnika.FindProperty("Domyslny")!, sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn9, sklepTowarSkladnika.FindProperty("Ilosc")!, sklepTowarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn58, sklepTowarSkladnika.FindProperty("Kolejnosc")!, sklepTowarSkladnikaTableMapping); + + var sklepTrescEmail = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail")!; + + var defaultTableMappings253 = new List>(); + sklepTrescEmail.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings253); + var blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", null, relationalModel); + var aktywnyColumnBase44 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase.Columns.Add("Aktywny", aktywnyColumnBase44); + var nazwaColumnBase54 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase.Columns.Add("Nazwa", nazwaColumnBase54); + var sklepIdColumnBase98 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase.Columns.Add("SklepId", sklepIdColumnBase98); + var sklepTEIdColumnBase = new ColumnBase("SklepTEId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase.Columns.Add("SklepTEId", sklepTEIdColumnBase); + var sklepUzIdColumnBase4 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase4); + var zmianaColumnBase55 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase.Columns.Add("Zmiana", zmianaColumnBase55); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase = new TableMappingBase(sklepTrescEmail, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase, false); + defaultTableMappings253.Add(blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase98, sklepTrescEmail.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTEIdColumnBase, sklepTrescEmail.FindProperty("SklepTEId")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase44, sklepTrescEmail.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase54, sklepTrescEmail.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase4, sklepTrescEmail.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase55, sklepTrescEmail.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailMappingBase); + + var tableMappings253 = new List(); + sklepTrescEmail.SetRuntimeAnnotation("Relational:TableMappings", tableMappings253); + var sklepTrescEmailTable = new Table("SklepTrescEmail", null, relationalModel); + var sklepIdColumn98 = new Column("SklepId", "numeric(9,0)", sklepTrescEmailTable); + sklepTrescEmailTable.Columns.Add("SklepId", sklepIdColumn98); + var sklepTEIdColumn = new Column("SklepTEId", "numeric(9,0)", sklepTrescEmailTable); + sklepTrescEmailTable.Columns.Add("SklepTEId", sklepTEIdColumn); + var aktywnyColumn44 = new Column("Aktywny", "smallint", sklepTrescEmailTable); + sklepTrescEmailTable.Columns.Add("Aktywny", aktywnyColumn44); + var nazwaColumn54 = new Column("Nazwa", "varchar(60)", sklepTrescEmailTable); + sklepTrescEmailTable.Columns.Add("Nazwa", nazwaColumn54); + var sklepUzIdColumn4 = new Column("SklepUzId", "numeric(9,0)", sklepTrescEmailTable) + { + IsNullable = true + }; + sklepTrescEmailTable.Columns.Add("SklepUzId", sklepUzIdColumn4); + var zmianaColumn55 = new Column("Zmiana", "datetime", sklepTrescEmailTable); + sklepTrescEmailTable.Columns.Add("Zmiana", zmianaColumn55); + var pK_SklepTrescEmail = new UniqueConstraint("PK_SklepTrescEmail", sklepTrescEmailTable, new[] { sklepIdColumn98, sklepTEIdColumn }); + sklepTrescEmailTable.PrimaryKey = pK_SklepTrescEmail; + var pK_SklepTrescEmailUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + new[] { "SklepId", "SklepTEId" }); + pK_SklepTrescEmail.MappedKeys.Add(pK_SklepTrescEmailUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepTrescEmailUc).Add(pK_SklepTrescEmail); + sklepTrescEmailTable.UniqueConstraints.Add("PK_SklepTrescEmail", pK_SklepTrescEmail); + var iX_SklepTrescEmail_SklepId_SklepUzId = new TableIndex( + "IX_SklepTrescEmail_SklepId_SklepUzId", sklepTrescEmailTable, new[] { sklepIdColumn98, sklepUzIdColumn4 }, false); + var iX_SklepTrescEmail_SklepId_SklepUzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + new[] { "SklepId", "SklepUzId" }); + iX_SklepTrescEmail_SklepId_SklepUzId.MappedIndexes.Add(iX_SklepTrescEmail_SklepId_SklepUzIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepTrescEmail_SklepId_SklepUzIdIx).Add(iX_SklepTrescEmail_SklepId_SklepUzId); + sklepTrescEmailTable.Indexes.Add("IX_SklepTrescEmail_SklepId_SklepUzId", iX_SklepTrescEmail_SklepId_SklepUzId); + relationalModel.Tables.Add(("SklepTrescEmail", null), sklepTrescEmailTable); + var sklepTrescEmailTableMapping = new TableMapping(sklepTrescEmail, sklepTrescEmailTable, true); + sklepTrescEmailTable.AddTypeMapping(sklepTrescEmailTableMapping, false); + tableMappings253.Add(sklepTrescEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn98, sklepTrescEmail.FindProperty("SklepId")!, sklepTrescEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepTEIdColumn, sklepTrescEmail.FindProperty("SklepTEId")!, sklepTrescEmailTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn44, sklepTrescEmail.FindProperty("Aktywny")!, sklepTrescEmailTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn54, sklepTrescEmail.FindProperty("Nazwa")!, sklepTrescEmailTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn4, sklepTrescEmail.FindProperty("SklepUzId")!, sklepTrescEmailTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn55, sklepTrescEmail.FindProperty("Zmiana")!, sklepTrescEmailTableMapping); + + var sklepTrescEmailTekst = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmailTekst")!; + + var defaultTableMappings254 = new List>(); + sklepTrescEmailTekst.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings254); + var blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmailTekst", null, relationalModel); + var kolejnoscColumnBase59 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase59); + var sklepIdColumnBase99 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase.Columns.Add("SklepId", sklepIdColumnBase99); + var sklepTEIdColumnBase0 = new ColumnBase("SklepTEId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase.Columns.Add("SklepTEId", sklepTEIdColumnBase0); + var trescColumnBase0 = new ColumnBase("Tresc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase.Columns.Add("Tresc", trescColumnBase0); + var znaczenieColumnBase35 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase.Columns.Add("Znaczenie", znaczenieColumnBase35); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmailTekst", blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase = new TableMappingBase(sklepTrescEmailTekst, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase, false); + defaultTableMappings254.Add(blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase59, sklepTrescEmailTekst.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase99, sklepTrescEmailTekst.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTEIdColumnBase0, sklepTrescEmailTekst.FindProperty("SklepTEId")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase35, sklepTrescEmailTekst.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)trescColumnBase0, sklepTrescEmailTekst.FindProperty("Tresc")!, blinkBackofficeServicesPcmDbEntitiesSklepTrescEmailTekstMappingBase); + + var tableMappings254 = new List(); + sklepTrescEmailTekst.SetRuntimeAnnotation("Relational:TableMappings", tableMappings254); + var sklepTrescEmailTekstTable = new Table("SklepTrescEmailTekst", null, relationalModel); + var sklepIdColumn99 = new Column("SklepId", "numeric(9,0)", sklepTrescEmailTekstTable); + sklepTrescEmailTekstTable.Columns.Add("SklepId", sklepIdColumn99); + var sklepTEIdColumn0 = new Column("SklepTEId", "numeric(9,0)", sklepTrescEmailTekstTable); + sklepTrescEmailTekstTable.Columns.Add("SklepTEId", sklepTEIdColumn0); + var kolejnoscColumn59 = new Column("Kolejnosc", "smallint", sklepTrescEmailTekstTable); + sklepTrescEmailTekstTable.Columns.Add("Kolejnosc", kolejnoscColumn59); + var znaczenieColumn35 = new Column("Znaczenie", "smallint", sklepTrescEmailTekstTable); + sklepTrescEmailTekstTable.Columns.Add("Znaczenie", znaczenieColumn35); + var trescColumn0 = new Column("Tresc", "varchar(255)", sklepTrescEmailTekstTable); + sklepTrescEmailTekstTable.Columns.Add("Tresc", trescColumn0); + var pK_SklepTrescEmailTekst = new UniqueConstraint("PK_SklepTrescEmailTekst", sklepTrescEmailTekstTable, new[] { sklepIdColumn99, sklepTEIdColumn0, kolejnoscColumn59, znaczenieColumn35 }); + sklepTrescEmailTekstTable.PrimaryKey = pK_SklepTrescEmailTekst; + var pK_SklepTrescEmailTekstUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmailTekst", + new[] { "SklepId", "SklepTEId", "Kolejnosc", "Znaczenie" }); + pK_SklepTrescEmailTekst.MappedKeys.Add(pK_SklepTrescEmailTekstUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SklepTrescEmailTekstUc).Add(pK_SklepTrescEmailTekst); + sklepTrescEmailTekstTable.UniqueConstraints.Add("PK_SklepTrescEmailTekst", pK_SklepTrescEmailTekst); + relationalModel.Tables.Add(("SklepTrescEmailTekst", null), sklepTrescEmailTekstTable); + var sklepTrescEmailTekstTableMapping = new TableMapping(sklepTrescEmailTekst, sklepTrescEmailTekstTable, true); + sklepTrescEmailTekstTable.AddTypeMapping(sklepTrescEmailTekstTableMapping, false); + tableMappings254.Add(sklepTrescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn59, sklepTrescEmailTekst.FindProperty("Kolejnosc")!, sklepTrescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn99, sklepTrescEmailTekst.FindProperty("SklepId")!, sklepTrescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(sklepTEIdColumn0, sklepTrescEmailTekst.FindProperty("SklepTEId")!, sklepTrescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn35, sklepTrescEmailTekst.FindProperty("Znaczenie")!, sklepTrescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(trescColumn0, sklepTrescEmailTekst.FindProperty("Tresc")!, sklepTrescEmailTekstTableMapping); + + var sklepTypOs = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs")!; + + var defaultTableMappings255 = new List>(); + sklepTypOs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings255); + var blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", null, relationalModel); + var aktywnyColumnBase45 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.Columns.Add("Aktywny", aktywnyColumnBase45); + var centrTypOsIdColumnBase = new ColumnBase("CentrTypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.Columns.Add("CentrTypOsId", centrTypOsIdColumnBase); + var komentarzColumnBase2 = new ColumnBase("Komentarz", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.Columns.Add("Komentarz", komentarzColumnBase2); + var nazwaColumnBase55 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.Columns.Add("Nazwa", nazwaColumnBase55); + var sklepIdColumnBase100 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.Columns.Add("SklepId", sklepIdColumnBase100); + var sklepTypOsIdColumnBase1 = new ColumnBase("SklepTypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.Columns.Add("SklepTypOsId", sklepTypOsIdColumnBase1); + var typOsIdColumnBase0 = new ColumnBase("TypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.Columns.Add("TypOsId", typOsIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase = new TableMappingBase(sklepTypOs, blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepTypOsTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase, false); + defaultTableMappings255.Add(blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase100, sklepTypOs.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTypOsIdColumnBase1, sklepTypOs.FindProperty("SklepTypOsId")!, blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase45, sklepTypOs.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrTypOsIdColumnBase, sklepTypOs.FindProperty("CentrTypOsId")!, blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)komentarzColumnBase2, sklepTypOs.FindProperty("Komentarz")!, blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase55, sklepTypOs.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typOsIdColumnBase0, sklepTypOs.FindProperty("TypOsId")!, blinkBackofficeServicesPcmDbEntitiesSklepTypOsMappingBase); + + var tableMappings255 = new List(); + sklepTypOs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings255); + var sklepTypOsTable = new Table("SklepTypOs", null, relationalModel); + var sklepIdColumn100 = new Column("SklepId", "numeric(9,0)", sklepTypOsTable); + sklepTypOsTable.Columns.Add("SklepId", sklepIdColumn100); + var sklepTypOsIdColumn1 = new Column("SklepTypOsId", "numeric(9,0)", sklepTypOsTable); + sklepTypOsTable.Columns.Add("SklepTypOsId", sklepTypOsIdColumn1); + var aktywnyColumn45 = new Column("Aktywny", "smallint", sklepTypOsTable); + sklepTypOsTable.Columns.Add("Aktywny", aktywnyColumn45); + var centrTypOsIdColumn = new Column("CentrTypOsId", "numeric(9,0)", sklepTypOsTable) + { + IsNullable = true + }; + sklepTypOsTable.Columns.Add("CentrTypOsId", centrTypOsIdColumn); + var komentarzColumn2 = new Column("Komentarz", "varchar(255)", sklepTypOsTable) + { + IsNullable = true + }; + sklepTypOsTable.Columns.Add("Komentarz", komentarzColumn2); + var nazwaColumn55 = new Column("Nazwa", "varchar(60)", sklepTypOsTable); + sklepTypOsTable.Columns.Add("Nazwa", nazwaColumn55); + var typOsIdColumn0 = new Column("TypOsId", "numeric(9,0)", sklepTypOsTable) + { + IsNullable = true + }; + sklepTypOsTable.Columns.Add("TypOsId", typOsIdColumn0); + var pK_SKLEPTYPOS = new UniqueConstraint("PK_SKLEPTYPOS", sklepTypOsTable, new[] { sklepIdColumn100, sklepTypOsIdColumn1 }); + sklepTypOsTable.PrimaryKey = pK_SKLEPTYPOS; + var pK_SKLEPTYPOSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + new[] { "SklepId", "SklepTypOsId" }); + pK_SKLEPTYPOS.MappedKeys.Add(pK_SKLEPTYPOSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPTYPOSUc).Add(pK_SKLEPTYPOS); + sklepTypOsTable.UniqueConstraints.Add("PK_SKLEPTYPOS", pK_SKLEPTYPOS); + var idx_SKTYPOS_TYPOS = new TableIndex( + "idx_SKTYPOS_TYPOS", sklepTypOsTable, new[] { typOsIdColumn0 }, false); + var idx_SKTYPOS_TYPOSIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + "idx_SKTYPOS_TYPOS"); + idx_SKTYPOS_TYPOS.MappedIndexes.Add(idx_SKTYPOS_TYPOSIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKTYPOS_TYPOSIx).Add(idx_SKTYPOS_TYPOS); + sklepTypOsTable.Indexes.Add("idx_SKTYPOS_TYPOS", idx_SKTYPOS_TYPOS); + relationalModel.Tables.Add(("SklepTypOs", null), sklepTypOsTable); + var sklepTypOsTableMapping = new TableMapping(sklepTypOs, sklepTypOsTable, true); + sklepTypOsTable.AddTypeMapping(sklepTypOsTableMapping, false); + tableMappings255.Add(sklepTypOsTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn100, sklepTypOs.FindProperty("SklepId")!, sklepTypOsTableMapping); + RelationalModel.CreateColumnMapping(sklepTypOsIdColumn1, sklepTypOs.FindProperty("SklepTypOsId")!, sklepTypOsTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn45, sklepTypOs.FindProperty("Aktywny")!, sklepTypOsTableMapping); + RelationalModel.CreateColumnMapping(centrTypOsIdColumn, sklepTypOs.FindProperty("CentrTypOsId")!, sklepTypOsTableMapping); + RelationalModel.CreateColumnMapping(komentarzColumn2, sklepTypOs.FindProperty("Komentarz")!, sklepTypOsTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn55, sklepTypOs.FindProperty("Nazwa")!, sklepTypOsTableMapping); + RelationalModel.CreateColumnMapping(typOsIdColumn0, sklepTypOs.FindProperty("TypOsId")!, sklepTypOsTableMapping); + + var sklepUprawnienie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepUprawnienie")!; + + var defaultTableMappings256 = new List>(); + sklepUprawnienie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings256); + var blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepUprawnienie", null, relationalModel); + var jestColumnBase1 = new ColumnBase("Jest", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase.Columns.Add("Jest", jestColumnBase1); + var rodzajColumnBase12 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase.Columns.Add("Rodzaj", rodzajColumnBase12); + var sklepIdColumnBase101 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase.Columns.Add("SklepId", sklepIdColumnBase101); + var sklepUzIdColumnBase5 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepUprawnienie", blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieMappingBase = new TableMappingBase(sklepUprawnienie, blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieMappingBase, false); + defaultTableMappings256.Add(blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase12, sklepUprawnienie.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase101, sklepUprawnienie.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase5, sklepUprawnienie.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jestColumnBase1, sklepUprawnienie.FindProperty("Jest")!, blinkBackofficeServicesPcmDbEntitiesSklepUprawnienieMappingBase); + + var tableMappings256 = new List(); + sklepUprawnienie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings256); + var sklepUprawnienieTable = new Table("SklepUprawnienie", null, relationalModel); + var sklepIdColumn101 = new Column("SklepId", "numeric(9,0)", sklepUprawnienieTable); + sklepUprawnienieTable.Columns.Add("SklepId", sklepIdColumn101); + var sklepUzIdColumn5 = new Column("SklepUzId", "numeric(9,0)", sklepUprawnienieTable); + sklepUprawnienieTable.Columns.Add("SklepUzId", sklepUzIdColumn5); + var rodzajColumn12 = new Column("Rodzaj", "smallint", sklepUprawnienieTable); + sklepUprawnienieTable.Columns.Add("Rodzaj", rodzajColumn12); + var jestColumn1 = new Column("Jest", "smallint", sklepUprawnienieTable) + { + IsNullable = true + }; + sklepUprawnienieTable.Columns.Add("Jest", jestColumn1); + var pK_SKLEPUPRAWNIENIE = new UniqueConstraint("PK_SKLEPUPRAWNIENIE", sklepUprawnienieTable, new[] { sklepIdColumn101, sklepUzIdColumn5, rodzajColumn12 }); + sklepUprawnienieTable.PrimaryKey = pK_SKLEPUPRAWNIENIE; + var pK_SKLEPUPRAWNIENIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUprawnienie", + new[] { "SklepId", "SklepUzId", "Rodzaj" }); + pK_SKLEPUPRAWNIENIE.MappedKeys.Add(pK_SKLEPUPRAWNIENIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPUPRAWNIENIEUc).Add(pK_SKLEPUPRAWNIENIE); + sklepUprawnienieTable.UniqueConstraints.Add("PK_SKLEPUPRAWNIENIE", pK_SKLEPUPRAWNIENIE); + relationalModel.Tables.Add(("SklepUprawnienie", null), sklepUprawnienieTable); + var sklepUprawnienieTableMapping = new TableMapping(sklepUprawnienie, sklepUprawnienieTable, true); + sklepUprawnienieTable.AddTypeMapping(sklepUprawnienieTableMapping, false); + tableMappings256.Add(sklepUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn12, sklepUprawnienie.FindProperty("Rodzaj")!, sklepUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn101, sklepUprawnienie.FindProperty("SklepId")!, sklepUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn5, sklepUprawnienie.FindProperty("SklepUzId")!, sklepUprawnienieTableMapping); + RelationalModel.CreateColumnMapping(jestColumn1, sklepUprawnienie.FindProperty("Jest")!, sklepUprawnienieTableMapping); + + var sklepUzytkownik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik")!; + + var defaultTableMappings257 = new List>(); + sklepUzytkownik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings257); + var blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", null, relationalModel); + var aktywnyColumnBase46 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Aktywny", aktywnyColumnBase46); + var hasloColumnBase1 = new ColumnBase("Haslo", "varchar(50)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Haslo", hasloColumnBase1); + var hasloPrepaidColumnBase = new ColumnBase("HasloPrepaid", "varchar(100)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("HasloPrepaid", hasloPrepaidColumnBase); + var identPrepaidColumnBase = new ColumnBase("IdentPrepaid", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("IdentPrepaid", identPrepaidColumnBase); + var identyfikatorColumnBase = new ColumnBase("Identyfikator", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Identyfikator", identyfikatorColumnBase); + var jezykColumnBase = new ColumnBase("Jezyk", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Jezyk", jezykColumnBase); + var kodKasjeraColumnBase = new ColumnBase("KodKasjera", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("KodKasjera", kodKasjeraColumnBase); + var nazwiskoColumnBase1 = new ColumnBase("Nazwisko", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Nazwisko", nazwiskoColumnBase1); + var nrKasjeraColumnBase = new ColumnBase("NrKasjera", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("NrKasjera", nrKasjeraColumnBase); + var nrSzufladyColumnBase = new ColumnBase("NrSzuflady", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("NrSzuflady", nrSzufladyColumnBase); + var opiekunColumnBase = new ColumnBase("Opiekun", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Opiekun", opiekunColumnBase); + var ostZmianaHaslaColumnBase = new ColumnBase("OstZmianaHasla", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("OstZmianaHasla", ostZmianaHaslaColumnBase); + var rolaColumnBase1 = new ColumnBase("Rola", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Rola", rolaColumnBase1); + var rolaKasjeraColumnBase = new ColumnBase("RolaKasjera", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("RolaKasjera", rolaKasjeraColumnBase); + var sklepIdColumnBase102 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("SklepId", sklepIdColumnBase102); + var sklepProfilIdColumnBase1 = new ColumnBase("SklepProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("SklepProfilId", sklepProfilIdColumnBase1); + var sklepUzIdColumnBase6 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase6); + var uzIdColumnBase5 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("UzId", uzIdColumnBase5); + var zmianaColumnBase56 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.Columns.Add("Zmiana", zmianaColumnBase56); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase = new TableMappingBase(sklepUzytkownik, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase, false); + defaultTableMappings257.Add(blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase102, sklepUzytkownik.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase6, sklepUzytkownik.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase46, sklepUzytkownik.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloColumnBase1, sklepUzytkownik.FindProperty("Haslo")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloPrepaidColumnBase, sklepUzytkownik.FindProperty("HasloPrepaid")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)identPrepaidColumnBase, sklepUzytkownik.FindProperty("IdentPrepaid")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)identyfikatorColumnBase, sklepUzytkownik.FindProperty("Identyfikator")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jezykColumnBase, sklepUzytkownik.FindProperty("Jezyk")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKasjeraColumnBase, sklepUzytkownik.FindProperty("KodKasjera")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwiskoColumnBase1, sklepUzytkownik.FindProperty("Nazwisko")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrKasjeraColumnBase, sklepUzytkownik.FindProperty("NrKasjera")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrSzufladyColumnBase, sklepUzytkownik.FindProperty("NrSzuflady")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opiekunColumnBase, sklepUzytkownik.FindProperty("Opiekun")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ostZmianaHaslaColumnBase, sklepUzytkownik.FindProperty("OstZmianaHasla")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaColumnBase1, sklepUzytkownik.FindProperty("Rola")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaKasjeraColumnBase, sklepUzytkownik.FindProperty("RolaKasjera")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepProfilIdColumnBase1, sklepUzytkownik.FindProperty("SklepProfilId")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase5, sklepUzytkownik.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase56, sklepUzytkownik.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepUzytkownikMappingBase); + + var tableMappings257 = new List(); + sklepUzytkownik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings257); + var sklepUzytkownikTable = new Table("SklepUzytkownik", null, relationalModel); + var sklepIdColumn102 = new Column("SklepId", "numeric(9,0)", sklepUzytkownikTable); + sklepUzytkownikTable.Columns.Add("SklepId", sklepIdColumn102); + var sklepUzIdColumn6 = new Column("SklepUzId", "numeric(9,0)", sklepUzytkownikTable); + sklepUzytkownikTable.Columns.Add("SklepUzId", sklepUzIdColumn6); + var aktywnyColumn46 = new Column("Aktywny", "smallint", sklepUzytkownikTable); + sklepUzytkownikTable.Columns.Add("Aktywny", aktywnyColumn46); + var hasloColumn1 = new Column("Haslo", "varchar(50)", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("Haslo", hasloColumn1); + var hasloPrepaidColumn = new Column("HasloPrepaid", "varchar(100)", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("HasloPrepaid", hasloPrepaidColumn); + var identPrepaidColumn = new Column("IdentPrepaid", "varchar(60)", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("IdentPrepaid", identPrepaidColumn); + var identyfikatorColumn = new Column("Identyfikator", "varchar(60)", sklepUzytkownikTable); + sklepUzytkownikTable.Columns.Add("Identyfikator", identyfikatorColumn); + var jezykColumn = new Column("Jezyk", "varchar(10)", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("Jezyk", jezykColumn); + var kodKasjeraColumn = new Column("KodKasjera", "varchar(20)", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("KodKasjera", kodKasjeraColumn); + var nazwiskoColumn1 = new Column("Nazwisko", "varchar(60)", sklepUzytkownikTable); + sklepUzytkownikTable.Columns.Add("Nazwisko", nazwiskoColumn1); + var nrKasjeraColumn = new Column("NrKasjera", "smallint", sklepUzytkownikTable); + sklepUzytkownikTable.Columns.Add("NrKasjera", nrKasjeraColumn); + var nrSzufladyColumn = new Column("NrSzuflady", "smallint", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("NrSzuflady", nrSzufladyColumn); + var opiekunColumn = new Column("Opiekun", "smallint", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("Opiekun", opiekunColumn); + var ostZmianaHaslaColumn = new Column("OstZmianaHasla", "datetime", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("OstZmianaHasla", ostZmianaHaslaColumn); + var rolaColumn1 = new Column("Rola", "smallint", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("Rola", rolaColumn1); + var rolaKasjeraColumn = new Column("RolaKasjera", "smallint", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("RolaKasjera", rolaKasjeraColumn); + var sklepProfilIdColumn1 = new Column("SklepProfilId", "numeric(9,0)", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("SklepProfilId", sklepProfilIdColumn1); + var uzIdColumn5 = new Column("UzId", "numeric(9,0)", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("UzId", uzIdColumn5); + var zmianaColumn56 = new Column("Zmiana", "datetime", sklepUzytkownikTable) + { + IsNullable = true + }; + sklepUzytkownikTable.Columns.Add("Zmiana", zmianaColumn56); + var pK_SKLEPUZYTKOWNIK = new UniqueConstraint("PK_SKLEPUZYTKOWNIK", sklepUzytkownikTable, new[] { sklepIdColumn102, sklepUzIdColumn6 }); + sklepUzytkownikTable.PrimaryKey = pK_SKLEPUZYTKOWNIK; + var pK_SKLEPUZYTKOWNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + pK_SKLEPUZYTKOWNIK.MappedKeys.Add(pK_SKLEPUZYTKOWNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPUZYTKOWNIKUc).Add(pK_SKLEPUZYTKOWNIK); + sklepUzytkownikTable.UniqueConstraints.Add("PK_SKLEPUZYTKOWNIK", pK_SKLEPUZYTKOWNIK); + var iX_SklepUzytkownik_SklepId_SklepProfilId = new TableIndex( + "IX_SklepUzytkownik_SklepId_SklepProfilId", sklepUzytkownikTable, new[] { sklepIdColumn102, sklepProfilIdColumn1 }, false); + var iX_SklepUzytkownik_SklepId_SklepProfilIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepProfilId" }); + iX_SklepUzytkownik_SklepId_SklepProfilId.MappedIndexes.Add(iX_SklepUzytkownik_SklepId_SklepProfilIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepUzytkownik_SklepId_SklepProfilIdIx).Add(iX_SklepUzytkownik_SklepId_SklepProfilId); + sklepUzytkownikTable.Indexes.Add("IX_SklepUzytkownik_SklepId_SklepProfilId", iX_SklepUzytkownik_SklepId_SklepProfilId); + var iX_SklepUzytkownik_UzId = new TableIndex( + "IX_SklepUzytkownik_UzId", sklepUzytkownikTable, new[] { uzIdColumn5 }, false); + var iX_SklepUzytkownik_UzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "UzId" }); + iX_SklepUzytkownik_UzId.MappedIndexes.Add(iX_SklepUzytkownik_UzIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepUzytkownik_UzIdIx).Add(iX_SklepUzytkownik_UzId); + sklepUzytkownikTable.Indexes.Add("IX_SklepUzytkownik_UzId", iX_SklepUzytkownik_UzId); + relationalModel.Tables.Add(("SklepUzytkownik", null), sklepUzytkownikTable); + var sklepUzytkownikTableMapping = new TableMapping(sklepUzytkownik, sklepUzytkownikTable, true); + sklepUzytkownikTable.AddTypeMapping(sklepUzytkownikTableMapping, false); + tableMappings257.Add(sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn102, sklepUzytkownik.FindProperty("SklepId")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn6, sklepUzytkownik.FindProperty("SklepUzId")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn46, sklepUzytkownik.FindProperty("Aktywny")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(hasloColumn1, sklepUzytkownik.FindProperty("Haslo")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(hasloPrepaidColumn, sklepUzytkownik.FindProperty("HasloPrepaid")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(identPrepaidColumn, sklepUzytkownik.FindProperty("IdentPrepaid")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(identyfikatorColumn, sklepUzytkownik.FindProperty("Identyfikator")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(jezykColumn, sklepUzytkownik.FindProperty("Jezyk")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(kodKasjeraColumn, sklepUzytkownik.FindProperty("KodKasjera")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(nazwiskoColumn1, sklepUzytkownik.FindProperty("Nazwisko")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(nrKasjeraColumn, sklepUzytkownik.FindProperty("NrKasjera")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(nrSzufladyColumn, sklepUzytkownik.FindProperty("NrSzuflady")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(opiekunColumn, sklepUzytkownik.FindProperty("Opiekun")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(ostZmianaHaslaColumn, sklepUzytkownik.FindProperty("OstZmianaHasla")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(rolaColumn1, sklepUzytkownik.FindProperty("Rola")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(rolaKasjeraColumn, sklepUzytkownik.FindProperty("RolaKasjera")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(sklepProfilIdColumn1, sklepUzytkownik.FindProperty("SklepProfilId")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn5, sklepUzytkownik.FindProperty("UzId")!, sklepUzytkownikTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn56, sklepUzytkownik.FindProperty("Zmiana")!, sklepUzytkownikTableMapping); + + var sklepWaluta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta")!; + + var defaultTableMappings258 = new List>(); + sklepWaluta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings258); + var blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", null, relationalModel); + var aktywnyColumnBase47 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("Aktywny", aktywnyColumnBase47); + var kodColumnBase16 = new ColumnBase("Kod", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("Kod", kodColumnBase16); + var kursColumnBase10 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("Kurs", kursColumnBase10); + var nazwaColumnBase56 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("Nazwa", nazwaColumnBase56); + var sklepIdColumnBase103 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("SklepId", sklepIdColumnBase103); + var sklepWalIdColumnBase6 = new ColumnBase("SklepWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("SklepWalId", sklepWalIdColumnBase6); + var skrot1ColumnBase0 = new ColumnBase("Skrot1", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("Skrot1", skrot1ColumnBase0); + var skrot100ColumnBase = new ColumnBase("Skrot100", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("Skrot100", skrot100ColumnBase); + var ukrycNaKasieColumnBase0 = new ColumnBase("UkrycNaKasie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("UkrycNaKasie", ukrycNaKasieColumnBase0); + var walIdColumnBase8 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("WalId", walIdColumnBase8); + var znaczenieColumnBase36 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.Columns.Add("Znaczenie", znaczenieColumnBase36); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase = new TableMappingBase(sklepWaluta, blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepWalutaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase, false); + defaultTableMappings258.Add(blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase103, sklepWaluta.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepWalIdColumnBase6, sklepWaluta.FindProperty("SklepWalId")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase47, sklepWaluta.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase16, sklepWaluta.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase10, sklepWaluta.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase56, sklepWaluta.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot1ColumnBase0, sklepWaluta.FindProperty("Skrot1")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot100ColumnBase, sklepWaluta.FindProperty("Skrot100")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ukrycNaKasieColumnBase0, sklepWaluta.FindProperty("UkrycNaKasie")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase8, sklepWaluta.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase36, sklepWaluta.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepWalutaMappingBase); + + var tableMappings258 = new List(); + sklepWaluta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings258); + var sklepWalutaTable = new Table("SklepWaluta", null, relationalModel); + var sklepIdColumn103 = new Column("SklepId", "numeric(9,0)", sklepWalutaTable); + sklepWalutaTable.Columns.Add("SklepId", sklepIdColumn103); + var sklepWalIdColumn6 = new Column("SklepWalId", "numeric(9,0)", sklepWalutaTable); + sklepWalutaTable.Columns.Add("SklepWalId", sklepWalIdColumn6); + var aktywnyColumn47 = new Column("Aktywny", "smallint", sklepWalutaTable); + sklepWalutaTable.Columns.Add("Aktywny", aktywnyColumn47); + var kodColumn16 = new Column("Kod", "varchar(10)", sklepWalutaTable); + sklepWalutaTable.Columns.Add("Kod", kodColumn16); + var kursColumn10 = new Column("Kurs", "decimal(15,4)", sklepWalutaTable); + sklepWalutaTable.Columns.Add("Kurs", kursColumn10); + var nazwaColumn56 = new Column("Nazwa", "varchar(40)", sklepWalutaTable); + sklepWalutaTable.Columns.Add("Nazwa", nazwaColumn56); + var skrot1Column0 = new Column("Skrot1", "varchar(10)", sklepWalutaTable) + { + IsNullable = true + }; + sklepWalutaTable.Columns.Add("Skrot1", skrot1Column0); + var skrot100Column = new Column("Skrot100", "varchar(10)", sklepWalutaTable) + { + IsNullable = true + }; + sklepWalutaTable.Columns.Add("Skrot100", skrot100Column); + var ukrycNaKasieColumn0 = new Column("UkrycNaKasie", "smallint", sklepWalutaTable) + { + IsNullable = true + }; + sklepWalutaTable.Columns.Add("UkrycNaKasie", ukrycNaKasieColumn0); + var walIdColumn8 = new Column("WalId", "numeric(9,0)", sklepWalutaTable) + { + IsNullable = true + }; + sklepWalutaTable.Columns.Add("WalId", walIdColumn8); + var znaczenieColumn36 = new Column("Znaczenie", "smallint", sklepWalutaTable); + sklepWalutaTable.Columns.Add("Znaczenie", znaczenieColumn36); + var pK_SK_WALUTA = new UniqueConstraint("PK_SK_WALUTA", sklepWalutaTable, new[] { sklepIdColumn103, sklepWalIdColumn6 }); + sklepWalutaTable.PrimaryKey = pK_SK_WALUTA; + var pK_SK_WALUTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + pK_SK_WALUTA.MappedKeys.Add(pK_SK_WALUTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SK_WALUTAUc).Add(pK_SK_WALUTA); + sklepWalutaTable.UniqueConstraints.Add("PK_SK_WALUTA", pK_SK_WALUTA); + var idx_SkWal = new TableIndex( + "idx_SkWal", sklepWalutaTable, new[] { walIdColumn8 }, false); + var idx_SkWalIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + "idx_SkWal"); + idx_SkWal.MappedIndexes.Add(idx_SkWalIx); + RelationalModel.GetOrCreateTableIndexes(idx_SkWalIx).Add(idx_SkWal); + sklepWalutaTable.Indexes.Add("idx_SkWal", idx_SkWal); + relationalModel.Tables.Add(("SklepWaluta", null), sklepWalutaTable); + var sklepWalutaTableMapping = new TableMapping(sklepWaluta, sklepWalutaTable, true); + sklepWalutaTable.AddTypeMapping(sklepWalutaTableMapping, false); + tableMappings258.Add(sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn103, sklepWaluta.FindProperty("SklepId")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(sklepWalIdColumn6, sklepWaluta.FindProperty("SklepWalId")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn47, sklepWaluta.FindProperty("Aktywny")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(kodColumn16, sklepWaluta.FindProperty("Kod")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(kursColumn10, sklepWaluta.FindProperty("Kurs")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn56, sklepWaluta.FindProperty("Nazwa")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(skrot1Column0, sklepWaluta.FindProperty("Skrot1")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(skrot100Column, sklepWaluta.FindProperty("Skrot100")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(ukrycNaKasieColumn0, sklepWaluta.FindProperty("UkrycNaKasie")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn8, sklepWaluta.FindProperty("WalId")!, sklepWalutaTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn36, sklepWaluta.FindProperty("Znaczenie")!, sklepWalutaTableMapping); + + var sklepZaleznosc = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc")!; + + var defaultTableMappings259 = new List>(); + sklepZaleznosc.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings259); + var blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc", null, relationalModel); + var poprzedniSklepDokIdColumnBase = new ColumnBase("PoprzedniSklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase.Columns.Add("PoprzedniSklepDokId", poprzedniSklepDokIdColumnBase); + var poprzedniSklepIdColumnBase = new ColumnBase("PoprzedniSklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase.Columns.Add("PoprzedniSklepId", poprzedniSklepIdColumnBase); + var sklepDokIdColumnBase17 = new ColumnBase("SklepDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase.Columns.Add("SklepDokId", sklepDokIdColumnBase17); + var sklepIdColumnBase104 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase.Columns.Add("SklepId", sklepIdColumnBase104); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc", blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscMappingBase = new TableMappingBase(sklepZaleznosc, blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscMappingBase, false); + defaultTableMappings259.Add(blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepDokIdColumnBase17, sklepZaleznosc.FindProperty("SklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase104, sklepZaleznosc.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poprzedniSklepDokIdColumnBase, sklepZaleznosc.FindProperty("PoprzedniSklepDokId")!, blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poprzedniSklepIdColumnBase, sklepZaleznosc.FindProperty("PoprzedniSklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepZaleznoscMappingBase); + + var tableMappings259 = new List(); + sklepZaleznosc.SetRuntimeAnnotation("Relational:TableMappings", tableMappings259); + var sklepZaleznoscTable = new Table("SklepZaleznosc", null, relationalModel); + var sklepIdColumn104 = new Column("SklepId", "numeric(9,0)", sklepZaleznoscTable); + sklepZaleznoscTable.Columns.Add("SklepId", sklepIdColumn104); + var sklepDokIdColumn17 = new Column("SklepDokId", "numeric(9,0)", sklepZaleznoscTable); + sklepZaleznoscTable.Columns.Add("SklepDokId", sklepDokIdColumn17); + var poprzedniSklepDokIdColumn = new Column("PoprzedniSklepDokId", "numeric(9,0)", sklepZaleznoscTable); + sklepZaleznoscTable.Columns.Add("PoprzedniSklepDokId", poprzedniSklepDokIdColumn); + var poprzedniSklepIdColumn = new Column("PoprzedniSklepId", "numeric(9,0)", sklepZaleznoscTable); + sklepZaleznoscTable.Columns.Add("PoprzedniSklepId", poprzedniSklepIdColumn); + var pK_SKLEPZALEZNOSC = new UniqueConstraint("PK_SKLEPZALEZNOSC", sklepZaleznoscTable, new[] { sklepIdColumn104, sklepDokIdColumn17 }); + sklepZaleznoscTable.PrimaryKey = pK_SKLEPZALEZNOSC; + var pK_SKLEPZALEZNOSCUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc", + new[] { "SklepId", "SklepDokId" }); + pK_SKLEPZALEZNOSC.MappedKeys.Add(pK_SKLEPZALEZNOSCUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPZALEZNOSCUc).Add(pK_SKLEPZALEZNOSC); + sklepZaleznoscTable.UniqueConstraints.Add("PK_SKLEPZALEZNOSC", pK_SKLEPZALEZNOSC); + var idx_SklepPoprzedniDokId = new TableIndex( + "idx_SklepPoprzedniDokId", sklepZaleznoscTable, new[] { poprzedniSklepIdColumn, poprzedniSklepDokIdColumn }, false); + var idx_SklepPoprzedniDokIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc", + "idx_SklepPoprzedniDokId"); + idx_SklepPoprzedniDokId.MappedIndexes.Add(idx_SklepPoprzedniDokIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepPoprzedniDokIdIx).Add(idx_SklepPoprzedniDokId); + sklepZaleznoscTable.Indexes.Add("idx_SklepPoprzedniDokId", idx_SklepPoprzedniDokId); + relationalModel.Tables.Add(("SklepZaleznosc", null), sklepZaleznoscTable); + var sklepZaleznoscTableMapping = new TableMapping(sklepZaleznosc, sklepZaleznoscTable, true); + sklepZaleznoscTable.AddTypeMapping(sklepZaleznoscTableMapping, false); + tableMappings259.Add(sklepZaleznoscTableMapping); + RelationalModel.CreateColumnMapping(sklepDokIdColumn17, sklepZaleznosc.FindProperty("SklepDokId")!, sklepZaleznoscTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn104, sklepZaleznosc.FindProperty("SklepId")!, sklepZaleznoscTableMapping); + RelationalModel.CreateColumnMapping(poprzedniSklepDokIdColumn, sklepZaleznosc.FindProperty("PoprzedniSklepDokId")!, sklepZaleznoscTableMapping); + RelationalModel.CreateColumnMapping(poprzedniSklepIdColumn, sklepZaleznosc.FindProperty("PoprzedniSklepId")!, sklepZaleznoscTableMapping); + + var sklepZamiennik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepZamiennik")!; + + var defaultTableMappings260 = new List>(); + sklepZamiennik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings260); + var blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepZamiennik", null, relationalModel); + var sklepIdColumnBase105 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase.Columns.Add("SklepId", sklepIdColumnBase105); + var sklepZmIdColumnBase0 = new ColumnBase("SklepZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase.Columns.Add("SklepZmId", sklepZmIdColumnBase0); + var zmIdColumnBase0 = new ColumnBase("ZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase.Columns.Add("ZmId", zmIdColumnBase0); + var zmianaColumnBase57 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase.Columns.Add("Zmiana", zmianaColumnBase57); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepZamiennik", blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepZamiennikMappingBase = new TableMappingBase(sklepZamiennik, blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepZamiennikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepZamiennikMappingBase, false); + defaultTableMappings260.Add(blinkBackofficeServicesPcmDbEntitiesSklepZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase105, sklepZamiennik.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZmIdColumnBase0, sklepZamiennik.FindProperty("SklepZmId")!, blinkBackofficeServicesPcmDbEntitiesSklepZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmIdColumnBase0, sklepZamiennik.FindProperty("ZmId")!, blinkBackofficeServicesPcmDbEntitiesSklepZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase57, sklepZamiennik.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSklepZamiennikMappingBase); + + var tableMappings260 = new List(); + sklepZamiennik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings260); + var sklepZamiennikTable = new Table("SklepZamiennik", null, relationalModel); + var sklepIdColumn105 = new Column("SklepId", "numeric(9,0)", sklepZamiennikTable); + sklepZamiennikTable.Columns.Add("SklepId", sklepIdColumn105); + var sklepZmIdColumn0 = new Column("SklepZmId", "numeric(9,0)", sklepZamiennikTable); + sklepZamiennikTable.Columns.Add("SklepZmId", sklepZmIdColumn0); + var zmIdColumn0 = new Column("ZmId", "numeric(9,0)", sklepZamiennikTable) + { + IsNullable = true + }; + sklepZamiennikTable.Columns.Add("ZmId", zmIdColumn0); + var zmianaColumn57 = new Column("Zmiana", "datetime", sklepZamiennikTable); + sklepZamiennikTable.Columns.Add("Zmiana", zmianaColumn57); + var pK_SKLEPZAMIENNIK = new UniqueConstraint("PK_SKLEPZAMIENNIK", sklepZamiennikTable, new[] { sklepIdColumn105, sklepZmIdColumn0 }); + sklepZamiennikTable.PrimaryKey = pK_SKLEPZAMIENNIK; + var pK_SKLEPZAMIENNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZamiennik", + new[] { "SklepId", "SklepZmId" }); + pK_SKLEPZAMIENNIK.MappedKeys.Add(pK_SKLEPZAMIENNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPZAMIENNIKUc).Add(pK_SKLEPZAMIENNIK); + sklepZamiennikTable.UniqueConstraints.Add("PK_SKLEPZAMIENNIK", pK_SKLEPZAMIENNIK); + relationalModel.Tables.Add(("SklepZamiennik", null), sklepZamiennikTable); + var sklepZamiennikTableMapping = new TableMapping(sklepZamiennik, sklepZamiennikTable, true); + sklepZamiennikTable.AddTypeMapping(sklepZamiennikTableMapping, false); + tableMappings260.Add(sklepZamiennikTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn105, sklepZamiennik.FindProperty("SklepId")!, sklepZamiennikTableMapping); + RelationalModel.CreateColumnMapping(sklepZmIdColumn0, sklepZamiennik.FindProperty("SklepZmId")!, sklepZamiennikTableMapping); + RelationalModel.CreateColumnMapping(zmIdColumn0, sklepZamiennik.FindProperty("ZmId")!, sklepZamiennikTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn57, sklepZamiennik.FindProperty("Zmiana")!, sklepZamiennikTableMapping); + + var sklepZasob = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepZasob")!; + + var defaultTableMappings261 = new List>(); + sklepZasob.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings261); + var blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepZasob", null, relationalModel); + var idColumnBase6 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase.Columns.Add("Id", idColumnBase6); + var sciezkaColumnBase0 = new ColumnBase("Sciezka", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase.Columns.Add("Sciezka", sciezkaColumnBase0); + var sklepIdColumnBase106 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase.Columns.Add("SklepId", sklepIdColumnBase106); + var tabelaColumnBase = new ColumnBase("Tabela", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase.Columns.Add("Tabela", tabelaColumnBase); + var typColumnBase39 = new ColumnBase("Typ", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase.Columns.Add("Typ", typColumnBase39); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepZasob", blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase = new TableMappingBase(sklepZasob, blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepZasobTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase, false); + defaultTableMappings261.Add(blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase6, sklepZasob.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase106, sklepZasob.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tabelaColumnBase, sklepZasob.FindProperty("Tabela")!, blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase39, sklepZasob.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sciezkaColumnBase0, sklepZasob.FindProperty("Sciezka")!, blinkBackofficeServicesPcmDbEntitiesSklepZasobMappingBase); + + var tableMappings261 = new List(); + sklepZasob.SetRuntimeAnnotation("Relational:TableMappings", tableMappings261); + var sklepZasobTable = new Table("SklepZasob", null, relationalModel); + var sklepIdColumn106 = new Column("SklepId", "numeric(9,0)", sklepZasobTable); + sklepZasobTable.Columns.Add("SklepId", sklepIdColumn106); + var tabelaColumn = new Column("Tabela", "smallint", sklepZasobTable); + sklepZasobTable.Columns.Add("Tabela", tabelaColumn); + var idColumn6 = new Column("Id", "numeric(9,0)", sklepZasobTable); + sklepZasobTable.Columns.Add("Id", idColumn6); + var typColumn39 = new Column("Typ", "varchar(40)", sklepZasobTable); + sklepZasobTable.Columns.Add("Typ", typColumn39); + var sciezkaColumn0 = new Column("Sciezka", "varchar(255)", sklepZasobTable); + sklepZasobTable.Columns.Add("Sciezka", sciezkaColumn0); + var pK_SKLEPZASOB = new UniqueConstraint("PK_SKLEPZASOB", sklepZasobTable, new[] { sklepIdColumn106, tabelaColumn, idColumn6, typColumn39 }); + sklepZasobTable.PrimaryKey = pK_SKLEPZASOB; + var pK_SKLEPZASOBUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZasob", + new[] { "SklepId", "Tabela", "Id", "Typ" }); + pK_SKLEPZASOB.MappedKeys.Add(pK_SKLEPZASOBUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPZASOBUc).Add(pK_SKLEPZASOB); + sklepZasobTable.UniqueConstraints.Add("PK_SKLEPZASOB", pK_SKLEPZASOB); + relationalModel.Tables.Add(("SklepZasob", null), sklepZasobTable); + var sklepZasobTableMapping = new TableMapping(sklepZasob, sklepZasobTable, true); + sklepZasobTable.AddTypeMapping(sklepZasobTableMapping, false); + tableMappings261.Add(sklepZasobTableMapping); + RelationalModel.CreateColumnMapping(idColumn6, sklepZasob.FindProperty("Id")!, sklepZasobTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn106, sklepZasob.FindProperty("SklepId")!, sklepZasobTableMapping); + RelationalModel.CreateColumnMapping(tabelaColumn, sklepZasob.FindProperty("Tabela")!, sklepZasobTableMapping); + RelationalModel.CreateColumnMapping(typColumn39, sklepZasob.FindProperty("Typ")!, sklepZasobTableMapping); + RelationalModel.CreateColumnMapping(sciezkaColumn0, sklepZasob.FindProperty("Sciezka")!, sklepZasobTableMapping); + + var sklepZdarzOs = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs")!; + + var defaultTableMappings262 = new List>(); + sklepZdarzOs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings262); + var blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", null, relationalModel); + var akcjaColumnBase = new ColumnBase("Akcja", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("Akcja", akcjaColumnBase); + var dataDecColumnBase0 = new ColumnBase("DataDec", "datetime", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("DataDec", dataDecColumnBase0); + var dodParColumnBase = new ColumnBase("DodPar", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("DodPar", dodParColumnBase); + var formaDecColumnBase0 = new ColumnBase("FormaDec", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("FormaDec", formaDecColumnBase0); + var kiedyColumnBase4 = new ColumnBase("Kiedy", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("Kiedy", kiedyColumnBase4); + var nowyStatusColumnBase = new ColumnBase("NowyStatus", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("NowyStatus", nowyStatusColumnBase); + var sklepIdColumnBase107 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("SklepId", sklepIdColumnBase107); + var sklepKontrIdColumnBase11 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase11); + var sklepTypOsIdColumnBase2 = new ColumnBase("SklepTypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("SklepTypOsId", sklepTypOsIdColumnBase2); + var sklepUzIdColumnBase7 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase7); + var sklepZgIdColumnBase1 = new ColumnBase("SklepZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("SklepZgId", sklepZgIdColumnBase1); + var wersjaColumnBase5 = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.Columns.Add("Wersja", wersjaColumnBase5); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase = new TableMappingBase(sklepZdarzOs, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase, false); + defaultTableMappings262.Add(blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase4, sklepZdarzOs.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase107, sklepZdarzOs.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase11, sklepZdarzOs.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akcjaColumnBase, sklepZdarzOs.FindProperty("Akcja")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDecColumnBase0, sklepZdarzOs.FindProperty("DataDec")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodParColumnBase, sklepZdarzOs.FindProperty("DodPar")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaDecColumnBase0, sklepZdarzOs.FindProperty("FormaDec")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nowyStatusColumnBase, sklepZdarzOs.FindProperty("NowyStatus")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTypOsIdColumnBase2, sklepZdarzOs.FindProperty("SklepTypOsId")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase7, sklepZdarzOs.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZgIdColumnBase1, sklepZdarzOs.FindProperty("SklepZgId")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase5, sklepZdarzOs.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsMappingBase); + + var tableMappings262 = new List(); + sklepZdarzOs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings262); + var sklepZdarzOsTable = new Table("SklepZdarzOs", null, relationalModel); + var sklepIdColumn107 = new Column("SklepId", "numeric(9,0)", sklepZdarzOsTable); + sklepZdarzOsTable.Columns.Add("SklepId", sklepIdColumn107); + var sklepKontrIdColumn11 = new Column("SklepKontrId", "numeric(9,0)", sklepZdarzOsTable); + sklepZdarzOsTable.Columns.Add("SklepKontrId", sklepKontrIdColumn11); + var kiedyColumn4 = new Column("Kiedy", "varchar(20)", sklepZdarzOsTable); + sklepZdarzOsTable.Columns.Add("Kiedy", kiedyColumn4); + var akcjaColumn = new Column("Akcja", "smallint", sklepZdarzOsTable); + sklepZdarzOsTable.Columns.Add("Akcja", akcjaColumn); + var dataDecColumn0 = new Column("DataDec", "datetime", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("DataDec", dataDecColumn0); + var dodParColumn = new Column("DodPar", "varchar(120)", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("DodPar", dodParColumn); + var formaDecColumn0 = new Column("FormaDec", "smallint", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("FormaDec", formaDecColumn0); + var nowyStatusColumn = new Column("NowyStatus", "smallint", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("NowyStatus", nowyStatusColumn); + var sklepTypOsIdColumn2 = new Column("SklepTypOsId", "numeric(9,0)", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("SklepTypOsId", sklepTypOsIdColumn2); + var sklepUzIdColumn7 = new Column("SklepUzId", "numeric(9,0)", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("SklepUzId", sklepUzIdColumn7); + var sklepZgIdColumn1 = new Column("SklepZgId", "numeric(9,0)", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("SklepZgId", sklepZgIdColumn1); + var wersjaColumn5 = new Column("Wersja", "varchar(20)", sklepZdarzOsTable) + { + IsNullable = true + }; + sklepZdarzOsTable.Columns.Add("Wersja", wersjaColumn5); + var pK_SKLEPZDARZOS = new UniqueConstraint("PK_SKLEPZDARZOS", sklepZdarzOsTable, new[] { sklepIdColumn107, sklepKontrIdColumn11, kiedyColumn4 }); + sklepZdarzOsTable.PrimaryKey = pK_SKLEPZDARZOS; + var pK_SKLEPZDARZOSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + new[] { "SklepId", "SklepKontrId", "Kiedy" }); + pK_SKLEPZDARZOS.MappedKeys.Add(pK_SKLEPZDARZOSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPZDARZOSUc).Add(pK_SKLEPZDARZOS); + sklepZdarzOsTable.UniqueConstraints.Add("PK_SKLEPZDARZOS", pK_SKLEPZDARZOS); + var idx_SKZDOS_OSTDEC = new TableIndex( + "idx_SKZDOS_OSTDEC", sklepZdarzOsTable, new[] { sklepIdColumn107, sklepKontrIdColumn11, sklepZgIdColumn1, dataDecColumn0 }, false); + var idx_SKZDOS_OSTDECIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + "idx_SKZDOS_OSTDEC"); + idx_SKZDOS_OSTDEC.MappedIndexes.Add(idx_SKZDOS_OSTDECIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKZDOS_OSTDECIx).Add(idx_SKZDOS_OSTDEC); + sklepZdarzOsTable.Indexes.Add("idx_SKZDOS_OSTDEC", idx_SKZDOS_OSTDEC); + var idx_SKZDOS_OSTZGODA = new TableIndex( + "idx_SKZDOS_OSTZGODA", sklepZdarzOsTable, new[] { sklepIdColumn107, sklepKontrIdColumn11, sklepZgIdColumn1, kiedyColumn4 }, false); + var idx_SKZDOS_OSTZGODAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + "idx_SKZDOS_OSTZGODA"); + idx_SKZDOS_OSTZGODA.MappedIndexes.Add(idx_SKZDOS_OSTZGODAIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKZDOS_OSTZGODAIx).Add(idx_SKZDOS_OSTZGODA); + sklepZdarzOsTable.Indexes.Add("idx_SKZDOS_OSTZGODA", idx_SKZDOS_OSTZGODA); + var idx_SKZDOS_SKTPOS = new TableIndex( + "idx_SKZDOS_SKTPOS", sklepZdarzOsTable, new[] { sklepIdColumn107, sklepTypOsIdColumn2 }, false); + var idx_SKZDOS_SKTPOSIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + "idx_SKZDOS_SKTPOS"); + idx_SKZDOS_SKTPOS.MappedIndexes.Add(idx_SKZDOS_SKTPOSIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKZDOS_SKTPOSIx).Add(idx_SKZDOS_SKTPOS); + sklepZdarzOsTable.Indexes.Add("idx_SKZDOS_SKTPOS", idx_SKZDOS_SKTPOS); + var idx_SKZDOS_SKZG = new TableIndex( + "idx_SKZDOS_SKZG", sklepZdarzOsTable, new[] { sklepIdColumn107, sklepZgIdColumn1 }, false); + var idx_SKZDOS_SKZGIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + "idx_SKZDOS_SKZG"); + idx_SKZDOS_SKZG.MappedIndexes.Add(idx_SKZDOS_SKZGIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKZDOS_SKZGIx).Add(idx_SKZDOS_SKZG); + sklepZdarzOsTable.Indexes.Add("idx_SKZDOS_SKZG", idx_SKZDOS_SKZG); + var idx_SKZDOSUZKIEDY = new TableIndex( + "idx_SKZDOSUZKIEDY", sklepZdarzOsTable, new[] { sklepIdColumn107, sklepUzIdColumn7, kiedyColumn4 }, false); + var idx_SKZDOSUZKIEDYIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + "idx_SKZDOSUZKIEDY"); + idx_SKZDOSUZKIEDY.MappedIndexes.Add(idx_SKZDOSUZKIEDYIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKZDOSUZKIEDYIx).Add(idx_SKZDOSUZKIEDY); + sklepZdarzOsTable.Indexes.Add("idx_SKZDOSUZKIEDY", idx_SKZDOSUZKIEDY); + relationalModel.Tables.Add(("SklepZdarzOs", null), sklepZdarzOsTable); + var sklepZdarzOsTableMapping = new TableMapping(sklepZdarzOs, sklepZdarzOsTable, true); + sklepZdarzOsTable.AddTypeMapping(sklepZdarzOsTableMapping, false); + tableMappings262.Add(sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn4, sklepZdarzOs.FindProperty("Kiedy")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn107, sklepZdarzOs.FindProperty("SklepId")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn11, sklepZdarzOs.FindProperty("SklepKontrId")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(akcjaColumn, sklepZdarzOs.FindProperty("Akcja")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(dataDecColumn0, sklepZdarzOs.FindProperty("DataDec")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(dodParColumn, sklepZdarzOs.FindProperty("DodPar")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(formaDecColumn0, sklepZdarzOs.FindProperty("FormaDec")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(nowyStatusColumn, sklepZdarzOs.FindProperty("NowyStatus")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(sklepTypOsIdColumn2, sklepZdarzOs.FindProperty("SklepTypOsId")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn7, sklepZdarzOs.FindProperty("SklepUzId")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(sklepZgIdColumn1, sklepZdarzOs.FindProperty("SklepZgId")!, sklepZdarzOsTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn5, sklepZdarzOs.FindProperty("Wersja")!, sklepZdarzOsTableMapping); + + var sklepZdarzOsOpis = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOsOpis")!; + + var defaultTableMappings263 = new List>(); + sklepZdarzOsOpis.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings263); + var blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOsOpis", null, relationalModel); + var kiedyColumnBase5 = new ColumnBase("Kiedy", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase.Columns.Add("Kiedy", kiedyColumnBase5); + var sklepIdColumnBase108 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase.Columns.Add("SklepId", sklepIdColumnBase108); + var sklepKontrIdColumnBase12 = new ColumnBase("SklepKontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase.Columns.Add("SklepKontrId", sklepKontrIdColumnBase12); + var tekstColumnBase29 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase.Columns.Add("Tekst", tekstColumnBase29); + var znaczenieColumnBase37 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase.Columns.Add("Znaczenie", znaczenieColumnBase37); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOsOpis", blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase = new TableMappingBase(sklepZdarzOsOpis, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase, false); + defaultTableMappings263.Add(blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase5, sklepZdarzOsOpis.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase108, sklepZdarzOsOpis.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepKontrIdColumnBase12, sklepZdarzOsOpis.FindProperty("SklepKontrId")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase37, sklepZdarzOsOpis.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase29, sklepZdarzOsOpis.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSklepZdarzOsOpisMappingBase); + + var tableMappings263 = new List(); + sklepZdarzOsOpis.SetRuntimeAnnotation("Relational:TableMappings", tableMappings263); + var sklepZdarzOsOpisTable = new Table("SklepZdarzOsOpis", null, relationalModel); + var sklepIdColumn108 = new Column("SklepId", "numeric(9,0)", sklepZdarzOsOpisTable); + sklepZdarzOsOpisTable.Columns.Add("SklepId", sklepIdColumn108); + var sklepKontrIdColumn12 = new Column("SklepKontrId", "numeric(9,0)", sklepZdarzOsOpisTable); + sklepZdarzOsOpisTable.Columns.Add("SklepKontrId", sklepKontrIdColumn12); + var kiedyColumn5 = new Column("Kiedy", "varchar(20)", sklepZdarzOsOpisTable); + sklepZdarzOsOpisTable.Columns.Add("Kiedy", kiedyColumn5); + var znaczenieColumn37 = new Column("Znaczenie", "smallint", sklepZdarzOsOpisTable); + sklepZdarzOsOpisTable.Columns.Add("Znaczenie", znaczenieColumn37); + var tekstColumn29 = new Column("Tekst", "varchar(255)", sklepZdarzOsOpisTable); + sklepZdarzOsOpisTable.Columns.Add("Tekst", tekstColumn29); + var pK_SKZDARZOSOPIS = new UniqueConstraint("PK_SKZDARZOSOPIS", sklepZdarzOsOpisTable, new[] { sklepIdColumn108, sklepKontrIdColumn12, kiedyColumn5, znaczenieColumn37 }); + sklepZdarzOsOpisTable.PrimaryKey = pK_SKZDARZOSOPIS; + var pK_SKZDARZOSOPISUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOsOpis", + new[] { "SklepId", "SklepKontrId", "Kiedy", "Znaczenie" }); + pK_SKZDARZOSOPIS.MappedKeys.Add(pK_SKZDARZOSOPISUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKZDARZOSOPISUc).Add(pK_SKZDARZOSOPIS); + sklepZdarzOsOpisTable.UniqueConstraints.Add("PK_SKZDARZOSOPIS", pK_SKZDARZOSOPIS); + relationalModel.Tables.Add(("SklepZdarzOsOpis", null), sklepZdarzOsOpisTable); + var sklepZdarzOsOpisTableMapping = new TableMapping(sklepZdarzOsOpis, sklepZdarzOsOpisTable, true); + sklepZdarzOsOpisTable.AddTypeMapping(sklepZdarzOsOpisTableMapping, false); + tableMappings263.Add(sklepZdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn5, sklepZdarzOsOpis.FindProperty("Kiedy")!, sklepZdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn108, sklepZdarzOsOpis.FindProperty("SklepId")!, sklepZdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(sklepKontrIdColumn12, sklepZdarzOsOpis.FindProperty("SklepKontrId")!, sklepZdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn37, sklepZdarzOsOpis.FindProperty("Znaczenie")!, sklepZdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn29, sklepZdarzOsOpis.FindProperty("Tekst")!, sklepZdarzOsOpisTableMapping); + + var sklepZgoda = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda")!; + + var defaultTableMappings264 = new List>(); + sklepZgoda.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings264); + var blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", null, relationalModel); + var aktywnaColumnBase3 = new ColumnBase("Aktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("Aktywna", aktywnaColumnBase3); + var centrZgIdColumnBase = new ColumnBase("CentrZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("CentrZgId", centrZgIdColumnBase); + var daneOsColumnBase = new ColumnBase("DaneOs", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("DaneOs", daneOsColumnBase); + var komentarzColumnBase3 = new ColumnBase("Komentarz", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("Komentarz", komentarzColumnBase3); + var nazwaColumnBase57 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("Nazwa", nazwaColumnBase57); + var sklepIdColumnBase109 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("SklepId", sklepIdColumnBase109); + var sklepZgIdColumnBase2 = new ColumnBase("SklepZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("SklepZgId", sklepZgIdColumnBase2); + var wersjaColumnBase6 = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("Wersja", wersjaColumnBase6); + var zastosowaniaColumnBase = new ColumnBase("Zastosowania", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("Zastosowania", zastosowaniaColumnBase); + var zgIdColumnBase1 = new ColumnBase("ZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.Columns.Add("ZgId", zgIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase); + var blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase = new TableMappingBase(sklepZgoda, blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSklepZgodaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase, false); + defaultTableMappings264.Add(blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase109, sklepZgoda.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepZgIdColumnBase2, sklepZgoda.FindProperty("SklepZgId")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnaColumnBase3, sklepZgoda.FindProperty("Aktywna")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrZgIdColumnBase, sklepZgoda.FindProperty("CentrZgId")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)daneOsColumnBase, sklepZgoda.FindProperty("DaneOs")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)komentarzColumnBase3, sklepZgoda.FindProperty("Komentarz")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase57, sklepZgoda.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase6, sklepZgoda.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zastosowaniaColumnBase, sklepZgoda.FindProperty("Zastosowania")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zgIdColumnBase1, sklepZgoda.FindProperty("ZgId")!, blinkBackofficeServicesPcmDbEntitiesSklepZgodaMappingBase); + + var tableMappings264 = new List(); + sklepZgoda.SetRuntimeAnnotation("Relational:TableMappings", tableMappings264); + var sklepZgodaTable = new Table("SklepZgoda", null, relationalModel); + var sklepIdColumn109 = new Column("SklepId", "numeric(9,0)", sklepZgodaTable); + sklepZgodaTable.Columns.Add("SklepId", sklepIdColumn109); + var sklepZgIdColumn2 = new Column("SklepZgId", "numeric(9,0)", sklepZgodaTable); + sklepZgodaTable.Columns.Add("SklepZgId", sklepZgIdColumn2); + var aktywnaColumn3 = new Column("Aktywna", "smallint", sklepZgodaTable); + sklepZgodaTable.Columns.Add("Aktywna", aktywnaColumn3); + var centrZgIdColumn = new Column("CentrZgId", "numeric(9,0)", sklepZgodaTable) + { + IsNullable = true + }; + sklepZgodaTable.Columns.Add("CentrZgId", centrZgIdColumn); + var daneOsColumn = new Column("DaneOs", "varchar(120)", sklepZgodaTable) + { + IsNullable = true + }; + sklepZgodaTable.Columns.Add("DaneOs", daneOsColumn); + var komentarzColumn3 = new Column("Komentarz", "varchar(255)", sklepZgodaTable) + { + IsNullable = true + }; + sklepZgodaTable.Columns.Add("Komentarz", komentarzColumn3); + var nazwaColumn57 = new Column("Nazwa", "varchar(60)", sklepZgodaTable); + sklepZgodaTable.Columns.Add("Nazwa", nazwaColumn57); + var wersjaColumn6 = new Column("Wersja", "varchar(20)", sklepZgodaTable) + { + IsNullable = true + }; + sklepZgodaTable.Columns.Add("Wersja", wersjaColumn6); + var zastosowaniaColumn = new Column("Zastosowania", "varchar(120)", sklepZgodaTable) + { + IsNullable = true + }; + sklepZgodaTable.Columns.Add("Zastosowania", zastosowaniaColumn); + var zgIdColumn1 = new Column("ZgId", "numeric(9,0)", sklepZgodaTable) + { + IsNullable = true + }; + sklepZgodaTable.Columns.Add("ZgId", zgIdColumn1); + var pK_SKLEPZGODA = new UniqueConstraint("PK_SKLEPZGODA", sklepZgodaTable, new[] { sklepIdColumn109, sklepZgIdColumn2 }); + sklepZgodaTable.PrimaryKey = pK_SKLEPZGODA; + var pK_SKLEPZGODAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + new[] { "SklepId", "SklepZgId" }); + pK_SKLEPZGODA.MappedKeys.Add(pK_SKLEPZGODAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPZGODAUc).Add(pK_SKLEPZGODA); + sklepZgodaTable.UniqueConstraints.Add("PK_SKLEPZGODA", pK_SKLEPZGODA); + var idx_SKZG_ZGODA = new TableIndex( + "idx_SKZG_ZGODA", sklepZgodaTable, new[] { zgIdColumn1 }, false); + var idx_SKZG_ZGODAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + "idx_SKZG_ZGODA"); + idx_SKZG_ZGODA.MappedIndexes.Add(idx_SKZG_ZGODAIx); + RelationalModel.GetOrCreateTableIndexes(idx_SKZG_ZGODAIx).Add(idx_SKZG_ZGODA); + sklepZgodaTable.Indexes.Add("idx_SKZG_ZGODA", idx_SKZG_ZGODA); + relationalModel.Tables.Add(("SklepZgoda", null), sklepZgodaTable); + var sklepZgodaTableMapping = new TableMapping(sklepZgoda, sklepZgodaTable, true); + sklepZgodaTable.AddTypeMapping(sklepZgodaTableMapping, false); + tableMappings264.Add(sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn109, sklepZgoda.FindProperty("SklepId")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(sklepZgIdColumn2, sklepZgoda.FindProperty("SklepZgId")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(aktywnaColumn3, sklepZgoda.FindProperty("Aktywna")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(centrZgIdColumn, sklepZgoda.FindProperty("CentrZgId")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(daneOsColumn, sklepZgoda.FindProperty("DaneOs")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(komentarzColumn3, sklepZgoda.FindProperty("Komentarz")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn57, sklepZgoda.FindProperty("Nazwa")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn6, sklepZgoda.FindProperty("Wersja")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(zastosowaniaColumn, sklepZgoda.FindProperty("Zastosowania")!, sklepZgodaTableMapping); + RelationalModel.CreateColumnMapping(zgIdColumn1, sklepZgoda.FindProperty("ZgId")!, sklepZgodaTableMapping); + + var sprzedaz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz")!; + + var defaultTableMappings265 = new List>(); + sprzedaz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings265); + var blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", null, relationalModel); + var cenaSprzedazyBruttoColumnBase = new ColumnBase("CenaSprzedazyBrutto", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("CenaSprzedazyBrutto", cenaSprzedazyBruttoColumnBase); + var cenaSprzedazyNettoColumnBase = new ColumnBase("CenaSprzedazyNetto", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("CenaSprzedazyNetto", cenaSprzedazyNettoColumnBase); + var cenaZakInneColumnBase = new ColumnBase("CenaZakInne", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("CenaZakInne", cenaZakInneColumnBase); + var cenaZakPrzesColumnBase = new ColumnBase("CenaZakPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("CenaZakPrzes", cenaZakPrzesColumnBase); + var cenaZakZakupyColumnBase = new ColumnBase("CenaZakZakupy", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("CenaZakZakupy", cenaZakZakupyColumnBase); + var cenaZakupuNettoColumnBase = new ColumnBase("CenaZakupuNetto", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("CenaZakupuNetto", cenaZakupuNettoColumnBase); + var czasIDColumnBase0 = new ColumnBase("CzasID", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase); + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("CzasID", czasIDColumnBase0); + var ilSprzedanaColumnBase = new ColumnBase("IlSprzedana", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlSprzedana", ilSprzedanaColumnBase); + var ilSztTowFaktColumnBase = new ColumnBase("IlSztTowFakt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlSztTowFakt", ilSztTowFaktColumnBase); + var ilSztTowHurtColumnBase = new ColumnBase("IlSztTowHurt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlSztTowHurt", ilSztTowHurtColumnBase); + var ilSztTowParColumnBase = new ColumnBase("IlSztTowPar", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlSztTowPar", ilSztTowParColumnBase); + var ilSztTowPrzesColumnBase = new ColumnBase("IlSztTowPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlSztTowPrzes", ilSztTowPrzesColumnBase); + var ilSztTowRozchodyColumnBase = new ColumnBase("IlSztTowRozchody", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlSztTowRozchody", ilSztTowRozchodyColumnBase); + var ilTowFaktColumnBase = new ColumnBase("IlTowFakt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlTowFakt", ilTowFaktColumnBase); + var ilTowParColumnBase = new ColumnBase("IlTowPar", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlTowPar", ilTowParColumnBase); + var ilZakInneColumnBase = new ColumnBase("IlZakInne", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlZakInne", ilZakInneColumnBase); + var ilZakPrzesColumnBase = new ColumnBase("IlZakPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlZakPrzes", ilZakPrzesColumnBase); + var ilZakZakupyColumnBase = new ColumnBase("IlZakZakupy", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlZakZakupy", ilZakZakupyColumnBase); + var ilZakupionaColumnBase = new ColumnBase("IlZakupiona", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("IlZakupiona", ilZakupionaColumnBase); + var sklepIDColumnBase = new ColumnBase("SklepID", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase); + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("SklepID", sklepIDColumnBase); + var sklepTowIDColumnBase = new ColumnBase("SklepTowID", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase); + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("SklepTowID", sklepTowIDColumnBase); + var stanTowaruColumnBase = new ColumnBase("StanTowaru", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("StanTowaru", stanTowaruColumnBase); + var towIDColumnBase = new ColumnBase("TowID", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase); + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("TowID", towIDColumnBase); + var versionColumnBase = new ColumnBase("Version", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("Version", versionColumnBase); + var wartNetZapasColumnBase = new ColumnBase("WartNetZapas", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartNetZapas", wartNetZapasColumnBase); + var wartSprzBrtFaktColumnBase = new ColumnBase("WartSprzBrtFakt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzBrtFakt", wartSprzBrtFaktColumnBase); + var wartSprzBrtHurtColumnBase = new ColumnBase("WartSprzBrtHurt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzBrtHurt", wartSprzBrtHurtColumnBase); + var wartSprzBrtParColumnBase = new ColumnBase("WartSprzBrtPar", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzBrtPar", wartSprzBrtParColumnBase); + var wartSprzBrtPrzesColumnBase = new ColumnBase("WartSprzBrtPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzBrtPrzes", wartSprzBrtPrzesColumnBase); + var wartSprzBrtRozchodyColumnBase = new ColumnBase("WartSprzBrtRozchody", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzBrtRozchody", wartSprzBrtRozchodyColumnBase); + var wartSprzNetFaktColumnBase = new ColumnBase("WartSprzNetFakt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzNetFakt", wartSprzNetFaktColumnBase); + var wartSprzNetHurtColumnBase = new ColumnBase("WartSprzNetHurt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzNetHurt", wartSprzNetHurtColumnBase); + var wartSprzNetParColumnBase = new ColumnBase("WartSprzNetPar", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzNetPar", wartSprzNetParColumnBase); + var wartSprzNetPrzesColumnBase = new ColumnBase("WartSprzNetPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzNetPrzes", wartSprzNetPrzesColumnBase); + var wartSprzNetRozchodyColumnBase = new ColumnBase("WartSprzNetRozchody", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartSprzNetRozchody", wartSprzNetRozchodyColumnBase); + var wartZakBrtFaktColumnBase = new ColumnBase("WartZakBrtFakt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakBrtFakt", wartZakBrtFaktColumnBase); + var wartZakBrtHurtColumnBase = new ColumnBase("WartZakBrtHurt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakBrtHurt", wartZakBrtHurtColumnBase); + var wartZakBrtParColumnBase = new ColumnBase("WartZakBrtPar", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakBrtPar", wartZakBrtParColumnBase); + var wartZakBrtPrzesColumnBase = new ColumnBase("WartZakBrtPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakBrtPrzes", wartZakBrtPrzesColumnBase); + var wartZakBrtRozchodyColumnBase = new ColumnBase("WartZakBrtRozchody", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakBrtRozchody", wartZakBrtRozchodyColumnBase); + var wartZakInneColumnBase = new ColumnBase("WartZakInne", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakInne", wartZakInneColumnBase); + var wartZakNetFaktColumnBase = new ColumnBase("WartZakNetFakt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakNetFakt", wartZakNetFaktColumnBase); + var wartZakNetHurtColumnBase = new ColumnBase("WartZakNetHurt", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakNetHurt", wartZakNetHurtColumnBase); + var wartZakNetParColumnBase = new ColumnBase("WartZakNetPar", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakNetPar", wartZakNetParColumnBase); + var wartZakNetPrzesColumnBase = new ColumnBase("WartZakNetPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakNetPrzes", wartZakNetPrzesColumnBase); + var wartZakNetRozchodyColumnBase = new ColumnBase("WartZakNetRozchody", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakNetRozchody", wartZakNetRozchodyColumnBase); + var wartZakPrzesColumnBase = new ColumnBase("WartZakPrzes", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakPrzes", wartZakPrzesColumnBase); + var wartZakZakupyColumnBase = new ColumnBase("WartZakZakupy", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartZakZakupy", wartZakZakupyColumnBase); + var wartoscSprzedazWCenieZakupuColumnBase = new ColumnBase("WartoscSprzedazWCenieZakupu", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartoscSprzedazWCenieZakupu", wartoscSprzedazWCenieZakupuColumnBase); + var wartoscSprzedazyBruttoColumnBase = new ColumnBase("WartoscSprzedazyBrutto", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartoscSprzedazyBrutto", wartoscSprzedazyBruttoColumnBase); + var wartoscSprzedazyNettoColumnBase = new ColumnBase("WartoscSprzedazyNetto", "decimal(14,3)", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.Columns.Add("WartoscSprzedazyNetto", wartoscSprzedazyNettoColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase); + var blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase = new TableMappingBase(sprzedaz, blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSprzedazTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase, false); + defaultTableMappings265.Add(blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czasIDColumnBase0, sprzedaz.FindProperty("CzasID")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIDColumnBase, sprzedaz.FindProperty("SklepID")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepTowIDColumnBase, sprzedaz.FindProperty("SklepTowID")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIDColumnBase, sprzedaz.FindProperty("TowID")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaSprzedazyBruttoColumnBase, sprzedaz.FindProperty("CenaSprzedazyBrutto")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaSprzedazyNettoColumnBase, sprzedaz.FindProperty("CenaSprzedazyNetto")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakInneColumnBase, sprzedaz.FindProperty("CenaZakInne")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakPrzesColumnBase, sprzedaz.FindProperty("CenaZakPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakZakupyColumnBase, sprzedaz.FindProperty("CenaZakZakupy")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakupuNettoColumnBase, sprzedaz.FindProperty("CenaZakupuNetto")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilSprzedanaColumnBase, sprzedaz.FindProperty("IlSprzedana")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilSztTowFaktColumnBase, sprzedaz.FindProperty("IlSztTowFakt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilSztTowHurtColumnBase, sprzedaz.FindProperty("IlSztTowHurt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilSztTowParColumnBase, sprzedaz.FindProperty("IlSztTowPar")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilSztTowPrzesColumnBase, sprzedaz.FindProperty("IlSztTowPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilSztTowRozchodyColumnBase, sprzedaz.FindProperty("IlSztTowRozchody")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilTowFaktColumnBase, sprzedaz.FindProperty("IlTowFakt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilTowParColumnBase, sprzedaz.FindProperty("IlTowPar")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilZakInneColumnBase, sprzedaz.FindProperty("IlZakInne")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilZakPrzesColumnBase, sprzedaz.FindProperty("IlZakPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilZakZakupyColumnBase, sprzedaz.FindProperty("IlZakZakupy")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ilZakupionaColumnBase, sprzedaz.FindProperty("IlZakupiona")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanTowaruColumnBase, sprzedaz.FindProperty("StanTowaru")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)versionColumnBase, sprzedaz.FindProperty("Version")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartNetZapasColumnBase, sprzedaz.FindProperty("WartNetZapas")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzBrtFaktColumnBase, sprzedaz.FindProperty("WartSprzBrtFakt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzBrtHurtColumnBase, sprzedaz.FindProperty("WartSprzBrtHurt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzBrtParColumnBase, sprzedaz.FindProperty("WartSprzBrtPar")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzBrtPrzesColumnBase, sprzedaz.FindProperty("WartSprzBrtPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzBrtRozchodyColumnBase, sprzedaz.FindProperty("WartSprzBrtRozchody")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzNetFaktColumnBase, sprzedaz.FindProperty("WartSprzNetFakt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzNetHurtColumnBase, sprzedaz.FindProperty("WartSprzNetHurt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzNetParColumnBase, sprzedaz.FindProperty("WartSprzNetPar")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzNetPrzesColumnBase, sprzedaz.FindProperty("WartSprzNetPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartSprzNetRozchodyColumnBase, sprzedaz.FindProperty("WartSprzNetRozchody")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakBrtFaktColumnBase, sprzedaz.FindProperty("WartZakBrtFakt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakBrtHurtColumnBase, sprzedaz.FindProperty("WartZakBrtHurt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakBrtParColumnBase, sprzedaz.FindProperty("WartZakBrtPar")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakBrtPrzesColumnBase, sprzedaz.FindProperty("WartZakBrtPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakBrtRozchodyColumnBase, sprzedaz.FindProperty("WartZakBrtRozchody")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakInneColumnBase, sprzedaz.FindProperty("WartZakInne")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakNetFaktColumnBase, sprzedaz.FindProperty("WartZakNetFakt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakNetHurtColumnBase, sprzedaz.FindProperty("WartZakNetHurt")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakNetParColumnBase, sprzedaz.FindProperty("WartZakNetPar")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakNetPrzesColumnBase, sprzedaz.FindProperty("WartZakNetPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakNetRozchodyColumnBase, sprzedaz.FindProperty("WartZakNetRozchody")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakPrzesColumnBase, sprzedaz.FindProperty("WartZakPrzes")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartZakZakupyColumnBase, sprzedaz.FindProperty("WartZakZakupy")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscSprzedazWCenieZakupuColumnBase, sprzedaz.FindProperty("WartoscSprzedazWCenieZakupu")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscSprzedazyBruttoColumnBase, sprzedaz.FindProperty("WartoscSprzedazyBrutto")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscSprzedazyNettoColumnBase, sprzedaz.FindProperty("WartoscSprzedazyNetto")!, blinkBackofficeServicesPcmDbEntitiesSprzedazMappingBase); + + var tableMappings265 = new List(); + sprzedaz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings265); + var sprzedazTable = new Table("Sprzedaz", null, relationalModel); + var towIDColumn = new Column("TowID", "numeric(9,0)", sprzedazTable); + sprzedazTable.Columns.Add("TowID", towIDColumn); + var sklepIDColumn = new Column("SklepID", "numeric(9,0)", sprzedazTable); + sprzedazTable.Columns.Add("SklepID", sklepIDColumn); + var czasIDColumn0 = new Column("CzasID", "numeric(9,0)", sprzedazTable); + sprzedazTable.Columns.Add("CzasID", czasIDColumn0); + var sklepTowIDColumn = new Column("SklepTowID", "numeric(9,0)", sprzedazTable); + sprzedazTable.Columns.Add("SklepTowID", sklepTowIDColumn); + var cenaSprzedazyBruttoColumn = new Column("CenaSprzedazyBrutto", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("CenaSprzedazyBrutto", cenaSprzedazyBruttoColumn); + var cenaSprzedazyNettoColumn = new Column("CenaSprzedazyNetto", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("CenaSprzedazyNetto", cenaSprzedazyNettoColumn); + var cenaZakInneColumn = new Column("CenaZakInne", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("CenaZakInne", cenaZakInneColumn); + var cenaZakPrzesColumn = new Column("CenaZakPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("CenaZakPrzes", cenaZakPrzesColumn); + var cenaZakZakupyColumn = new Column("CenaZakZakupy", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("CenaZakZakupy", cenaZakZakupyColumn); + var cenaZakupuNettoColumn = new Column("CenaZakupuNetto", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("CenaZakupuNetto", cenaZakupuNettoColumn); + var ilSprzedanaColumn = new Column("IlSprzedana", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlSprzedana", ilSprzedanaColumn); + var ilSztTowFaktColumn = new Column("IlSztTowFakt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlSztTowFakt", ilSztTowFaktColumn); + var ilSztTowHurtColumn = new Column("IlSztTowHurt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlSztTowHurt", ilSztTowHurtColumn); + var ilSztTowParColumn = new Column("IlSztTowPar", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlSztTowPar", ilSztTowParColumn); + var ilSztTowPrzesColumn = new Column("IlSztTowPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlSztTowPrzes", ilSztTowPrzesColumn); + var ilSztTowRozchodyColumn = new Column("IlSztTowRozchody", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlSztTowRozchody", ilSztTowRozchodyColumn); + var ilTowFaktColumn = new Column("IlTowFakt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlTowFakt", ilTowFaktColumn); + var ilTowParColumn = new Column("IlTowPar", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlTowPar", ilTowParColumn); + var ilZakInneColumn = new Column("IlZakInne", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlZakInne", ilZakInneColumn); + var ilZakPrzesColumn = new Column("IlZakPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlZakPrzes", ilZakPrzesColumn); + var ilZakZakupyColumn = new Column("IlZakZakupy", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlZakZakupy", ilZakZakupyColumn); + var ilZakupionaColumn = new Column("IlZakupiona", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("IlZakupiona", ilZakupionaColumn); + var stanTowaruColumn = new Column("StanTowaru", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("StanTowaru", stanTowaruColumn); + var versionColumn = new Column("Version", "varchar(60)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("Version", versionColumn); + var wartNetZapasColumn = new Column("WartNetZapas", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartNetZapas", wartNetZapasColumn); + var wartSprzBrtFaktColumn = new Column("WartSprzBrtFakt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzBrtFakt", wartSprzBrtFaktColumn); + var wartSprzBrtHurtColumn = new Column("WartSprzBrtHurt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzBrtHurt", wartSprzBrtHurtColumn); + var wartSprzBrtParColumn = new Column("WartSprzBrtPar", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzBrtPar", wartSprzBrtParColumn); + var wartSprzBrtPrzesColumn = new Column("WartSprzBrtPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzBrtPrzes", wartSprzBrtPrzesColumn); + var wartSprzBrtRozchodyColumn = new Column("WartSprzBrtRozchody", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzBrtRozchody", wartSprzBrtRozchodyColumn); + var wartSprzNetFaktColumn = new Column("WartSprzNetFakt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzNetFakt", wartSprzNetFaktColumn); + var wartSprzNetHurtColumn = new Column("WartSprzNetHurt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzNetHurt", wartSprzNetHurtColumn); + var wartSprzNetParColumn = new Column("WartSprzNetPar", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzNetPar", wartSprzNetParColumn); + var wartSprzNetPrzesColumn = new Column("WartSprzNetPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzNetPrzes", wartSprzNetPrzesColumn); + var wartSprzNetRozchodyColumn = new Column("WartSprzNetRozchody", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartSprzNetRozchody", wartSprzNetRozchodyColumn); + var wartZakBrtFaktColumn = new Column("WartZakBrtFakt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakBrtFakt", wartZakBrtFaktColumn); + var wartZakBrtHurtColumn = new Column("WartZakBrtHurt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakBrtHurt", wartZakBrtHurtColumn); + var wartZakBrtParColumn = new Column("WartZakBrtPar", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakBrtPar", wartZakBrtParColumn); + var wartZakBrtPrzesColumn = new Column("WartZakBrtPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakBrtPrzes", wartZakBrtPrzesColumn); + var wartZakBrtRozchodyColumn = new Column("WartZakBrtRozchody", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakBrtRozchody", wartZakBrtRozchodyColumn); + var wartZakInneColumn = new Column("WartZakInne", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakInne", wartZakInneColumn); + var wartZakNetFaktColumn = new Column("WartZakNetFakt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakNetFakt", wartZakNetFaktColumn); + var wartZakNetHurtColumn = new Column("WartZakNetHurt", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakNetHurt", wartZakNetHurtColumn); + var wartZakNetParColumn = new Column("WartZakNetPar", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakNetPar", wartZakNetParColumn); + var wartZakNetPrzesColumn = new Column("WartZakNetPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakNetPrzes", wartZakNetPrzesColumn); + var wartZakNetRozchodyColumn = new Column("WartZakNetRozchody", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakNetRozchody", wartZakNetRozchodyColumn); + var wartZakPrzesColumn = new Column("WartZakPrzes", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakPrzes", wartZakPrzesColumn); + var wartZakZakupyColumn = new Column("WartZakZakupy", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartZakZakupy", wartZakZakupyColumn); + var wartoscSprzedazWCenieZakupuColumn = new Column("WartoscSprzedazWCenieZakupu", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartoscSprzedazWCenieZakupu", wartoscSprzedazWCenieZakupuColumn); + var wartoscSprzedazyBruttoColumn = new Column("WartoscSprzedazyBrutto", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartoscSprzedazyBrutto", wartoscSprzedazyBruttoColumn); + var wartoscSprzedazyNettoColumn = new Column("WartoscSprzedazyNetto", "decimal(14,3)", sprzedazTable) + { + IsNullable = true + }; + sprzedazTable.Columns.Add("WartoscSprzedazyNetto", wartoscSprzedazyNettoColumn); + var pK_SPRZEDAZ = new UniqueConstraint("PK_SPRZEDAZ", sprzedazTable, new[] { towIDColumn, sklepIDColumn, czasIDColumn0, sklepTowIDColumn }); + sprzedazTable.PrimaryKey = pK_SPRZEDAZ; + var pK_SPRZEDAZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + new[] { "TowID", "SklepID", "CzasID", "SklepTowID" }); + pK_SPRZEDAZ.MappedKeys.Add(pK_SPRZEDAZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SPRZEDAZUc).Add(pK_SPRZEDAZ); + sprzedazTable.UniqueConstraints.Add("PK_SPRZEDAZ", pK_SPRZEDAZ); + var idx_Sprzedaz_SklepId = new TableIndex( + "idx_Sprzedaz_SklepId", sprzedazTable, new[] { sklepIDColumn }, false); + var idx_Sprzedaz_SklepIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + "idx_Sprzedaz_SklepId"); + idx_Sprzedaz_SklepId.MappedIndexes.Add(idx_Sprzedaz_SklepIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_Sprzedaz_SklepIdIx).Add(idx_Sprzedaz_SklepId); + sprzedazTable.Indexes.Add("idx_Sprzedaz_SklepId", idx_Sprzedaz_SklepId); + var idx_Sprzedaz_TowId = new TableIndex( + "idx_Sprzedaz_TowId", sprzedazTable, new[] { towIDColumn }, false); + var idx_Sprzedaz_TowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + "idx_Sprzedaz_TowId"); + idx_Sprzedaz_TowId.MappedIndexes.Add(idx_Sprzedaz_TowIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_Sprzedaz_TowIdIx).Add(idx_Sprzedaz_TowId); + sprzedazTable.Indexes.Add("idx_Sprzedaz_TowId", idx_Sprzedaz_TowId); + var sprzedaz_Czas_Sklep_Towar = new TableIndex( + "Sprzedaz_Czas_Sklep_Towar", sprzedazTable, new[] { czasIDColumn0, sklepIDColumn, towIDColumn }, false); + var sprzedaz_Czas_Sklep_TowarIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + "Sprzedaz_Czas_Sklep_Towar"); + sprzedaz_Czas_Sklep_Towar.MappedIndexes.Add(sprzedaz_Czas_Sklep_TowarIx); + RelationalModel.GetOrCreateTableIndexes(sprzedaz_Czas_Sklep_TowarIx).Add(sprzedaz_Czas_Sklep_Towar); + sprzedazTable.Indexes.Add("Sprzedaz_Czas_Sklep_Towar", sprzedaz_Czas_Sklep_Towar); + var sprzedaz_Czas_Towar_Sklep = new TableIndex( + "Sprzedaz_Czas_Towar_Sklep", sprzedazTable, new[] { czasIDColumn0, towIDColumn, sklepIDColumn }, false); + var sprzedaz_Czas_Towar_SklepIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + "Sprzedaz_Czas_Towar_Sklep"); + sprzedaz_Czas_Towar_Sklep.MappedIndexes.Add(sprzedaz_Czas_Towar_SklepIx); + RelationalModel.GetOrCreateTableIndexes(sprzedaz_Czas_Towar_SklepIx).Add(sprzedaz_Czas_Towar_Sklep); + sprzedazTable.Indexes.Add("Sprzedaz_Czas_Towar_Sklep", sprzedaz_Czas_Towar_Sklep); + var sprzedaz_Sklep_Towar = new TableIndex( + "Sprzedaz_Sklep_Towar", sprzedazTable, new[] { sklepIDColumn, towIDColumn }, false); + var sprzedaz_Sklep_TowarIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + "Sprzedaz_Sklep_Towar"); + sprzedaz_Sklep_Towar.MappedIndexes.Add(sprzedaz_Sklep_TowarIx); + RelationalModel.GetOrCreateTableIndexes(sprzedaz_Sklep_TowarIx).Add(sprzedaz_Sklep_Towar); + sprzedazTable.Indexes.Add("Sprzedaz_Sklep_Towar", sprzedaz_Sklep_Towar); + var sprzedaz_Towar_Sklep = new TableIndex( + "Sprzedaz_Towar_Sklep", sprzedazTable, new[] { towIDColumn, sklepIDColumn }, false); + var sprzedaz_Towar_SklepIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + "Sprzedaz_Towar_Sklep"); + sprzedaz_Towar_Sklep.MappedIndexes.Add(sprzedaz_Towar_SklepIx); + RelationalModel.GetOrCreateTableIndexes(sprzedaz_Towar_SklepIx).Add(sprzedaz_Towar_Sklep); + sprzedazTable.Indexes.Add("Sprzedaz_Towar_Sklep", sprzedaz_Towar_Sklep); + relationalModel.Tables.Add(("Sprzedaz", null), sprzedazTable); + var sprzedazTableMapping = new TableMapping(sprzedaz, sprzedazTable, true); + sprzedazTable.AddTypeMapping(sprzedazTableMapping, false); + tableMappings265.Add(sprzedazTableMapping); + RelationalModel.CreateColumnMapping(czasIDColumn0, sprzedaz.FindProperty("CzasID")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(sklepIDColumn, sprzedaz.FindProperty("SklepID")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(sklepTowIDColumn, sprzedaz.FindProperty("SklepTowID")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(towIDColumn, sprzedaz.FindProperty("TowID")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(cenaSprzedazyBruttoColumn, sprzedaz.FindProperty("CenaSprzedazyBrutto")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(cenaSprzedazyNettoColumn, sprzedaz.FindProperty("CenaSprzedazyNetto")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(cenaZakInneColumn, sprzedaz.FindProperty("CenaZakInne")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(cenaZakPrzesColumn, sprzedaz.FindProperty("CenaZakPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(cenaZakZakupyColumn, sprzedaz.FindProperty("CenaZakZakupy")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(cenaZakupuNettoColumn, sprzedaz.FindProperty("CenaZakupuNetto")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilSprzedanaColumn, sprzedaz.FindProperty("IlSprzedana")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilSztTowFaktColumn, sprzedaz.FindProperty("IlSztTowFakt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilSztTowHurtColumn, sprzedaz.FindProperty("IlSztTowHurt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilSztTowParColumn, sprzedaz.FindProperty("IlSztTowPar")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilSztTowPrzesColumn, sprzedaz.FindProperty("IlSztTowPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilSztTowRozchodyColumn, sprzedaz.FindProperty("IlSztTowRozchody")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilTowFaktColumn, sprzedaz.FindProperty("IlTowFakt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilTowParColumn, sprzedaz.FindProperty("IlTowPar")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilZakInneColumn, sprzedaz.FindProperty("IlZakInne")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilZakPrzesColumn, sprzedaz.FindProperty("IlZakPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilZakZakupyColumn, sprzedaz.FindProperty("IlZakZakupy")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(ilZakupionaColumn, sprzedaz.FindProperty("IlZakupiona")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(stanTowaruColumn, sprzedaz.FindProperty("StanTowaru")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(versionColumn, sprzedaz.FindProperty("Version")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartNetZapasColumn, sprzedaz.FindProperty("WartNetZapas")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzBrtFaktColumn, sprzedaz.FindProperty("WartSprzBrtFakt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzBrtHurtColumn, sprzedaz.FindProperty("WartSprzBrtHurt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzBrtParColumn, sprzedaz.FindProperty("WartSprzBrtPar")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzBrtPrzesColumn, sprzedaz.FindProperty("WartSprzBrtPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzBrtRozchodyColumn, sprzedaz.FindProperty("WartSprzBrtRozchody")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzNetFaktColumn, sprzedaz.FindProperty("WartSprzNetFakt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzNetHurtColumn, sprzedaz.FindProperty("WartSprzNetHurt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzNetParColumn, sprzedaz.FindProperty("WartSprzNetPar")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzNetPrzesColumn, sprzedaz.FindProperty("WartSprzNetPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartSprzNetRozchodyColumn, sprzedaz.FindProperty("WartSprzNetRozchody")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakBrtFaktColumn, sprzedaz.FindProperty("WartZakBrtFakt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakBrtHurtColumn, sprzedaz.FindProperty("WartZakBrtHurt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakBrtParColumn, sprzedaz.FindProperty("WartZakBrtPar")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakBrtPrzesColumn, sprzedaz.FindProperty("WartZakBrtPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakBrtRozchodyColumn, sprzedaz.FindProperty("WartZakBrtRozchody")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakInneColumn, sprzedaz.FindProperty("WartZakInne")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakNetFaktColumn, sprzedaz.FindProperty("WartZakNetFakt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakNetHurtColumn, sprzedaz.FindProperty("WartZakNetHurt")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakNetParColumn, sprzedaz.FindProperty("WartZakNetPar")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakNetPrzesColumn, sprzedaz.FindProperty("WartZakNetPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakNetRozchodyColumn, sprzedaz.FindProperty("WartZakNetRozchody")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakPrzesColumn, sprzedaz.FindProperty("WartZakPrzes")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartZakZakupyColumn, sprzedaz.FindProperty("WartZakZakupy")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartoscSprzedazWCenieZakupuColumn, sprzedaz.FindProperty("WartoscSprzedazWCenieZakupu")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartoscSprzedazyBruttoColumn, sprzedaz.FindProperty("WartoscSprzedazyBrutto")!, sprzedazTableMapping); + RelationalModel.CreateColumnMapping(wartoscSprzedazyNettoColumn, sprzedaz.FindProperty("WartoscSprzedazyNetto")!, sprzedazTableMapping); + + var stanPrtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag")!; + + var defaultTableMappings266 = new List>(); + stanPrtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings266); + var blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag", null, relationalModel); + var dzienColumnBase8 = new ColumnBase("Dzien", "datetime", blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase.Columns.Add("Dzien", dzienColumnBase8); + var pMIdColumnBase5 = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase5); + var stanPrtColumnBase0 = new ColumnBase("StanPrt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase.Columns.Add("StanPrt", stanPrtColumnBase0); + var towIdColumnBase21 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase.Columns.Add("TowId", towIdColumnBase21); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag", blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesStanPrtMagMappingBase = new TableMappingBase(stanPrtMag, blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesStanPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesStanPrtMagMappingBase, false); + defaultTableMappings266.Add(blinkBackofficeServicesPcmDbEntitiesStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dzienColumnBase8, stanPrtMag.FindProperty("Dzien")!, blinkBackofficeServicesPcmDbEntitiesStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase5, stanPrtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase21, stanPrtMag.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesStanPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanPrtColumnBase0, stanPrtMag.FindProperty("StanPrt")!, blinkBackofficeServicesPcmDbEntitiesStanPrtMagMappingBase); + + var tableMappings266 = new List(); + stanPrtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings266); + var stanPrtMagTable = new Table("StanPrtMag", null, relationalModel); + var dzienColumn8 = new Column("Dzien", "datetime", stanPrtMagTable); + stanPrtMagTable.Columns.Add("Dzien", dzienColumn8); + var towIdColumn21 = new Column("TowId", "numeric(9,0)", stanPrtMagTable); + stanPrtMagTable.Columns.Add("TowId", towIdColumn21); + var pMIdColumn5 = new Column("PMId", "numeric(9,0)", stanPrtMagTable); + stanPrtMagTable.Columns.Add("PMId", pMIdColumn5); + var stanPrtColumn0 = new Column("StanPrt", "decimal(15,4)", stanPrtMagTable); + stanPrtMagTable.Columns.Add("StanPrt", stanPrtColumn0); + var pK_STANPRTMAG = new UniqueConstraint("PK_STANPRTMAG", stanPrtMagTable, new[] { dzienColumn8, towIdColumn21, pMIdColumn5 }); + stanPrtMagTable.PrimaryKey = pK_STANPRTMAG; + var pK_STANPRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag", + new[] { "Dzien", "TowId", "PMId" }); + pK_STANPRTMAG.MappedKeys.Add(pK_STANPRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_STANPRTMAGUc).Add(pK_STANPRTMAG); + stanPrtMagTable.UniqueConstraints.Add("PK_STANPRTMAG", pK_STANPRTMAG); + var idx_StanPrt = new TableIndex( + "idx_StanPrt", stanPrtMagTable, new[] { towIdColumn21, pMIdColumn5, dzienColumn8 }, false); + var idx_StanPrtIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag", + "idx_StanPrt"); + idx_StanPrt.MappedIndexes.Add(idx_StanPrtIx); + RelationalModel.GetOrCreateTableIndexes(idx_StanPrtIx).Add(idx_StanPrt); + stanPrtMagTable.Indexes.Add("idx_StanPrt", idx_StanPrt); + relationalModel.Tables.Add(("StanPrtMag", null), stanPrtMagTable); + var stanPrtMagTableMapping = new TableMapping(stanPrtMag, stanPrtMagTable, true); + stanPrtMagTable.AddTypeMapping(stanPrtMagTableMapping, false); + tableMappings266.Add(stanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(dzienColumn8, stanPrtMag.FindProperty("Dzien")!, stanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn5, stanPrtMag.FindProperty("PMId")!, stanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn21, stanPrtMag.FindProperty("TowId")!, stanPrtMagTableMapping); + RelationalModel.CreateColumnMapping(stanPrtColumn0, stanPrtMag.FindProperty("StanPrt")!, stanPrtMagTableMapping); + + var stanZgody = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.StanZgody")!; + + var defaultTableMappings267 = new List>(); + stanZgody.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings267); + var blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.StanZgody", null, relationalModel); + var dataDecColumnBase1 = new ColumnBase("DataDec", "datetime", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("DataDec", dataDecColumnBase1); + var formaDecColumnBase1 = new ColumnBase("FormaDec", "smallint", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("FormaDec", formaDecColumnBase1); + var kiedyColumnBase6 = new ColumnBase("Kiedy", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("Kiedy", kiedyColumnBase6); + var kontrIdColumnBase19 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("KontrId", kontrIdColumnBase19); + var statusColumnBase7 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("Status", statusColumnBase7); + var wersjaColumnBase7 = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("Wersja", wersjaColumnBase7); + var zgIdColumnBase2 = new ColumnBase("ZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("ZgId", zgIdColumnBase2); + var zmianaColumnBase58 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.Columns.Add("Zmiana", zmianaColumnBase58); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.StanZgody", blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase); + var blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase = new TableMappingBase(stanZgody, blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesStanZgodyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase, false); + defaultTableMappings267.Add(blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase19, stanZgody.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zgIdColumnBase2, stanZgody.FindProperty("ZgId")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDecColumnBase1, stanZgody.FindProperty("DataDec")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaDecColumnBase1, stanZgody.FindProperty("FormaDec")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase6, stanZgody.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase7, stanZgody.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase7, stanZgody.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase58, stanZgody.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesStanZgodyMappingBase); + + var tableMappings267 = new List(); + stanZgody.SetRuntimeAnnotation("Relational:TableMappings", tableMappings267); + var stanZgodyTable = new Table("StanZgody", null, relationalModel); + var kontrIdColumn19 = new Column("KontrId", "numeric(9,0)", stanZgodyTable); + stanZgodyTable.Columns.Add("KontrId", kontrIdColumn19); + var zgIdColumn2 = new Column("ZgId", "numeric(9,0)", stanZgodyTable); + stanZgodyTable.Columns.Add("ZgId", zgIdColumn2); + var dataDecColumn1 = new Column("DataDec", "datetime", stanZgodyTable) + { + IsNullable = true + }; + stanZgodyTable.Columns.Add("DataDec", dataDecColumn1); + var formaDecColumn1 = new Column("FormaDec", "smallint", stanZgodyTable) + { + IsNullable = true + }; + stanZgodyTable.Columns.Add("FormaDec", formaDecColumn1); + var kiedyColumn6 = new Column("Kiedy", "varchar(20)", stanZgodyTable); + stanZgodyTable.Columns.Add("Kiedy", kiedyColumn6); + var statusColumn7 = new Column("Status", "smallint", stanZgodyTable); + stanZgodyTable.Columns.Add("Status", statusColumn7); + var wersjaColumn7 = new Column("Wersja", "varchar(20)", stanZgodyTable) + { + IsNullable = true + }; + stanZgodyTable.Columns.Add("Wersja", wersjaColumn7); + var zmianaColumn58 = new Column("Zmiana", "datetime", stanZgodyTable); + stanZgodyTable.Columns.Add("Zmiana", zmianaColumn58); + var pK_STANZGODY = new UniqueConstraint("PK_STANZGODY", stanZgodyTable, new[] { kontrIdColumn19, zgIdColumn2 }); + stanZgodyTable.PrimaryKey = pK_STANZGODY; + var pK_STANZGODYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanZgody", + new[] { "KontrId", "ZgId" }); + pK_STANZGODY.MappedKeys.Add(pK_STANZGODYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_STANZGODYUc).Add(pK_STANZGODY); + stanZgodyTable.UniqueConstraints.Add("PK_STANZGODY", pK_STANZGODY); + var idx_STZG_ZG = new TableIndex( + "idx_STZG_ZG", stanZgodyTable, new[] { zgIdColumn2 }, false); + var idx_STZG_ZGIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanZgody", + "idx_STZG_ZG"); + idx_STZG_ZG.MappedIndexes.Add(idx_STZG_ZGIx); + RelationalModel.GetOrCreateTableIndexes(idx_STZG_ZGIx).Add(idx_STZG_ZG); + stanZgodyTable.Indexes.Add("idx_STZG_ZG", idx_STZG_ZG); + var idx_STZG_ZMIANA = new TableIndex( + "idx_STZG_ZMIANA", stanZgodyTable, new[] { zmianaColumn58 }, false); + var idx_STZG_ZMIANAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanZgody", + "idx_STZG_ZMIANA"); + idx_STZG_ZMIANA.MappedIndexes.Add(idx_STZG_ZMIANAIx); + RelationalModel.GetOrCreateTableIndexes(idx_STZG_ZMIANAIx).Add(idx_STZG_ZMIANA); + stanZgodyTable.Indexes.Add("idx_STZG_ZMIANA", idx_STZG_ZMIANA); + relationalModel.Tables.Add(("StanZgody", null), stanZgodyTable); + var stanZgodyTableMapping = new TableMapping(stanZgody, stanZgodyTable, true); + stanZgodyTable.AddTypeMapping(stanZgodyTableMapping, false); + tableMappings267.Add(stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn19, stanZgody.FindProperty("KontrId")!, stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(zgIdColumn2, stanZgody.FindProperty("ZgId")!, stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(dataDecColumn1, stanZgody.FindProperty("DataDec")!, stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(formaDecColumn1, stanZgody.FindProperty("FormaDec")!, stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn6, stanZgody.FindProperty("Kiedy")!, stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(statusColumn7, stanZgody.FindProperty("Status")!, stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn7, stanZgody.FindProperty("Wersja")!, stanZgodyTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn58, stanZgody.FindProperty("Zmiana")!, stanZgodyTableMapping); + + var struktura_7_3 = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Struktura_7_3")!; + + var defaultTableMappings268 = new List>(); + struktura_7_3.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings268); + var blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Struktura_7_3", null, relationalModel); + var kiedyColumnBase7 = new ColumnBase("Kiedy", "datetime", blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase.Columns.Add("Kiedy", kiedyColumnBase7); + var modIdColumnBase = new ColumnBase("ModId", "smallint", blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase); + blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase.Columns.Add("ModId", modIdColumnBase); + var typAplikacjiColumnBase2 = new ColumnBase("TypAplikacji", "smallint", blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase.Columns.Add("TypAplikacji", typAplikacjiColumnBase2); + var wersjaColumnBase8 = new ColumnBase("Wersja", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase.Columns.Add("Wersja", wersjaColumnBase8); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Struktura_7_3", blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase); + var blinkBackofficeServicesPcmDbEntitiesStruktura_7_3MappingBase = new TableMappingBase(struktura_7_3, blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase, true); + blinkBackofficeServicesPcmDbEntitiesStruktura_7_3TableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesStruktura_7_3MappingBase, false); + defaultTableMappings268.Add(blinkBackofficeServicesPcmDbEntitiesStruktura_7_3MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)modIdColumnBase, struktura_7_3.FindProperty("ModId")!, blinkBackofficeServicesPcmDbEntitiesStruktura_7_3MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase7, struktura_7_3.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesStruktura_7_3MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typAplikacjiColumnBase2, struktura_7_3.FindProperty("TypAplikacji")!, blinkBackofficeServicesPcmDbEntitiesStruktura_7_3MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase8, struktura_7_3.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesStruktura_7_3MappingBase); + + var tableMappings268 = new List(); + struktura_7_3.SetRuntimeAnnotation("Relational:TableMappings", tableMappings268); + var struktura_7_3Table = new Table("Struktura_7_3", null, relationalModel); + var modIdColumn = new Column("ModId", "smallint", struktura_7_3Table); + struktura_7_3Table.Columns.Add("ModId", modIdColumn); + var kiedyColumn7 = new Column("Kiedy", "datetime", struktura_7_3Table) + { + IsNullable = true + }; + struktura_7_3Table.Columns.Add("Kiedy", kiedyColumn7); + var typAplikacjiColumn2 = new Column("TypAplikacji", "smallint", struktura_7_3Table) + { + IsNullable = true + }; + struktura_7_3Table.Columns.Add("TypAplikacji", typAplikacjiColumn2); + var wersjaColumn8 = new Column("Wersja", "varchar(40)", struktura_7_3Table) + { + IsNullable = true + }; + struktura_7_3Table.Columns.Add("Wersja", wersjaColumn8); + var pK_STRUKTURA_7_3 = new UniqueConstraint("PK_STRUKTURA_7_3", struktura_7_3Table, new[] { modIdColumn }); + struktura_7_3Table.PrimaryKey = pK_STRUKTURA_7_3; + var pK_STRUKTURA_7_3Uc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Struktura_7_3", + new[] { "ModId" }); + pK_STRUKTURA_7_3.MappedKeys.Add(pK_STRUKTURA_7_3Uc); + RelationalModel.GetOrCreateUniqueConstraints(pK_STRUKTURA_7_3Uc).Add(pK_STRUKTURA_7_3); + struktura_7_3Table.UniqueConstraints.Add("PK_STRUKTURA_7_3", pK_STRUKTURA_7_3); + relationalModel.Tables.Add(("Struktura_7_3", null), struktura_7_3Table); + var struktura_7_3TableMapping = new TableMapping(struktura_7_3, struktura_7_3Table, true); + struktura_7_3Table.AddTypeMapping(struktura_7_3TableMapping, false); + tableMappings268.Add(struktura_7_3TableMapping); + RelationalModel.CreateColumnMapping(modIdColumn, struktura_7_3.FindProperty("ModId")!, struktura_7_3TableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn7, struktura_7_3.FindProperty("Kiedy")!, struktura_7_3TableMapping); + RelationalModel.CreateColumnMapping(typAplikacjiColumn2, struktura_7_3.FindProperty("TypAplikacji")!, struktura_7_3TableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn8, struktura_7_3.FindProperty("Wersja")!, struktura_7_3TableMapping); + + var subsys = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Subsys")!; + + var defaultTableMappings269 = new List>(); + subsys.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings269); + var blinkBackofficeServicesPcmDbEntitiesSubsysTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Subsys", null, relationalModel); + var dataDokColumnBase = new ColumnBase("DataDok", "datetime", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("DataDok", dataDokColumnBase); + var domyslnyColumnBase1 = new ColumnBase("Domyslny", "smallint", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase); + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("Domyslny", domyslnyColumnBase1); + var ileWZgrzewceColumnBase4 = new ColumnBase("IleWZgrzewce", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("IleWZgrzewce", ileWZgrzewceColumnBase4); + var kodSubsysColumnBase = new ColumnBase("KodSubsys", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase); + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("KodSubsys", kodSubsysColumnBase); + var kodZgrzewkiColumnBase = new ColumnBase("KodZgrzewki", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("KodZgrzewki", kodZgrzewkiColumnBase); + var nrDokColumnBase1 = new ColumnBase("NrDok", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("NrDok", nrDokColumnBase1); + var towIdColumnBase22 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("TowId", towIdColumnBase22); + var zmianaColumnBase59 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase); + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.Columns.Add("Zmiana", zmianaColumnBase59); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Subsys", blinkBackofficeServicesPcmDbEntitiesSubsysTableBase); + var blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase = new TableMappingBase(subsys, blinkBackofficeServicesPcmDbEntitiesSubsysTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSubsysTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase, false); + defaultTableMappings269.Add(blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodSubsysColumnBase, subsys.FindProperty("KodSubsys")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDokColumnBase, subsys.FindProperty("DataDok")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslnyColumnBase1, subsys.FindProperty("Domyslny")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWZgrzewceColumnBase4, subsys.FindProperty("IleWZgrzewce")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodZgrzewkiColumnBase, subsys.FindProperty("KodZgrzewki")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDokColumnBase1, subsys.FindProperty("NrDok")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase22, subsys.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase59, subsys.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesSubsysMappingBase); + + var tableMappings269 = new List(); + subsys.SetRuntimeAnnotation("Relational:TableMappings", tableMappings269); + var subsysTable = new Table("Subsys", null, relationalModel); + var kodSubsysColumn = new Column("KodSubsys", "varchar(40)", subsysTable); + subsysTable.Columns.Add("KodSubsys", kodSubsysColumn); + var dataDokColumn = new Column("DataDok", "datetime", subsysTable) + { + IsNullable = true + }; + subsysTable.Columns.Add("DataDok", dataDokColumn); + var domyslnyColumn1 = new Column("Domyslny", "smallint", subsysTable); + subsysTable.Columns.Add("Domyslny", domyslnyColumn1); + var ileWZgrzewceColumn4 = new Column("IleWZgrzewce", "decimal(15,4)", subsysTable) + { + IsNullable = true + }; + subsysTable.Columns.Add("IleWZgrzewce", ileWZgrzewceColumn4); + var kodZgrzewkiColumn = new Column("KodZgrzewki", "varchar(40)", subsysTable) + { + IsNullable = true + }; + subsysTable.Columns.Add("KodZgrzewki", kodZgrzewkiColumn); + var nrDokColumn1 = new Column("NrDok", "varchar(60)", subsysTable) + { + IsNullable = true + }; + subsysTable.Columns.Add("NrDok", nrDokColumn1); + var towIdColumn22 = new Column("TowId", "numeric(9,0)", subsysTable) + { + IsNullable = true + }; + subsysTable.Columns.Add("TowId", towIdColumn22); + var zmianaColumn59 = new Column("Zmiana", "datetime", subsysTable); + subsysTable.Columns.Add("Zmiana", zmianaColumn59); + var pK_SUBSYS = new UniqueConstraint("PK_SUBSYS", subsysTable, new[] { kodSubsysColumn }); + subsysTable.PrimaryKey = pK_SUBSYS; + var pK_SUBSYSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Subsys", + new[] { "KodSubsys" }); + pK_SUBSYS.MappedKeys.Add(pK_SUBSYSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SUBSYSUc).Add(pK_SUBSYS); + subsysTable.UniqueConstraints.Add("PK_SUBSYS", pK_SUBSYS); + var idx_SubsysTow = new TableIndex( + "idx_SubsysTow", subsysTable, new[] { towIdColumn22, kodSubsysColumn }, false); + var idx_SubsysTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Subsys", + "idx_SubsysTow"); + idx_SubsysTow.MappedIndexes.Add(idx_SubsysTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_SubsysTowIx).Add(idx_SubsysTow); + subsysTable.Indexes.Add("idx_SubsysTow", idx_SubsysTow); + var idx_SubsysZmiana = new TableIndex( + "idx_SubsysZmiana", subsysTable, new[] { zmianaColumn59 }, false); + var idx_SubsysZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Subsys", + "idx_SubsysZmiana"); + idx_SubsysZmiana.MappedIndexes.Add(idx_SubsysZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_SubsysZmianaIx).Add(idx_SubsysZmiana); + subsysTable.Indexes.Add("idx_SubsysZmiana", idx_SubsysZmiana); + relationalModel.Tables.Add(("Subsys", null), subsysTable); + var subsysTableMapping = new TableMapping(subsys, subsysTable, true); + subsysTable.AddTypeMapping(subsysTableMapping, false); + tableMappings269.Add(subsysTableMapping); + RelationalModel.CreateColumnMapping(kodSubsysColumn, subsys.FindProperty("KodSubsys")!, subsysTableMapping); + RelationalModel.CreateColumnMapping(dataDokColumn, subsys.FindProperty("DataDok")!, subsysTableMapping); + RelationalModel.CreateColumnMapping(domyslnyColumn1, subsys.FindProperty("Domyslny")!, subsysTableMapping); + RelationalModel.CreateColumnMapping(ileWZgrzewceColumn4, subsys.FindProperty("IleWZgrzewce")!, subsysTableMapping); + RelationalModel.CreateColumnMapping(kodZgrzewkiColumn, subsys.FindProperty("KodZgrzewki")!, subsysTableMapping); + RelationalModel.CreateColumnMapping(nrDokColumn1, subsys.FindProperty("NrDok")!, subsysTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn22, subsys.FindProperty("TowId")!, subsysTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn59, subsys.FindProperty("Zmiana")!, subsysTableMapping); + + var szczegPrtMag = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.SzczegPrtMag")!; + + var defaultTableMappings270 = new List>(); + szczegPrtMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings270); + var blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.SzczegPrtMag", null, relationalModel); + var pMIdColumnBase6 = new ColumnBase("PMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase.Columns.Add("PMId", pMIdColumnBase6); + var tekstColumnBase30 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase.Columns.Add("Tekst", tekstColumnBase30); + var towIdColumnBase23 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase.Columns.Add("TowId", towIdColumnBase23); + var typDanychColumnBase1 = new ColumnBase("TypDanych", "smallint", blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase); + blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase.Columns.Add("TypDanych", typDanychColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.SzczegPrtMag", blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase); + var blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagMappingBase = new TableMappingBase(szczegPrtMag, blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase, true); + blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagMappingBase, false); + defaultTableMappings270.Add(blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)pMIdColumnBase6, szczegPrtMag.FindProperty("PMId")!, blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase23, szczegPrtMag.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typDanychColumnBase1, szczegPrtMag.FindProperty("TypDanych")!, blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase30, szczegPrtMag.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesSzczegPrtMagMappingBase); + + var tableMappings270 = new List(); + szczegPrtMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings270); + var szczegPrtMagTable = new Table("SzczegPrtMag", null, relationalModel); + var towIdColumn23 = new Column("TowId", "numeric(9,0)", szczegPrtMagTable); + szczegPrtMagTable.Columns.Add("TowId", towIdColumn23); + var pMIdColumn6 = new Column("PMId", "numeric(9,0)", szczegPrtMagTable); + szczegPrtMagTable.Columns.Add("PMId", pMIdColumn6); + var typDanychColumn1 = new Column("TypDanych", "smallint", szczegPrtMagTable); + szczegPrtMagTable.Columns.Add("TypDanych", typDanychColumn1); + var tekstColumn30 = new Column("Tekst", "varchar(255)", szczegPrtMagTable); + szczegPrtMagTable.Columns.Add("Tekst", tekstColumn30); + var pK_SZCZEGPRTMAG = new UniqueConstraint("PK_SZCZEGPRTMAG", szczegPrtMagTable, new[] { towIdColumn23, pMIdColumn6, typDanychColumn1 }); + szczegPrtMagTable.PrimaryKey = pK_SZCZEGPRTMAG; + var pK_SZCZEGPRTMAGUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SzczegPrtMag", + new[] { "TowId", "PMId", "TypDanych" }); + pK_SZCZEGPRTMAG.MappedKeys.Add(pK_SZCZEGPRTMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SZCZEGPRTMAGUc).Add(pK_SZCZEGPRTMAG); + szczegPrtMagTable.UniqueConstraints.Add("PK_SZCZEGPRTMAG", pK_SZCZEGPRTMAG); + relationalModel.Tables.Add(("SzczegPrtMag", null), szczegPrtMagTable); + var szczegPrtMagTableMapping = new TableMapping(szczegPrtMag, szczegPrtMagTable, true); + szczegPrtMagTable.AddTypeMapping(szczegPrtMagTableMapping, false); + tableMappings270.Add(szczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(pMIdColumn6, szczegPrtMag.FindProperty("PMId")!, szczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn23, szczegPrtMag.FindProperty("TowId")!, szczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(typDanychColumn1, szczegPrtMag.FindProperty("TypDanych")!, szczegPrtMagTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn30, szczegPrtMag.FindProperty("Tekst")!, szczegPrtMagTableMapping); + + var tabelaAkcyzowa = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TabelaAkcyzowa")!; + + var defaultTableMappings271 = new List>(); + tabelaAkcyzowa.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings271); + var blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TabelaAkcyzowa", null, relationalModel); + var grAkcIdColumnBase1 = new ColumnBase("GrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase.Columns.Add("GrAkcId", grAkcIdColumnBase1); + var minStawkaAkcColumnBase = new ColumnBase("MinStawkaAkc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase.Columns.Add("MinStawkaAkc", minStawkaAkcColumnBase); + var odDatyColumnBase = new ColumnBase("OdDaty", "datetime", blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase); + blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase.Columns.Add("OdDaty", odDatyColumnBase); + var procCenyMaxColumnBase = new ColumnBase("ProcCenyMax", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase.Columns.Add("ProcCenyMax", procCenyMaxColumnBase); + var stawkaAkcColumnBase = new ColumnBase("StawkaAkc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase.Columns.Add("StawkaAkc", stawkaAkcColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TabelaAkcyzowa", blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase); + var blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase = new TableMappingBase(tabelaAkcyzowa, blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase, false); + defaultTableMappings271.Add(blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grAkcIdColumnBase1, tabelaAkcyzowa.FindProperty("GrAkcId")!, blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odDatyColumnBase, tabelaAkcyzowa.FindProperty("OdDaty")!, blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minStawkaAkcColumnBase, tabelaAkcyzowa.FindProperty("MinStawkaAkc")!, blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)procCenyMaxColumnBase, tabelaAkcyzowa.FindProperty("ProcCenyMax")!, blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaAkcColumnBase, tabelaAkcyzowa.FindProperty("StawkaAkc")!, blinkBackofficeServicesPcmDbEntitiesTabelaAkcyzowaMappingBase); + + var tableMappings271 = new List(); + tabelaAkcyzowa.SetRuntimeAnnotation("Relational:TableMappings", tableMappings271); + var tabelaAkcyzowaTable = new Table("TabelaAkcyzowa", null, relationalModel); + var grAkcIdColumn1 = new Column("GrAkcId", "numeric(9,0)", tabelaAkcyzowaTable); + tabelaAkcyzowaTable.Columns.Add("GrAkcId", grAkcIdColumn1); + var odDatyColumn = new Column("OdDaty", "datetime", tabelaAkcyzowaTable); + tabelaAkcyzowaTable.Columns.Add("OdDaty", odDatyColumn); + var minStawkaAkcColumn = new Column("MinStawkaAkc", "decimal(15,4)", tabelaAkcyzowaTable) + { + IsNullable = true + }; + tabelaAkcyzowaTable.Columns.Add("MinStawkaAkc", minStawkaAkcColumn); + var procCenyMaxColumn = new Column("ProcCenyMax", "decimal(10,4)", tabelaAkcyzowaTable) + { + IsNullable = true + }; + tabelaAkcyzowaTable.Columns.Add("ProcCenyMax", procCenyMaxColumn); + var stawkaAkcColumn = new Column("StawkaAkc", "decimal(15,4)", tabelaAkcyzowaTable) + { + IsNullable = true + }; + tabelaAkcyzowaTable.Columns.Add("StawkaAkc", stawkaAkcColumn); + var pK_TABELAAKCYZOWA = new UniqueConstraint("PK_TABELAAKCYZOWA", tabelaAkcyzowaTable, new[] { grAkcIdColumn1, odDatyColumn }); + tabelaAkcyzowaTable.PrimaryKey = pK_TABELAAKCYZOWA; + var pK_TABELAAKCYZOWAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TabelaAkcyzowa", + new[] { "GrAkcId", "OdDaty" }); + pK_TABELAAKCYZOWA.MappedKeys.Add(pK_TABELAAKCYZOWAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TABELAAKCYZOWAUc).Add(pK_TABELAAKCYZOWA); + tabelaAkcyzowaTable.UniqueConstraints.Add("PK_TABELAAKCYZOWA", pK_TABELAAKCYZOWA); + relationalModel.Tables.Add(("TabelaAkcyzowa", null), tabelaAkcyzowaTable); + var tabelaAkcyzowaTableMapping = new TableMapping(tabelaAkcyzowa, tabelaAkcyzowaTable, true); + tabelaAkcyzowaTable.AddTypeMapping(tabelaAkcyzowaTableMapping, false); + tableMappings271.Add(tabelaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(grAkcIdColumn1, tabelaAkcyzowa.FindProperty("GrAkcId")!, tabelaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(odDatyColumn, tabelaAkcyzowa.FindProperty("OdDaty")!, tabelaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(minStawkaAkcColumn, tabelaAkcyzowa.FindProperty("MinStawkaAkc")!, tabelaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(procCenyMaxColumn, tabelaAkcyzowa.FindProperty("ProcCenyMax")!, tabelaAkcyzowaTableMapping); + RelationalModel.CreateColumnMapping(stawkaAkcColumn, tabelaAkcyzowa.FindProperty("StawkaAkc")!, tabelaAkcyzowaTableMapping); + + var tekstDok = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TekstDok")!; + + var defaultTableMappings272 = new List>(); + tekstDok.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings272); + var blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TekstDok", null, relationalModel); + var dokIdColumnBase22 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase.Columns.Add("DokId", dokIdColumnBase22); + var tekstColumnBase31 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase.Columns.Add("Tekst", tekstColumnBase31); + var znaczenieColumnBase38 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase.Columns.Add("Znaczenie", znaczenieColumnBase38); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TekstDok", blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase); + var blinkBackofficeServicesPcmDbEntitiesTekstDokMappingBase = new TableMappingBase(tekstDok, blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTekstDokTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTekstDokMappingBase, false); + defaultTableMappings272.Add(blinkBackofficeServicesPcmDbEntitiesTekstDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase22, tekstDok.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesTekstDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase38, tekstDok.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesTekstDokMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase31, tekstDok.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesTekstDokMappingBase); + + var tableMappings272 = new List(); + tekstDok.SetRuntimeAnnotation("Relational:TableMappings", tableMappings272); + var tekstDokTable = new Table("TekstDok", null, relationalModel); + var dokIdColumn22 = new Column("DokId", "numeric(9,0)", tekstDokTable); + tekstDokTable.Columns.Add("DokId", dokIdColumn22); + var znaczenieColumn38 = new Column("Znaczenie", "smallint", tekstDokTable); + tekstDokTable.Columns.Add("Znaczenie", znaczenieColumn38); + var tekstColumn31 = new Column("Tekst", "varchar(255)", tekstDokTable); + tekstDokTable.Columns.Add("Tekst", tekstColumn31); + var pK_TEKSTDOK = new UniqueConstraint("PK_TEKSTDOK", tekstDokTable, new[] { dokIdColumn22, znaczenieColumn38 }); + tekstDokTable.PrimaryKey = pK_TEKSTDOK; + var pK_TEKSTDOKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstDok", + new[] { "DokId", "Znaczenie" }); + pK_TEKSTDOK.MappedKeys.Add(pK_TEKSTDOKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TEKSTDOKUc).Add(pK_TEKSTDOK); + tekstDokTable.UniqueConstraints.Add("PK_TEKSTDOK", pK_TEKSTDOK); + var idx_TekstDokTekstZnaczenie = new TableIndex( + "idx_TekstDokTekstZnaczenie", tekstDokTable, new[] { tekstColumn31, znaczenieColumn38 }, false); + var idx_TekstDokTekstZnaczenieIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstDok", + "idx_TekstDokTekstZnaczenie"); + idx_TekstDokTekstZnaczenie.MappedIndexes.Add(idx_TekstDokTekstZnaczenieIx); + RelationalModel.GetOrCreateTableIndexes(idx_TekstDokTekstZnaczenieIx).Add(idx_TekstDokTekstZnaczenie); + tekstDokTable.Indexes.Add("idx_TekstDokTekstZnaczenie", idx_TekstDokTekstZnaczenie); + relationalModel.Tables.Add(("TekstDok", null), tekstDokTable); + var tekstDokTableMapping = new TableMapping(tekstDok, tekstDokTable, true); + tekstDokTable.AddTypeMapping(tekstDokTableMapping, false); + tableMappings272.Add(tekstDokTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn22, tekstDok.FindProperty("DokId")!, tekstDokTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn38, tekstDok.FindProperty("Znaczenie")!, tekstDokTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn31, tekstDok.FindProperty("Tekst")!, tekstDokTableMapping); + + var tekstPoz = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TekstPoz")!; + + var defaultTableMappings273 = new List>(); + tekstPoz.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings273); + var blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TekstPoz", null, relationalModel); + var dokIdColumnBase23 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase.Columns.Add("DokId", dokIdColumnBase23); + var kolejnoscColumnBase60 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase60); + var tekstColumnBase32 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase.Columns.Add("Tekst", tekstColumnBase32); + var znaczenieColumnBase39 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase.Columns.Add("Znaczenie", znaczenieColumnBase39); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TekstPoz", blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase); + var blinkBackofficeServicesPcmDbEntitiesTekstPozMappingBase = new TableMappingBase(tekstPoz, blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTekstPozTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTekstPozMappingBase, false); + defaultTableMappings273.Add(blinkBackofficeServicesPcmDbEntitiesTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase23, tekstPoz.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase60, tekstPoz.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase39, tekstPoz.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesTekstPozMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase32, tekstPoz.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesTekstPozMappingBase); + + var tableMappings273 = new List(); + tekstPoz.SetRuntimeAnnotation("Relational:TableMappings", tableMappings273); + var tekstPozTable = new Table("TekstPoz", null, relationalModel); + var dokIdColumn23 = new Column("DokId", "numeric(9,0)", tekstPozTable); + tekstPozTable.Columns.Add("DokId", dokIdColumn23); + var kolejnoscColumn60 = new Column("Kolejnosc", "int", tekstPozTable); + tekstPozTable.Columns.Add("Kolejnosc", kolejnoscColumn60); + var znaczenieColumn39 = new Column("Znaczenie", "smallint", tekstPozTable); + tekstPozTable.Columns.Add("Znaczenie", znaczenieColumn39); + var tekstColumn32 = new Column("Tekst", "varchar(255)", tekstPozTable); + tekstPozTable.Columns.Add("Tekst", tekstColumn32); + var pK_TEKSTPOZ = new UniqueConstraint("PK_TEKSTPOZ", tekstPozTable, new[] { dokIdColumn23, kolejnoscColumn60, znaczenieColumn39 }); + tekstPozTable.PrimaryKey = pK_TEKSTPOZ; + var pK_TEKSTPOZUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstPoz", + new[] { "DokId", "Kolejnosc", "Znaczenie" }); + pK_TEKSTPOZ.MappedKeys.Add(pK_TEKSTPOZUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TEKSTPOZUc).Add(pK_TEKSTPOZ); + tekstPozTable.UniqueConstraints.Add("PK_TEKSTPOZ", pK_TEKSTPOZ); + var idx_TekstPoz_Znaczenie = new TableIndex( + "idx_TekstPoz_Znaczenie", tekstPozTable, new[] { znaczenieColumn39 }, false); + var idx_TekstPoz_ZnaczenieIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstPoz", + "idx_TekstPoz_Znaczenie"); + idx_TekstPoz_Znaczenie.MappedIndexes.Add(idx_TekstPoz_ZnaczenieIx); + RelationalModel.GetOrCreateTableIndexes(idx_TekstPoz_ZnaczenieIx).Add(idx_TekstPoz_Znaczenie); + tekstPozTable.Indexes.Add("idx_TekstPoz_Znaczenie", idx_TekstPoz_Znaczenie); + relationalModel.Tables.Add(("TekstPoz", null), tekstPozTable); + var tekstPozTableMapping = new TableMapping(tekstPoz, tekstPozTable, true); + tekstPozTable.AddTypeMapping(tekstPozTableMapping, false); + tableMappings273.Add(tekstPozTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn23, tekstPoz.FindProperty("DokId")!, tekstPozTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn60, tekstPoz.FindProperty("Kolejnosc")!, tekstPozTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn39, tekstPoz.FindProperty("Znaczenie")!, tekstPozTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn32, tekstPoz.FindProperty("Tekst")!, tekstPozTableMapping); + + var tekstZgody = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TekstZgody")!; + + var defaultTableMappings274 = new List>(); + tekstZgody.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings274); + var blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TekstZgody", null, relationalModel); + var kolejnoscColumnBase61 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase61); + var tekstColumnBase33 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase.Columns.Add("Tekst", tekstColumnBase33); + var wersjaColumnBase9 = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase.Columns.Add("Wersja", wersjaColumnBase9); + var zgIdColumnBase3 = new ColumnBase("ZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase.Columns.Add("ZgId", zgIdColumnBase3); + var zmianaColumnBase60 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase); + blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase.Columns.Add("Zmiana", zmianaColumnBase60); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TekstZgody", blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase); + var blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase = new TableMappingBase(tekstZgody, blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTekstZgodyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase, false); + defaultTableMappings274.Add(blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase61, tekstZgody.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase9, tekstZgody.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zgIdColumnBase3, tekstZgody.FindProperty("ZgId")!, blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase33, tekstZgody.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase60, tekstZgody.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesTekstZgodyMappingBase); + + var tableMappings274 = new List(); + tekstZgody.SetRuntimeAnnotation("Relational:TableMappings", tableMappings274); + var tekstZgodyTable = new Table("TekstZgody", null, relationalModel); + var zgIdColumn3 = new Column("ZgId", "numeric(9,0)", tekstZgodyTable); + tekstZgodyTable.Columns.Add("ZgId", zgIdColumn3); + var wersjaColumn9 = new Column("Wersja", "varchar(20)", tekstZgodyTable); + tekstZgodyTable.Columns.Add("Wersja", wersjaColumn9); + var kolejnoscColumn61 = new Column("Kolejnosc", "int", tekstZgodyTable); + tekstZgodyTable.Columns.Add("Kolejnosc", kolejnoscColumn61); + var tekstColumn33 = new Column("Tekst", "varchar(255)", tekstZgodyTable); + tekstZgodyTable.Columns.Add("Tekst", tekstColumn33); + var zmianaColumn60 = new Column("Zmiana", "datetime", tekstZgodyTable); + tekstZgodyTable.Columns.Add("Zmiana", zmianaColumn60); + var pK_TEKSTZGODY = new UniqueConstraint("PK_TEKSTZGODY", tekstZgodyTable, new[] { zgIdColumn3, wersjaColumn9, kolejnoscColumn61 }); + tekstZgodyTable.PrimaryKey = pK_TEKSTZGODY; + var pK_TEKSTZGODYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstZgody", + new[] { "ZgId", "Wersja", "Kolejnosc" }); + pK_TEKSTZGODY.MappedKeys.Add(pK_TEKSTZGODYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TEKSTZGODYUc).Add(pK_TEKSTZGODY); + tekstZgodyTable.UniqueConstraints.Add("PK_TEKSTZGODY", pK_TEKSTZGODY); + var idx_TXTZG_ZMIANA = new TableIndex( + "idx_TXTZG_ZMIANA", tekstZgodyTable, new[] { zmianaColumn60 }, false); + var idx_TXTZG_ZMIANAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstZgody", + "idx_TXTZG_ZMIANA"); + idx_TXTZG_ZMIANA.MappedIndexes.Add(idx_TXTZG_ZMIANAIx); + RelationalModel.GetOrCreateTableIndexes(idx_TXTZG_ZMIANAIx).Add(idx_TXTZG_ZMIANA); + tekstZgodyTable.Indexes.Add("idx_TXTZG_ZMIANA", idx_TXTZG_ZMIANA); + relationalModel.Tables.Add(("TekstZgody", null), tekstZgodyTable); + var tekstZgodyTableMapping = new TableMapping(tekstZgody, tekstZgodyTable, true); + tekstZgodyTable.AddTypeMapping(tekstZgodyTableMapping, false); + tableMappings274.Add(tekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn61, tekstZgody.FindProperty("Kolejnosc")!, tekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn9, tekstZgody.FindProperty("Wersja")!, tekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(zgIdColumn3, tekstZgody.FindProperty("ZgId")!, tekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn33, tekstZgody.FindProperty("Tekst")!, tekstZgodyTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn60, tekstZgody.FindProperty("Zmiana")!, tekstZgodyTableMapping); + + var towAkcyza = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza")!; + + var defaultTableMappings275 = new List>(); + towAkcyza.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings275); + var blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza", null, relationalModel); + var cenaMaxColumnBase0 = new ColumnBase("CenaMax", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.Columns.Add("CenaMax", cenaMaxColumnBase0); + var grAkcIdColumnBase2 = new ColumnBase("GrAkcId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.Columns.Add("GrAkcId", grAkcIdColumnBase2); + var ileAkcJMColumnBase0 = new ColumnBase("IleAkcJM", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.Columns.Add("IleAkcJM", ileAkcJMColumnBase0); + var kodCNColumnBase1 = new ColumnBase("KodCN", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.Columns.Add("KodCN", kodCNColumnBase1); + var kolejnoscColumnBase62 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase62); + var skladColumnBase0 = new ColumnBase("Sklad", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.Columns.Add("Sklad", skladColumnBase0); + var towIdColumnBase24 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.Columns.Add("TowId", towIdColumnBase24); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza", blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase = new TableMappingBase(towAkcyza, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowAkcyzaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase, false); + defaultTableMappings275.Add(blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase62, towAkcyza.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase24, towAkcyza.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaMaxColumnBase0, towAkcyza.FindProperty("CenaMax")!, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grAkcIdColumnBase2, towAkcyza.FindProperty("GrAkcId")!, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileAkcJMColumnBase0, towAkcyza.FindProperty("IleAkcJM")!, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodCNColumnBase1, towAkcyza.FindProperty("KodCN")!, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skladColumnBase0, towAkcyza.FindProperty("Sklad")!, blinkBackofficeServicesPcmDbEntitiesTowAkcyzaMappingBase); + + var tableMappings275 = new List(); + towAkcyza.SetRuntimeAnnotation("Relational:TableMappings", tableMappings275); + var towAkcyzaTable = new Table("TowAkcyza", null, relationalModel); + var towIdColumn24 = new Column("TowId", "numeric(9,0)", towAkcyzaTable); + towAkcyzaTable.Columns.Add("TowId", towIdColumn24); + var kolejnoscColumn62 = new Column("Kolejnosc", "smallint", towAkcyzaTable); + towAkcyzaTable.Columns.Add("Kolejnosc", kolejnoscColumn62); + var cenaMaxColumn0 = new Column("CenaMax", "decimal(15,4)", towAkcyzaTable) + { + IsNullable = true + }; + towAkcyzaTable.Columns.Add("CenaMax", cenaMaxColumn0); + var grAkcIdColumn2 = new Column("GrAkcId", "numeric(9,0)", towAkcyzaTable); + towAkcyzaTable.Columns.Add("GrAkcId", grAkcIdColumn2); + var ileAkcJMColumn0 = new Column("IleAkcJM", "decimal(15,4)", towAkcyzaTable) + { + IsNullable = true + }; + towAkcyzaTable.Columns.Add("IleAkcJM", ileAkcJMColumn0); + var kodCNColumn1 = new Column("KodCN", "varchar(20)", towAkcyzaTable) + { + IsNullable = true + }; + towAkcyzaTable.Columns.Add("KodCN", kodCNColumn1); + var skladColumn0 = new Column("Sklad", "decimal(15,4)", towAkcyzaTable) + { + IsNullable = true + }; + towAkcyzaTable.Columns.Add("Sklad", skladColumn0); + var pK_TOWAKCYZA = new UniqueConstraint("PK_TOWAKCYZA", towAkcyzaTable, new[] { towIdColumn24, kolejnoscColumn62 }); + towAkcyzaTable.PrimaryKey = pK_TOWAKCYZA; + var pK_TOWAKCYZAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza", + new[] { "TowId", "Kolejnosc" }); + pK_TOWAKCYZA.MappedKeys.Add(pK_TOWAKCYZAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWAKCYZAUc).Add(pK_TOWAKCYZA); + towAkcyzaTable.UniqueConstraints.Add("PK_TOWAKCYZA", pK_TOWAKCYZA); + var idx_TowAkcGr = new TableIndex( + "idx_TowAkcGr", towAkcyzaTable, new[] { grAkcIdColumn2 }, false); + var idx_TowAkcGrIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza", + "idx_TowAkcGr"); + idx_TowAkcGr.MappedIndexes.Add(idx_TowAkcGrIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowAkcGrIx).Add(idx_TowAkcGr); + towAkcyzaTable.Indexes.Add("idx_TowAkcGr", idx_TowAkcGr); + relationalModel.Tables.Add(("TowAkcyza", null), towAkcyzaTable); + var towAkcyzaTableMapping = new TableMapping(towAkcyza, towAkcyzaTable, true); + towAkcyzaTable.AddTypeMapping(towAkcyzaTableMapping, false); + tableMappings275.Add(towAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn62, towAkcyza.FindProperty("Kolejnosc")!, towAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn24, towAkcyza.FindProperty("TowId")!, towAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(cenaMaxColumn0, towAkcyza.FindProperty("CenaMax")!, towAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(grAkcIdColumn2, towAkcyza.FindProperty("GrAkcId")!, towAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(ileAkcJMColumn0, towAkcyza.FindProperty("IleAkcJM")!, towAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(kodCNColumn1, towAkcyza.FindProperty("KodCN")!, towAkcyzaTableMapping); + RelationalModel.CreateColumnMapping(skladColumn0, towAkcyza.FindProperty("Sklad")!, towAkcyzaTableMapping); + + var towDodatek = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowDodatek")!; + + var defaultTableMappings276 = new List>(); + towDodatek.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings276); + var blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowDodatek", null, relationalModel); + var cenaColumnBase8 = new ColumnBase("Cena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("Cena", cenaColumnBase8); + var dodTowIdColumnBase = new ColumnBase("DodTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("DodTowId", dodTowIdColumnBase); + var domyslnyColumnBase2 = new ColumnBase("Domyslny", "smallint", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("Domyslny", domyslnyColumnBase2); + var iloscColumnBase10 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("Ilosc", iloscColumnBase10); + var kolejnoscColumnBase63 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase63); + var obowiazkowyColumnBase2 = new ColumnBase("Obowiazkowy", "smallint", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("Obowiazkowy", obowiazkowyColumnBase2); + var param1ColumnBase14 = new ColumnBase("Param1", "smallint", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("Param1", param1ColumnBase14); + var towIdColumnBase25 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.Columns.Add("TowId", towIdColumnBase25); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowDodatek", blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase = new TableMappingBase(towDodatek, blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowDodatekTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase, false); + defaultTableMappings276.Add(blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase63, towDodatek.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase25, towDodatek.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase8, towDodatek.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodTowIdColumnBase, towDodatek.FindProperty("DodTowId")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslnyColumnBase2, towDodatek.FindProperty("Domyslny")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase10, towDodatek.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)obowiazkowyColumnBase2, towDodatek.FindProperty("Obowiazkowy")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase14, towDodatek.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesTowDodatekMappingBase); + + var tableMappings276 = new List(); + towDodatek.SetRuntimeAnnotation("Relational:TableMappings", tableMappings276); + var towDodatekTable = new Table("TowDodatek", null, relationalModel); + var towIdColumn25 = new Column("TowId", "numeric(9,0)", towDodatekTable); + towDodatekTable.Columns.Add("TowId", towIdColumn25); + var kolejnoscColumn63 = new Column("Kolejnosc", "smallint", towDodatekTable); + towDodatekTable.Columns.Add("Kolejnosc", kolejnoscColumn63); + var cenaColumn8 = new Column("Cena", "decimal(15,4)", towDodatekTable); + towDodatekTable.Columns.Add("Cena", cenaColumn8); + var dodTowIdColumn = new Column("DodTowId", "numeric(9,0)", towDodatekTable); + towDodatekTable.Columns.Add("DodTowId", dodTowIdColumn); + var domyslnyColumn2 = new Column("Domyslny", "smallint", towDodatekTable); + towDodatekTable.Columns.Add("Domyslny", domyslnyColumn2); + var iloscColumn10 = new Column("Ilosc", "decimal(15,4)", towDodatekTable); + towDodatekTable.Columns.Add("Ilosc", iloscColumn10); + var obowiazkowyColumn2 = new Column("Obowiazkowy", "smallint", towDodatekTable); + towDodatekTable.Columns.Add("Obowiazkowy", obowiazkowyColumn2); + var param1Column14 = new Column("Param1", "smallint", towDodatekTable) + { + IsNullable = true + }; + towDodatekTable.Columns.Add("Param1", param1Column14); + var pK_TOWDODATEK = new UniqueConstraint("PK_TOWDODATEK", towDodatekTable, new[] { towIdColumn25, kolejnoscColumn63 }); + towDodatekTable.PrimaryKey = pK_TOWDODATEK; + var pK_TOWDODATEKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowDodatek", + new[] { "TowId", "Kolejnosc" }); + pK_TOWDODATEK.MappedKeys.Add(pK_TOWDODATEKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWDODATEKUc).Add(pK_TOWDODATEK); + towDodatekTable.UniqueConstraints.Add("PK_TOWDODATEK", pK_TOWDODATEK); + var iX_TowDodatek_DodTowId = new TableIndex( + "IX_TowDodatek_DodTowId", towDodatekTable, new[] { dodTowIdColumn }, false); + var iX_TowDodatek_DodTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowDodatek", + new[] { "DodTowId" }); + iX_TowDodatek_DodTowId.MappedIndexes.Add(iX_TowDodatek_DodTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_TowDodatek_DodTowIdIx).Add(iX_TowDodatek_DodTowId); + towDodatekTable.Indexes.Add("IX_TowDodatek_DodTowId", iX_TowDodatek_DodTowId); + relationalModel.Tables.Add(("TowDodatek", null), towDodatekTable); + var towDodatekTableMapping = new TableMapping(towDodatek, towDodatekTable, true); + towDodatekTable.AddTypeMapping(towDodatekTableMapping, false); + tableMappings276.Add(towDodatekTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn63, towDodatek.FindProperty("Kolejnosc")!, towDodatekTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn25, towDodatek.FindProperty("TowId")!, towDodatekTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn8, towDodatek.FindProperty("Cena")!, towDodatekTableMapping); + RelationalModel.CreateColumnMapping(dodTowIdColumn, towDodatek.FindProperty("DodTowId")!, towDodatekTableMapping); + RelationalModel.CreateColumnMapping(domyslnyColumn2, towDodatek.FindProperty("Domyslny")!, towDodatekTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn10, towDodatek.FindProperty("Ilosc")!, towDodatekTableMapping); + RelationalModel.CreateColumnMapping(obowiazkowyColumn2, towDodatek.FindProperty("Obowiazkowy")!, towDodatekTableMapping); + RelationalModel.CreateColumnMapping(param1Column14, towDodatek.FindProperty("Param1")!, towDodatekTableMapping); + + var towIntParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowIntParam")!; + + var defaultTableMappings277 = new List>(); + towIntParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings277); + var blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowIntParam", null, relationalModel); + var paramColumnBase2 = new ColumnBase("Param", "int", blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase); + blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase.Columns.Add("Param", paramColumnBase2); + var towIdColumnBase26 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase); + blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase.Columns.Add("TowId", towIdColumnBase26); + var znaczenieColumnBase40 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase); + blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase.Columns.Add("Znaczenie", znaczenieColumnBase40); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowIntParam", blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowIntParamMappingBase = new TableMappingBase(towIntParam, blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowIntParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowIntParamMappingBase, false); + defaultTableMappings277.Add(blinkBackofficeServicesPcmDbEntitiesTowIntParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase26, towIntParam.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowIntParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase40, towIntParam.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesTowIntParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramColumnBase2, towIntParam.FindProperty("Param")!, blinkBackofficeServicesPcmDbEntitiesTowIntParamMappingBase); + + var tableMappings277 = new List(); + towIntParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings277); + var towIntParamTable = new Table("TowIntParam", null, relationalModel); + var towIdColumn26 = new Column("TowId", "numeric(9,0)", towIntParamTable); + towIntParamTable.Columns.Add("TowId", towIdColumn26); + var znaczenieColumn40 = new Column("Znaczenie", "smallint", towIntParamTable); + towIntParamTable.Columns.Add("Znaczenie", znaczenieColumn40); + var paramColumn2 = new Column("Param", "int", towIntParamTable); + towIntParamTable.Columns.Add("Param", paramColumn2); + var pK_TOWIntPARAM = new UniqueConstraint("PK_TOWIntPARAM", towIntParamTable, new[] { towIdColumn26, znaczenieColumn40 }); + towIntParamTable.PrimaryKey = pK_TOWIntPARAM; + var pK_TOWIntPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowIntParam", + new[] { "TowId", "Znaczenie" }); + pK_TOWIntPARAM.MappedKeys.Add(pK_TOWIntPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWIntPARAMUc).Add(pK_TOWIntPARAM); + towIntParamTable.UniqueConstraints.Add("PK_TOWIntPARAM", pK_TOWIntPARAM); + relationalModel.Tables.Add(("TowIntParam", null), towIntParamTable); + var towIntParamTableMapping = new TableMapping(towIntParam, towIntParamTable, true); + towIntParamTable.AddTypeMapping(towIntParamTableMapping, false); + tableMappings277.Add(towIntParamTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn26, towIntParam.FindProperty("TowId")!, towIntParamTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn40, towIntParam.FindProperty("Znaczenie")!, towIntParamTableMapping); + RelationalModel.CreateColumnMapping(paramColumn2, towIntParam.FindProperty("Param")!, towIntParamTableMapping); + + var towKraj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowKraj")!; + + var defaultTableMappings278 = new List>(); + towKraj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings278); + var blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowKraj", null, relationalModel); + var cenaDetColumnBase3 = new ColumnBase("CenaDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("CenaDet", cenaDetColumnBase3); + var cenaDodColumnBase1 = new ColumnBase("CenaDod", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("CenaDod", cenaDodColumnBase1); + var cenaHurtColumnBase1 = new ColumnBase("CenaHurt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("CenaHurt", cenaHurtColumnBase1); + var cenaNocColumnBase1 = new ColumnBase("CenaNoc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("CenaNoc", cenaNocColumnBase1); + var cenaZakColumnBase3 = new ColumnBase("CenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("CenaZak", cenaZakColumnBase3); + var indeks1ColumnBase1 = new ColumnBase("Indeks1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Indeks1", indeks1ColumnBase1); + var indeks2ColumnBase1 = new ColumnBase("Indeks2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Indeks2", indeks2ColumnBase1); + var krajIdColumnBase3 = new ColumnBase("KrajId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("KrajId", krajIdColumnBase3); + var nazwaColumnBase58 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Nazwa", nazwaColumnBase58); + var opis1ColumnBase3 = new ColumnBase("Opis1", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Opis1", opis1ColumnBase3); + var opis2ColumnBase3 = new ColumnBase("Opis2", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Opis2", opis2ColumnBase3); + var opis3ColumnBase1 = new ColumnBase("Opis3", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Opis3", opis3ColumnBase1); + var opis4ColumnBase1 = new ColumnBase("Opis4", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Opis4", opis4ColumnBase1); + var skrotColumnBase5 = new ColumnBase("Skrot", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Skrot", skrotColumnBase5); + var stawkaColumnBase14 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Stawka", stawkaColumnBase14); + var towIdColumnBase27 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("TowId", towIdColumnBase27); + var zmianaColumnBase61 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase); + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.Columns.Add("Zmiana", zmianaColumnBase61); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowKraj", blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase = new TableMappingBase(towKraj, blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowKrajTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase, false); + defaultTableMappings278.Add(blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)krajIdColumnBase3, towKraj.FindProperty("KrajId")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase27, towKraj.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDetColumnBase3, towKraj.FindProperty("CenaDet")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDodColumnBase1, towKraj.FindProperty("CenaDod")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaHurtColumnBase1, towKraj.FindProperty("CenaHurt")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaNocColumnBase1, towKraj.FindProperty("CenaNoc")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZakColumnBase3, towKraj.FindProperty("CenaZak")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks1ColumnBase1, towKraj.FindProperty("Indeks1")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks2ColumnBase1, towKraj.FindProperty("Indeks2")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase58, towKraj.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis1ColumnBase3, towKraj.FindProperty("Opis1")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis2ColumnBase3, towKraj.FindProperty("Opis2")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis3ColumnBase1, towKraj.FindProperty("Opis3")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis4ColumnBase1, towKraj.FindProperty("Opis4")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase5, towKraj.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase14, towKraj.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase61, towKraj.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesTowKrajMappingBase); + + var tableMappings278 = new List(); + towKraj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings278); + var towKrajTable = new Table("TowKraj", null, relationalModel); + var towIdColumn27 = new Column("TowId", "numeric(9,0)", towKrajTable); + towKrajTable.Columns.Add("TowId", towIdColumn27); + var krajIdColumn3 = new Column("KrajId", "numeric(9,0)", towKrajTable); + towKrajTable.Columns.Add("KrajId", krajIdColumn3); + var cenaDetColumn3 = new Column("CenaDet", "decimal(15,4)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("CenaDet", cenaDetColumn3); + var cenaDodColumn1 = new Column("CenaDod", "decimal(15,4)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("CenaDod", cenaDodColumn1); + var cenaHurtColumn1 = new Column("CenaHurt", "decimal(15,4)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("CenaHurt", cenaHurtColumn1); + var cenaNocColumn1 = new Column("CenaNoc", "decimal(15,4)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("CenaNoc", cenaNocColumn1); + var cenaZakColumn3 = new Column("CenaZak", "decimal(15,4)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("CenaZak", cenaZakColumn3); + var indeks1Column1 = new Column("Indeks1", "varchar(40)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Indeks1", indeks1Column1); + var indeks2Column1 = new Column("Indeks2", "varchar(40)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Indeks2", indeks2Column1); + var nazwaColumn58 = new Column("Nazwa", "varchar(255)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Nazwa", nazwaColumn58); + var opis1Column3 = new Column("Opis1", "varchar(60)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Opis1", opis1Column3); + var opis2Column3 = new Column("Opis2", "varchar(60)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Opis2", opis2Column3); + var opis3Column1 = new Column("Opis3", "varchar(60)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Opis3", opis3Column1); + var opis4Column1 = new Column("Opis4", "varchar(60)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Opis4", opis4Column1); + var skrotColumn5 = new Column("Skrot", "varchar(120)", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Skrot", skrotColumn5); + var stawkaColumn14 = new Column("Stawka", "smallint", towKrajTable) + { + IsNullable = true + }; + towKrajTable.Columns.Add("Stawka", stawkaColumn14); + var zmianaColumn61 = new Column("Zmiana", "datetime", towKrajTable); + towKrajTable.Columns.Add("Zmiana", zmianaColumn61); + var pK_TOWKRAJ = new UniqueConstraint("PK_TOWKRAJ", towKrajTable, new[] { towIdColumn27, krajIdColumn3 }); + towKrajTable.PrimaryKey = pK_TOWKRAJ; + var pK_TOWKRAJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowKraj", + new[] { "TowId", "KrajId" }); + pK_TOWKRAJ.MappedKeys.Add(pK_TOWKRAJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWKRAJUc).Add(pK_TOWKRAJ); + towKrajTable.UniqueConstraints.Add("PK_TOWKRAJ", pK_TOWKRAJ); + var idx_KrajTow = new TableIndex( + "idx_KrajTow", towKrajTable, new[] { krajIdColumn3, towIdColumn27 }, false); + var idx_KrajTowIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowKraj", + "idx_KrajTow"); + idx_KrajTow.MappedIndexes.Add(idx_KrajTowIx); + RelationalModel.GetOrCreateTableIndexes(idx_KrajTowIx).Add(idx_KrajTow); + towKrajTable.Indexes.Add("idx_KrajTow", idx_KrajTow); + relationalModel.Tables.Add(("TowKraj", null), towKrajTable); + var towKrajTableMapping = new TableMapping(towKraj, towKrajTable, true); + towKrajTable.AddTypeMapping(towKrajTableMapping, false); + tableMappings278.Add(towKrajTableMapping); + RelationalModel.CreateColumnMapping(krajIdColumn3, towKraj.FindProperty("KrajId")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn27, towKraj.FindProperty("TowId")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(cenaDetColumn3, towKraj.FindProperty("CenaDet")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(cenaDodColumn1, towKraj.FindProperty("CenaDod")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(cenaHurtColumn1, towKraj.FindProperty("CenaHurt")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(cenaNocColumn1, towKraj.FindProperty("CenaNoc")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(cenaZakColumn3, towKraj.FindProperty("CenaZak")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(indeks1Column1, towKraj.FindProperty("Indeks1")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(indeks2Column1, towKraj.FindProperty("Indeks2")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn58, towKraj.FindProperty("Nazwa")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(opis1Column3, towKraj.FindProperty("Opis1")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(opis2Column3, towKraj.FindProperty("Opis2")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(opis3Column1, towKraj.FindProperty("Opis3")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(opis4Column1, towKraj.FindProperty("Opis4")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn5, towKraj.FindProperty("Skrot")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn14, towKraj.FindProperty("Stawka")!, towKrajTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn61, towKraj.FindProperty("Zmiana")!, towKrajTableMapping); + + var towParWiseBase = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase")!; + + var defaultTableMappings279 = new List>(); + towParWiseBase.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings279); + var blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", null, relationalModel); + var parIdColumnBase15 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase.Columns.Add("ParId", parIdColumnBase15); + var tekstColumnBase34 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase.Columns.Add("Tekst", tekstColumnBase34); + var towIdColumnBase28 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase); + blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase.Columns.Add("TowId", towIdColumnBase28); + var zasobIdColumnBase3 = new ColumnBase("ZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase.Columns.Add("ZasobId", zasobIdColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseMappingBase = new TableMappingBase(towParWiseBase, blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseMappingBase, false); + defaultTableMappings279.Add(blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase15, towParWiseBase.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase28, towParWiseBase.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase34, towParWiseBase.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zasobIdColumnBase3, towParWiseBase.FindProperty("ZasobId")!, blinkBackofficeServicesPcmDbEntitiesTowParWiseBaseMappingBase); + + var tableMappings279 = new List(); + towParWiseBase.SetRuntimeAnnotation("Relational:TableMappings", tableMappings279); + var towParWiseBaseTable = new Table("TowParWiseBase", null, relationalModel); + var towIdColumn28 = new Column("TowId", "numeric(9,0)", towParWiseBaseTable); + towParWiseBaseTable.Columns.Add("TowId", towIdColumn28); + var parIdColumn15 = new Column("ParId", "numeric(9,0)", towParWiseBaseTable); + towParWiseBaseTable.Columns.Add("ParId", parIdColumn15); + var tekstColumn34 = new Column("Tekst", "varchar(255)", towParWiseBaseTable) + { + IsNullable = true + }; + towParWiseBaseTable.Columns.Add("Tekst", tekstColumn34); + var zasobIdColumn3 = new Column("ZasobId", "numeric(9,0)", towParWiseBaseTable) + { + IsNullable = true + }; + towParWiseBaseTable.Columns.Add("ZasobId", zasobIdColumn3); + var pK_TowParWiseBase = new UniqueConstraint("PK_TowParWiseBase", towParWiseBaseTable, new[] { towIdColumn28, parIdColumn15 }); + towParWiseBaseTable.PrimaryKey = pK_TowParWiseBase; + var pK_TowParWiseBaseUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", + new[] { "TowId", "ParId" }); + pK_TowParWiseBase.MappedKeys.Add(pK_TowParWiseBaseUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TowParWiseBaseUc).Add(pK_TowParWiseBase); + towParWiseBaseTable.UniqueConstraints.Add("PK_TowParWiseBase", pK_TowParWiseBase); + var idx_TowParWB_ParId = new TableIndex( + "idx_TowParWB_ParId", towParWiseBaseTable, new[] { parIdColumn15 }, false); + var idx_TowParWB_ParIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", + "idx_TowParWB_ParId"); + idx_TowParWB_ParId.MappedIndexes.Add(idx_TowParWB_ParIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowParWB_ParIdIx).Add(idx_TowParWB_ParId); + towParWiseBaseTable.Indexes.Add("idx_TowParWB_ParId", idx_TowParWB_ParId); + var idx_TowParWB_ZasobId = new TableIndex( + "idx_TowParWB_ZasobId", towParWiseBaseTable, new[] { zasobIdColumn3 }, false); + var idx_TowParWB_ZasobIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", + "idx_TowParWB_ZasobId"); + idx_TowParWB_ZasobId.MappedIndexes.Add(idx_TowParWB_ZasobIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowParWB_ZasobIdIx).Add(idx_TowParWB_ZasobId); + towParWiseBaseTable.Indexes.Add("idx_TowParWB_ZasobId", idx_TowParWB_ZasobId); + relationalModel.Tables.Add(("TowParWiseBase", null), towParWiseBaseTable); + var towParWiseBaseTableMapping = new TableMapping(towParWiseBase, towParWiseBaseTable, true); + towParWiseBaseTable.AddTypeMapping(towParWiseBaseTableMapping, false); + tableMappings279.Add(towParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn15, towParWiseBase.FindProperty("ParId")!, towParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn28, towParWiseBase.FindProperty("TowId")!, towParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn34, towParWiseBase.FindProperty("Tekst")!, towParWiseBaseTableMapping); + RelationalModel.CreateColumnMapping(zasobIdColumn3, towParWiseBase.FindProperty("ZasobId")!, towParWiseBaseTableMapping); + + var towPowiazanie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie")!; + + var defaultTableMappings280 = new List>(); + towPowiazanie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings280); + var blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie", null, relationalModel); + var powTowIdColumnBase = new ColumnBase("PowTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase.Columns.Add("PowTowId", powTowIdColumnBase); + var towIdColumnBase29 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase.Columns.Add("TowId", towIdColumnBase29); + var znaczenieColumnBase41 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase); + blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase.Columns.Add("Znaczenie", znaczenieColumnBase41); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie", blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowPowiazanieMappingBase = new TableMappingBase(towPowiazanie, blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowPowiazanieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowPowiazanieMappingBase, false); + defaultTableMappings280.Add(blinkBackofficeServicesPcmDbEntitiesTowPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase29, towPowiazanie.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase41, towPowiazanie.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesTowPowiazanieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)powTowIdColumnBase, towPowiazanie.FindProperty("PowTowId")!, blinkBackofficeServicesPcmDbEntitiesTowPowiazanieMappingBase); + + var tableMappings280 = new List(); + towPowiazanie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings280); + var towPowiazanieTable = new Table("TowPowiazanie", null, relationalModel); + var towIdColumn29 = new Column("TowId", "numeric(9,0)", towPowiazanieTable); + towPowiazanieTable.Columns.Add("TowId", towIdColumn29); + var znaczenieColumn41 = new Column("Znaczenie", "smallint", towPowiazanieTable); + towPowiazanieTable.Columns.Add("Znaczenie", znaczenieColumn41); + var powTowIdColumn = new Column("PowTowId", "numeric(9,0)", towPowiazanieTable); + towPowiazanieTable.Columns.Add("PowTowId", powTowIdColumn); + var pK_TOWPOWIAZANIE = new UniqueConstraint("PK_TOWPOWIAZANIE", towPowiazanieTable, new[] { towIdColumn29, znaczenieColumn41 }); + towPowiazanieTable.PrimaryKey = pK_TOWPOWIAZANIE; + var pK_TOWPOWIAZANIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie", + new[] { "TowId", "Znaczenie" }); + pK_TOWPOWIAZANIE.MappedKeys.Add(pK_TOWPOWIAZANIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWPOWIAZANIEUc).Add(pK_TOWPOWIAZANIE); + towPowiazanieTable.UniqueConstraints.Add("PK_TOWPOWIAZANIE", pK_TOWPOWIAZANIE); + var iX_TowPowiazanie_PowTowId = new TableIndex( + "IX_TowPowiazanie_PowTowId", towPowiazanieTable, new[] { powTowIdColumn }, false); + var iX_TowPowiazanie_PowTowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie", + new[] { "PowTowId" }); + iX_TowPowiazanie_PowTowId.MappedIndexes.Add(iX_TowPowiazanie_PowTowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_TowPowiazanie_PowTowIdIx).Add(iX_TowPowiazanie_PowTowId); + towPowiazanieTable.Indexes.Add("IX_TowPowiazanie_PowTowId", iX_TowPowiazanie_PowTowId); + relationalModel.Tables.Add(("TowPowiazanie", null), towPowiazanieTable); + var towPowiazanieTableMapping = new TableMapping(towPowiazanie, towPowiazanieTable, true); + towPowiazanieTable.AddTypeMapping(towPowiazanieTableMapping, false); + tableMappings280.Add(towPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn29, towPowiazanie.FindProperty("TowId")!, towPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn41, towPowiazanie.FindProperty("Znaczenie")!, towPowiazanieTableMapping); + RelationalModel.CreateColumnMapping(powTowIdColumn, towPowiazanie.FindProperty("PowTowId")!, towPowiazanieTableMapping); + + var towStraty = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowStraty")!; + + var defaultTableMappings281 = new List>(); + towStraty.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings281); + var blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowStraty", null, relationalModel); + var idxRodzStratColumnBase0 = new ColumnBase("IdxRodzStrat", "smallint", blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase); + blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase.Columns.Add("IdxRodzStrat", idxRodzStratColumnBase0); + var normaStratColumnBase0 = new ColumnBase("NormaStrat", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase.Columns.Add("NormaStrat", normaStratColumnBase0); + var odliczanieColumnBase0 = new ColumnBase("Odliczanie", "smallint", blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase); + blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase.Columns.Add("Odliczanie", odliczanieColumnBase0); + var towIdColumnBase30 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase); + blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase.Columns.Add("TowId", towIdColumnBase30); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowStraty", blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowStratyMappingBase = new TableMappingBase(towStraty, blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowStratyTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowStratyMappingBase, false); + defaultTableMappings281.Add(blinkBackofficeServicesPcmDbEntitiesTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idxRodzStratColumnBase0, towStraty.FindProperty("IdxRodzStrat")!, blinkBackofficeServicesPcmDbEntitiesTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase30, towStraty.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)normaStratColumnBase0, towStraty.FindProperty("NormaStrat")!, blinkBackofficeServicesPcmDbEntitiesTowStratyMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)odliczanieColumnBase0, towStraty.FindProperty("Odliczanie")!, blinkBackofficeServicesPcmDbEntitiesTowStratyMappingBase); + + var tableMappings281 = new List(); + towStraty.SetRuntimeAnnotation("Relational:TableMappings", tableMappings281); + var towStratyTable = new Table("TowStraty", null, relationalModel); + var towIdColumn30 = new Column("TowId", "numeric(9,0)", towStratyTable); + towStratyTable.Columns.Add("TowId", towIdColumn30); + var idxRodzStratColumn0 = new Column("IdxRodzStrat", "smallint", towStratyTable); + towStratyTable.Columns.Add("IdxRodzStrat", idxRodzStratColumn0); + var normaStratColumn0 = new Column("NormaStrat", "decimal(10,4)", towStratyTable) + { + IsNullable = true + }; + towStratyTable.Columns.Add("NormaStrat", normaStratColumn0); + var odliczanieColumn0 = new Column("Odliczanie", "smallint", towStratyTable); + towStratyTable.Columns.Add("Odliczanie", odliczanieColumn0); + var pK_TOWSTRATY = new UniqueConstraint("PK_TOWSTRATY", towStratyTable, new[] { towIdColumn30, idxRodzStratColumn0 }); + towStratyTable.PrimaryKey = pK_TOWSTRATY; + var pK_TOWSTRATYUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowStraty", + new[] { "TowId", "IdxRodzStrat" }); + pK_TOWSTRATY.MappedKeys.Add(pK_TOWSTRATYUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWSTRATYUc).Add(pK_TOWSTRATY); + towStratyTable.UniqueConstraints.Add("PK_TOWSTRATY", pK_TOWSTRATY); + var idx_TwStrRS = new TableIndex( + "idx_TwStrRS", towStratyTable, new[] { idxRodzStratColumn0 }, false); + var idx_TwStrRSIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowStraty", + "idx_TwStrRS"); + idx_TwStrRS.MappedIndexes.Add(idx_TwStrRSIx); + RelationalModel.GetOrCreateTableIndexes(idx_TwStrRSIx).Add(idx_TwStrRS); + towStratyTable.Indexes.Add("idx_TwStrRS", idx_TwStrRS); + relationalModel.Tables.Add(("TowStraty", null), towStratyTable); + var towStratyTableMapping = new TableMapping(towStraty, towStratyTable, true); + towStratyTable.AddTypeMapping(towStratyTableMapping, false); + tableMappings281.Add(towStratyTableMapping); + RelationalModel.CreateColumnMapping(idxRodzStratColumn0, towStraty.FindProperty("IdxRodzStrat")!, towStratyTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn30, towStraty.FindProperty("TowId")!, towStratyTableMapping); + RelationalModel.CreateColumnMapping(normaStratColumn0, towStraty.FindProperty("NormaStrat")!, towStratyTableMapping); + RelationalModel.CreateColumnMapping(odliczanieColumn0, towStraty.FindProperty("Odliczanie")!, towStratyTableMapping); + + var towStratyDlaSklepu = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu")!; + + var defaultTableMappings282 = new List>(); + towStratyDlaSklepu.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings282); + var blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu", null, relationalModel); + var idxRodzStratColumnBase1 = new ColumnBase("IdxRodzStrat", "smallint", blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase); + blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase.Columns.Add("IdxRodzStrat", idxRodzStratColumnBase1); + var normaStratColumnBase1 = new ColumnBase("NormaStrat", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase.Columns.Add("NormaStrat", normaStratColumnBase1); + var sklepIdColumnBase110 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase); + blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase.Columns.Add("SklepId", sklepIdColumnBase110); + var towIdColumnBase31 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase); + blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase.Columns.Add("TowId", towIdColumnBase31); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu", blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuMappingBase = new TableMappingBase(towStratyDlaSklepu, blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuMappingBase, false); + defaultTableMappings282.Add(blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idxRodzStratColumnBase1, towStratyDlaSklepu.FindProperty("IdxRodzStrat")!, blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase110, towStratyDlaSklepu.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase31, towStratyDlaSklepu.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)normaStratColumnBase1, towStratyDlaSklepu.FindProperty("NormaStrat")!, blinkBackofficeServicesPcmDbEntitiesTowStratyDlaSklepuMappingBase); + + var tableMappings282 = new List(); + towStratyDlaSklepu.SetRuntimeAnnotation("Relational:TableMappings", tableMappings282); + var towStratyDlaSklepuTable = new Table("TowStratyDlaSklepu", null, relationalModel); + var towIdColumn31 = new Column("TowId", "numeric(9,0)", towStratyDlaSklepuTable); + towStratyDlaSklepuTable.Columns.Add("TowId", towIdColumn31); + var idxRodzStratColumn1 = new Column("IdxRodzStrat", "smallint", towStratyDlaSklepuTable); + towStratyDlaSklepuTable.Columns.Add("IdxRodzStrat", idxRodzStratColumn1); + var sklepIdColumn110 = new Column("SklepId", "numeric(9,0)", towStratyDlaSklepuTable); + towStratyDlaSklepuTable.Columns.Add("SklepId", sklepIdColumn110); + var normaStratColumn1 = new Column("NormaStrat", "decimal(10,4)", towStratyDlaSklepuTable) + { + IsNullable = true + }; + towStratyDlaSklepuTable.Columns.Add("NormaStrat", normaStratColumn1); + var pK_TOWSTRATYDLASKLEPU = new UniqueConstraint("PK_TOWSTRATYDLASKLEPU", towStratyDlaSklepuTable, new[] { towIdColumn31, idxRodzStratColumn1, sklepIdColumn110 }); + towStratyDlaSklepuTable.PrimaryKey = pK_TOWSTRATYDLASKLEPU; + var pK_TOWSTRATYDLASKLEPUUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu", + new[] { "TowId", "IdxRodzStrat", "SklepId" }); + pK_TOWSTRATYDLASKLEPU.MappedKeys.Add(pK_TOWSTRATYDLASKLEPUUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWSTRATYDLASKLEPUUc).Add(pK_TOWSTRATYDLASKLEPU); + towStratyDlaSklepuTable.UniqueConstraints.Add("PK_TOWSTRATYDLASKLEPU", pK_TOWSTRATYDLASKLEPU); + var idx_TwStrSk = new TableIndex( + "idx_TwStrSk", towStratyDlaSklepuTable, new[] { sklepIdColumn110 }, false); + var idx_TwStrSkIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu", + "idx_TwStrSk"); + idx_TwStrSk.MappedIndexes.Add(idx_TwStrSkIx); + RelationalModel.GetOrCreateTableIndexes(idx_TwStrSkIx).Add(idx_TwStrSk); + towStratyDlaSklepuTable.Indexes.Add("idx_TwStrSk", idx_TwStrSk); + relationalModel.Tables.Add(("TowStratyDlaSklepu", null), towStratyDlaSklepuTable); + var towStratyDlaSklepuTableMapping = new TableMapping(towStratyDlaSklepu, towStratyDlaSklepuTable, true); + towStratyDlaSklepuTable.AddTypeMapping(towStratyDlaSklepuTableMapping, false); + tableMappings282.Add(towStratyDlaSklepuTableMapping); + RelationalModel.CreateColumnMapping(idxRodzStratColumn1, towStratyDlaSklepu.FindProperty("IdxRodzStrat")!, towStratyDlaSklepuTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn110, towStratyDlaSklepu.FindProperty("SklepId")!, towStratyDlaSklepuTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn31, towStratyDlaSklepu.FindProperty("TowId")!, towStratyDlaSklepuTableMapping); + RelationalModel.CreateColumnMapping(normaStratColumn1, towStratyDlaSklepu.FindProperty("NormaStrat")!, towStratyDlaSklepuTableMapping); + + var towWartosc = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowWartosc")!; + + var defaultTableMappings283 = new List>(); + towWartosc.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings283); + var blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowWartosc", null, relationalModel); + var parIdColumnBase16 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase.Columns.Add("ParId", parIdColumnBase16); + var towIdColumnBase32 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase.Columns.Add("TowId", towIdColumnBase32); + var wartoscColumnBase19 = new ColumnBase("Wartosc", "int", blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase); + blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase.Columns.Add("Wartosc", wartoscColumnBase19); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowWartosc", blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowWartoscMappingBase = new TableMappingBase(towWartosc, blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowWartoscTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowWartoscMappingBase, false); + defaultTableMappings283.Add(blinkBackofficeServicesPcmDbEntitiesTowWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase16, towWartosc.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesTowWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase32, towWartosc.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wartoscColumnBase19, towWartosc.FindProperty("Wartosc")!, blinkBackofficeServicesPcmDbEntitiesTowWartoscMappingBase); + + var tableMappings283 = new List(); + towWartosc.SetRuntimeAnnotation("Relational:TableMappings", tableMappings283); + var towWartoscTable = new Table("TowWartosc", null, relationalModel); + var towIdColumn32 = new Column("TowId", "numeric(9,0)", towWartoscTable); + towWartoscTable.Columns.Add("TowId", towIdColumn32); + var parIdColumn16 = new Column("ParId", "numeric(9,0)", towWartoscTable); + towWartoscTable.Columns.Add("ParId", parIdColumn16); + var wartoscColumn19 = new Column("Wartosc", "int", towWartoscTable); + towWartoscTable.Columns.Add("Wartosc", wartoscColumn19); + var pK_TOWWARTOSC = new UniqueConstraint("PK_TOWWARTOSC", towWartoscTable, new[] { towIdColumn32, parIdColumn16 }); + towWartoscTable.PrimaryKey = pK_TOWWARTOSC; + var pK_TOWWARTOSCUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowWartosc", + new[] { "TowId", "ParId" }); + pK_TOWWARTOSC.MappedKeys.Add(pK_TOWWARTOSCUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWWARTOSCUc).Add(pK_TOWWARTOSC); + towWartoscTable.UniqueConstraints.Add("PK_TOWWARTOSC", pK_TOWWARTOSC); + var idx_TowWartParIdWart = new TableIndex( + "idx_TowWartParIdWart", towWartoscTable, new[] { parIdColumn16, wartoscColumn19 }, false); + var idx_TowWartParIdWartIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowWartosc", + "idx_TowWartParIdWart"); + idx_TowWartParIdWart.MappedIndexes.Add(idx_TowWartParIdWartIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowWartParIdWartIx).Add(idx_TowWartParIdWart); + towWartoscTable.Indexes.Add("idx_TowWartParIdWart", idx_TowWartParIdWart); + relationalModel.Tables.Add(("TowWartosc", null), towWartoscTable); + var towWartoscTableMapping = new TableMapping(towWartosc, towWartoscTable, true); + towWartoscTable.AddTypeMapping(towWartoscTableMapping, false); + tableMappings283.Add(towWartoscTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn16, towWartosc.FindProperty("ParId")!, towWartoscTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn32, towWartosc.FindProperty("TowId")!, towWartoscTableMapping); + RelationalModel.CreateColumnMapping(wartoscColumn19, towWartosc.FindProperty("Wartosc")!, towWartoscTableMapping); + + var towZamiennik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik")!; + + var defaultTableMappings284 = new List>(); + towZamiennik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings284); + var blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik", null, relationalModel); + var towIdColumnBase33 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase.Columns.Add("TowId", towIdColumnBase33); + var zmIdColumnBase1 = new ColumnBase("ZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase.Columns.Add("ZmId", zmIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik", blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowZamiennikMappingBase = new TableMappingBase(towZamiennik, blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowZamiennikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowZamiennikMappingBase, false); + defaultTableMappings284.Add(blinkBackofficeServicesPcmDbEntitiesTowZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase33, towZamiennik.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmIdColumnBase1, towZamiennik.FindProperty("ZmId")!, blinkBackofficeServicesPcmDbEntitiesTowZamiennikMappingBase); + + var tableMappings284 = new List(); + towZamiennik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings284); + var towZamiennikTable = new Table("TowZamiennik", null, relationalModel); + var towIdColumn33 = new Column("TowId", "numeric(9,0)", towZamiennikTable); + towZamiennikTable.Columns.Add("TowId", towIdColumn33); + var zmIdColumn1 = new Column("ZmId", "numeric(9,0)", towZamiennikTable); + towZamiennikTable.Columns.Add("ZmId", zmIdColumn1); + var pK_TOWZAMIENNIK = new UniqueConstraint("PK_TOWZAMIENNIK", towZamiennikTable, new[] { towIdColumn33 }); + towZamiennikTable.PrimaryKey = pK_TOWZAMIENNIK; + var pK_TOWZAMIENNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik", + new[] { "TowId" }); + pK_TOWZAMIENNIK.MappedKeys.Add(pK_TOWZAMIENNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWZAMIENNIKUc).Add(pK_TOWZAMIENNIK); + towZamiennikTable.UniqueConstraints.Add("PK_TOWZAMIENNIK", pK_TOWZAMIENNIK); + var iX_TowZamiennik_ZmId = new TableIndex( + "IX_TowZamiennik_ZmId", towZamiennikTable, new[] { zmIdColumn1 }, false); + var iX_TowZamiennik_ZmIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik", + new[] { "ZmId" }); + iX_TowZamiennik_ZmId.MappedIndexes.Add(iX_TowZamiennik_ZmIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_TowZamiennik_ZmIdIx).Add(iX_TowZamiennik_ZmId); + towZamiennikTable.Indexes.Add("IX_TowZamiennik_ZmId", iX_TowZamiennik_ZmId); + relationalModel.Tables.Add(("TowZamiennik", null), towZamiennikTable); + var towZamiennikTableMapping = new TableMapping(towZamiennik, towZamiennikTable, true); + towZamiennikTable.AddTypeMapping(towZamiennikTableMapping, false); + tableMappings284.Add(towZamiennikTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn33, towZamiennik.FindProperty("TowId")!, towZamiennikTableMapping); + RelationalModel.CreateColumnMapping(zmIdColumn1, towZamiennik.FindProperty("ZmId")!, towZamiennikTableMapping); + + var towZdjecia = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowZdjecia")!; + + var defaultTableMappings285 = new List>(); + towZdjecia.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings285); + var blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowZdjecia", null, relationalModel); + var kolejnoscColumnBase64 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase64); + var towIdColumnBase34 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase.Columns.Add("TowId", towIdColumnBase34); + var zasobIdColumnBase4 = new ColumnBase("ZasobId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase.Columns.Add("ZasobId", zasobIdColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowZdjecia", blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowZdjeciaMappingBase = new TableMappingBase(towZdjecia, blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowZdjeciaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowZdjeciaMappingBase, false); + defaultTableMappings285.Add(blinkBackofficeServicesPcmDbEntitiesTowZdjeciaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase64, towZdjecia.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesTowZdjeciaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase34, towZdjecia.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowZdjeciaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zasobIdColumnBase4, towZdjecia.FindProperty("ZasobId")!, blinkBackofficeServicesPcmDbEntitiesTowZdjeciaMappingBase); + + var tableMappings285 = new List(); + towZdjecia.SetRuntimeAnnotation("Relational:TableMappings", tableMappings285); + var towZdjeciaTable = new Table("TowZdjecia", null, relationalModel); + var towIdColumn34 = new Column("TowId", "numeric(9,0)", towZdjeciaTable); + towZdjeciaTable.Columns.Add("TowId", towIdColumn34); + var kolejnoscColumn64 = new Column("Kolejnosc", "smallint", towZdjeciaTable); + towZdjeciaTable.Columns.Add("Kolejnosc", kolejnoscColumn64); + var zasobIdColumn4 = new Column("ZasobId", "numeric(9,0)", towZdjeciaTable); + towZdjeciaTable.Columns.Add("ZasobId", zasobIdColumn4); + var pK_TowZdjecia = new UniqueConstraint("PK_TowZdjecia", towZdjeciaTable, new[] { towIdColumn34, kolejnoscColumn64 }); + towZdjeciaTable.PrimaryKey = pK_TowZdjecia; + var pK_TowZdjeciaUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowZdjecia", + new[] { "TowId", "Kolejnosc" }); + pK_TowZdjecia.MappedKeys.Add(pK_TowZdjeciaUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TowZdjeciaUc).Add(pK_TowZdjecia); + towZdjeciaTable.UniqueConstraints.Add("PK_TowZdjecia", pK_TowZdjecia); + var idx_TowZdjecia_ZasobId = new TableIndex( + "idx_TowZdjecia_ZasobId", towZdjeciaTable, new[] { zasobIdColumn4 }, false); + var idx_TowZdjecia_ZasobIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowZdjecia", + "idx_TowZdjecia_ZasobId"); + idx_TowZdjecia_ZasobId.MappedIndexes.Add(idx_TowZdjecia_ZasobIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowZdjecia_ZasobIdIx).Add(idx_TowZdjecia_ZasobId); + towZdjeciaTable.Indexes.Add("idx_TowZdjecia_ZasobId", idx_TowZdjecia_ZasobId); + relationalModel.Tables.Add(("TowZdjecia", null), towZdjeciaTable); + var towZdjeciaTableMapping = new TableMapping(towZdjecia, towZdjeciaTable, true); + towZdjeciaTable.AddTypeMapping(towZdjeciaTableMapping, false); + tableMappings285.Add(towZdjeciaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn64, towZdjecia.FindProperty("Kolejnosc")!, towZdjeciaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn34, towZdjecia.FindProperty("TowId")!, towZdjeciaTableMapping); + RelationalModel.CreateColumnMapping(zasobIdColumn4, towZdjecia.FindProperty("ZasobId")!, towZdjeciaTableMapping); + + var towar = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Towar")!; + + var defaultTableMappings286 = new List>(); + towar.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings286); + var blinkBackofficeServicesPcmDbEntitiesTowarTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Towar", null, relationalModel); + var akcyzowyColumnBase0 = new ColumnBase("Akcyzowy", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Akcyzowy", akcyzowyColumnBase0); + var aktywnyColumnBase48 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Aktywny", aktywnyColumnBase48); + var artIdColumnBase0 = new ColumnBase("ArtId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("ArtId", artIdColumnBase0); + var asIdColumnBase2 = new ColumnBase("AsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("AsId", asIdColumnBase2); + var blokCenSpColumnBase0 = new ColumnBase("BlokCenSp", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("BlokCenSp", blokCenSpColumnBase0); + var blokCenyZakColumnBase0 = new ColumnBase("BlokCenyZak", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("BlokCenyZak", blokCenyZakColumnBase0); + var blokDostawcowColumnBase0 = new ColumnBase("BlokDostawcow", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("BlokDostawcow", blokDostawcowColumnBase0); + var blokZmianColumnBase0 = new ColumnBase("BlokZmian", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("BlokZmian", blokZmianColumnBase0); + var cKUColumnBase1 = new ColumnBase("CKU", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CKU", cKUColumnBase1); + var cena5ColumnBase1 = new ColumnBase("Cena5", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Cena5", cena5ColumnBase1); + var cena6ColumnBase1 = new ColumnBase("Cena6", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Cena6", cena6ColumnBase1); + var cenaDetColumnBase4 = new ColumnBase("CenaDet", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CenaDet", cenaDetColumnBase4); + var cenaDodColumnBase2 = new ColumnBase("CenaDod", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CenaDod", cenaDodColumnBase2); + var cenaEwColumnBase0 = new ColumnBase("CenaEw", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CenaEw", cenaEwColumnBase0); + var cenaHurtColumnBase2 = new ColumnBase("CenaHurt", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CenaHurt", cenaHurtColumnBase2); + var cenaNocColumnBase2 = new ColumnBase("CenaNoc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CenaNoc", cenaNocColumnBase2); + var cenaOtwartaColumnBase1 = new ColumnBase("CenaOtwarta", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CenaOtwarta", cenaOtwartaColumnBase1); + var centrTowIdColumnBase0 = new ColumnBase("CentrTowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("CentrTowId", centrTowIdColumnBase0); + var glebokoscColumnBase0 = new ColumnBase("Glebokosc", "int", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Glebokosc", glebokoscColumnBase0); + var grupaGTUColumnBase2 = new ColumnBase("GrupaGTU", "varchar(3)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("GrupaGTU", grupaGTUColumnBase2); + var hurtRabatColumnBase1 = new ColumnBase("HurtRabat", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("HurtRabat", hurtRabatColumnBase1); + var ileWCalosciColumnBase0 = new ColumnBase("IleWCalosci", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("IleWCalosci", ileWCalosciColumnBase0); + var ileWZgrzewceColumnBase5 = new ColumnBase("IleWZgrzewce", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("IleWZgrzewce", ileWZgrzewceColumnBase5); + var indeks1ColumnBase2 = new ColumnBase("Indeks1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Indeks1", indeks1ColumnBase2); + var indeks2ColumnBase2 = new ColumnBase("Indeks2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Indeks2", indeks2ColumnBase2); + var jMIdColumnBase1 = new ColumnBase("JMId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("JMId", jMIdColumnBase1); + var katIdColumnBase1 = new ColumnBase("KatId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("KatId", katIdColumnBase1); + var kodColumnBase17 = new ColumnBase("Kod", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Kod", kodColumnBase17); + var kodCNColumnBase2 = new ColumnBase("KodCN", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("KodCN", kodCNColumnBase2); + var kodGlownyCentralnyColumnBase = new ColumnBase("KodGlownyCentralny", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("KodGlownyCentralny", kodGlownyCentralnyColumnBase); + var kodSklepuColumnBase0 = new ColumnBase("KodSklepu", "varchar(30)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("KodSklepu", kodSklepuColumnBase0); + var kodZgrzewkiColumnBase0 = new ColumnBase("KodZgrzewki", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("KodZgrzewki", kodZgrzewkiColumnBase0); + var krajIdPochodzeniaColumnBase = new ColumnBase("KrajIdPochodzenia", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("KrajIdPochodzenia", krajIdPochodzeniaColumnBase); + var marzaColumnBase1 = new ColumnBase("Marza", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Marza", marzaColumnBase1); + var maxCenaZakColumnBase0 = new ColumnBase("MaxCenaZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("MaxCenaZak", maxCenaZakColumnBase0); + var minCenaSpColumnBase0 = new ColumnBase("MinCenaSp", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("MinCenaSp", minCenaSpColumnBase0); + var nazwaColumnBase59 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Nazwa", nazwaColumnBase59); + var nocNarzutColumnBase1 = new ColumnBase("NocNarzut", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("NocNarzut", nocNarzutColumnBase1); + var nowoscOdColumnBase0 = new ColumnBase("NowoscOd", "datetime", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("NowoscOd", nowoscOdColumnBase0); + var nowoscPrzezColumnBase0 = new ColumnBase("NowoscPrzez", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("NowoscPrzez", nowoscPrzezColumnBase0); + var nrDrukarkiColumnBase0 = new ColumnBase("NrDrukarki", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("NrDrukarki", nrDrukarkiColumnBase0); + var obslugaPartiiColumnBase0 = new ColumnBase("ObslugaPartii", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("ObslugaPartii", obslugaPartiiColumnBase0); + var opcjaMarzyColumnBase1 = new ColumnBase("OpcjaMarzy", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("OpcjaMarzy", opcjaMarzyColumnBase1); + var opcjaNarzutuColumnBase1 = new ColumnBase("OpcjaNarzutu", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("OpcjaNarzutu", opcjaNarzutuColumnBase1); + var opcjaRabatuColumnBase1 = new ColumnBase("OpcjaRabatu", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("OpcjaRabatu", opcjaRabatuColumnBase1); + var opis1ColumnBase4 = new ColumnBase("Opis1", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Opis1", opis1ColumnBase4); + var opis2ColumnBase4 = new ColumnBase("Opis2", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Opis2", opis2ColumnBase4); + var opis3ColumnBase2 = new ColumnBase("Opis3", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Opis3", opis3ColumnBase2); + var opis4ColumnBase2 = new ColumnBase("Opis4", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Opis4", opis4ColumnBase2); + var poziomCenColumnBase7 = new ColumnBase("PoziomCen", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("PoziomCen", poziomCenColumnBase7); + var prefPLUColumnBase1 = new ColumnBase("PrefPLU", "int", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("PrefPLU", prefPLUColumnBase1); + var producentColumnBase1 = new ColumnBase("Producent", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Producent", producentColumnBase1); + var progPromocjiColumnBase1 = new ColumnBase("ProgPromocji", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("ProgPromocji", progPromocjiColumnBase1); + var przeliczJMColumnBase0 = new ColumnBase("PrzeliczJM", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("PrzeliczJM", przeliczJMColumnBase0); + var przeznaczenieColumnBase0 = new ColumnBase("Przeznaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Przeznaczenie", przeznaczenieColumnBase0); + var rezerwa1ColumnBase2 = new ColumnBase("Rezerwa1", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Rezerwa1", rezerwa1ColumnBase2); + var rezerwa2ColumnBase2 = new ColumnBase("Rezerwa2", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Rezerwa2", rezerwa2ColumnBase2); + var skrotColumnBase6 = new ColumnBase("Skrot", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Skrot", skrotColumnBase6); + var sledzPartiiColumnBase0 = new ColumnBase("SledzPartii", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("SledzPartii", sledzPartiiColumnBase0); + var statusZamColumnBase2 = new ColumnBase("StatusZam", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("StatusZam", statusZamColumnBase2); + var stawkaColumnBase15 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Stawka", stawkaColumnBase15); + var subsysKoduGlownegoColumnBase = new ColumnBase("SubsysKoduGlownego", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("SubsysKoduGlownego", subsysKoduGlownegoColumnBase); + var szerokoscColumnBase0 = new ColumnBase("Szerokosc", "int", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Szerokosc", szerokoscColumnBase0); + var termWaznColumnBase1 = new ColumnBase("TermWazn", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("TermWazn", termWaznColumnBase1); + var towIdColumnBase35 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("TowId", towIdColumnBase35); + var typTowaruColumnBase4 = new ColumnBase("TypTowaru", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("TypTowaru", typTowaruColumnBase4); + var ukrycNaKasieColumnBase1 = new ColumnBase("UkrycNaKasie", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("UkrycNaKasie", ukrycNaKasieColumnBase1); + var wagaColumnBase0 = new ColumnBase("Waga", "int", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Waga", wagaColumnBase0); + var wysokoscColumnBase0 = new ColumnBase("Wysokosc", "int", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Wysokosc", wysokoscColumnBase0); + var wysylacNaSklepInternetowyColumnBase0 = new ColumnBase("WysylacNaSklepInternetowy", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("WysylacNaSklepInternetowy", wysylacNaSklepInternetowyColumnBase0); + var zmianaColumnBase62 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Zmiana", zmianaColumnBase62); + var zmianaIstotnaColumnBase1 = new ColumnBase("ZmianaIstotna", "datetime", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("ZmianaIstotna", zmianaIstotnaColumnBase1); + var zmianaTylkoCenColumnBase0 = new ColumnBase("ZmianaTylkoCen", "datetime", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("ZmianaTylkoCen", zmianaTylkoCenColumnBase0); + var zywnoscColumnBase0 = new ColumnBase("Zywnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.Columns.Add("Zywnosc", zywnoscColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Towar", blinkBackofficeServicesPcmDbEntitiesTowarTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowarMappingBase = new TableMappingBase(towar, blinkBackofficeServicesPcmDbEntitiesTowarTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowarTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowarMappingBase, false); + defaultTableMappings286.Add(blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase35, towar.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akcyzowyColumnBase0, towar.FindProperty("Akcyzowy")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase48, towar.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)artIdColumnBase0, towar.FindProperty("ArtId")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asIdColumnBase2, towar.FindProperty("AsId")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokCenSpColumnBase0, towar.FindProperty("BlokCenSp")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokCenyZakColumnBase0, towar.FindProperty("BlokCenyZak")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokDostawcowColumnBase0, towar.FindProperty("BlokDostawcow")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)blokZmianColumnBase0, towar.FindProperty("BlokZmian")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cKUColumnBase1, towar.FindProperty("CKU")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena5ColumnBase1, towar.FindProperty("Cena5")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cena6ColumnBase1, towar.FindProperty("Cena6")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDetColumnBase4, towar.FindProperty("CenaDet")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaDodColumnBase2, towar.FindProperty("CenaDod")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaEwColumnBase0, towar.FindProperty("CenaEw")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaHurtColumnBase2, towar.FindProperty("CenaHurt")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaNocColumnBase2, towar.FindProperty("CenaNoc")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaOtwartaColumnBase1, towar.FindProperty("CenaOtwarta")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrTowIdColumnBase0, towar.FindProperty("CentrTowId")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)glebokoscColumnBase0, towar.FindProperty("Glebokosc")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupaGTUColumnBase2, towar.FindProperty("GrupaGTU")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hurtRabatColumnBase1, towar.FindProperty("HurtRabat")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWCalosciColumnBase0, towar.FindProperty("IleWCalosci")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ileWZgrzewceColumnBase5, towar.FindProperty("IleWZgrzewce")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks1ColumnBase2, towar.FindProperty("Indeks1")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)indeks2ColumnBase2, towar.FindProperty("Indeks2")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jMIdColumnBase1, towar.FindProperty("JMId")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)katIdColumnBase1, towar.FindProperty("KatId")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase17, towar.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodCNColumnBase2, towar.FindProperty("KodCN")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodGlownyCentralnyColumnBase, towar.FindProperty("KodGlownyCentralny")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodSklepuColumnBase0, towar.FindProperty("KodSklepu")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodZgrzewkiColumnBase0, towar.FindProperty("KodZgrzewki")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)krajIdPochodzeniaColumnBase, towar.FindProperty("KrajIdPochodzenia")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)marzaColumnBase1, towar.FindProperty("Marza")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)maxCenaZakColumnBase0, towar.FindProperty("MaxCenaZak")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)minCenaSpColumnBase0, towar.FindProperty("MinCenaSp")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase59, towar.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nocNarzutColumnBase1, towar.FindProperty("NocNarzut")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nowoscOdColumnBase0, towar.FindProperty("NowoscOd")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nowoscPrzezColumnBase0, towar.FindProperty("NowoscPrzez")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrDrukarkiColumnBase0, towar.FindProperty("NrDrukarki")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)obslugaPartiiColumnBase0, towar.FindProperty("ObslugaPartii")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaMarzyColumnBase1, towar.FindProperty("OpcjaMarzy")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaNarzutuColumnBase1, towar.FindProperty("OpcjaNarzutu")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opcjaRabatuColumnBase1, towar.FindProperty("OpcjaRabatu")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis1ColumnBase4, towar.FindProperty("Opis1")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis2ColumnBase4, towar.FindProperty("Opis2")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis3ColumnBase2, towar.FindProperty("Opis3")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opis4ColumnBase2, towar.FindProperty("Opis4")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poziomCenColumnBase7, towar.FindProperty("PoziomCen")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)prefPLUColumnBase1, towar.FindProperty("PrefPLU")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)producentColumnBase1, towar.FindProperty("Producent")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)progPromocjiColumnBase1, towar.FindProperty("ProgPromocji")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przeliczJMColumnBase0, towar.FindProperty("PrzeliczJM")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)przeznaczenieColumnBase0, towar.FindProperty("Przeznaczenie")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa1ColumnBase2, towar.FindProperty("Rezerwa1")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rezerwa2ColumnBase2, towar.FindProperty("Rezerwa2")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrotColumnBase6, towar.FindProperty("Skrot")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sledzPartiiColumnBase0, towar.FindProperty("SledzPartii")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusZamColumnBase2, towar.FindProperty("StatusZam")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase15, towar.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)subsysKoduGlownegoColumnBase, towar.FindProperty("SubsysKoduGlownego")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)szerokoscColumnBase0, towar.FindProperty("Szerokosc")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)termWaznColumnBase1, towar.FindProperty("TermWazn")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typTowaruColumnBase4, towar.FindProperty("TypTowaru")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ukrycNaKasieColumnBase1, towar.FindProperty("UkrycNaKasie")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wagaColumnBase0, towar.FindProperty("Waga")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wysokoscColumnBase0, towar.FindProperty("Wysokosc")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wysylacNaSklepInternetowyColumnBase0, towar.FindProperty("WysylacNaSklepInternetowy")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase62, towar.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaIstotnaColumnBase1, towar.FindProperty("ZmianaIstotna")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaTylkoCenColumnBase0, towar.FindProperty("ZmianaTylkoCen")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zywnoscColumnBase0, towar.FindProperty("Zywnosc")!, blinkBackofficeServicesPcmDbEntitiesTowarMappingBase); + + var tableMappings286 = new List(); + towar.SetRuntimeAnnotation("Relational:TableMappings", tableMappings286); + var towarTable = new Table("Towar", null, relationalModel); + var towIdColumn35 = new Column("TowId", "numeric(9,0)", towarTable); + towarTable.Columns.Add("TowId", towIdColumn35); + var akcyzowyColumn0 = new Column("Akcyzowy", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("Akcyzowy", akcyzowyColumn0); + var aktywnyColumn48 = new Column("Aktywny", "smallint", towarTable); + towarTable.Columns.Add("Aktywny", aktywnyColumn48); + var artIdColumn0 = new Column("ArtId", "numeric(9,0)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("ArtId", artIdColumn0); + var asIdColumn2 = new Column("AsId", "numeric(9,0)", towarTable); + towarTable.Columns.Add("AsId", asIdColumn2); + var blokCenSpColumn0 = new Column("BlokCenSp", "smallint", towarTable); + towarTable.Columns.Add("BlokCenSp", blokCenSpColumn0); + var blokCenyZakColumn0 = new Column("BlokCenyZak", "smallint", towarTable); + towarTable.Columns.Add("BlokCenyZak", blokCenyZakColumn0); + var blokDostawcowColumn0 = new Column("BlokDostawcow", "smallint", towarTable); + towarTable.Columns.Add("BlokDostawcow", blokDostawcowColumn0); + var blokZmianColumn0 = new Column("BlokZmian", "smallint", towarTable); + towarTable.Columns.Add("BlokZmian", blokZmianColumn0); + var cKUColumn1 = new Column("CKU", "varchar(20)", towarTable); + towarTable.Columns.Add("CKU", cKUColumn1); + var cena5Column1 = new Column("Cena5", "decimal(15,4)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("Cena5", cena5Column1); + var cena6Column1 = new Column("Cena6", "decimal(15,4)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("Cena6", cena6Column1); + var cenaDetColumn4 = new Column("CenaDet", "decimal(15,4)", towarTable); + towarTable.Columns.Add("CenaDet", cenaDetColumn4); + var cenaDodColumn2 = new Column("CenaDod", "decimal(15,4)", towarTable); + towarTable.Columns.Add("CenaDod", cenaDodColumn2); + var cenaEwColumn0 = new Column("CenaEw", "decimal(15,4)", towarTable); + towarTable.Columns.Add("CenaEw", cenaEwColumn0); + var cenaHurtColumn2 = new Column("CenaHurt", "decimal(15,4)", towarTable); + towarTable.Columns.Add("CenaHurt", cenaHurtColumn2); + var cenaNocColumn2 = new Column("CenaNoc", "decimal(15,4)", towarTable); + towarTable.Columns.Add("CenaNoc", cenaNocColumn2); + var cenaOtwartaColumn1 = new Column("CenaOtwarta", "smallint", towarTable); + towarTable.Columns.Add("CenaOtwarta", cenaOtwartaColumn1); + var centrTowIdColumn0 = new Column("CentrTowId", "numeric(9,0)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("CentrTowId", centrTowIdColumn0); + var glebokoscColumn0 = new Column("Glebokosc", "int", towarTable); + towarTable.Columns.Add("Glebokosc", glebokoscColumn0); + var grupaGTUColumn2 = new Column("GrupaGTU", "varchar(3)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("GrupaGTU", grupaGTUColumn2); + var hurtRabatColumn1 = new Column("HurtRabat", "decimal(10,4)", towarTable); + towarTable.Columns.Add("HurtRabat", hurtRabatColumn1); + var ileWCalosciColumn0 = new Column("IleWCalosci", "decimal(15,4)", towarTable); + towarTable.Columns.Add("IleWCalosci", ileWCalosciColumn0); + var ileWZgrzewceColumn5 = new Column("IleWZgrzewce", "decimal(15,4)", towarTable); + towarTable.Columns.Add("IleWZgrzewce", ileWZgrzewceColumn5); + var indeks1Column2 = new Column("Indeks1", "varchar(40)", towarTable); + towarTable.Columns.Add("Indeks1", indeks1Column2); + var indeks2Column2 = new Column("Indeks2", "varchar(40)", towarTable); + towarTable.Columns.Add("Indeks2", indeks2Column2); + var jMIdColumn1 = new Column("JMId", "numeric(9,0)", towarTable); + towarTable.Columns.Add("JMId", jMIdColumn1); + var katIdColumn1 = new Column("KatId", "numeric(9,0)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("KatId", katIdColumn1); + var kodColumn17 = new Column("Kod", "varchar(20)", towarTable); + towarTable.Columns.Add("Kod", kodColumn17); + var kodCNColumn2 = new Column("KodCN", "varchar(20)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("KodCN", kodCNColumn2); + var kodGlownyCentralnyColumn = new Column("KodGlownyCentralny", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("KodGlownyCentralny", kodGlownyCentralnyColumn); + var kodSklepuColumn0 = new Column("KodSklepu", "varchar(30)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("KodSklepu", kodSklepuColumn0); + var kodZgrzewkiColumn0 = new Column("KodZgrzewki", "varchar(20)", towarTable); + towarTable.Columns.Add("KodZgrzewki", kodZgrzewkiColumn0); + var krajIdPochodzeniaColumn = new Column("KrajIdPochodzenia", "numeric(9,0)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("KrajIdPochodzenia", krajIdPochodzeniaColumn); + var marzaColumn1 = new Column("Marza", "decimal(10,4)", towarTable); + towarTable.Columns.Add("Marza", marzaColumn1); + var maxCenaZakColumn0 = new Column("MaxCenaZak", "decimal(15,4)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("MaxCenaZak", maxCenaZakColumn0); + var minCenaSpColumn0 = new Column("MinCenaSp", "decimal(15,4)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("MinCenaSp", minCenaSpColumn0); + var nazwaColumn59 = new Column("Nazwa", "varchar(255)", towarTable); + towarTable.Columns.Add("Nazwa", nazwaColumn59); + var nocNarzutColumn1 = new Column("NocNarzut", "decimal(10,4)", towarTable); + towarTable.Columns.Add("NocNarzut", nocNarzutColumn1); + var nowoscOdColumn0 = new Column("NowoscOd", "datetime", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("NowoscOd", nowoscOdColumn0); + var nowoscPrzezColumn0 = new Column("NowoscPrzez", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("NowoscPrzez", nowoscPrzezColumn0); + var nrDrukarkiColumn0 = new Column("NrDrukarki", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("NrDrukarki", nrDrukarkiColumn0); + var obslugaPartiiColumn0 = new Column("ObslugaPartii", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("ObslugaPartii", obslugaPartiiColumn0); + var opcjaMarzyColumn1 = new Column("OpcjaMarzy", "smallint", towarTable); + towarTable.Columns.Add("OpcjaMarzy", opcjaMarzyColumn1); + var opcjaNarzutuColumn1 = new Column("OpcjaNarzutu", "smallint", towarTable); + towarTable.Columns.Add("OpcjaNarzutu", opcjaNarzutuColumn1); + var opcjaRabatuColumn1 = new Column("OpcjaRabatu", "smallint", towarTable); + towarTable.Columns.Add("OpcjaRabatu", opcjaRabatuColumn1); + var opis1Column4 = new Column("Opis1", "varchar(60)", towarTable); + towarTable.Columns.Add("Opis1", opis1Column4); + var opis2Column4 = new Column("Opis2", "varchar(60)", towarTable); + towarTable.Columns.Add("Opis2", opis2Column4); + var opis3Column2 = new Column("Opis3", "varchar(60)", towarTable); + towarTable.Columns.Add("Opis3", opis3Column2); + var opis4Column2 = new Column("Opis4", "varchar(60)", towarTable); + towarTable.Columns.Add("Opis4", opis4Column2); + var poziomCenColumn7 = new Column("PoziomCen", "smallint", towarTable); + towarTable.Columns.Add("PoziomCen", poziomCenColumn7); + var prefPLUColumn1 = new Column("PrefPLU", "int", towarTable); + towarTable.Columns.Add("PrefPLU", prefPLUColumn1); + var producentColumn1 = new Column("Producent", "numeric(9,0)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("Producent", producentColumn1); + var progPromocjiColumn1 = new Column("ProgPromocji", "decimal(15,4)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("ProgPromocji", progPromocjiColumn1); + var przeliczJMColumn0 = new Column("PrzeliczJM", "varchar(20)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("PrzeliczJM", przeliczJMColumn0); + var przeznaczenieColumn0 = new Column("Przeznaczenie", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("Przeznaczenie", przeznaczenieColumn0); + var rezerwa1Column2 = new Column("Rezerwa1", "varchar(40)", towarTable); + towarTable.Columns.Add("Rezerwa1", rezerwa1Column2); + var rezerwa2Column2 = new Column("Rezerwa2", "varchar(40)", towarTable); + towarTable.Columns.Add("Rezerwa2", rezerwa2Column2); + var skrotColumn6 = new Column("Skrot", "varchar(120)", towarTable); + towarTable.Columns.Add("Skrot", skrotColumn6); + var sledzPartiiColumn0 = new Column("SledzPartii", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("SledzPartii", sledzPartiiColumn0); + var statusZamColumn2 = new Column("StatusZam", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("StatusZam", statusZamColumn2); + var stawkaColumn15 = new Column("Stawka", "smallint", towarTable); + towarTable.Columns.Add("Stawka", stawkaColumn15); + var subsysKoduGlownegoColumn = new Column("SubsysKoduGlownego", "varchar(40)", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("SubsysKoduGlownego", subsysKoduGlownegoColumn); + var szerokoscColumn0 = new Column("Szerokosc", "int", towarTable); + towarTable.Columns.Add("Szerokosc", szerokoscColumn0); + var termWaznColumn1 = new Column("TermWazn", "smallint", towarTable); + towarTable.Columns.Add("TermWazn", termWaznColumn1); + var typTowaruColumn4 = new Column("TypTowaru", "smallint", towarTable); + towarTable.Columns.Add("TypTowaru", typTowaruColumn4); + var ukrycNaKasieColumn1 = new Column("UkrycNaKasie", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("UkrycNaKasie", ukrycNaKasieColumn1); + var wagaColumn0 = new Column("Waga", "int", towarTable); + towarTable.Columns.Add("Waga", wagaColumn0); + var wysokoscColumn0 = new Column("Wysokosc", "int", towarTable); + towarTable.Columns.Add("Wysokosc", wysokoscColumn0); + var wysylacNaSklepInternetowyColumn0 = new Column("WysylacNaSklepInternetowy", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("WysylacNaSklepInternetowy", wysylacNaSklepInternetowyColumn0); + var zmianaColumn62 = new Column("Zmiana", "datetime", towarTable); + towarTable.Columns.Add("Zmiana", zmianaColumn62); + var zmianaIstotnaColumn1 = new Column("ZmianaIstotna", "datetime", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("ZmianaIstotna", zmianaIstotnaColumn1); + var zmianaTylkoCenColumn0 = new Column("ZmianaTylkoCen", "datetime", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("ZmianaTylkoCen", zmianaTylkoCenColumn0); + var zywnoscColumn0 = new Column("Zywnosc", "smallint", towarTable) + { + IsNullable = true + }; + towarTable.Columns.Add("Zywnosc", zywnoscColumn0); + var pK_TOWAR = new UniqueConstraint("PK_TOWAR", towarTable, new[] { towIdColumn35 }); + towarTable.PrimaryKey = pK_TOWAR; + var pK_TOWARUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + pK_TOWAR.MappedKeys.Add(pK_TOWARUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWARUc).Add(pK_TOWAR); + towarTable.UniqueConstraints.Add("PK_TOWAR", pK_TOWAR); + var idx_TowArtId = new TableIndex( + "idx_TowArtId", towarTable, new[] { artIdColumn0 }, false); + var idx_TowArtIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowArtId"); + idx_TowArtId.MappedIndexes.Add(idx_TowArtIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowArtIdIx).Add(idx_TowArtId); + towarTable.Indexes.Add("idx_TowArtId", idx_TowArtId); + var idx_TowAsId = new TableIndex( + "idx_TowAsId", towarTable, new[] { asIdColumn2 }, false); + var idx_TowAsIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowAsId"); + idx_TowAsId.MappedIndexes.Add(idx_TowAsIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowAsIdIx).Add(idx_TowAsId); + towarTable.Indexes.Add("idx_TowAsId", idx_TowAsId); + var idx_TowCKU = new TableIndex( + "idx_TowCKU", towarTable, new[] { cKUColumn1 }, false); + var idx_TowCKUIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowCKU"); + idx_TowCKU.MappedIndexes.Add(idx_TowCKUIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowCKUIx).Add(idx_TowCKU); + towarTable.Indexes.Add("idx_TowCKU", idx_TowCKU); + var idx_TowJMId = new TableIndex( + "idx_TowJMId", towarTable, new[] { jMIdColumn1 }, false); + var idx_TowJMIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowJMId"); + idx_TowJMId.MappedIndexes.Add(idx_TowJMIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowJMIdIx).Add(idx_TowJMId); + towarTable.Indexes.Add("idx_TowJMId", idx_TowJMId); + var idx_TowKatId = new TableIndex( + "idx_TowKatId", towarTable, new[] { katIdColumn1 }, false); + var idx_TowKatIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowKatId"); + idx_TowKatId.MappedIndexes.Add(idx_TowKatIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowKatIdIx).Add(idx_TowKatId); + towarTable.Indexes.Add("idx_TowKatId", idx_TowKatId); + var idx_TowKod = new TableIndex( + "idx_TowKod", towarTable, new[] { kodColumn17 }, false); + var idx_TowKodIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowKod"); + idx_TowKod.MappedIndexes.Add(idx_TowKodIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowKodIx).Add(idx_TowKod); + towarTable.Indexes.Add("idx_TowKod", idx_TowKod); + var idx_TowKodZgrzewki = new TableIndex( + "idx_TowKodZgrzewki", towarTable, new[] { kodZgrzewkiColumn0 }, false); + var idx_TowKodZgrzewkiIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowKodZgrzewki"); + idx_TowKodZgrzewki.MappedIndexes.Add(idx_TowKodZgrzewkiIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowKodZgrzewkiIx).Add(idx_TowKodZgrzewki); + towarTable.Indexes.Add("idx_TowKodZgrzewki", idx_TowKodZgrzewki); + var idx_TowProducent = new TableIndex( + "idx_TowProducent", towarTable, new[] { producentColumn1 }, false); + var idx_TowProducentIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowProducent"); + idx_TowProducent.MappedIndexes.Add(idx_TowProducentIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowProducentIx).Add(idx_TowProducent); + towarTable.Indexes.Add("idx_TowProducent", idx_TowProducent); + var idx_TowSkrot = new TableIndex( + "idx_TowSkrot", towarTable, new[] { skrotColumn6 }, false); + var idx_TowSkrotIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowSkrot"); + idx_TowSkrot.MappedIndexes.Add(idx_TowSkrotIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowSkrotIx).Add(idx_TowSkrot); + towarTable.Indexes.Add("idx_TowSkrot", idx_TowSkrot); + var idx_TowZmiana = new TableIndex( + "idx_TowZmiana", towarTable, new[] { zmianaColumn62 }, false); + var idx_TowZmianaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + "idx_TowZmiana"); + idx_TowZmiana.MappedIndexes.Add(idx_TowZmianaIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowZmianaIx).Add(idx_TowZmiana); + towarTable.Indexes.Add("idx_TowZmiana", idx_TowZmiana); + var iX_Towar_KrajIdPochodzenia = new TableIndex( + "IX_Towar_KrajIdPochodzenia", towarTable, new[] { krajIdPochodzeniaColumn }, false); + var iX_Towar_KrajIdPochodzeniaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "KrajIdPochodzenia" }); + iX_Towar_KrajIdPochodzenia.MappedIndexes.Add(iX_Towar_KrajIdPochodzeniaIx); + RelationalModel.GetOrCreateTableIndexes(iX_Towar_KrajIdPochodzeniaIx).Add(iX_Towar_KrajIdPochodzenia); + towarTable.Indexes.Add("IX_Towar_KrajIdPochodzenia", iX_Towar_KrajIdPochodzenia); + relationalModel.Tables.Add(("Towar", null), towarTable); + var towarTableMapping = new TableMapping(towar, towarTable, true); + towarTable.AddTypeMapping(towarTableMapping, false); + tableMappings286.Add(towarTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn35, towar.FindProperty("TowId")!, towarTableMapping); + RelationalModel.CreateColumnMapping(akcyzowyColumn0, towar.FindProperty("Akcyzowy")!, towarTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn48, towar.FindProperty("Aktywny")!, towarTableMapping); + RelationalModel.CreateColumnMapping(artIdColumn0, towar.FindProperty("ArtId")!, towarTableMapping); + RelationalModel.CreateColumnMapping(asIdColumn2, towar.FindProperty("AsId")!, towarTableMapping); + RelationalModel.CreateColumnMapping(blokCenSpColumn0, towar.FindProperty("BlokCenSp")!, towarTableMapping); + RelationalModel.CreateColumnMapping(blokCenyZakColumn0, towar.FindProperty("BlokCenyZak")!, towarTableMapping); + RelationalModel.CreateColumnMapping(blokDostawcowColumn0, towar.FindProperty("BlokDostawcow")!, towarTableMapping); + RelationalModel.CreateColumnMapping(blokZmianColumn0, towar.FindProperty("BlokZmian")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cKUColumn1, towar.FindProperty("CKU")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cena5Column1, towar.FindProperty("Cena5")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cena6Column1, towar.FindProperty("Cena6")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cenaDetColumn4, towar.FindProperty("CenaDet")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cenaDodColumn2, towar.FindProperty("CenaDod")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cenaEwColumn0, towar.FindProperty("CenaEw")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cenaHurtColumn2, towar.FindProperty("CenaHurt")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cenaNocColumn2, towar.FindProperty("CenaNoc")!, towarTableMapping); + RelationalModel.CreateColumnMapping(cenaOtwartaColumn1, towar.FindProperty("CenaOtwarta")!, towarTableMapping); + RelationalModel.CreateColumnMapping(centrTowIdColumn0, towar.FindProperty("CentrTowId")!, towarTableMapping); + RelationalModel.CreateColumnMapping(glebokoscColumn0, towar.FindProperty("Glebokosc")!, towarTableMapping); + RelationalModel.CreateColumnMapping(grupaGTUColumn2, towar.FindProperty("GrupaGTU")!, towarTableMapping); + RelationalModel.CreateColumnMapping(hurtRabatColumn1, towar.FindProperty("HurtRabat")!, towarTableMapping); + RelationalModel.CreateColumnMapping(ileWCalosciColumn0, towar.FindProperty("IleWCalosci")!, towarTableMapping); + RelationalModel.CreateColumnMapping(ileWZgrzewceColumn5, towar.FindProperty("IleWZgrzewce")!, towarTableMapping); + RelationalModel.CreateColumnMapping(indeks1Column2, towar.FindProperty("Indeks1")!, towarTableMapping); + RelationalModel.CreateColumnMapping(indeks2Column2, towar.FindProperty("Indeks2")!, towarTableMapping); + RelationalModel.CreateColumnMapping(jMIdColumn1, towar.FindProperty("JMId")!, towarTableMapping); + RelationalModel.CreateColumnMapping(katIdColumn1, towar.FindProperty("KatId")!, towarTableMapping); + RelationalModel.CreateColumnMapping(kodColumn17, towar.FindProperty("Kod")!, towarTableMapping); + RelationalModel.CreateColumnMapping(kodCNColumn2, towar.FindProperty("KodCN")!, towarTableMapping); + RelationalModel.CreateColumnMapping(kodGlownyCentralnyColumn, towar.FindProperty("KodGlownyCentralny")!, towarTableMapping); + RelationalModel.CreateColumnMapping(kodSklepuColumn0, towar.FindProperty("KodSklepu")!, towarTableMapping); + RelationalModel.CreateColumnMapping(kodZgrzewkiColumn0, towar.FindProperty("KodZgrzewki")!, towarTableMapping); + RelationalModel.CreateColumnMapping(krajIdPochodzeniaColumn, towar.FindProperty("KrajIdPochodzenia")!, towarTableMapping); + RelationalModel.CreateColumnMapping(marzaColumn1, towar.FindProperty("Marza")!, towarTableMapping); + RelationalModel.CreateColumnMapping(maxCenaZakColumn0, towar.FindProperty("MaxCenaZak")!, towarTableMapping); + RelationalModel.CreateColumnMapping(minCenaSpColumn0, towar.FindProperty("MinCenaSp")!, towarTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn59, towar.FindProperty("Nazwa")!, towarTableMapping); + RelationalModel.CreateColumnMapping(nocNarzutColumn1, towar.FindProperty("NocNarzut")!, towarTableMapping); + RelationalModel.CreateColumnMapping(nowoscOdColumn0, towar.FindProperty("NowoscOd")!, towarTableMapping); + RelationalModel.CreateColumnMapping(nowoscPrzezColumn0, towar.FindProperty("NowoscPrzez")!, towarTableMapping); + RelationalModel.CreateColumnMapping(nrDrukarkiColumn0, towar.FindProperty("NrDrukarki")!, towarTableMapping); + RelationalModel.CreateColumnMapping(obslugaPartiiColumn0, towar.FindProperty("ObslugaPartii")!, towarTableMapping); + RelationalModel.CreateColumnMapping(opcjaMarzyColumn1, towar.FindProperty("OpcjaMarzy")!, towarTableMapping); + RelationalModel.CreateColumnMapping(opcjaNarzutuColumn1, towar.FindProperty("OpcjaNarzutu")!, towarTableMapping); + RelationalModel.CreateColumnMapping(opcjaRabatuColumn1, towar.FindProperty("OpcjaRabatu")!, towarTableMapping); + RelationalModel.CreateColumnMapping(opis1Column4, towar.FindProperty("Opis1")!, towarTableMapping); + RelationalModel.CreateColumnMapping(opis2Column4, towar.FindProperty("Opis2")!, towarTableMapping); + RelationalModel.CreateColumnMapping(opis3Column2, towar.FindProperty("Opis3")!, towarTableMapping); + RelationalModel.CreateColumnMapping(opis4Column2, towar.FindProperty("Opis4")!, towarTableMapping); + RelationalModel.CreateColumnMapping(poziomCenColumn7, towar.FindProperty("PoziomCen")!, towarTableMapping); + RelationalModel.CreateColumnMapping(prefPLUColumn1, towar.FindProperty("PrefPLU")!, towarTableMapping); + RelationalModel.CreateColumnMapping(producentColumn1, towar.FindProperty("Producent")!, towarTableMapping); + RelationalModel.CreateColumnMapping(progPromocjiColumn1, towar.FindProperty("ProgPromocji")!, towarTableMapping); + RelationalModel.CreateColumnMapping(przeliczJMColumn0, towar.FindProperty("PrzeliczJM")!, towarTableMapping); + RelationalModel.CreateColumnMapping(przeznaczenieColumn0, towar.FindProperty("Przeznaczenie")!, towarTableMapping); + RelationalModel.CreateColumnMapping(rezerwa1Column2, towar.FindProperty("Rezerwa1")!, towarTableMapping); + RelationalModel.CreateColumnMapping(rezerwa2Column2, towar.FindProperty("Rezerwa2")!, towarTableMapping); + RelationalModel.CreateColumnMapping(skrotColumn6, towar.FindProperty("Skrot")!, towarTableMapping); + RelationalModel.CreateColumnMapping(sledzPartiiColumn0, towar.FindProperty("SledzPartii")!, towarTableMapping); + RelationalModel.CreateColumnMapping(statusZamColumn2, towar.FindProperty("StatusZam")!, towarTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn15, towar.FindProperty("Stawka")!, towarTableMapping); + RelationalModel.CreateColumnMapping(subsysKoduGlownegoColumn, towar.FindProperty("SubsysKoduGlownego")!, towarTableMapping); + RelationalModel.CreateColumnMapping(szerokoscColumn0, towar.FindProperty("Szerokosc")!, towarTableMapping); + RelationalModel.CreateColumnMapping(termWaznColumn1, towar.FindProperty("TermWazn")!, towarTableMapping); + RelationalModel.CreateColumnMapping(typTowaruColumn4, towar.FindProperty("TypTowaru")!, towarTableMapping); + RelationalModel.CreateColumnMapping(ukrycNaKasieColumn1, towar.FindProperty("UkrycNaKasie")!, towarTableMapping); + RelationalModel.CreateColumnMapping(wagaColumn0, towar.FindProperty("Waga")!, towarTableMapping); + RelationalModel.CreateColumnMapping(wysokoscColumn0, towar.FindProperty("Wysokosc")!, towarTableMapping); + RelationalModel.CreateColumnMapping(wysylacNaSklepInternetowyColumn0, towar.FindProperty("WysylacNaSklepInternetowy")!, towarTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn62, towar.FindProperty("Zmiana")!, towarTableMapping); + RelationalModel.CreateColumnMapping(zmianaIstotnaColumn1, towar.FindProperty("ZmianaIstotna")!, towarTableMapping); + RelationalModel.CreateColumnMapping(zmianaTylkoCenColumn0, towar.FindProperty("ZmianaTylkoCen")!, towarTableMapping); + RelationalModel.CreateColumnMapping(zywnoscColumn0, towar.FindProperty("Zywnosc")!, towarTableMapping); + + var towarSkladnika = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika")!; + + var defaultTableMappings287 = new List>(); + towarSkladnika.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings287); + var blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", null, relationalModel); + var cenaColumnBase9 = new ColumnBase("Cena", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.Columns.Add("Cena", cenaColumnBase9); + var cenaZKartyTowColumnBase0 = new ColumnBase("CenaZKartyTow", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.Columns.Add("CenaZKartyTow", cenaZKartyTowColumnBase0); + var domyslnyColumnBase3 = new ColumnBase("Domyslny", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.Columns.Add("Domyslny", domyslnyColumnBase3); + var iloscColumnBase11 = new ColumnBase("Ilosc", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.Columns.Add("Ilosc", iloscColumnBase11); + var kolejnoscColumnBase65 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase65); + var skWzIdColumnBase1 = new ColumnBase("SkWzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.Columns.Add("SkWzId", skWzIdColumnBase1); + var towIdColumnBase36 = new ColumnBase("TowId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase); + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.Columns.Add("TowId", towIdColumnBase36); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase); + var blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase = new TableMappingBase(towarSkladnika, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase, false); + defaultTableMappings287.Add(blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skWzIdColumnBase1, towarSkladnika.FindProperty("SkWzId")!, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase36, towarSkladnika.FindProperty("TowId")!, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaColumnBase9, towarSkladnika.FindProperty("Cena")!, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cenaZKartyTowColumnBase0, towarSkladnika.FindProperty("CenaZKartyTow")!, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)domyslnyColumnBase3, towarSkladnika.FindProperty("Domyslny")!, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)iloscColumnBase11, towarSkladnika.FindProperty("Ilosc")!, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase65, towarSkladnika.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesTowarSkladnikaMappingBase); + + var tableMappings287 = new List(); + towarSkladnika.SetRuntimeAnnotation("Relational:TableMappings", tableMappings287); + var towarSkladnikaTable = new Table("TowarSkladnika", null, relationalModel); + var skWzIdColumn1 = new Column("SkWzId", "numeric(9,0)", towarSkladnikaTable); + towarSkladnikaTable.Columns.Add("SkWzId", skWzIdColumn1); + var towIdColumn36 = new Column("TowId", "numeric(9,0)", towarSkladnikaTable); + towarSkladnikaTable.Columns.Add("TowId", towIdColumn36); + var cenaColumn9 = new Column("Cena", "decimal(15,4)", towarSkladnikaTable) + { + IsNullable = true + }; + towarSkladnikaTable.Columns.Add("Cena", cenaColumn9); + var cenaZKartyTowColumn0 = new Column("CenaZKartyTow", "smallint", towarSkladnikaTable) + { + IsNullable = true + }; + towarSkladnikaTable.Columns.Add("CenaZKartyTow", cenaZKartyTowColumn0); + var domyslnyColumn3 = new Column("Domyslny", "smallint", towarSkladnikaTable) + { + IsNullable = true + }; + towarSkladnikaTable.Columns.Add("Domyslny", domyslnyColumn3); + var iloscColumn11 = new Column("Ilosc", "decimal(15,4)", towarSkladnikaTable) + { + IsNullable = true + }; + towarSkladnikaTable.Columns.Add("Ilosc", iloscColumn11); + var kolejnoscColumn65 = new Column("Kolejnosc", "smallint", towarSkladnikaTable); + towarSkladnikaTable.Columns.Add("Kolejnosc", kolejnoscColumn65); + var pK_TOWARSKLADNIKA = new UniqueConstraint("PK_TOWARSKLADNIKA", towarSkladnikaTable, new[] { skWzIdColumn1, towIdColumn36 }); + towarSkladnikaTable.PrimaryKey = pK_TOWARSKLADNIKA; + var pK_TOWARSKLADNIKAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", + new[] { "SkWzId", "TowId" }); + pK_TOWARSKLADNIKA.MappedKeys.Add(pK_TOWARSKLADNIKAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TOWARSKLADNIKAUc).Add(pK_TOWARSKLADNIKA); + towarSkladnikaTable.UniqueConstraints.Add("PK_TOWARSKLADNIKA", pK_TOWARSKLADNIKA); + var idx_TowarSkladniaka = new TableIndex( + "idx_TowarSkladniaka", towarSkladnikaTable, new[] { skWzIdColumn1 }, false); + var idx_TowarSkladniakaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", + "idx_TowarSkladniaka"); + idx_TowarSkladniaka.MappedIndexes.Add(idx_TowarSkladniakaIx); + RelationalModel.GetOrCreateTableIndexes(idx_TowarSkladniakaIx).Add(idx_TowarSkladniaka); + towarSkladnikaTable.Indexes.Add("idx_TowarSkladniaka", idx_TowarSkladniaka); + var iX_TowarSkladnika_TowId = new TableIndex( + "IX_TowarSkladnika_TowId", towarSkladnikaTable, new[] { towIdColumn36 }, false); + var iX_TowarSkladnika_TowIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", + new[] { "TowId" }); + iX_TowarSkladnika_TowId.MappedIndexes.Add(iX_TowarSkladnika_TowIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_TowarSkladnika_TowIdIx).Add(iX_TowarSkladnika_TowId); + towarSkladnikaTable.Indexes.Add("IX_TowarSkladnika_TowId", iX_TowarSkladnika_TowId); + relationalModel.Tables.Add(("TowarSkladnika", null), towarSkladnikaTable); + var towarSkladnikaTableMapping = new TableMapping(towarSkladnika, towarSkladnikaTable, true); + towarSkladnikaTable.AddTypeMapping(towarSkladnikaTableMapping, false); + tableMappings287.Add(towarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(skWzIdColumn1, towarSkladnika.FindProperty("SkWzId")!, towarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn36, towarSkladnika.FindProperty("TowId")!, towarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(cenaColumn9, towarSkladnika.FindProperty("Cena")!, towarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(cenaZKartyTowColumn0, towarSkladnika.FindProperty("CenaZKartyTow")!, towarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(domyslnyColumn3, towarSkladnika.FindProperty("Domyslny")!, towarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(iloscColumn11, towarSkladnika.FindProperty("Ilosc")!, towarSkladnikaTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn65, towarSkladnika.FindProperty("Kolejnosc")!, towarSkladnikaTableMapping); + + var trescEmail = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TrescEmail")!; + + var defaultTableMappings288 = new List>(); + trescEmail.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings288); + var blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", null, relationalModel); + var aktywnyColumnBase49 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase.Columns.Add("Aktywny", aktywnyColumnBase49); + var nazwaColumnBase60 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase.Columns.Add("Nazwa", nazwaColumnBase60); + var tEIdColumnBase = new ColumnBase("TEId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase.Columns.Add("TEId", tEIdColumnBase); + var uzIdColumnBase6 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase.Columns.Add("UzId", uzIdColumnBase6); + var zmianaColumnBase63 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase.Columns.Add("Zmiana", zmianaColumnBase63); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase); + var blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase = new TableMappingBase(trescEmail, blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase, false); + defaultTableMappings288.Add(blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tEIdColumnBase, trescEmail.FindProperty("TEId")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase49, trescEmail.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase60, trescEmail.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase6, trescEmail.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase63, trescEmail.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailMappingBase); + + var tableMappings288 = new List(); + trescEmail.SetRuntimeAnnotation("Relational:TableMappings", tableMappings288); + var trescEmailTable = new Table("TrescEmail", null, relationalModel); + var tEIdColumn = new Column("TEId", "numeric(9,0)", trescEmailTable); + trescEmailTable.Columns.Add("TEId", tEIdColumn); + var aktywnyColumn49 = new Column("Aktywny", "smallint", trescEmailTable); + trescEmailTable.Columns.Add("Aktywny", aktywnyColumn49); + var nazwaColumn60 = new Column("Nazwa", "varchar(60)", trescEmailTable); + trescEmailTable.Columns.Add("Nazwa", nazwaColumn60); + var uzIdColumn6 = new Column("UzId", "numeric(9,0)", trescEmailTable) + { + IsNullable = true + }; + trescEmailTable.Columns.Add("UzId", uzIdColumn6); + var zmianaColumn63 = new Column("Zmiana", "datetime", trescEmailTable); + trescEmailTable.Columns.Add("Zmiana", zmianaColumn63); + var pK_TrescEmail = new UniqueConstraint("PK_TrescEmail", trescEmailTable, new[] { tEIdColumn }); + trescEmailTable.PrimaryKey = pK_TrescEmail; + var pK_TrescEmailUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + new[] { "TEId" }); + pK_TrescEmail.MappedKeys.Add(pK_TrescEmailUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TrescEmailUc).Add(pK_TrescEmail); + trescEmailTable.UniqueConstraints.Add("PK_TrescEmail", pK_TrescEmail); + var iX_TrescEmail_UzId = new TableIndex( + "IX_TrescEmail_UzId", trescEmailTable, new[] { uzIdColumn6 }, false); + var iX_TrescEmail_UzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + new[] { "UzId" }); + iX_TrescEmail_UzId.MappedIndexes.Add(iX_TrescEmail_UzIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_TrescEmail_UzIdIx).Add(iX_TrescEmail_UzId); + trescEmailTable.Indexes.Add("IX_TrescEmail_UzId", iX_TrescEmail_UzId); + relationalModel.Tables.Add(("TrescEmail", null), trescEmailTable); + var trescEmailTableMapping = new TableMapping(trescEmail, trescEmailTable, true); + trescEmailTable.AddTypeMapping(trescEmailTableMapping, false); + tableMappings288.Add(trescEmailTableMapping); + RelationalModel.CreateColumnMapping(tEIdColumn, trescEmail.FindProperty("TEId")!, trescEmailTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn49, trescEmail.FindProperty("Aktywny")!, trescEmailTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn60, trescEmail.FindProperty("Nazwa")!, trescEmailTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn6, trescEmail.FindProperty("UzId")!, trescEmailTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn63, trescEmail.FindProperty("Zmiana")!, trescEmailTableMapping); + + var trescEmailTekst = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TrescEmailTekst")!; + + var defaultTableMappings289 = new List>(); + trescEmailTekst.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings289); + var blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TrescEmailTekst", null, relationalModel); + var kolejnoscColumnBase66 = new ColumnBase("Kolejnosc", "smallint", blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase66); + var tEIdColumnBase0 = new ColumnBase("TEId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase.Columns.Add("TEId", tEIdColumnBase0); + var trescColumnBase1 = new ColumnBase("Tresc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase.Columns.Add("Tresc", trescColumnBase1); + var znaczenieColumnBase42 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase.Columns.Add("Znaczenie", znaczenieColumnBase42); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TrescEmailTekst", blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase); + var blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstMappingBase = new TableMappingBase(trescEmailTekst, blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstMappingBase, false); + defaultTableMappings289.Add(blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase66, trescEmailTekst.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tEIdColumnBase0, trescEmailTekst.FindProperty("TEId")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase42, trescEmailTekst.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)trescColumnBase1, trescEmailTekst.FindProperty("Tresc")!, blinkBackofficeServicesPcmDbEntitiesTrescEmailTekstMappingBase); + + var tableMappings289 = new List(); + trescEmailTekst.SetRuntimeAnnotation("Relational:TableMappings", tableMappings289); + var trescEmailTekstTable = new Table("TrescEmailTekst", null, relationalModel); + var tEIdColumn0 = new Column("TEId", "numeric(9,0)", trescEmailTekstTable); + trescEmailTekstTable.Columns.Add("TEId", tEIdColumn0); + var kolejnoscColumn66 = new Column("Kolejnosc", "smallint", trescEmailTekstTable); + trescEmailTekstTable.Columns.Add("Kolejnosc", kolejnoscColumn66); + var znaczenieColumn42 = new Column("Znaczenie", "smallint", trescEmailTekstTable); + trescEmailTekstTable.Columns.Add("Znaczenie", znaczenieColumn42); + var trescColumn1 = new Column("Tresc", "varchar(255)", trescEmailTekstTable); + trescEmailTekstTable.Columns.Add("Tresc", trescColumn1); + var pK_TrescEmailTekst = new UniqueConstraint("PK_TrescEmailTekst", trescEmailTekstTable, new[] { tEIdColumn0, kolejnoscColumn66, znaczenieColumn42 }); + trescEmailTekstTable.PrimaryKey = pK_TrescEmailTekst; + var pK_TrescEmailTekstUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmailTekst", + new[] { "TEId", "Kolejnosc", "Znaczenie" }); + pK_TrescEmailTekst.MappedKeys.Add(pK_TrescEmailTekstUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TrescEmailTekstUc).Add(pK_TrescEmailTekst); + trescEmailTekstTable.UniqueConstraints.Add("PK_TrescEmailTekst", pK_TrescEmailTekst); + relationalModel.Tables.Add(("TrescEmailTekst", null), trescEmailTekstTable); + var trescEmailTekstTableMapping = new TableMapping(trescEmailTekst, trescEmailTekstTable, true); + trescEmailTekstTable.AddTypeMapping(trescEmailTekstTableMapping, false); + tableMappings289.Add(trescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn66, trescEmailTekst.FindProperty("Kolejnosc")!, trescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(tEIdColumn0, trescEmailTekst.FindProperty("TEId")!, trescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn42, trescEmailTekst.FindProperty("Znaczenie")!, trescEmailTekstTableMapping); + RelationalModel.CreateColumnMapping(trescColumn1, trescEmailTekst.FindProperty("Tresc")!, trescEmailTekstTableMapping); + + var typOs = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.TypOs")!; + + var defaultTableMappings290 = new List>(); + typOs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings290); + var blinkBackofficeServicesPcmDbEntitiesTypOsTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.TypOs", null, relationalModel); + var aktywnyColumnBase50 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.Columns.Add("Aktywny", aktywnyColumnBase50); + var centrTypOsIdColumnBase0 = new ColumnBase("CentrTypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.Columns.Add("CentrTypOsId", centrTypOsIdColumnBase0); + var komentarzColumnBase4 = new ColumnBase("Komentarz", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.Columns.Add("Komentarz", komentarzColumnBase4); + var narzucacColumnBase = new ColumnBase("Narzucac", "smallint", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.Columns.Add("Narzucac", narzucacColumnBase); + var nazwaColumnBase61 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.Columns.Add("Nazwa", nazwaColumnBase61); + var typOsIdColumnBase1 = new ColumnBase("TypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.Columns.Add("TypOsId", typOsIdColumnBase1); + var zmianaColumnBase64 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase); + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.Columns.Add("Zmiana", zmianaColumnBase64); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.TypOs", blinkBackofficeServicesPcmDbEntitiesTypOsTableBase); + var blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase = new TableMappingBase(typOs, blinkBackofficeServicesPcmDbEntitiesTypOsTableBase, true); + blinkBackofficeServicesPcmDbEntitiesTypOsTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase, false); + defaultTableMappings290.Add(blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typOsIdColumnBase1, typOs.FindProperty("TypOsId")!, blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase50, typOs.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrTypOsIdColumnBase0, typOs.FindProperty("CentrTypOsId")!, blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)komentarzColumnBase4, typOs.FindProperty("Komentarz")!, blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)narzucacColumnBase, typOs.FindProperty("Narzucac")!, blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase61, typOs.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase64, typOs.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesTypOsMappingBase); + + var tableMappings290 = new List(); + typOs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings290); + var typOsTable = new Table("TypOs", null, relationalModel); + var typOsIdColumn1 = new Column("TypOsId", "numeric(9,0)", typOsTable); + typOsTable.Columns.Add("TypOsId", typOsIdColumn1); + var aktywnyColumn50 = new Column("Aktywny", "smallint", typOsTable); + typOsTable.Columns.Add("Aktywny", aktywnyColumn50); + var centrTypOsIdColumn0 = new Column("CentrTypOsId", "numeric(9,0)", typOsTable) + { + IsNullable = true + }; + typOsTable.Columns.Add("CentrTypOsId", centrTypOsIdColumn0); + var komentarzColumn4 = new Column("Komentarz", "varchar(255)", typOsTable) + { + IsNullable = true + }; + typOsTable.Columns.Add("Komentarz", komentarzColumn4); + var narzucacColumn = new Column("Narzucac", "smallint", typOsTable) + { + IsNullable = true + }; + typOsTable.Columns.Add("Narzucac", narzucacColumn); + var nazwaColumn61 = new Column("Nazwa", "varchar(60)", typOsTable); + typOsTable.Columns.Add("Nazwa", nazwaColumn61); + var zmianaColumn64 = new Column("Zmiana", "datetime", typOsTable); + typOsTable.Columns.Add("Zmiana", zmianaColumn64); + var pK_TYPOS = new UniqueConstraint("PK_TYPOS", typOsTable, new[] { typOsIdColumn1 }); + typOsTable.PrimaryKey = pK_TYPOS; + var pK_TYPOSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TypOs", + new[] { "TypOsId" }); + pK_TYPOS.MappedKeys.Add(pK_TYPOSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_TYPOSUc).Add(pK_TYPOS); + typOsTable.UniqueConstraints.Add("PK_TYPOS", pK_TYPOS); + var idx_TYPOS_ZMIANA = new TableIndex( + "idx_TYPOS_ZMIANA", typOsTable, new[] { zmianaColumn64 }, false); + var idx_TYPOS_ZMIANAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.TypOs", + "idx_TYPOS_ZMIANA"); + idx_TYPOS_ZMIANA.MappedIndexes.Add(idx_TYPOS_ZMIANAIx); + RelationalModel.GetOrCreateTableIndexes(idx_TYPOS_ZMIANAIx).Add(idx_TYPOS_ZMIANA); + typOsTable.Indexes.Add("idx_TYPOS_ZMIANA", idx_TYPOS_ZMIANA); + relationalModel.Tables.Add(("TypOs", null), typOsTable); + var typOsTableMapping = new TableMapping(typOs, typOsTable, true); + typOsTable.AddTypeMapping(typOsTableMapping, false); + tableMappings290.Add(typOsTableMapping); + RelationalModel.CreateColumnMapping(typOsIdColumn1, typOs.FindProperty("TypOsId")!, typOsTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn50, typOs.FindProperty("Aktywny")!, typOsTableMapping); + RelationalModel.CreateColumnMapping(centrTypOsIdColumn0, typOs.FindProperty("CentrTypOsId")!, typOsTableMapping); + RelationalModel.CreateColumnMapping(komentarzColumn4, typOs.FindProperty("Komentarz")!, typOsTableMapping); + RelationalModel.CreateColumnMapping(narzucacColumn, typOs.FindProperty("Narzucac")!, typOsTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn61, typOs.FindProperty("Nazwa")!, typOsTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn64, typOs.FindProperty("Zmiana")!, typOsTableMapping); + + var ulica = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Ulica")!; + + var defaultTableMappings291 = new List>(); + ulica.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings291); + var blinkBackofficeServicesPcmDbEntitiesUlicaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Ulica", null, relationalModel); + var aktywnyColumnBase51 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesUlicaTableBase); + blinkBackofficeServicesPcmDbEntitiesUlicaTableBase.Columns.Add("Aktywny", aktywnyColumnBase51); + var mIdColumnBase0 = new ColumnBase("MId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUlicaTableBase); + blinkBackofficeServicesPcmDbEntitiesUlicaTableBase.Columns.Add("MId", mIdColumnBase0); + var nazwaColumnBase62 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesUlicaTableBase); + blinkBackofficeServicesPcmDbEntitiesUlicaTableBase.Columns.Add("Nazwa", nazwaColumnBase62); + var ulIdColumnBase = new ColumnBase("UlId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUlicaTableBase); + blinkBackofficeServicesPcmDbEntitiesUlicaTableBase.Columns.Add("UlId", ulIdColumnBase); + var zmianaColumnBase65 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesUlicaTableBase); + blinkBackofficeServicesPcmDbEntitiesUlicaTableBase.Columns.Add("Zmiana", zmianaColumnBase65); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Ulica", blinkBackofficeServicesPcmDbEntitiesUlicaTableBase); + var blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase = new TableMappingBase(ulica, blinkBackofficeServicesPcmDbEntitiesUlicaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesUlicaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase, false); + defaultTableMappings291.Add(blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ulIdColumnBase, ulica.FindProperty("UlId")!, blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase51, ulica.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)mIdColumnBase0, ulica.FindProperty("MId")!, blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase62, ulica.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase65, ulica.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesUlicaMappingBase); + + var tableMappings291 = new List(); + ulica.SetRuntimeAnnotation("Relational:TableMappings", tableMappings291); + var ulicaTable = new Table("Ulica", null, relationalModel); + var ulIdColumn = new Column("UlId", "numeric(9,0)", ulicaTable); + ulicaTable.Columns.Add("UlId", ulIdColumn); + var aktywnyColumn51 = new Column("Aktywny", "smallint", ulicaTable); + ulicaTable.Columns.Add("Aktywny", aktywnyColumn51); + var mIdColumn0 = new Column("MId", "numeric(9,0)", ulicaTable); + ulicaTable.Columns.Add("MId", mIdColumn0); + var nazwaColumn62 = new Column("Nazwa", "varchar(255)", ulicaTable); + ulicaTable.Columns.Add("Nazwa", nazwaColumn62); + var zmianaColumn65 = new Column("Zmiana", "datetime", ulicaTable); + ulicaTable.Columns.Add("Zmiana", zmianaColumn65); + var pK_Ulica = new UniqueConstraint("PK_Ulica", ulicaTable, new[] { ulIdColumn }); + ulicaTable.PrimaryKey = pK_Ulica; + var pK_UlicaUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Ulica", + new[] { "UlId" }); + pK_Ulica.MappedKeys.Add(pK_UlicaUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_UlicaUc).Add(pK_Ulica); + ulicaTable.UniqueConstraints.Add("PK_Ulica", pK_Ulica); + var iX_Ulica_MId = new TableIndex( + "IX_Ulica_MId", ulicaTable, new[] { mIdColumn0 }, false); + var iX_Ulica_MIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Ulica", + new[] { "MId" }); + iX_Ulica_MId.MappedIndexes.Add(iX_Ulica_MIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Ulica_MIdIx).Add(iX_Ulica_MId); + ulicaTable.Indexes.Add("IX_Ulica_MId", iX_Ulica_MId); + relationalModel.Tables.Add(("Ulica", null), ulicaTable); + var ulicaTableMapping = new TableMapping(ulica, ulicaTable, true); + ulicaTable.AddTypeMapping(ulicaTableMapping, false); + tableMappings291.Add(ulicaTableMapping); + RelationalModel.CreateColumnMapping(ulIdColumn, ulica.FindProperty("UlId")!, ulicaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn51, ulica.FindProperty("Aktywny")!, ulicaTableMapping); + RelationalModel.CreateColumnMapping(mIdColumn0, ulica.FindProperty("MId")!, ulicaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn62, ulica.FindProperty("Nazwa")!, ulicaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn65, ulica.FindProperty("Zmiana")!, ulicaTableMapping); + + var uprawnienie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Uprawnienie")!; + + var defaultTableMappings292 = new List>(); + uprawnienie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings292); + var blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Uprawnienie", null, relationalModel); + var jestColumnBase2 = new ColumnBase("Jest", "smallint", blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase.Columns.Add("Jest", jestColumnBase2); + var rodzajColumnBase13 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase.Columns.Add("Rodzaj", rodzajColumnBase13); + var uzIdColumnBase7 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase); + blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase.Columns.Add("UzId", uzIdColumnBase7); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Uprawnienie", blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase); + var blinkBackofficeServicesPcmDbEntitiesUprawnienieMappingBase = new TableMappingBase(uprawnienie, blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesUprawnienieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesUprawnienieMappingBase, false); + defaultTableMappings292.Add(blinkBackofficeServicesPcmDbEntitiesUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase13, uprawnienie.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase7, uprawnienie.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesUprawnienieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jestColumnBase2, uprawnienie.FindProperty("Jest")!, blinkBackofficeServicesPcmDbEntitiesUprawnienieMappingBase); + + var tableMappings292 = new List(); + uprawnienie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings292); + var uprawnienieTable = new Table("Uprawnienie", null, relationalModel); + var uzIdColumn7 = new Column("UzId", "numeric(9,0)", uprawnienieTable); + uprawnienieTable.Columns.Add("UzId", uzIdColumn7); + var rodzajColumn13 = new Column("Rodzaj", "smallint", uprawnienieTable); + uprawnienieTable.Columns.Add("Rodzaj", rodzajColumn13); + var jestColumn2 = new Column("Jest", "smallint", uprawnienieTable) + { + IsNullable = true + }; + uprawnienieTable.Columns.Add("Jest", jestColumn2); + var pK_UPRAWNIENIE = new UniqueConstraint("PK_UPRAWNIENIE", uprawnienieTable, new[] { uzIdColumn7, rodzajColumn13 }); + uprawnienieTable.PrimaryKey = pK_UPRAWNIENIE; + var pK_UPRAWNIENIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Uprawnienie", + new[] { "UzId", "Rodzaj" }); + pK_UPRAWNIENIE.MappedKeys.Add(pK_UPRAWNIENIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_UPRAWNIENIEUc).Add(pK_UPRAWNIENIE); + uprawnienieTable.UniqueConstraints.Add("PK_UPRAWNIENIE", pK_UPRAWNIENIE); + relationalModel.Tables.Add(("Uprawnienie", null), uprawnienieTable); + var uprawnienieTableMapping = new TableMapping(uprawnienie, uprawnienieTable, true); + uprawnienieTable.AddTypeMapping(uprawnienieTableMapping, false); + tableMappings292.Add(uprawnienieTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn13, uprawnienie.FindProperty("Rodzaj")!, uprawnienieTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn7, uprawnienie.FindProperty("UzId")!, uprawnienieTableMapping); + RelationalModel.CreateColumnMapping(jestColumn2, uprawnienie.FindProperty("Jest")!, uprawnienieTableMapping); + + var uprawnienieNaSklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.UprawnienieNaSklep")!; + + var defaultTableMappings293 = new List>(); + uprawnienieNaSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings293); + var blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.UprawnienieNaSklep", null, relationalModel); + var jestColumnBase3 = new ColumnBase("Jest", "smallint", blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase.Columns.Add("Jest", jestColumnBase3); + var rodzajColumnBase14 = new ColumnBase("Rodzaj", "smallint", blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase.Columns.Add("Rodzaj", rodzajColumnBase14); + var uzNSIdColumnBase1 = new ColumnBase("UzNSId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase.Columns.Add("UzNSId", uzNSIdColumnBase1); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.UprawnienieNaSklep", blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepMappingBase = new TableMappingBase(uprawnienieNaSklep, blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepMappingBase, false); + defaultTableMappings293.Add(blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rodzajColumnBase14, uprawnienieNaSklep.FindProperty("Rodzaj")!, blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzNSIdColumnBase1, uprawnienieNaSklep.FindProperty("UzNSId")!, blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jestColumnBase3, uprawnienieNaSklep.FindProperty("Jest")!, blinkBackofficeServicesPcmDbEntitiesUprawnienieNaSklepMappingBase); + + var tableMappings293 = new List(); + uprawnienieNaSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings293); + var uprawnienieNaSklepTable = new Table("UprawnienieNaSklep", null, relationalModel); + var uzNSIdColumn1 = new Column("UzNSId", "numeric(9,0)", uprawnienieNaSklepTable); + uprawnienieNaSklepTable.Columns.Add("UzNSId", uzNSIdColumn1); + var rodzajColumn14 = new Column("Rodzaj", "smallint", uprawnienieNaSklepTable); + uprawnienieNaSklepTable.Columns.Add("Rodzaj", rodzajColumn14); + var jestColumn3 = new Column("Jest", "smallint", uprawnienieNaSklepTable) + { + IsNullable = true + }; + uprawnienieNaSklepTable.Columns.Add("Jest", jestColumn3); + var pK_UPRAWNIENIENASKLEP = new UniqueConstraint("PK_UPRAWNIENIENASKLEP", uprawnienieNaSklepTable, new[] { uzNSIdColumn1, rodzajColumn14 }); + uprawnienieNaSklepTable.PrimaryKey = pK_UPRAWNIENIENASKLEP; + var pK_UPRAWNIENIENASKLEPUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.UprawnienieNaSklep", + new[] { "UzNSId", "Rodzaj" }); + pK_UPRAWNIENIENASKLEP.MappedKeys.Add(pK_UPRAWNIENIENASKLEPUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_UPRAWNIENIENASKLEPUc).Add(pK_UPRAWNIENIENASKLEP); + uprawnienieNaSklepTable.UniqueConstraints.Add("PK_UPRAWNIENIENASKLEP", pK_UPRAWNIENIENASKLEP); + relationalModel.Tables.Add(("UprawnienieNaSklep", null), uprawnienieNaSklepTable); + var uprawnienieNaSklepTableMapping = new TableMapping(uprawnienieNaSklep, uprawnienieNaSklepTable, true); + uprawnienieNaSklepTable.AddTypeMapping(uprawnienieNaSklepTableMapping, false); + tableMappings293.Add(uprawnienieNaSklepTableMapping); + RelationalModel.CreateColumnMapping(rodzajColumn14, uprawnienieNaSklep.FindProperty("Rodzaj")!, uprawnienieNaSklepTableMapping); + RelationalModel.CreateColumnMapping(uzNSIdColumn1, uprawnienieNaSklep.FindProperty("UzNSId")!, uprawnienieNaSklepTableMapping); + RelationalModel.CreateColumnMapping(jestColumn3, uprawnienieNaSklep.FindProperty("Jest")!, uprawnienieNaSklepTableMapping); + + var uzNaSklep = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep")!; + + var defaultTableMappings294 = new List>(); + uzNaSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings294); + var blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", null, relationalModel); + var aktywnyColumnBase52 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("Aktywny", aktywnyColumnBase52); + var hasloColumnBase2 = new ColumnBase("Haslo", "varchar(50)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("Haslo", hasloColumnBase2); + var hasloPrepaidColumnBase0 = new ColumnBase("HasloPrepaid", "varchar(50)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("HasloPrepaid", hasloPrepaidColumnBase0); + var identPrePaidColumnBase = new ColumnBase("IdentPrePaid", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("IdentPrePaid", identPrePaidColumnBase); + var identyfikatorColumnBase0 = new ColumnBase("Identyfikator", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("Identyfikator", identyfikatorColumnBase0); + var jezykColumnBase0 = new ColumnBase("Jezyk", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("Jezyk", jezykColumnBase0); + var kodKasjeraColumnBase0 = new ColumnBase("KodKasjera", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("KodKasjera", kodKasjeraColumnBase0); + var nazwiskoColumnBase2 = new ColumnBase("Nazwisko", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("Nazwisko", nazwiskoColumnBase2); + var nrKasjeraColumnBase0 = new ColumnBase("NrKasjera", "smallint", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("NrKasjera", nrKasjeraColumnBase0); + var nrSzufladyColumnBase0 = new ColumnBase("NrSzuflady", "smallint", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("NrSzuflady", nrSzufladyColumnBase0); + var rolaColumnBase2 = new ColumnBase("Rola", "smallint", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("Rola", rolaColumnBase2); + var rolaKasjeraColumnBase0 = new ColumnBase("RolaKasjera", "smallint", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("RolaKasjera", rolaKasjeraColumnBase0); + var sklepIdColumnBase111 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("SklepId", sklepIdColumnBase111); + var sklepUzIdColumnBase8 = new ColumnBase("SklepUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("SklepUzId", sklepUzIdColumnBase8); + var uzNSIdColumnBase2 = new ColumnBase("UzNSId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase); + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("UzNSId", uzNSIdColumnBase2); + var wymusZmianeHaslaColumnBase = new ColumnBase("WymusZmianeHasla", "datetime", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("WymusZmianeHasla", wymusZmianeHaslaColumnBase); + var zmianaColumnBase66 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.Columns.Add("Zmiana", zmianaColumnBase66); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase); + var blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase = new TableMappingBase(uzNaSklep, blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase, true); + blinkBackofficeServicesPcmDbEntitiesUzNaSklepTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase, false); + defaultTableMappings294.Add(blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzNSIdColumnBase2, uzNaSklep.FindProperty("UzNSId")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase52, uzNaSklep.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloColumnBase2, uzNaSklep.FindProperty("Haslo")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloPrepaidColumnBase0, uzNaSklep.FindProperty("HasloPrepaid")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)identPrePaidColumnBase, uzNaSklep.FindProperty("IdentPrePaid")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)identyfikatorColumnBase0, uzNaSklep.FindProperty("Identyfikator")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jezykColumnBase0, uzNaSklep.FindProperty("Jezyk")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKasjeraColumnBase0, uzNaSklep.FindProperty("KodKasjera")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwiskoColumnBase2, uzNaSklep.FindProperty("Nazwisko")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrKasjeraColumnBase0, uzNaSklep.FindProperty("NrKasjera")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrSzufladyColumnBase0, uzNaSklep.FindProperty("NrSzuflady")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaColumnBase2, uzNaSklep.FindProperty("Rola")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaKasjeraColumnBase0, uzNaSklep.FindProperty("RolaKasjera")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase111, uzNaSklep.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepUzIdColumnBase8, uzNaSklep.FindProperty("SklepUzId")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wymusZmianeHaslaColumnBase, uzNaSklep.FindProperty("WymusZmianeHasla")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase66, uzNaSklep.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesUzNaSklepMappingBase); + + var tableMappings294 = new List(); + uzNaSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings294); + var uzNaSklepTable = new Table("UzNaSklep", null, relationalModel); + var uzNSIdColumn2 = new Column("UzNSId", "numeric(9,0)", uzNaSklepTable); + uzNaSklepTable.Columns.Add("UzNSId", uzNSIdColumn2); + var aktywnyColumn52 = new Column("Aktywny", "smallint", uzNaSklepTable); + uzNaSklepTable.Columns.Add("Aktywny", aktywnyColumn52); + var hasloColumn2 = new Column("Haslo", "varchar(50)", uzNaSklepTable); + uzNaSklepTable.Columns.Add("Haslo", hasloColumn2); + var hasloPrepaidColumn0 = new Column("HasloPrepaid", "varchar(50)", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("HasloPrepaid", hasloPrepaidColumn0); + var identPrePaidColumn = new Column("IdentPrePaid", "varchar(60)", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("IdentPrePaid", identPrePaidColumn); + var identyfikatorColumn0 = new Column("Identyfikator", "varchar(60)", uzNaSklepTable); + uzNaSklepTable.Columns.Add("Identyfikator", identyfikatorColumn0); + var jezykColumn0 = new Column("Jezyk", "varchar(10)", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("Jezyk", jezykColumn0); + var kodKasjeraColumn0 = new Column("KodKasjera", "varchar(20)", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("KodKasjera", kodKasjeraColumn0); + var nazwiskoColumn2 = new Column("Nazwisko", "varchar(60)", uzNaSklepTable); + uzNaSklepTable.Columns.Add("Nazwisko", nazwiskoColumn2); + var nrKasjeraColumn0 = new Column("NrKasjera", "smallint", uzNaSklepTable); + uzNaSklepTable.Columns.Add("NrKasjera", nrKasjeraColumn0); + var nrSzufladyColumn0 = new Column("NrSzuflady", "smallint", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("NrSzuflady", nrSzufladyColumn0); + var rolaColumn2 = new Column("Rola", "smallint", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("Rola", rolaColumn2); + var rolaKasjeraColumn0 = new Column("RolaKasjera", "smallint", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("RolaKasjera", rolaKasjeraColumn0); + var sklepIdColumn111 = new Column("SklepId", "numeric(9,0)", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("SklepId", sklepIdColumn111); + var sklepUzIdColumn8 = new Column("SklepUzId", "numeric(9,0)", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("SklepUzId", sklepUzIdColumn8); + var wymusZmianeHaslaColumn = new Column("WymusZmianeHasla", "datetime", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("WymusZmianeHasla", wymusZmianeHaslaColumn); + var zmianaColumn66 = new Column("Zmiana", "datetime", uzNaSklepTable) + { + IsNullable = true + }; + uzNaSklepTable.Columns.Add("Zmiana", zmianaColumn66); + var pK_UZNASKLEP = new UniqueConstraint("PK_UZNASKLEP", uzNaSklepTable, new[] { uzNSIdColumn2 }); + uzNaSklepTable.PrimaryKey = pK_UZNASKLEP; + var pK_UZNASKLEPUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + new[] { "UzNSId" }); + pK_UZNASKLEP.MappedKeys.Add(pK_UZNASKLEPUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_UZNASKLEPUc).Add(pK_UZNASKLEP); + uzNaSklepTable.UniqueConstraints.Add("PK_UZNASKLEP", pK_UZNASKLEP); + var idx_UzNaSklelp_Ident = new TableIndex( + "idx_UzNaSklelp_Ident", uzNaSklepTable, new[] { identyfikatorColumn0 }, false); + var idx_UzNaSklelp_IdentIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + "idx_UzNaSklelp_Ident"); + idx_UzNaSklelp_Ident.MappedIndexes.Add(idx_UzNaSklelp_IdentIx); + RelationalModel.GetOrCreateTableIndexes(idx_UzNaSklelp_IdentIx).Add(idx_UzNaSklelp_Ident); + uzNaSklepTable.Indexes.Add("idx_UzNaSklelp_Ident", idx_UzNaSklelp_Ident); + var idx_UzNaSklelp_SIdSUzId = new TableIndex( + "idx_UzNaSklelp_SIdSUzId", uzNaSklepTable, new[] { sklepIdColumn111, sklepUzIdColumn8 }, false); + var idx_UzNaSklelp_SIdSUzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + "idx_UzNaSklelp_SIdSUzId"); + idx_UzNaSklelp_SIdSUzId.MappedIndexes.Add(idx_UzNaSklelp_SIdSUzIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_UzNaSklelp_SIdSUzIdIx).Add(idx_UzNaSklelp_SIdSUzId); + uzNaSklepTable.Indexes.Add("idx_UzNaSklelp_SIdSUzId", idx_UzNaSklelp_SIdSUzId); + relationalModel.Tables.Add(("UzNaSklep", null), uzNaSklepTable); + var uzNaSklepTableMapping = new TableMapping(uzNaSklep, uzNaSklepTable, true); + uzNaSklepTable.AddTypeMapping(uzNaSklepTableMapping, false); + tableMappings294.Add(uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(uzNSIdColumn2, uzNaSklep.FindProperty("UzNSId")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn52, uzNaSklep.FindProperty("Aktywny")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(hasloColumn2, uzNaSklep.FindProperty("Haslo")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(hasloPrepaidColumn0, uzNaSklep.FindProperty("HasloPrepaid")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(identPrePaidColumn, uzNaSklep.FindProperty("IdentPrePaid")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(identyfikatorColumn0, uzNaSklep.FindProperty("Identyfikator")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(jezykColumn0, uzNaSklep.FindProperty("Jezyk")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(kodKasjeraColumn0, uzNaSklep.FindProperty("KodKasjera")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(nazwiskoColumn2, uzNaSklep.FindProperty("Nazwisko")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(nrKasjeraColumn0, uzNaSklep.FindProperty("NrKasjera")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(nrSzufladyColumn0, uzNaSklep.FindProperty("NrSzuflady")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(rolaColumn2, uzNaSklep.FindProperty("Rola")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(rolaKasjeraColumn0, uzNaSklep.FindProperty("RolaKasjera")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn111, uzNaSklep.FindProperty("SklepId")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepUzIdColumn8, uzNaSklep.FindProperty("SklepUzId")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(wymusZmianeHaslaColumn, uzNaSklep.FindProperty("WymusZmianeHasla")!, uzNaSklepTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn66, uzNaSklep.FindProperty("Zmiana")!, uzNaSklepTableMapping); + + var uzytkownik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik")!; + + var defaultTableMappings295 = new List>(); + uzytkownik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings295); + var blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", null, relationalModel); + var aktywnyColumnBase53 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Aktywny", aktywnyColumnBase53); + var centrUzIdColumnBase = new ColumnBase("CentrUzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("CentrUzId", centrUzIdColumnBase); + var centrUzNSIdColumnBase = new ColumnBase("CentrUzNSId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("CentrUzNSId", centrUzNSIdColumnBase); + var hasloColumnBase3 = new ColumnBase("Haslo", "varchar(50)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Haslo", hasloColumnBase3); + var hasloPrepaidColumnBase1 = new ColumnBase("HasloPrepaid", "varchar(100)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("HasloPrepaid", hasloPrepaidColumnBase1); + var identPrepaidColumnBase0 = new ColumnBase("IdentPrepaid", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("IdentPrepaid", identPrepaidColumnBase0); + var identyfikatorColumnBase1 = new ColumnBase("Identyfikator", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Identyfikator", identyfikatorColumnBase1); + var jezykColumnBase1 = new ColumnBase("Jezyk", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Jezyk", jezykColumnBase1); + var kodKasjeraColumnBase1 = new ColumnBase("KodKasjera", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("KodKasjera", kodKasjeraColumnBase1); + var nazwiskoColumnBase3 = new ColumnBase("Nazwisko", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Nazwisko", nazwiskoColumnBase3); + var nrKasjeraColumnBase1 = new ColumnBase("NrKasjera", "smallint", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("NrKasjera", nrKasjeraColumnBase1); + var nrSzufladyColumnBase1 = new ColumnBase("NrSzuflady", "smallint", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("NrSzuflady", nrSzufladyColumnBase1); + var opiekunColumnBase0 = new ColumnBase("Opiekun", "smallint", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Opiekun", opiekunColumnBase0); + var ostZmianaHaslaColumnBase0 = new ColumnBase("OstZmianaHasla", "datetime", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("OstZmianaHasla", ostZmianaHaslaColumnBase0); + var profilIdColumnBase3 = new ColumnBase("ProfilId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("ProfilId", profilIdColumnBase3); + var rolaColumnBase3 = new ColumnBase("Rola", "smallint", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Rola", rolaColumnBase3); + var rolaKasjeraColumnBase1 = new ColumnBase("RolaKasjera", "smallint", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("RolaKasjera", rolaKasjeraColumnBase1); + var uzIdColumnBase8 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase); + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("UzId", uzIdColumnBase8); + var wymusZmianeHaslaColumnBase0 = new ColumnBase("WymusZmianeHasla", "datetime", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("WymusZmianeHasla", wymusZmianeHaslaColumnBase0); + var zmianaColumnBase67 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.Columns.Add("Zmiana", zmianaColumnBase67); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase); + var blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase = new TableMappingBase(uzytkownik, blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesUzytkownikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase, false); + defaultTableMappings295.Add(blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase8, uzytkownik.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase53, uzytkownik.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrUzIdColumnBase, uzytkownik.FindProperty("CentrUzId")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrUzNSIdColumnBase, uzytkownik.FindProperty("CentrUzNSId")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloColumnBase3, uzytkownik.FindProperty("Haslo")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)hasloPrepaidColumnBase1, uzytkownik.FindProperty("HasloPrepaid")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)identPrepaidColumnBase0, uzytkownik.FindProperty("IdentPrepaid")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)identyfikatorColumnBase1, uzytkownik.FindProperty("Identyfikator")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)jezykColumnBase1, uzytkownik.FindProperty("Jezyk")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKasjeraColumnBase1, uzytkownik.FindProperty("KodKasjera")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwiskoColumnBase3, uzytkownik.FindProperty("Nazwisko")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrKasjeraColumnBase1, uzytkownik.FindProperty("NrKasjera")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrSzufladyColumnBase1, uzytkownik.FindProperty("NrSzuflady")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opiekunColumnBase0, uzytkownik.FindProperty("Opiekun")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ostZmianaHaslaColumnBase0, uzytkownik.FindProperty("OstZmianaHasla")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)profilIdColumnBase3, uzytkownik.FindProperty("ProfilId")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaColumnBase3, uzytkownik.FindProperty("Rola")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)rolaKasjeraColumnBase1, uzytkownik.FindProperty("RolaKasjera")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wymusZmianeHaslaColumnBase0, uzytkownik.FindProperty("WymusZmianeHasla")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase67, uzytkownik.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesUzytkownikMappingBase); + + var tableMappings295 = new List(); + uzytkownik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings295); + var uzytkownikTable = new Table("Uzytkownik", null, relationalModel); + var uzIdColumn8 = new Column("UzId", "numeric(9,0)", uzytkownikTable); + uzytkownikTable.Columns.Add("UzId", uzIdColumn8); + var aktywnyColumn53 = new Column("Aktywny", "smallint", uzytkownikTable); + uzytkownikTable.Columns.Add("Aktywny", aktywnyColumn53); + var centrUzIdColumn = new Column("CentrUzId", "numeric(9,0)", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("CentrUzId", centrUzIdColumn); + var centrUzNSIdColumn = new Column("CentrUzNSId", "numeric(9,0)", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("CentrUzNSId", centrUzNSIdColumn); + var hasloColumn3 = new Column("Haslo", "varchar(50)", uzytkownikTable); + uzytkownikTable.Columns.Add("Haslo", hasloColumn3); + var hasloPrepaidColumn1 = new Column("HasloPrepaid", "varchar(100)", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("HasloPrepaid", hasloPrepaidColumn1); + var identPrepaidColumn0 = new Column("IdentPrepaid", "varchar(60)", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("IdentPrepaid", identPrepaidColumn0); + var identyfikatorColumn1 = new Column("Identyfikator", "varchar(60)", uzytkownikTable); + uzytkownikTable.Columns.Add("Identyfikator", identyfikatorColumn1); + var jezykColumn1 = new Column("Jezyk", "varchar(10)", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("Jezyk", jezykColumn1); + var kodKasjeraColumn1 = new Column("KodKasjera", "varchar(20)", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("KodKasjera", kodKasjeraColumn1); + var nazwiskoColumn3 = new Column("Nazwisko", "varchar(60)", uzytkownikTable); + uzytkownikTable.Columns.Add("Nazwisko", nazwiskoColumn3); + var nrKasjeraColumn1 = new Column("NrKasjera", "smallint", uzytkownikTable); + uzytkownikTable.Columns.Add("NrKasjera", nrKasjeraColumn1); + var nrSzufladyColumn1 = new Column("NrSzuflady", "smallint", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("NrSzuflady", nrSzufladyColumn1); + var opiekunColumn0 = new Column("Opiekun", "smallint", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("Opiekun", opiekunColumn0); + var ostZmianaHaslaColumn0 = new Column("OstZmianaHasla", "datetime", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("OstZmianaHasla", ostZmianaHaslaColumn0); + var profilIdColumn3 = new Column("ProfilId", "numeric(9,0)", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("ProfilId", profilIdColumn3); + var rolaColumn3 = new Column("Rola", "smallint", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("Rola", rolaColumn3); + var rolaKasjeraColumn1 = new Column("RolaKasjera", "smallint", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("RolaKasjera", rolaKasjeraColumn1); + var wymusZmianeHaslaColumn0 = new Column("WymusZmianeHasla", "datetime", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("WymusZmianeHasla", wymusZmianeHaslaColumn0); + var zmianaColumn67 = new Column("Zmiana", "datetime", uzytkownikTable) + { + IsNullable = true + }; + uzytkownikTable.Columns.Add("Zmiana", zmianaColumn67); + var pK_UZYTKOWNIK = new UniqueConstraint("PK_UZYTKOWNIK", uzytkownikTable, new[] { uzIdColumn8 }); + uzytkownikTable.PrimaryKey = pK_UZYTKOWNIK; + var pK_UZYTKOWNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + pK_UZYTKOWNIK.MappedKeys.Add(pK_UZYTKOWNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_UZYTKOWNIKUc).Add(pK_UZYTKOWNIK); + uzytkownikTable.UniqueConstraints.Add("PK_UZYTKOWNIK", pK_UZYTKOWNIK); + var idx_CentrUzId = new TableIndex( + "idx_CentrUzId", uzytkownikTable, new[] { centrUzIdColumn }, false); + var idx_CentrUzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + "idx_CentrUzId"); + idx_CentrUzId.MappedIndexes.Add(idx_CentrUzIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrUzIdIx).Add(idx_CentrUzId); + uzytkownikTable.Indexes.Add("idx_CentrUzId", idx_CentrUzId); + var iX_Uzytkownik_ProfilId = new TableIndex( + "IX_Uzytkownik_ProfilId", uzytkownikTable, new[] { profilIdColumn3 }, false); + var iX_Uzytkownik_ProfilIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "ProfilId" }); + iX_Uzytkownik_ProfilId.MappedIndexes.Add(iX_Uzytkownik_ProfilIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Uzytkownik_ProfilIdIx).Add(iX_Uzytkownik_ProfilId); + uzytkownikTable.Indexes.Add("IX_Uzytkownik_ProfilId", iX_Uzytkownik_ProfilId); + relationalModel.Tables.Add(("Uzytkownik", null), uzytkownikTable); + var uzytkownikTableMapping = new TableMapping(uzytkownik, uzytkownikTable, true); + uzytkownikTable.AddTypeMapping(uzytkownikTableMapping, false); + tableMappings295.Add(uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn8, uzytkownik.FindProperty("UzId")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn53, uzytkownik.FindProperty("Aktywny")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(centrUzIdColumn, uzytkownik.FindProperty("CentrUzId")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(centrUzNSIdColumn, uzytkownik.FindProperty("CentrUzNSId")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(hasloColumn3, uzytkownik.FindProperty("Haslo")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(hasloPrepaidColumn1, uzytkownik.FindProperty("HasloPrepaid")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(identPrepaidColumn0, uzytkownik.FindProperty("IdentPrepaid")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(identyfikatorColumn1, uzytkownik.FindProperty("Identyfikator")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(jezykColumn1, uzytkownik.FindProperty("Jezyk")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(kodKasjeraColumn1, uzytkownik.FindProperty("KodKasjera")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(nazwiskoColumn3, uzytkownik.FindProperty("Nazwisko")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(nrKasjeraColumn1, uzytkownik.FindProperty("NrKasjera")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(nrSzufladyColumn1, uzytkownik.FindProperty("NrSzuflady")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(opiekunColumn0, uzytkownik.FindProperty("Opiekun")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(ostZmianaHaslaColumn0, uzytkownik.FindProperty("OstZmianaHasla")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(profilIdColumn3, uzytkownik.FindProperty("ProfilId")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(rolaColumn3, uzytkownik.FindProperty("Rola")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(rolaKasjeraColumn1, uzytkownik.FindProperty("RolaKasjera")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(wymusZmianeHaslaColumn0, uzytkownik.FindProperty("WymusZmianeHasla")!, uzytkownikTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn67, uzytkownik.FindProperty("Zmiana")!, uzytkownikTableMapping); + + var vat = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Vat")!; + + var defaultTableMappings296 = new List>(); + vat.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings296); + var blinkBackofficeServicesPcmDbEntitiesVatTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Vat", null, relationalModel); + var stawkaColumnBase16 = new ColumnBase("Stawka", "smallint", blinkBackofficeServicesPcmDbEntitiesVatTableBase); + blinkBackofficeServicesPcmDbEntitiesVatTableBase.Columns.Add("Stawka", stawkaColumnBase16); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Vat", blinkBackofficeServicesPcmDbEntitiesVatTableBase); + var blinkBackofficeServicesPcmDbEntitiesVatMappingBase = new TableMappingBase(vat, blinkBackofficeServicesPcmDbEntitiesVatTableBase, true); + blinkBackofficeServicesPcmDbEntitiesVatTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesVatMappingBase, false); + defaultTableMappings296.Add(blinkBackofficeServicesPcmDbEntitiesVatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stawkaColumnBase16, vat.FindProperty("Stawka")!, blinkBackofficeServicesPcmDbEntitiesVatMappingBase); + + var tableMappings296 = new List(); + vat.SetRuntimeAnnotation("Relational:TableMappings", tableMappings296); + var vatTable = new Table("Vat", null, relationalModel); + var stawkaColumn16 = new Column("Stawka", "smallint", vatTable); + vatTable.Columns.Add("Stawka", stawkaColumn16); + var pK_VAT = new UniqueConstraint("PK_VAT", vatTable, new[] { stawkaColumn16 }); + vatTable.PrimaryKey = pK_VAT; + var pK_VATUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Vat", + new[] { "Stawka" }); + pK_VAT.MappedKeys.Add(pK_VATUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_VATUc).Add(pK_VAT); + vatTable.UniqueConstraints.Add("PK_VAT", pK_VAT); + relationalModel.Tables.Add(("Vat", null), vatTable); + var vatTableMapping = new TableMapping(vat, vatTable, true); + vatTable.AddTypeMapping(vatTableMapping, false); + tableMappings296.Add(vatTableMapping); + RelationalModel.CreateColumnMapping(stawkaColumn16, vat.FindProperty("Stawka")!, vatTableMapping); + + var waluta = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Waluta")!; + + var defaultTableMappings297 = new List>(); + waluta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings297); + var blinkBackofficeServicesPcmDbEntitiesWalutaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Waluta", null, relationalModel); + var aktywnyColumnBase54 = new ColumnBase("Aktywny", "smallint", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Aktywny", aktywnyColumnBase54); + var centrWalIdColumnBase = new ColumnBase("CentrWalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("CentrWalId", centrWalIdColumnBase); + var kodColumnBase18 = new ColumnBase("Kod", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Kod", kodColumnBase18); + var kursColumnBase11 = new ColumnBase("Kurs", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Kurs", kursColumnBase11); + var kursZakColumnBase0 = new ColumnBase("KursZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("KursZak", kursZakColumnBase0); + var nazwaColumnBase63 = new ColumnBase("Nazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Nazwa", nazwaColumnBase63); + var skrot1ColumnBase1 = new ColumnBase("Skrot1", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Skrot1", skrot1ColumnBase1); + var skrot100ColumnBase0 = new ColumnBase("Skrot100", "varchar(10)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Skrot100", skrot100ColumnBase0); + var spreadColumnBase0 = new ColumnBase("Spread", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Spread", spreadColumnBase0); + var spreadZakColumnBase0 = new ColumnBase("SpreadZak", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("SpreadZak", spreadZakColumnBase0); + var ukrycNaKasieColumnBase2 = new ColumnBase("UkrycNaKasie", "smallint", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("UkrycNaKasie", ukrycNaKasieColumnBase2); + var walIdColumnBase9 = new ColumnBase("WalId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("WalId", walIdColumnBase9); + var znaczenieColumnBase43 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase); + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.Columns.Add("Znaczenie", znaczenieColumnBase43); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Waluta", blinkBackofficeServicesPcmDbEntitiesWalutaTableBase); + var blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase = new TableMappingBase(waluta, blinkBackofficeServicesPcmDbEntitiesWalutaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesWalutaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase, false); + defaultTableMappings297.Add(blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)walIdColumnBase9, waluta.FindProperty("WalId")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnyColumnBase54, waluta.FindProperty("Aktywny")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrWalIdColumnBase, waluta.FindProperty("CentrWalId")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodColumnBase18, waluta.FindProperty("Kod")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursColumnBase11, waluta.FindProperty("Kurs")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kursZakColumnBase0, waluta.FindProperty("KursZak")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase63, waluta.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot1ColumnBase1, waluta.FindProperty("Skrot1")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)skrot100ColumnBase0, waluta.FindProperty("Skrot100")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)spreadColumnBase0, waluta.FindProperty("Spread")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)spreadZakColumnBase0, waluta.FindProperty("SpreadZak")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)ukrycNaKasieColumnBase2, waluta.FindProperty("UkrycNaKasie")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase43, waluta.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesWalutaMappingBase); + + var tableMappings297 = new List(); + waluta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings297); + var walutaTable = new Table("Waluta", null, relationalModel); + var walIdColumn9 = new Column("WalId", "numeric(9,0)", walutaTable); + walutaTable.Columns.Add("WalId", walIdColumn9); + var aktywnyColumn54 = new Column("Aktywny", "smallint", walutaTable); + walutaTable.Columns.Add("Aktywny", aktywnyColumn54); + var centrWalIdColumn = new Column("CentrWalId", "numeric(9,0)", walutaTable) + { + IsNullable = true + }; + walutaTable.Columns.Add("CentrWalId", centrWalIdColumn); + var kodColumn18 = new Column("Kod", "varchar(10)", walutaTable); + walutaTable.Columns.Add("Kod", kodColumn18); + var kursColumn11 = new Column("Kurs", "decimal(15,4)", walutaTable); + walutaTable.Columns.Add("Kurs", kursColumn11); + var kursZakColumn0 = new Column("KursZak", "decimal(15,4)", walutaTable) + { + IsNullable = true + }; + walutaTable.Columns.Add("KursZak", kursZakColumn0); + var nazwaColumn63 = new Column("Nazwa", "varchar(40)", walutaTable); + walutaTable.Columns.Add("Nazwa", nazwaColumn63); + var skrot1Column1 = new Column("Skrot1", "varchar(10)", walutaTable) + { + IsNullable = true + }; + walutaTable.Columns.Add("Skrot1", skrot1Column1); + var skrot100Column0 = new Column("Skrot100", "varchar(10)", walutaTable) + { + IsNullable = true + }; + walutaTable.Columns.Add("Skrot100", skrot100Column0); + var spreadColumn0 = new Column("Spread", "decimal(15,4)", walutaTable) + { + IsNullable = true + }; + walutaTable.Columns.Add("Spread", spreadColumn0); + var spreadZakColumn0 = new Column("SpreadZak", "decimal(15,4)", walutaTable) + { + IsNullable = true + }; + walutaTable.Columns.Add("SpreadZak", spreadZakColumn0); + var ukrycNaKasieColumn2 = new Column("UkrycNaKasie", "smallint", walutaTable) + { + IsNullable = true + }; + walutaTable.Columns.Add("UkrycNaKasie", ukrycNaKasieColumn2); + var znaczenieColumn43 = new Column("Znaczenie", "smallint", walutaTable); + walutaTable.Columns.Add("Znaczenie", znaczenieColumn43); + var pK_WALUTA = new UniqueConstraint("PK_WALUTA", walutaTable, new[] { walIdColumn9 }); + walutaTable.PrimaryKey = pK_WALUTA; + var pK_WALUTAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + pK_WALUTA.MappedKeys.Add(pK_WALUTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_WALUTAUc).Add(pK_WALUTA); + walutaTable.UniqueConstraints.Add("PK_WALUTA", pK_WALUTA); + var idx_CentrWalId = new TableIndex( + "idx_CentrWalId", walutaTable, new[] { centrWalIdColumn }, false); + var idx_CentrWalIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + "idx_CentrWalId"); + idx_CentrWalId.MappedIndexes.Add(idx_CentrWalIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrWalIdIx).Add(idx_CentrWalId); + walutaTable.Indexes.Add("idx_CentrWalId", idx_CentrWalId); + relationalModel.Tables.Add(("Waluta", null), walutaTable); + var walutaTableMapping = new TableMapping(waluta, walutaTable, true); + walutaTable.AddTypeMapping(walutaTableMapping, false); + tableMappings297.Add(walutaTableMapping); + RelationalModel.CreateColumnMapping(walIdColumn9, waluta.FindProperty("WalId")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(aktywnyColumn54, waluta.FindProperty("Aktywny")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(centrWalIdColumn, waluta.FindProperty("CentrWalId")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(kodColumn18, waluta.FindProperty("Kod")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(kursColumn11, waluta.FindProperty("Kurs")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(kursZakColumn0, waluta.FindProperty("KursZak")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn63, waluta.FindProperty("Nazwa")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(skrot1Column1, waluta.FindProperty("Skrot1")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(skrot100Column0, waluta.FindProperty("Skrot100")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(spreadColumn0, waluta.FindProperty("Spread")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(spreadZakColumn0, waluta.FindProperty("SpreadZak")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(ukrycNaKasieColumn2, waluta.FindProperty("UkrycNaKasie")!, walutaTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn43, waluta.FindProperty("Znaczenie")!, walutaTableMapping); + + var wersja_7_2 = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Wersja_7_2")!; + + var defaultTableMappings298 = new List>(); + wersja_7_2.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings298); + var blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Wersja_7_2", null, relationalModel); + var nazwaColumnBase64 = new ColumnBase("Nazwa", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase); + blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase.Columns.Add("Nazwa", nazwaColumnBase64); + var statusColumnBase8 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase); + blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase.Columns.Add("Status", statusColumnBase8); + var upgradeColumnBase = new ColumnBase("Upgrade", "smallint", blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase); + blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase.Columns.Add("Upgrade", upgradeColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Wersja_7_2", blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase); + var blinkBackofficeServicesPcmDbEntitiesWersja_7_2MappingBase = new TableMappingBase(wersja_7_2, blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase, true); + blinkBackofficeServicesPcmDbEntitiesWersja_7_2TableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesWersja_7_2MappingBase, false); + defaultTableMappings298.Add(blinkBackofficeServicesPcmDbEntitiesWersja_7_2MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)upgradeColumnBase, wersja_7_2.FindProperty("Upgrade")!, blinkBackofficeServicesPcmDbEntitiesWersja_7_2MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase64, wersja_7_2.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesWersja_7_2MappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase8, wersja_7_2.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesWersja_7_2MappingBase); + + var tableMappings298 = new List(); + wersja_7_2.SetRuntimeAnnotation("Relational:TableMappings", tableMappings298); + var wersja_7_2Table = new Table("Wersja_7_2", null, relationalModel); + var upgradeColumn = new Column("Upgrade", "smallint", wersja_7_2Table); + wersja_7_2Table.Columns.Add("Upgrade", upgradeColumn); + var nazwaColumn64 = new Column("Nazwa", "varchar(255)", wersja_7_2Table); + wersja_7_2Table.Columns.Add("Nazwa", nazwaColumn64); + var statusColumn8 = new Column("Status", "smallint", wersja_7_2Table); + wersja_7_2Table.Columns.Add("Status", statusColumn8); + var pK_WERSJA_7_2 = new UniqueConstraint("PK_WERSJA_7_2", wersja_7_2Table, new[] { upgradeColumn }); + wersja_7_2Table.PrimaryKey = pK_WERSJA_7_2; + var pK_WERSJA_7_2Uc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Wersja_7_2", + new[] { "Upgrade" }); + pK_WERSJA_7_2.MappedKeys.Add(pK_WERSJA_7_2Uc); + RelationalModel.GetOrCreateUniqueConstraints(pK_WERSJA_7_2Uc).Add(pK_WERSJA_7_2); + wersja_7_2Table.UniqueConstraints.Add("PK_WERSJA_7_2", pK_WERSJA_7_2); + relationalModel.Tables.Add(("Wersja_7_2", null), wersja_7_2Table); + var wersja_7_2TableMapping = new TableMapping(wersja_7_2, wersja_7_2Table, true); + wersja_7_2Table.AddTypeMapping(wersja_7_2TableMapping, false); + tableMappings298.Add(wersja_7_2TableMapping); + RelationalModel.CreateColumnMapping(upgradeColumn, wersja_7_2.FindProperty("Upgrade")!, wersja_7_2TableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn64, wersja_7_2.FindProperty("Nazwa")!, wersja_7_2TableMapping); + RelationalModel.CreateColumnMapping(statusColumn8, wersja_7_2.FindProperty("Status")!, wersja_7_2TableMapping); + + var wzorzec = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Wzorzec")!; + + var defaultTableMappings299 = new List>(); + wzorzec.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings299); + var blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Wzorzec", null, relationalModel); + var automatycznyColumnBase = new ColumnBase("Automatyczny", "smallint", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("Automatyczny", automatycznyColumnBase); + var centrWzIdColumnBase = new ColumnBase("CentrWzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("CentrWzId", centrWzIdColumnBase); + var grupGenColumnBase = new ColumnBase("GrupGen", "smallint", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("GrupGen", grupGenColumnBase); + var nazwaColumnBase65 = new ColumnBase("Nazwa", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase); + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("Nazwa", nazwaColumnBase65); + var opisColumnBase6 = new ColumnBase("Opis", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("Opis", opisColumnBase6); + var param1ColumnBase15 = new ColumnBase("Param1", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("Param1", param1ColumnBase15); + var param2ColumnBase10 = new ColumnBase("Param2", "decimal(10,4)", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("Param2", param2ColumnBase10); + var typWzorcaColumnBase = new ColumnBase("TypWzorca", "smallint", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase); + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("TypWzorca", typWzorcaColumnBase); + var wzIdColumnBase0 = new ColumnBase("WzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase); + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.Columns.Add("WzId", wzIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Wzorzec", blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase); + var blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase = new TableMappingBase(wzorzec, blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase, true); + blinkBackofficeServicesPcmDbEntitiesWzorzecTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase, false); + defaultTableMappings299.Add(blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wzIdColumnBase0, wzorzec.FindProperty("WzId")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)automatycznyColumnBase, wzorzec.FindProperty("Automatyczny")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrWzIdColumnBase, wzorzec.FindProperty("CentrWzId")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)grupGenColumnBase, wzorzec.FindProperty("GrupGen")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase65, wzorzec.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase6, wzorzec.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param1ColumnBase15, wzorzec.FindProperty("Param1")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)param2ColumnBase10, wzorzec.FindProperty("Param2")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typWzorcaColumnBase, wzorzec.FindProperty("TypWzorca")!, blinkBackofficeServicesPcmDbEntitiesWzorzecMappingBase); + + var tableMappings299 = new List(); + wzorzec.SetRuntimeAnnotation("Relational:TableMappings", tableMappings299); + var wzorzecTable = new Table("Wzorzec", null, relationalModel); + var wzIdColumn0 = new Column("WzId", "numeric(9,0)", wzorzecTable); + wzorzecTable.Columns.Add("WzId", wzIdColumn0); + var automatycznyColumn = new Column("Automatyczny", "smallint", wzorzecTable) + { + IsNullable = true + }; + wzorzecTable.Columns.Add("Automatyczny", automatycznyColumn); + var centrWzIdColumn = new Column("CentrWzId", "numeric(9,0)", wzorzecTable) + { + IsNullable = true + }; + wzorzecTable.Columns.Add("CentrWzId", centrWzIdColumn); + var grupGenColumn = new Column("GrupGen", "smallint", wzorzecTable) + { + IsNullable = true + }; + wzorzecTable.Columns.Add("GrupGen", grupGenColumn); + var nazwaColumn65 = new Column("Nazwa", "varchar(120)", wzorzecTable); + wzorzecTable.Columns.Add("Nazwa", nazwaColumn65); + var opisColumn6 = new Column("Opis", "varchar(255)", wzorzecTable) + { + IsNullable = true + }; + wzorzecTable.Columns.Add("Opis", opisColumn6); + var param1Column15 = new Column("Param1", "decimal(10,4)", wzorzecTable) + { + IsNullable = true + }; + wzorzecTable.Columns.Add("Param1", param1Column15); + var param2Column10 = new Column("Param2", "decimal(10,4)", wzorzecTable) + { + IsNullable = true + }; + wzorzecTable.Columns.Add("Param2", param2Column10); + var typWzorcaColumn = new Column("TypWzorca", "smallint", wzorzecTable); + wzorzecTable.Columns.Add("TypWzorca", typWzorcaColumn); + var pK_WZORZEC = new UniqueConstraint("PK_WZORZEC", wzorzecTable, new[] { wzIdColumn0 }); + wzorzecTable.PrimaryKey = pK_WZORZEC; + var pK_WZORZECUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Wzorzec", + new[] { "WzId" }); + pK_WZORZEC.MappedKeys.Add(pK_WZORZECUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_WZORZECUc).Add(pK_WZORZEC); + wzorzecTable.UniqueConstraints.Add("PK_WZORZEC", pK_WZORZEC); + var idx_CentrWzId = new TableIndex( + "idx_CentrWzId", wzorzecTable, new[] { centrWzIdColumn }, false); + var idx_CentrWzIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Wzorzec", + "idx_CentrWzId"); + idx_CentrWzId.MappedIndexes.Add(idx_CentrWzIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_CentrWzIdIx).Add(idx_CentrWzId); + wzorzecTable.Indexes.Add("idx_CentrWzId", idx_CentrWzId); + relationalModel.Tables.Add(("Wzorzec", null), wzorzecTable); + var wzorzecTableMapping = new TableMapping(wzorzec, wzorzecTable, true); + wzorzecTable.AddTypeMapping(wzorzecTableMapping, false); + tableMappings299.Add(wzorzecTableMapping); + RelationalModel.CreateColumnMapping(wzIdColumn0, wzorzec.FindProperty("WzId")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(automatycznyColumn, wzorzec.FindProperty("Automatyczny")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(centrWzIdColumn, wzorzec.FindProperty("CentrWzId")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(grupGenColumn, wzorzec.FindProperty("GrupGen")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn65, wzorzec.FindProperty("Nazwa")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(opisColumn6, wzorzec.FindProperty("Opis")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(param1Column15, wzorzec.FindProperty("Param1")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(param2Column10, wzorzec.FindProperty("Param2")!, wzorzecTableMapping); + RelationalModel.CreateColumnMapping(typWzorcaColumn, wzorzec.FindProperty("TypWzorca")!, wzorzecTableMapping); + + var zaleznosc = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc")!; + + var defaultTableMappings300 = new List>(); + zaleznosc.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings300); + var blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc", null, relationalModel); + var dokIdColumnBase24 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase); + blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase.Columns.Add("DokId", dokIdColumnBase24); + var poprzedniDokIdColumnBase = new ColumnBase("PoprzedniDokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase); + blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase.Columns.Add("PoprzedniDokId", poprzedniDokIdColumnBase); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc", blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase); + var blinkBackofficeServicesPcmDbEntitiesZaleznoscMappingBase = new TableMappingBase(zaleznosc, blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZaleznoscTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZaleznoscMappingBase, false); + defaultTableMappings300.Add(blinkBackofficeServicesPcmDbEntitiesZaleznoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase24, zaleznosc.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesZaleznoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)poprzedniDokIdColumnBase, zaleznosc.FindProperty("PoprzedniDokId")!, blinkBackofficeServicesPcmDbEntitiesZaleznoscMappingBase); + + var tableMappings300 = new List(); + zaleznosc.SetRuntimeAnnotation("Relational:TableMappings", tableMappings300); + var zaleznoscTable = new Table("Zaleznosc", null, relationalModel); + var dokIdColumn24 = new Column("DokId", "numeric(9,0)", zaleznoscTable); + zaleznoscTable.Columns.Add("DokId", dokIdColumn24); + var poprzedniDokIdColumn = new Column("PoprzedniDokId", "numeric(9,0)", zaleznoscTable); + zaleznoscTable.Columns.Add("PoprzedniDokId", poprzedniDokIdColumn); + var pK_ZALEZNOSC = new UniqueConstraint("PK_ZALEZNOSC", zaleznoscTable, new[] { dokIdColumn24 }); + zaleznoscTable.PrimaryKey = pK_ZALEZNOSC; + var pK_ZALEZNOSCUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc", + new[] { "DokId" }); + pK_ZALEZNOSC.MappedKeys.Add(pK_ZALEZNOSCUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZALEZNOSCUc).Add(pK_ZALEZNOSC); + zaleznoscTable.UniqueConstraints.Add("PK_ZALEZNOSC", pK_ZALEZNOSC); + var idx_PoprzedniDokId = new TableIndex( + "idx_PoprzedniDokId", zaleznoscTable, new[] { poprzedniDokIdColumn }, false); + var idx_PoprzedniDokIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc", + "idx_PoprzedniDokId"); + idx_PoprzedniDokId.MappedIndexes.Add(idx_PoprzedniDokIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_PoprzedniDokIdIx).Add(idx_PoprzedniDokId); + zaleznoscTable.Indexes.Add("idx_PoprzedniDokId", idx_PoprzedniDokId); + relationalModel.Tables.Add(("Zaleznosc", null), zaleznoscTable); + var zaleznoscTableMapping = new TableMapping(zaleznosc, zaleznoscTable, true); + zaleznoscTable.AddTypeMapping(zaleznoscTableMapping, false); + tableMappings300.Add(zaleznoscTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn24, zaleznosc.FindProperty("DokId")!, zaleznoscTableMapping); + RelationalModel.CreateColumnMapping(poprzedniDokIdColumn, zaleznosc.FindProperty("PoprzedniDokId")!, zaleznoscTableMapping); + + var zamiennik = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Zamiennik")!; + + var defaultTableMappings301 = new List>(); + zamiennik.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings301); + var blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Zamiennik", null, relationalModel); + var centrZmIdColumnBase = new ColumnBase("CentrZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase.Columns.Add("CentrZmId", centrZmIdColumnBase); + var zmIdColumnBase2 = new ColumnBase("ZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase.Columns.Add("ZmId", zmIdColumnBase2); + var zmianaColumnBase68 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase); + blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase.Columns.Add("Zmiana", zmianaColumnBase68); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Zamiennik", blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase); + var blinkBackofficeServicesPcmDbEntitiesZamiennikMappingBase = new TableMappingBase(zamiennik, blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZamiennikTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZamiennikMappingBase, false); + defaultTableMappings301.Add(blinkBackofficeServicesPcmDbEntitiesZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmIdColumnBase2, zamiennik.FindProperty("ZmId")!, blinkBackofficeServicesPcmDbEntitiesZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrZmIdColumnBase, zamiennik.FindProperty("CentrZmId")!, blinkBackofficeServicesPcmDbEntitiesZamiennikMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase68, zamiennik.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesZamiennikMappingBase); + + var tableMappings301 = new List(); + zamiennik.SetRuntimeAnnotation("Relational:TableMappings", tableMappings301); + var zamiennikTable = new Table("Zamiennik", null, relationalModel); + var zmIdColumn2 = new Column("ZmId", "numeric(9,0)", zamiennikTable); + zamiennikTable.Columns.Add("ZmId", zmIdColumn2); + var centrZmIdColumn = new Column("CentrZmId", "numeric(9,0)", zamiennikTable) + { + IsNullable = true + }; + zamiennikTable.Columns.Add("CentrZmId", centrZmIdColumn); + var zmianaColumn68 = new Column("Zmiana", "datetime", zamiennikTable); + zamiennikTable.Columns.Add("Zmiana", zmianaColumn68); + var pK_ZAMIENNIK = new UniqueConstraint("PK_ZAMIENNIK", zamiennikTable, new[] { zmIdColumn2 }); + zamiennikTable.PrimaryKey = pK_ZAMIENNIK; + var pK_ZAMIENNIKUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zamiennik", + new[] { "ZmId" }); + pK_ZAMIENNIK.MappedKeys.Add(pK_ZAMIENNIKUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZAMIENNIKUc).Add(pK_ZAMIENNIK); + zamiennikTable.UniqueConstraints.Add("PK_ZAMIENNIK", pK_ZAMIENNIK); + relationalModel.Tables.Add(("Zamiennik", null), zamiennikTable); + var zamiennikTableMapping = new TableMapping(zamiennik, zamiennikTable, true); + zamiennikTable.AddTypeMapping(zamiennikTableMapping, false); + tableMappings301.Add(zamiennikTableMapping); + RelationalModel.CreateColumnMapping(zmIdColumn2, zamiennik.FindProperty("ZmId")!, zamiennikTableMapping); + RelationalModel.CreateColumnMapping(centrZmIdColumn, zamiennik.FindProperty("CentrZmId")!, zamiennikTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn68, zamiennik.FindProperty("Zmiana")!, zamiennikTableMapping); + + var zasob = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Zasob")!; + + var defaultTableMappings302 = new List>(); + zasob.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings302); + var blinkBackofficeServicesPcmDbEntitiesZasobTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Zasob", null, relationalModel); + var idColumnBase7 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesZasobTableBase.Columns.Add("Id", idColumnBase7); + var sciezkaColumnBase1 = new ColumnBase("Sciezka", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesZasobTableBase.Columns.Add("Sciezka", sciezkaColumnBase1); + var tabelaColumnBase0 = new ColumnBase("Tabela", "smallint", blinkBackofficeServicesPcmDbEntitiesZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesZasobTableBase.Columns.Add("Tabela", tabelaColumnBase0); + var typColumnBase40 = new ColumnBase("Typ", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesZasobTableBase); + blinkBackofficeServicesPcmDbEntitiesZasobTableBase.Columns.Add("Typ", typColumnBase40); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Zasob", blinkBackofficeServicesPcmDbEntitiesZasobTableBase); + var blinkBackofficeServicesPcmDbEntitiesZasobMappingBase = new TableMappingBase(zasob, blinkBackofficeServicesPcmDbEntitiesZasobTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZasobTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZasobMappingBase, false); + defaultTableMappings302.Add(blinkBackofficeServicesPcmDbEntitiesZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase7, zasob.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tabelaColumnBase0, zasob.FindProperty("Tabela")!, blinkBackofficeServicesPcmDbEntitiesZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase40, zasob.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesZasobMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sciezkaColumnBase1, zasob.FindProperty("Sciezka")!, blinkBackofficeServicesPcmDbEntitiesZasobMappingBase); + + var tableMappings302 = new List(); + zasob.SetRuntimeAnnotation("Relational:TableMappings", tableMappings302); + var zasobTable = new Table("Zasob", null, relationalModel); + var tabelaColumn0 = new Column("Tabela", "smallint", zasobTable); + zasobTable.Columns.Add("Tabela", tabelaColumn0); + var idColumn7 = new Column("Id", "numeric(9,0)", zasobTable); + zasobTable.Columns.Add("Id", idColumn7); + var typColumn40 = new Column("Typ", "varchar(40)", zasobTable); + zasobTable.Columns.Add("Typ", typColumn40); + var sciezkaColumn1 = new Column("Sciezka", "varchar(255)", zasobTable); + zasobTable.Columns.Add("Sciezka", sciezkaColumn1); + var pK_ZASOB = new UniqueConstraint("PK_ZASOB", zasobTable, new[] { tabelaColumn0, idColumn7, typColumn40 }); + zasobTable.PrimaryKey = pK_ZASOB; + var pK_ZASOBUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zasob", + new[] { "Tabela", "Id", "Typ" }); + pK_ZASOB.MappedKeys.Add(pK_ZASOBUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZASOBUc).Add(pK_ZASOB); + zasobTable.UniqueConstraints.Add("PK_ZASOB", pK_ZASOB); + relationalModel.Tables.Add(("Zasob", null), zasobTable); + var zasobTableMapping = new TableMapping(zasob, zasobTable, true); + zasobTable.AddTypeMapping(zasobTableMapping, false); + tableMappings302.Add(zasobTableMapping); + RelationalModel.CreateColumnMapping(idColumn7, zasob.FindProperty("Id")!, zasobTableMapping); + RelationalModel.CreateColumnMapping(tabelaColumn0, zasob.FindProperty("Tabela")!, zasobTableMapping); + RelationalModel.CreateColumnMapping(typColumn40, zasob.FindProperty("Typ")!, zasobTableMapping); + RelationalModel.CreateColumnMapping(sciezkaColumn1, zasob.FindProperty("Sciezka")!, zasobTableMapping); + + var zdarzLoj = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj")!; + + var defaultTableMappings303 = new List>(); + zdarzLoj.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings303); + var blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", null, relationalModel); + var cechaColumnBase = new ColumnBase("Cecha", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("Cecha", cechaColumnBase); + var dataCzasColumnBase2 = new ColumnBase("DataCzas", "datetime", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("DataCzas", dataCzasColumnBase2); + var dataCzasZapisuColumnBase = new ColumnBase("DataCzasZapisu", "datetime", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("DataCzasZapisu", dataCzasZapisuColumnBase); + var dokIdColumnBase25 = new ColumnBase("DokId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("DokId", dokIdColumnBase25); + var kartaIdColumnBase0 = new ColumnBase("KartaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("KartaId", kartaIdColumnBase0); + var kodKartyColumnBase5 = new ColumnBase("KodKarty", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("KodKarty", kodKartyColumnBase5); + var kontoIdColumnBase6 = new ColumnBase("KontoId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("KontoId", kontoIdColumnBase6); + var kwotaColumnBase10 = new ColumnBase("Kwota", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("Kwota", kwotaColumnBase10); + var opisColumnBase7 = new ColumnBase("Opis", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("Opis", opisColumnBase7); + var posNoColumnBase2 = new ColumnBase("PosNo", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("PosNo", posNoColumnBase2); + var regulaIdColumnBase16 = new ColumnBase("RegulaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("RegulaId", regulaIdColumnBase16); + var shopNoColumnBase2 = new ColumnBase("ShopNo", "varchar(32)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("ShopNo", shopNoColumnBase2); + var sklepIdColumnBase112 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("SklepId", sklepIdColumnBase112); + var stanPoColumnBase = new ColumnBase("StanPo", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("StanPo", stanPoColumnBase); + var stanPrzedColumnBase = new ColumnBase("StanPrzed", "decimal(15,4)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("StanPrzed", stanPrzedColumnBase); + var transUUIDColumnBase0 = new ColumnBase("TransUUID", "varchar(64)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("TransUUID", transUUIDColumnBase0); + var typZdarzColumnBase = new ColumnBase("TypZdarz", "smallint", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("TypZdarz", typZdarzColumnBase); + var zdarzLojIdColumnBase0 = new ColumnBase("ZdarzLojId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.Columns.Add("ZdarzLojId", zdarzLojIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase); + var blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase = new TableMappingBase(zdarzLoj, blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZdarzLojTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase, false); + defaultTableMappings303.Add(blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zdarzLojIdColumnBase0, zdarzLoj.FindProperty("ZdarzLojId")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)cechaColumnBase, zdarzLoj.FindProperty("Cecha")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasColumnBase2, zdarzLoj.FindProperty("DataCzas")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataCzasZapisuColumnBase, zdarzLoj.FindProperty("DataCzasZapisu")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase25, zdarzLoj.FindProperty("DokId")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kartaIdColumnBase0, zdarzLoj.FindProperty("KartaId")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kodKartyColumnBase5, zdarzLoj.FindProperty("KodKarty")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontoIdColumnBase6, zdarzLoj.FindProperty("KontoId")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kwotaColumnBase10, zdarzLoj.FindProperty("Kwota")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)opisColumnBase7, zdarzLoj.FindProperty("Opis")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)posNoColumnBase2, zdarzLoj.FindProperty("PosNo")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)regulaIdColumnBase16, zdarzLoj.FindProperty("RegulaId")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)shopNoColumnBase2, zdarzLoj.FindProperty("ShopNo")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase112, zdarzLoj.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanPoColumnBase, zdarzLoj.FindProperty("StanPo")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stanPrzedColumnBase, zdarzLoj.FindProperty("StanPrzed")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)transUUIDColumnBase0, zdarzLoj.FindProperty("TransUUID")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typZdarzColumnBase, zdarzLoj.FindProperty("TypZdarz")!, blinkBackofficeServicesPcmDbEntitiesZdarzLojMappingBase); + + var tableMappings303 = new List(); + zdarzLoj.SetRuntimeAnnotation("Relational:TableMappings", tableMappings303); + var zdarzLojTable = new Table("ZdarzLoj", null, relationalModel); + var zdarzLojIdColumn0 = new Column("ZdarzLojId", "numeric(9,0)", zdarzLojTable); + zdarzLojTable.Columns.Add("ZdarzLojId", zdarzLojIdColumn0); + var cechaColumn = new Column("Cecha", "varchar(64)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("Cecha", cechaColumn); + var dataCzasColumn2 = new Column("DataCzas", "datetime", zdarzLojTable); + zdarzLojTable.Columns.Add("DataCzas", dataCzasColumn2); + var dataCzasZapisuColumn = new Column("DataCzasZapisu", "datetime", zdarzLojTable); + zdarzLojTable.Columns.Add("DataCzasZapisu", dataCzasZapisuColumn); + var dokIdColumn25 = new Column("DokId", "numeric(9,0)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("DokId", dokIdColumn25); + var kartaIdColumn0 = new Column("KartaId", "numeric(9,0)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("KartaId", kartaIdColumn0); + var kodKartyColumn5 = new Column("KodKarty", "varchar(40)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("KodKarty", kodKartyColumn5); + var kontoIdColumn6 = new Column("KontoId", "numeric(9,0)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("KontoId", kontoIdColumn6); + var kwotaColumn10 = new Column("Kwota", "decimal(15,4)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("Kwota", kwotaColumn10); + var opisColumn7 = new Column("Opis", "varchar(64)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("Opis", opisColumn7); + var posNoColumn2 = new Column("PosNo", "varchar(32)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("PosNo", posNoColumn2); + var regulaIdColumn16 = new Column("RegulaId", "numeric(9,0)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("RegulaId", regulaIdColumn16); + var shopNoColumn2 = new Column("ShopNo", "varchar(32)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("ShopNo", shopNoColumn2); + var sklepIdColumn112 = new Column("SklepId", "numeric(9,0)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("SklepId", sklepIdColumn112); + var stanPoColumn = new Column("StanPo", "decimal(15,4)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("StanPo", stanPoColumn); + var stanPrzedColumn = new Column("StanPrzed", "decimal(15,4)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("StanPrzed", stanPrzedColumn); + var transUUIDColumn0 = new Column("TransUUID", "varchar(64)", zdarzLojTable) + { + IsNullable = true + }; + zdarzLojTable.Columns.Add("TransUUID", transUUIDColumn0); + var typZdarzColumn = new Column("TypZdarz", "smallint", zdarzLojTable); + zdarzLojTable.Columns.Add("TypZdarz", typZdarzColumn); + var pK_ZDARZLOJ = new UniqueConstraint("PK_ZDARZLOJ", zdarzLojTable, new[] { zdarzLojIdColumn0 }); + zdarzLojTable.PrimaryKey = pK_ZDARZLOJ; + var pK_ZDARZLOJUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + new[] { "ZdarzLojId" }); + pK_ZDARZLOJ.MappedKeys.Add(pK_ZDARZLOJUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZDARZLOJUc).Add(pK_ZDARZLOJ); + zdarzLojTable.UniqueConstraints.Add("PK_ZDARZLOJ", pK_ZDARZLOJ); + var iX_ZdarzLoj_KartaId = new TableIndex( + "IX_ZdarzLoj_KartaId", zdarzLojTable, new[] { kartaIdColumn0 }, false); + var iX_ZdarzLoj_KartaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + new[] { "KartaId" }); + iX_ZdarzLoj_KartaId.MappedIndexes.Add(iX_ZdarzLoj_KartaIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_ZdarzLoj_KartaIdIx).Add(iX_ZdarzLoj_KartaId); + zdarzLojTable.Indexes.Add("IX_ZdarzLoj_KartaId", iX_ZdarzLoj_KartaId); + var ixZdarzLoj_Cecha = new TableIndex( + "IxZdarzLoj_Cecha", zdarzLojTable, new[] { cechaColumn }, false); + var ixZdarzLoj_CechaIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + "IxZdarzLoj_Cecha"); + ixZdarzLoj_Cecha.MappedIndexes.Add(ixZdarzLoj_CechaIx); + RelationalModel.GetOrCreateTableIndexes(ixZdarzLoj_CechaIx).Add(ixZdarzLoj_Cecha); + zdarzLojTable.Indexes.Add("IxZdarzLoj_Cecha", ixZdarzLoj_Cecha); + var ixZdarzLoj_DataCzas = new TableIndex( + "IxZdarzLoj_DataCzas", zdarzLojTable, new[] { dataCzasColumn2 }, false); + var ixZdarzLoj_DataCzasIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + "IxZdarzLoj_DataCzas"); + ixZdarzLoj_DataCzas.MappedIndexes.Add(ixZdarzLoj_DataCzasIx); + RelationalModel.GetOrCreateTableIndexes(ixZdarzLoj_DataCzasIx).Add(ixZdarzLoj_DataCzas); + zdarzLojTable.Indexes.Add("IxZdarzLoj_DataCzas", ixZdarzLoj_DataCzas); + var ixZdarzLoj_KodKarty = new TableIndex( + "IxZdarzLoj_KodKarty", zdarzLojTable, new[] { kodKartyColumn5 }, false); + var ixZdarzLoj_KodKartyIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + "IxZdarzLoj_KodKarty"); + ixZdarzLoj_KodKarty.MappedIndexes.Add(ixZdarzLoj_KodKartyIx); + RelationalModel.GetOrCreateTableIndexes(ixZdarzLoj_KodKartyIx).Add(ixZdarzLoj_KodKarty); + zdarzLojTable.Indexes.Add("IxZdarzLoj_KodKarty", ixZdarzLoj_KodKarty); + var ixZdarzLoj_KontoId = new TableIndex( + "IxZdarzLoj_KontoId", zdarzLojTable, new[] { kontoIdColumn6 }, false); + var ixZdarzLoj_KontoIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + "IxZdarzLoj_KontoId"); + ixZdarzLoj_KontoId.MappedIndexes.Add(ixZdarzLoj_KontoIdIx); + RelationalModel.GetOrCreateTableIndexes(ixZdarzLoj_KontoIdIx).Add(ixZdarzLoj_KontoId); + zdarzLojTable.Indexes.Add("IxZdarzLoj_KontoId", ixZdarzLoj_KontoId); + var ixZdarzLoj_TransUUID = new TableIndex( + "IxZdarzLoj_TransUUID", zdarzLojTable, new[] { transUUIDColumn0 }, false); + var ixZdarzLoj_TransUUIDIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + "IxZdarzLoj_TransUUID"); + ixZdarzLoj_TransUUID.MappedIndexes.Add(ixZdarzLoj_TransUUIDIx); + RelationalModel.GetOrCreateTableIndexes(ixZdarzLoj_TransUUIDIx).Add(ixZdarzLoj_TransUUID); + zdarzLojTable.Indexes.Add("IxZdarzLoj_TransUUID", ixZdarzLoj_TransUUID); + relationalModel.Tables.Add(("ZdarzLoj", null), zdarzLojTable); + var zdarzLojTableMapping = new TableMapping(zdarzLoj, zdarzLojTable, true); + zdarzLojTable.AddTypeMapping(zdarzLojTableMapping, false); + tableMappings303.Add(zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(zdarzLojIdColumn0, zdarzLoj.FindProperty("ZdarzLojId")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(cechaColumn, zdarzLoj.FindProperty("Cecha")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(dataCzasColumn2, zdarzLoj.FindProperty("DataCzas")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(dataCzasZapisuColumn, zdarzLoj.FindProperty("DataCzasZapisu")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn25, zdarzLoj.FindProperty("DokId")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(kartaIdColumn0, zdarzLoj.FindProperty("KartaId")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(kodKartyColumn5, zdarzLoj.FindProperty("KodKarty")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(kontoIdColumn6, zdarzLoj.FindProperty("KontoId")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(kwotaColumn10, zdarzLoj.FindProperty("Kwota")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(opisColumn7, zdarzLoj.FindProperty("Opis")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(posNoColumn2, zdarzLoj.FindProperty("PosNo")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(regulaIdColumn16, zdarzLoj.FindProperty("RegulaId")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(shopNoColumn2, zdarzLoj.FindProperty("ShopNo")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn112, zdarzLoj.FindProperty("SklepId")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(stanPoColumn, zdarzLoj.FindProperty("StanPo")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(stanPrzedColumn, zdarzLoj.FindProperty("StanPrzed")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(transUUIDColumn0, zdarzLoj.FindProperty("TransUUID")!, zdarzLojTableMapping); + RelationalModel.CreateColumnMapping(typZdarzColumn, zdarzLoj.FindProperty("TypZdarz")!, zdarzLojTableMapping); + + var zdarzOs = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs")!; + + var defaultTableMappings304 = new List>(); + zdarzOs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings304); + var blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", null, relationalModel); + var akcjaColumnBase0 = new ColumnBase("Akcja", "smallint", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("Akcja", akcjaColumnBase0); + var dataDecColumnBase2 = new ColumnBase("DataDec", "datetime", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("DataDec", dataDecColumnBase2); + var dodParColumnBase0 = new ColumnBase("DodPar", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("DodPar", dodParColumnBase0); + var formaDecColumnBase2 = new ColumnBase("FormaDec", "smallint", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("FormaDec", formaDecColumnBase2); + var kiedyColumnBase8 = new ColumnBase("Kiedy", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("Kiedy", kiedyColumnBase8); + var kontrIdColumnBase20 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("KontrId", kontrIdColumnBase20); + var nowyStatusColumnBase0 = new ColumnBase("NowyStatus", "smallint", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("NowyStatus", nowyStatusColumnBase0); + var typOsIdColumnBase2 = new ColumnBase("TypOsId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("TypOsId", typOsIdColumnBase2); + var uzIdColumnBase9 = new ColumnBase("UzId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("UzId", uzIdColumnBase9); + var wersjaColumnBase10 = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("Wersja", wersjaColumnBase10); + var zgIdColumnBase4 = new ColumnBase("ZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("ZgId", zgIdColumnBase4); + var zmianaColumnBase69 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.Columns.Add("Zmiana", zmianaColumnBase69); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase); + var blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase = new TableMappingBase(zdarzOs, blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZdarzOsTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase, false); + defaultTableMappings304.Add(blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase8, zdarzOs.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase20, zdarzOs.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akcjaColumnBase0, zdarzOs.FindProperty("Akcja")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dataDecColumnBase2, zdarzOs.FindProperty("DataDec")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dodParColumnBase0, zdarzOs.FindProperty("DodPar")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)formaDecColumnBase2, zdarzOs.FindProperty("FormaDec")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nowyStatusColumnBase0, zdarzOs.FindProperty("NowyStatus")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typOsIdColumnBase2, zdarzOs.FindProperty("TypOsId")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uzIdColumnBase9, zdarzOs.FindProperty("UzId")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase10, zdarzOs.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zgIdColumnBase4, zdarzOs.FindProperty("ZgId")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase69, zdarzOs.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsMappingBase); + + var tableMappings304 = new List(); + zdarzOs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings304); + var zdarzOsTable = new Table("ZdarzOs", null, relationalModel); + var kontrIdColumn20 = new Column("KontrId", "numeric(9,0)", zdarzOsTable); + zdarzOsTable.Columns.Add("KontrId", kontrIdColumn20); + var kiedyColumn8 = new Column("Kiedy", "varchar(20)", zdarzOsTable); + zdarzOsTable.Columns.Add("Kiedy", kiedyColumn8); + var akcjaColumn0 = new Column("Akcja", "smallint", zdarzOsTable); + zdarzOsTable.Columns.Add("Akcja", akcjaColumn0); + var dataDecColumn2 = new Column("DataDec", "datetime", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("DataDec", dataDecColumn2); + var dodParColumn0 = new Column("DodPar", "varchar(120)", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("DodPar", dodParColumn0); + var formaDecColumn2 = new Column("FormaDec", "smallint", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("FormaDec", formaDecColumn2); + var nowyStatusColumn0 = new Column("NowyStatus", "smallint", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("NowyStatus", nowyStatusColumn0); + var typOsIdColumn2 = new Column("TypOsId", "numeric(9,0)", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("TypOsId", typOsIdColumn2); + var uzIdColumn9 = new Column("UzId", "numeric(9,0)", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("UzId", uzIdColumn9); + var wersjaColumn10 = new Column("Wersja", "varchar(20)", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("Wersja", wersjaColumn10); + var zgIdColumn4 = new Column("ZgId", "numeric(9,0)", zdarzOsTable) + { + IsNullable = true + }; + zdarzOsTable.Columns.Add("ZgId", zgIdColumn4); + var zmianaColumn69 = new Column("Zmiana", "datetime", zdarzOsTable); + zdarzOsTable.Columns.Add("Zmiana", zmianaColumn69); + var pK_ZDARZOS = new UniqueConstraint("PK_ZDARZOS", zdarzOsTable, new[] { kontrIdColumn20, kiedyColumn8 }); + zdarzOsTable.PrimaryKey = pK_ZDARZOS; + var pK_ZDARZOSUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + new[] { "KontrId", "Kiedy" }); + pK_ZDARZOS.MappedKeys.Add(pK_ZDARZOSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZDARZOSUc).Add(pK_ZDARZOS); + zdarzOsTable.UniqueConstraints.Add("PK_ZDARZOS", pK_ZDARZOS); + var idx_ZDOS_OSTDEC = new TableIndex( + "idx_ZDOS_OSTDEC", zdarzOsTable, new[] { kontrIdColumn20, zgIdColumn4, dataDecColumn2 }, false); + var idx_ZDOS_OSTDECIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + "idx_ZDOS_OSTDEC"); + idx_ZDOS_OSTDEC.MappedIndexes.Add(idx_ZDOS_OSTDECIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZDOS_OSTDECIx).Add(idx_ZDOS_OSTDEC); + zdarzOsTable.Indexes.Add("idx_ZDOS_OSTDEC", idx_ZDOS_OSTDEC); + var idx_ZDOS_OSTZGODA = new TableIndex( + "idx_ZDOS_OSTZGODA", zdarzOsTable, new[] { kontrIdColumn20, zgIdColumn4, kiedyColumn8 }, false); + var idx_ZDOS_OSTZGODAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + "idx_ZDOS_OSTZGODA"); + idx_ZDOS_OSTZGODA.MappedIndexes.Add(idx_ZDOS_OSTZGODAIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZDOS_OSTZGODAIx).Add(idx_ZDOS_OSTZGODA); + zdarzOsTable.Indexes.Add("idx_ZDOS_OSTZGODA", idx_ZDOS_OSTZGODA); + var idx_ZDOS_TPOS = new TableIndex( + "idx_ZDOS_TPOS", zdarzOsTable, new[] { typOsIdColumn2 }, false); + var idx_ZDOS_TPOSIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + "idx_ZDOS_TPOS"); + idx_ZDOS_TPOS.MappedIndexes.Add(idx_ZDOS_TPOSIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZDOS_TPOSIx).Add(idx_ZDOS_TPOS); + zdarzOsTable.Indexes.Add("idx_ZDOS_TPOS", idx_ZDOS_TPOS); + var idx_ZDOS_ZG = new TableIndex( + "idx_ZDOS_ZG", zdarzOsTable, new[] { zgIdColumn4 }, false); + var idx_ZDOS_ZGIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + "idx_ZDOS_ZG"); + idx_ZDOS_ZG.MappedIndexes.Add(idx_ZDOS_ZGIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZDOS_ZGIx).Add(idx_ZDOS_ZG); + zdarzOsTable.Indexes.Add("idx_ZDOS_ZG", idx_ZDOS_ZG); + var idx_ZDOS_ZMIANA = new TableIndex( + "idx_ZDOS_ZMIANA", zdarzOsTable, new[] { zmianaColumn69 }, false); + var idx_ZDOS_ZMIANAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + "idx_ZDOS_ZMIANA"); + idx_ZDOS_ZMIANA.MappedIndexes.Add(idx_ZDOS_ZMIANAIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZDOS_ZMIANAIx).Add(idx_ZDOS_ZMIANA); + zdarzOsTable.Indexes.Add("idx_ZDOS_ZMIANA", idx_ZDOS_ZMIANA); + var idx_ZDOSUZKIEDY = new TableIndex( + "idx_ZDOSUZKIEDY", zdarzOsTable, new[] { uzIdColumn9, kiedyColumn8 }, false); + var idx_ZDOSUZKIEDYIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + "idx_ZDOSUZKIEDY"); + idx_ZDOSUZKIEDY.MappedIndexes.Add(idx_ZDOSUZKIEDYIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZDOSUZKIEDYIx).Add(idx_ZDOSUZKIEDY); + zdarzOsTable.Indexes.Add("idx_ZDOSUZKIEDY", idx_ZDOSUZKIEDY); + relationalModel.Tables.Add(("ZdarzOs", null), zdarzOsTable); + var zdarzOsTableMapping = new TableMapping(zdarzOs, zdarzOsTable, true); + zdarzOsTable.AddTypeMapping(zdarzOsTableMapping, false); + tableMappings304.Add(zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn8, zdarzOs.FindProperty("Kiedy")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn20, zdarzOs.FindProperty("KontrId")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(akcjaColumn0, zdarzOs.FindProperty("Akcja")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(dataDecColumn2, zdarzOs.FindProperty("DataDec")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(dodParColumn0, zdarzOs.FindProperty("DodPar")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(formaDecColumn2, zdarzOs.FindProperty("FormaDec")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(nowyStatusColumn0, zdarzOs.FindProperty("NowyStatus")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(typOsIdColumn2, zdarzOs.FindProperty("TypOsId")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(uzIdColumn9, zdarzOs.FindProperty("UzId")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn10, zdarzOs.FindProperty("Wersja")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(zgIdColumn4, zdarzOs.FindProperty("ZgId")!, zdarzOsTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn69, zdarzOs.FindProperty("Zmiana")!, zdarzOsTableMapping); + + var zdarzOsOpis = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ZdarzOsOpis")!; + + var defaultTableMappings305 = new List>(); + zdarzOsOpis.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings305); + var blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ZdarzOsOpis", null, relationalModel); + var kiedyColumnBase9 = new ColumnBase("Kiedy", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase.Columns.Add("Kiedy", kiedyColumnBase9); + var kontrIdColumnBase21 = new ColumnBase("KontrId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase.Columns.Add("KontrId", kontrIdColumnBase21); + var tekstColumnBase35 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase.Columns.Add("Tekst", tekstColumnBase35); + var znaczenieColumnBase44 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase); + blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase.Columns.Add("Znaczenie", znaczenieColumnBase44); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ZdarzOsOpis", blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase); + var blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisMappingBase = new TableMappingBase(zdarzOsOpis, blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisMappingBase, false); + defaultTableMappings305.Add(blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kiedyColumnBase9, zdarzOsOpis.FindProperty("Kiedy")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase21, zdarzOsOpis.FindProperty("KontrId")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase44, zdarzOsOpis.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase35, zdarzOsOpis.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesZdarzOsOpisMappingBase); + + var tableMappings305 = new List(); + zdarzOsOpis.SetRuntimeAnnotation("Relational:TableMappings", tableMappings305); + var zdarzOsOpisTable = new Table("ZdarzOsOpis", null, relationalModel); + var kontrIdColumn21 = new Column("KontrId", "numeric(9,0)", zdarzOsOpisTable); + zdarzOsOpisTable.Columns.Add("KontrId", kontrIdColumn21); + var kiedyColumn9 = new Column("Kiedy", "varchar(20)", zdarzOsOpisTable); + zdarzOsOpisTable.Columns.Add("Kiedy", kiedyColumn9); + var znaczenieColumn44 = new Column("Znaczenie", "smallint", zdarzOsOpisTable); + zdarzOsOpisTable.Columns.Add("Znaczenie", znaczenieColumn44); + var tekstColumn35 = new Column("Tekst", "varchar(255)", zdarzOsOpisTable); + zdarzOsOpisTable.Columns.Add("Tekst", tekstColumn35); + var pK_ZDARZOSOPIS = new UniqueConstraint("PK_ZDARZOSOPIS", zdarzOsOpisTable, new[] { kontrIdColumn21, kiedyColumn9, znaczenieColumn44 }); + zdarzOsOpisTable.PrimaryKey = pK_ZDARZOSOPIS; + var pK_ZDARZOSOPISUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOsOpis", + new[] { "KontrId", "Kiedy", "Znaczenie" }); + pK_ZDARZOSOPIS.MappedKeys.Add(pK_ZDARZOSOPISUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZDARZOSOPISUc).Add(pK_ZDARZOSOPIS); + zdarzOsOpisTable.UniqueConstraints.Add("PK_ZDARZOSOPIS", pK_ZDARZOSOPIS); + relationalModel.Tables.Add(("ZdarzOsOpis", null), zdarzOsOpisTable); + var zdarzOsOpisTableMapping = new TableMapping(zdarzOsOpis, zdarzOsOpisTable, true); + zdarzOsOpisTable.AddTypeMapping(zdarzOsOpisTableMapping, false); + tableMappings305.Add(zdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(kiedyColumn9, zdarzOsOpis.FindProperty("Kiedy")!, zdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn21, zdarzOsOpis.FindProperty("KontrId")!, zdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn44, zdarzOsOpis.FindProperty("Znaczenie")!, zdarzOsOpisTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn35, zdarzOsOpis.FindProperty("Tekst")!, zdarzOsOpisTableMapping); + + var zgoda = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Zgoda")!; + + var defaultTableMappings306 = new List>(); + zgoda.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings306); + var blinkBackofficeServicesPcmDbEntitiesZgodaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Zgoda", null, relationalModel); + var aktywnaColumnBase4 = new ColumnBase("Aktywna", "smallint", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("Aktywna", aktywnaColumnBase4); + var centrZgIdColumnBase0 = new ColumnBase("CentrZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("CentrZgId", centrZgIdColumnBase0); + var daneOsColumnBase0 = new ColumnBase("DaneOs", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("DaneOs", daneOsColumnBase0); + var komentarzColumnBase5 = new ColumnBase("Komentarz", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("Komentarz", komentarzColumnBase5); + var nazwaColumnBase66 = new ColumnBase("Nazwa", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("Nazwa", nazwaColumnBase66); + var wersjaColumnBase11 = new ColumnBase("Wersja", "varchar(20)", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("Wersja", wersjaColumnBase11); + var zastosowaniaColumnBase0 = new ColumnBase("Zastosowania", "varchar(120)", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("Zastosowania", zastosowaniaColumnBase0); + var zgIdColumnBase5 = new ColumnBase("ZgId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("ZgId", zgIdColumnBase5); + var zmianaColumnBase70 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase); + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.Columns.Add("Zmiana", zmianaColumnBase70); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Zgoda", blinkBackofficeServicesPcmDbEntitiesZgodaTableBase); + var blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase = new TableMappingBase(zgoda, blinkBackofficeServicesPcmDbEntitiesZgodaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZgodaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase, false); + defaultTableMappings306.Add(blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zgIdColumnBase5, zgoda.FindProperty("ZgId")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)aktywnaColumnBase4, zgoda.FindProperty("Aktywna")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centrZgIdColumnBase0, zgoda.FindProperty("CentrZgId")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)daneOsColumnBase0, zgoda.FindProperty("DaneOs")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)komentarzColumnBase5, zgoda.FindProperty("Komentarz")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaColumnBase66, zgoda.FindProperty("Nazwa")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wersjaColumnBase11, zgoda.FindProperty("Wersja")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zastosowaniaColumnBase0, zgoda.FindProperty("Zastosowania")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase70, zgoda.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesZgodaMappingBase); + + var tableMappings306 = new List(); + zgoda.SetRuntimeAnnotation("Relational:TableMappings", tableMappings306); + var zgodaTable = new Table("Zgoda", null, relationalModel); + var zgIdColumn5 = new Column("ZgId", "numeric(9,0)", zgodaTable); + zgodaTable.Columns.Add("ZgId", zgIdColumn5); + var aktywnaColumn4 = new Column("Aktywna", "smallint", zgodaTable); + zgodaTable.Columns.Add("Aktywna", aktywnaColumn4); + var centrZgIdColumn0 = new Column("CentrZgId", "numeric(9,0)", zgodaTable) + { + IsNullable = true + }; + zgodaTable.Columns.Add("CentrZgId", centrZgIdColumn0); + var daneOsColumn0 = new Column("DaneOs", "varchar(120)", zgodaTable) + { + IsNullable = true + }; + zgodaTable.Columns.Add("DaneOs", daneOsColumn0); + var komentarzColumn5 = new Column("Komentarz", "varchar(255)", zgodaTable) + { + IsNullable = true + }; + zgodaTable.Columns.Add("Komentarz", komentarzColumn5); + var nazwaColumn66 = new Column("Nazwa", "varchar(60)", zgodaTable); + zgodaTable.Columns.Add("Nazwa", nazwaColumn66); + var wersjaColumn11 = new Column("Wersja", "varchar(20)", zgodaTable) + { + IsNullable = true + }; + zgodaTable.Columns.Add("Wersja", wersjaColumn11); + var zastosowaniaColumn0 = new Column("Zastosowania", "varchar(120)", zgodaTable) + { + IsNullable = true + }; + zgodaTable.Columns.Add("Zastosowania", zastosowaniaColumn0); + var zmianaColumn70 = new Column("Zmiana", "datetime", zgodaTable); + zgodaTable.Columns.Add("Zmiana", zmianaColumn70); + var pK_ZGODA = new UniqueConstraint("PK_ZGODA", zgodaTable, new[] { zgIdColumn5 }); + zgodaTable.PrimaryKey = pK_ZGODA; + var pK_ZGODAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + new[] { "ZgId" }); + pK_ZGODA.MappedKeys.Add(pK_ZGODAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZGODAUc).Add(pK_ZGODA); + zgodaTable.UniqueConstraints.Add("PK_ZGODA", pK_ZGODA); + var idx_ZG_ZMIANA = new TableIndex( + "idx_ZG_ZMIANA", zgodaTable, new[] { zmianaColumn70 }, false); + var idx_ZG_ZMIANAIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + "idx_ZG_ZMIANA"); + idx_ZG_ZMIANA.MappedIndexes.Add(idx_ZG_ZMIANAIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZG_ZMIANAIx).Add(idx_ZG_ZMIANA); + zgodaTable.Indexes.Add("idx_ZG_ZMIANA", idx_ZG_ZMIANA); + relationalModel.Tables.Add(("Zgoda", null), zgodaTable); + var zgodaTableMapping = new TableMapping(zgoda, zgodaTable, true); + zgodaTable.AddTypeMapping(zgodaTableMapping, false); + tableMappings306.Add(zgodaTableMapping); + RelationalModel.CreateColumnMapping(zgIdColumn5, zgoda.FindProperty("ZgId")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(aktywnaColumn4, zgoda.FindProperty("Aktywna")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(centrZgIdColumn0, zgoda.FindProperty("CentrZgId")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(daneOsColumn0, zgoda.FindProperty("DaneOs")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(komentarzColumn5, zgoda.FindProperty("Komentarz")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(nazwaColumn66, zgoda.FindProperty("Nazwa")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(wersjaColumn11, zgoda.FindProperty("Wersja")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(zastosowaniaColumn0, zgoda.FindProperty("Zastosowania")!, zgodaTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn70, zgoda.FindProperty("Zmiana")!, zgodaTableMapping); + + var zlecKomunikat = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ZlecKomunikat")!; + + var defaultTableMappings307 = new List>(); + zlecKomunikat.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings307); + var blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ZlecKomunikat", null, relationalModel); + var kasaIdColumnBase7 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase.Columns.Add("KasaId", kasaIdColumnBase7); + var kolejnoscColumnBase67 = new ColumnBase("Kolejnosc", "int", blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase.Columns.Add("Kolejnosc", kolejnoscColumnBase67); + var tekstColumnBase36 = new ColumnBase("Tekst", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase.Columns.Add("Tekst", tekstColumnBase36); + var zlecIdColumnBase = new ColumnBase("ZlecId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase.Columns.Add("ZlecId", zlecIdColumnBase); + var znaczenieColumnBase45 = new ColumnBase("Znaczenie", "smallint", blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase.Columns.Add("Znaczenie", znaczenieColumnBase45); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ZlecKomunikat", blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase); + var blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase = new TableMappingBase(zlecKomunikat, blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZlecKomunikatTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase, false); + defaultTableMappings307.Add(blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase7, zlecKomunikat.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kolejnoscColumnBase67, zlecKomunikat.FindProperty("Kolejnosc")!, blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zlecIdColumnBase, zlecKomunikat.FindProperty("ZlecId")!, blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase36, zlecKomunikat.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)znaczenieColumnBase45, zlecKomunikat.FindProperty("Znaczenie")!, blinkBackofficeServicesPcmDbEntitiesZlecKomunikatMappingBase); + + var tableMappings307 = new List(); + zlecKomunikat.SetRuntimeAnnotation("Relational:TableMappings", tableMappings307); + var zlecKomunikatTable = new Table("ZlecKomunikat", null, relationalModel); + var kasaIdColumn7 = new Column("KasaId", "numeric(9,0)", zlecKomunikatTable); + zlecKomunikatTable.Columns.Add("KasaId", kasaIdColumn7); + var zlecIdColumn = new Column("ZlecId", "numeric(9,0)", zlecKomunikatTable); + zlecKomunikatTable.Columns.Add("ZlecId", zlecIdColumn); + var kolejnoscColumn67 = new Column("Kolejnosc", "int", zlecKomunikatTable); + zlecKomunikatTable.Columns.Add("Kolejnosc", kolejnoscColumn67); + var tekstColumn36 = new Column("Tekst", "varchar(255)", zlecKomunikatTable); + zlecKomunikatTable.Columns.Add("Tekst", tekstColumn36); + var znaczenieColumn45 = new Column("Znaczenie", "smallint", zlecKomunikatTable); + zlecKomunikatTable.Columns.Add("Znaczenie", znaczenieColumn45); + var pK_ZLECKOMUNIKAT = new UniqueConstraint("PK_ZLECKOMUNIKAT", zlecKomunikatTable, new[] { kasaIdColumn7, zlecIdColumn, kolejnoscColumn67 }); + zlecKomunikatTable.PrimaryKey = pK_ZLECKOMUNIKAT; + var pK_ZLECKOMUNIKATUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZlecKomunikat", + new[] { "KasaId", "ZlecId", "Kolejnosc" }); + pK_ZLECKOMUNIKAT.MappedKeys.Add(pK_ZLECKOMUNIKATUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZLECKOMUNIKATUc).Add(pK_ZLECKOMUNIKAT); + zlecKomunikatTable.UniqueConstraints.Add("PK_ZLECKOMUNIKAT", pK_ZLECKOMUNIKAT); + relationalModel.Tables.Add(("ZlecKomunikat", null), zlecKomunikatTable); + var zlecKomunikatTableMapping = new TableMapping(zlecKomunikat, zlecKomunikatTable, true); + zlecKomunikatTable.AddTypeMapping(zlecKomunikatTableMapping, false); + tableMappings307.Add(zlecKomunikatTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn7, zlecKomunikat.FindProperty("KasaId")!, zlecKomunikatTableMapping); + RelationalModel.CreateColumnMapping(kolejnoscColumn67, zlecKomunikat.FindProperty("Kolejnosc")!, zlecKomunikatTableMapping); + RelationalModel.CreateColumnMapping(zlecIdColumn, zlecKomunikat.FindProperty("ZlecId")!, zlecKomunikatTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn36, zlecKomunikat.FindProperty("Tekst")!, zlecKomunikatTableMapping); + RelationalModel.CreateColumnMapping(znaczenieColumn45, zlecKomunikat.FindProperty("Znaczenie")!, zlecKomunikatTableMapping); + + var zlecParam = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ZlecParam")!; + + var defaultTableMappings308 = new List>(); + zlecParam.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings308); + var blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ZlecParam", null, relationalModel); + var kasaIdColumnBase8 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase.Columns.Add("KasaId", kasaIdColumnBase8); + var parNazwaColumnBase7 = new ColumnBase("ParNazwa", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase.Columns.Add("ParNazwa", parNazwaColumnBase7); + var parWartoscColumnBase5 = new ColumnBase("ParWartosc", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase.Columns.Add("ParWartosc", parWartoscColumnBase5); + var zlecIdColumnBase0 = new ColumnBase("ZlecId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase.Columns.Add("ZlecId", zlecIdColumnBase0); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ZlecParam", blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase); + var blinkBackofficeServicesPcmDbEntitiesZlecParamMappingBase = new TableMappingBase(zlecParam, blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZlecParamTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZlecParamMappingBase, false); + defaultTableMappings308.Add(blinkBackofficeServicesPcmDbEntitiesZlecParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase8, zlecParam.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesZlecParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parNazwaColumnBase7, zlecParam.FindProperty("ParNazwa")!, blinkBackofficeServicesPcmDbEntitiesZlecParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zlecIdColumnBase0, zlecParam.FindProperty("ZlecId")!, blinkBackofficeServicesPcmDbEntitiesZlecParamMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parWartoscColumnBase5, zlecParam.FindProperty("ParWartosc")!, blinkBackofficeServicesPcmDbEntitiesZlecParamMappingBase); + + var tableMappings308 = new List(); + zlecParam.SetRuntimeAnnotation("Relational:TableMappings", tableMappings308); + var zlecParamTable = new Table("ZlecParam", null, relationalModel); + var kasaIdColumn8 = new Column("KasaId", "numeric(9,0)", zlecParamTable); + zlecParamTable.Columns.Add("KasaId", kasaIdColumn8); + var zlecIdColumn0 = new Column("ZlecId", "numeric(9,0)", zlecParamTable); + zlecParamTable.Columns.Add("ZlecId", zlecIdColumn0); + var parNazwaColumn7 = new Column("ParNazwa", "varchar(40)", zlecParamTable); + zlecParamTable.Columns.Add("ParNazwa", parNazwaColumn7); + var parWartoscColumn5 = new Column("ParWartosc", "varchar(255)", zlecParamTable); + zlecParamTable.Columns.Add("ParWartosc", parWartoscColumn5); + var pK_ZLECPARAM = new UniqueConstraint("PK_ZLECPARAM", zlecParamTable, new[] { kasaIdColumn8, zlecIdColumn0, parNazwaColumn7 }); + zlecParamTable.PrimaryKey = pK_ZLECPARAM; + var pK_ZLECPARAMUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZlecParam", + new[] { "KasaId", "ZlecId", "ParNazwa" }); + pK_ZLECPARAM.MappedKeys.Add(pK_ZLECPARAMUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZLECPARAMUc).Add(pK_ZLECPARAM); + zlecParamTable.UniqueConstraints.Add("PK_ZLECPARAM", pK_ZLECPARAM); + relationalModel.Tables.Add(("ZlecParam", null), zlecParamTable); + var zlecParamTableMapping = new TableMapping(zlecParam, zlecParamTable, true); + zlecParamTable.AddTypeMapping(zlecParamTableMapping, false); + tableMappings308.Add(zlecParamTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn8, zlecParam.FindProperty("KasaId")!, zlecParamTableMapping); + RelationalModel.CreateColumnMapping(parNazwaColumn7, zlecParam.FindProperty("ParNazwa")!, zlecParamTableMapping); + RelationalModel.CreateColumnMapping(zlecIdColumn0, zlecParam.FindProperty("ZlecId")!, zlecParamTableMapping); + RelationalModel.CreateColumnMapping(parWartoscColumn5, zlecParam.FindProperty("ParWartosc")!, zlecParamTableMapping); + + var zlecenie = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Zlecenie")!; + + var defaultTableMappings309 = new List>(); + zlecenie.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings309); + var blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Zlecenie", null, relationalModel); + var alarmColumnBase = new ColumnBase("Alarm", "smallint", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("Alarm", alarmColumnBase); + var kasaIdColumnBase9 = new ColumnBase("KasaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("KasaId", kasaIdColumnBase9); + var nazwaDodColumnBase = new ColumnBase("NazwaDod", "varchar(60)", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("NazwaDod", nazwaDodColumnBase); + var nieUsuwacColumnBase = new ColumnBase("NieUsuwac", "smallint", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("NieUsuwac", nieUsuwacColumnBase); + var parIdColumnBase17 = new ColumnBase("ParId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("ParId", parIdColumnBase17); + var paramColumnBase3 = new ColumnBase("Param", "int", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("Param", paramColumnBase3); + var statusColumnBase9 = new ColumnBase("Status", "smallint", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("Status", statusColumnBase9); + var typColumnBase41 = new ColumnBase("Typ", "smallint", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("Typ", typColumnBase41); + var utworzonoColumnBase2 = new ColumnBase("Utworzono", "datetime", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("Utworzono", utworzonoColumnBase2); + var wstrzymanieColumnBase = new ColumnBase("Wstrzymanie", "varchar(255)", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("Wstrzymanie", wstrzymanieColumnBase); + var zlecIdColumnBase1 = new ColumnBase("ZlecId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("ZlecId", zlecIdColumnBase1); + var zmianaColumnBase71 = new ColumnBase("Zmiana", "datetime", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.Columns.Add("Zmiana", zmianaColumnBase71); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Zlecenie", blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase); + var blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase = new TableMappingBase(zlecenie, blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZlecenieTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase, false); + defaultTableMappings309.Add(blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase9, zlecenie.FindProperty("KasaId")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zlecIdColumnBase1, zlecenie.FindProperty("ZlecId")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)alarmColumnBase, zlecenie.FindProperty("Alarm")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nazwaDodColumnBase, zlecenie.FindProperty("NazwaDod")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nieUsuwacColumnBase, zlecenie.FindProperty("NieUsuwac")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)parIdColumnBase17, zlecenie.FindProperty("ParId")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)paramColumnBase3, zlecenie.FindProperty("Param")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)statusColumnBase9, zlecenie.FindProperty("Status")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typColumnBase41, zlecenie.FindProperty("Typ")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)utworzonoColumnBase2, zlecenie.FindProperty("Utworzono")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)wstrzymanieColumnBase, zlecenie.FindProperty("Wstrzymanie")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmianaColumnBase71, zlecenie.FindProperty("Zmiana")!, blinkBackofficeServicesPcmDbEntitiesZlecenieMappingBase); + + var tableMappings309 = new List(); + zlecenie.SetRuntimeAnnotation("Relational:TableMappings", tableMappings309); + var zlecenieTable = new Table("Zlecenie", null, relationalModel); + var kasaIdColumn9 = new Column("KasaId", "numeric(9,0)", zlecenieTable); + zlecenieTable.Columns.Add("KasaId", kasaIdColumn9); + var zlecIdColumn1 = new Column("ZlecId", "numeric(9,0)", zlecenieTable); + zlecenieTable.Columns.Add("ZlecId", zlecIdColumn1); + var alarmColumn = new Column("Alarm", "smallint", zlecenieTable); + zlecenieTable.Columns.Add("Alarm", alarmColumn); + var nazwaDodColumn = new Column("NazwaDod", "varchar(60)", zlecenieTable) + { + IsNullable = true + }; + zlecenieTable.Columns.Add("NazwaDod", nazwaDodColumn); + var nieUsuwacColumn = new Column("NieUsuwac", "smallint", zlecenieTable); + zlecenieTable.Columns.Add("NieUsuwac", nieUsuwacColumn); + var parIdColumn17 = new Column("ParId", "numeric(9,0)", zlecenieTable) + { + IsNullable = true + }; + zlecenieTable.Columns.Add("ParId", parIdColumn17); + var paramColumn3 = new Column("Param", "int", zlecenieTable); + zlecenieTable.Columns.Add("Param", paramColumn3); + var statusColumn9 = new Column("Status", "smallint", zlecenieTable); + zlecenieTable.Columns.Add("Status", statusColumn9); + var typColumn41 = new Column("Typ", "smallint", zlecenieTable); + zlecenieTable.Columns.Add("Typ", typColumn41); + var utworzonoColumn2 = new Column("Utworzono", "datetime", zlecenieTable); + zlecenieTable.Columns.Add("Utworzono", utworzonoColumn2); + var wstrzymanieColumn = new Column("Wstrzymanie", "varchar(255)", zlecenieTable) + { + IsNullable = true + }; + zlecenieTable.Columns.Add("Wstrzymanie", wstrzymanieColumn); + var zmianaColumn71 = new Column("Zmiana", "datetime", zlecenieTable); + zlecenieTable.Columns.Add("Zmiana", zmianaColumn71); + var pK_ZLECENIE = new UniqueConstraint("PK_ZLECENIE", zlecenieTable, new[] { kasaIdColumn9, zlecIdColumn1 }); + zlecenieTable.PrimaryKey = pK_ZLECENIE; + var pK_ZLECENIEUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zlecenie", + new[] { "KasaId", "ZlecId" }); + pK_ZLECENIE.MappedKeys.Add(pK_ZLECENIEUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZLECENIEUc).Add(pK_ZLECENIE); + zlecenieTable.UniqueConstraints.Add("PK_ZLECENIE", pK_ZLECENIE); + relationalModel.Tables.Add(("Zlecenie", null), zlecenieTable); + var zlecenieTableMapping = new TableMapping(zlecenie, zlecenieTable, true); + zlecenieTable.AddTypeMapping(zlecenieTableMapping, false); + tableMappings309.Add(zlecenieTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn9, zlecenie.FindProperty("KasaId")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(zlecIdColumn1, zlecenie.FindProperty("ZlecId")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(alarmColumn, zlecenie.FindProperty("Alarm")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(nazwaDodColumn, zlecenie.FindProperty("NazwaDod")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(nieUsuwacColumn, zlecenie.FindProperty("NieUsuwac")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(parIdColumn17, zlecenie.FindProperty("ParId")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(paramColumn3, zlecenie.FindProperty("Param")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(statusColumn9, zlecenie.FindProperty("Status")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(typColumn41, zlecenie.FindProperty("Typ")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(utworzonoColumn2, zlecenie.FindProperty("Utworzono")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(wstrzymanieColumn, zlecenie.FindProperty("Wstrzymanie")!, zlecenieTableMapping); + RelationalModel.CreateColumnMapping(zmianaColumn71, zlecenie.FindProperty("Zmiana")!, zlecenieTableMapping); + + var zmiana = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.Zmiana")!; + + var defaultTableMappings310 = new List>(); + zmiana.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings310); + var blinkBackofficeServicesPcmDbEntitiesZmianaTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.Zmiana", null, relationalModel); + var akcjaColumnBase1 = new ColumnBase("Akcja", "smallint", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("Akcja", akcjaColumnBase1); + var czasColumnBase = new ColumnBase("Czas", "datetime", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("Czas", czasColumnBase); + var sesjaIdColumnBase2 = new ColumnBase("SesjaId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("SesjaId", sesjaIdColumnBase2); + var sklepIdColumnBase113 = new ColumnBase("SklepId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("SklepId", sklepIdColumnBase113); + var tabIdColumnBase = new ColumnBase("TabId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase) + { + IsNullable = true + }; + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("TabId", tabIdColumnBase); + var tabelaColumnBase1 = new ColumnBase("Tabela", "smallint", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("Tabela", tabelaColumnBase1); + var tekstColumnBase37 = new ColumnBase("Tekst", "varchar(40)", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("Tekst", tekstColumnBase37); + var zmIdColumnBase3 = new ColumnBase("ZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.Columns.Add("ZmId", zmIdColumnBase3); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.Zmiana", blinkBackofficeServicesPcmDbEntitiesZmianaTableBase); + var blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase = new TableMappingBase(zmiana, blinkBackofficeServicesPcmDbEntitiesZmianaTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZmianaTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase, false); + defaultTableMappings310.Add(blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmIdColumnBase3, zmiana.FindProperty("ZmId")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)akcjaColumnBase1, zmiana.FindProperty("Akcja")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)czasColumnBase, zmiana.FindProperty("Czas")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sesjaIdColumnBase2, zmiana.FindProperty("SesjaId")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase113, zmiana.FindProperty("SklepId")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tabIdColumnBase, zmiana.FindProperty("TabId")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tabelaColumnBase1, zmiana.FindProperty("Tabela")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)tekstColumnBase37, zmiana.FindProperty("Tekst")!, blinkBackofficeServicesPcmDbEntitiesZmianaMappingBase); + + var tableMappings310 = new List(); + zmiana.SetRuntimeAnnotation("Relational:TableMappings", tableMappings310); + var zmianaTable = new Table("Zmiana", null, relationalModel); + var zmIdColumn3 = new Column("ZmId", "numeric(9,0)", zmianaTable); + zmianaTable.Columns.Add("ZmId", zmIdColumn3); + var akcjaColumn1 = new Column("Akcja", "smallint", zmianaTable); + zmianaTable.Columns.Add("Akcja", akcjaColumn1); + var czasColumn = new Column("Czas", "datetime", zmianaTable); + zmianaTable.Columns.Add("Czas", czasColumn); + var sesjaIdColumn2 = new Column("SesjaId", "numeric(9,0)", zmianaTable); + zmianaTable.Columns.Add("SesjaId", sesjaIdColumn2); + var sklepIdColumn113 = new Column("SklepId", "numeric(9,0)", zmianaTable) + { + IsNullable = true + }; + zmianaTable.Columns.Add("SklepId", sklepIdColumn113); + var tabIdColumn = new Column("TabId", "numeric(9,0)", zmianaTable) + { + IsNullable = true + }; + zmianaTable.Columns.Add("TabId", tabIdColumn); + var tabelaColumn1 = new Column("Tabela", "smallint", zmianaTable); + zmianaTable.Columns.Add("Tabela", tabelaColumn1); + var tekstColumn37 = new Column("Tekst", "varchar(40)", zmianaTable); + zmianaTable.Columns.Add("Tekst", tekstColumn37); + var pK_ZMIANA = new UniqueConstraint("PK_ZMIANA", zmianaTable, new[] { zmIdColumn3 }); + zmianaTable.PrimaryKey = pK_ZMIANA; + var pK_ZMIANAUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + new[] { "ZmId" }); + pK_ZMIANA.MappedKeys.Add(pK_ZMIANAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZMIANAUc).Add(pK_ZMIANA); + zmianaTable.UniqueConstraints.Add("PK_ZMIANA", pK_ZMIANA); + var idx_ZmianaSesjaId = new TableIndex( + "idx_ZmianaSesjaId", zmianaTable, new[] { sesjaIdColumn2 }, false); + var idx_ZmianaSesjaIdIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + "idx_ZmianaSesjaId"); + idx_ZmianaSesjaId.MappedIndexes.Add(idx_ZmianaSesjaIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZmianaSesjaIdIx).Add(idx_ZmianaSesjaId); + zmianaTable.Indexes.Add("idx_ZmianaSesjaId", idx_ZmianaSesjaId); + var idx_ZmSkTabIdCzas = new TableIndex( + "idx_ZmSkTabIdCzas", zmianaTable, new[] { sklepIdColumn113, tabIdColumn, czasColumn }, false); + var idx_ZmSkTabIdCzasIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + "idx_ZmSkTabIdCzas"); + idx_ZmSkTabIdCzas.MappedIndexes.Add(idx_ZmSkTabIdCzasIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZmSkTabIdCzasIx).Add(idx_ZmSkTabIdCzas); + zmianaTable.Indexes.Add("idx_ZmSkTabIdCzas", idx_ZmSkTabIdCzas); + var idx_ZmTabIdCzas = new TableIndex( + "idx_ZmTabIdCzas", zmianaTable, new[] { tabIdColumn, czasColumn }, false); + var idx_ZmTabIdCzasIx = RelationalModel.GetIndex(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + "idx_ZmTabIdCzas"); + idx_ZmTabIdCzas.MappedIndexes.Add(idx_ZmTabIdCzasIx); + RelationalModel.GetOrCreateTableIndexes(idx_ZmTabIdCzasIx).Add(idx_ZmTabIdCzas); + zmianaTable.Indexes.Add("idx_ZmTabIdCzas", idx_ZmTabIdCzas); + relationalModel.Tables.Add(("Zmiana", null), zmianaTable); + var zmianaTableMapping = new TableMapping(zmiana, zmianaTable, true); + zmianaTable.AddTypeMapping(zmianaTableMapping, false); + tableMappings310.Add(zmianaTableMapping); + RelationalModel.CreateColumnMapping(zmIdColumn3, zmiana.FindProperty("ZmId")!, zmianaTableMapping); + RelationalModel.CreateColumnMapping(akcjaColumn1, zmiana.FindProperty("Akcja")!, zmianaTableMapping); + RelationalModel.CreateColumnMapping(czasColumn, zmiana.FindProperty("Czas")!, zmianaTableMapping); + RelationalModel.CreateColumnMapping(sesjaIdColumn2, zmiana.FindProperty("SesjaId")!, zmianaTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn113, zmiana.FindProperty("SklepId")!, zmianaTableMapping); + RelationalModel.CreateColumnMapping(tabIdColumn, zmiana.FindProperty("TabId")!, zmianaTableMapping); + RelationalModel.CreateColumnMapping(tabelaColumn1, zmiana.FindProperty("Tabela")!, zmianaTableMapping); + RelationalModel.CreateColumnMapping(tekstColumn37, zmiana.FindProperty("Tekst")!, zmianaTableMapping); + + var zmianaTabeli = FindEntityType("Blink.Backoffice.Services.PcmDb.Entities.ZmianaTabeli")!; + + var defaultTableMappings311 = new List>(); + zmianaTabeli.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings311); + var blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase = new TableBase("Blink.Backoffice.Services.PcmDb.Entities.ZmianaTabeli", null, relationalModel); + var idColumnBase8 = new ColumnBase("Id", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase.Columns.Add("Id", idColumnBase8); + var zmIdColumnBase4 = new ColumnBase("ZmId", "numeric(9,0)", blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase); + blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase.Columns.Add("ZmId", zmIdColumnBase4); + relationalModel.DefaultTables.Add("Blink.Backoffice.Services.PcmDb.Entities.ZmianaTabeli", blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase); + var blinkBackofficeServicesPcmDbEntitiesZmianaTabeliMappingBase = new TableMappingBase(zmianaTabeli, blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase, true); + blinkBackofficeServicesPcmDbEntitiesZmianaTabeliTableBase.AddTypeMapping(blinkBackofficeServicesPcmDbEntitiesZmianaTabeliMappingBase, false); + defaultTableMappings311.Add(blinkBackofficeServicesPcmDbEntitiesZmianaTabeliMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase8, zmianaTabeli.FindProperty("Id")!, blinkBackofficeServicesPcmDbEntitiesZmianaTabeliMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)zmIdColumnBase4, zmianaTabeli.FindProperty("ZmId")!, blinkBackofficeServicesPcmDbEntitiesZmianaTabeliMappingBase); + + var tableMappings311 = new List(); + zmianaTabeli.SetRuntimeAnnotation("Relational:TableMappings", tableMappings311); + var zmianaTabeliTable = new Table("ZmianaTabeli", null, relationalModel); + var zmIdColumn4 = new Column("ZmId", "numeric(9,0)", zmianaTabeliTable); + zmianaTabeliTable.Columns.Add("ZmId", zmIdColumn4); + var idColumn8 = new Column("Id", "numeric(9,0)", zmianaTabeliTable); + zmianaTabeliTable.Columns.Add("Id", idColumn8); + var pK_ZMIANATABELI = new UniqueConstraint("PK_ZMIANATABELI", zmianaTabeliTable, new[] { zmIdColumn4, idColumn8 }); + zmianaTabeliTable.PrimaryKey = pK_ZMIANATABELI; + var pK_ZMIANATABELIUc = RelationalModel.GetKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZmianaTabeli", + new[] { "ZmId", "Id" }); + pK_ZMIANATABELI.MappedKeys.Add(pK_ZMIANATABELIUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_ZMIANATABELIUc).Add(pK_ZMIANATABELI); + zmianaTabeliTable.UniqueConstraints.Add("PK_ZMIANATABELI", pK_ZMIANATABELI); + relationalModel.Tables.Add(("ZmianaTabeli", null), zmianaTabeliTable); + var zmianaTabeliTableMapping = new TableMapping(zmianaTabeli, zmianaTabeliTable, true); + zmianaTabeliTable.AddTypeMapping(zmianaTabeliTableMapping, false); + tableMappings311.Add(zmianaTabeliTableMapping); + RelationalModel.CreateColumnMapping(idColumn8, zmianaTabeli.FindProperty("Id")!, zmianaTabeliTableMapping); + RelationalModel.CreateColumnMapping(zmIdColumn4, zmianaTabeli.FindProperty("ZmId")!, zmianaTabeliTableMapping); + + var dokKontoBankowe = FindEntityType("DokKontoBankowe")!; + + var defaultTableMappings312 = new List>(); + dokKontoBankowe.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings312); + var dokKontoBankoweTableBase = new TableBase("DokKontoBankowe", null, relationalModel); + var dokIdColumnBase26 = new ColumnBase("DokId", "numeric(9,0)", dokKontoBankoweTableBase); + dokKontoBankoweTableBase.Columns.Add("DokId", dokIdColumnBase26); + var kBIdColumnBase2 = new ColumnBase("KBId", "numeric(9,0)", dokKontoBankoweTableBase); + dokKontoBankoweTableBase.Columns.Add("KBId", kBIdColumnBase2); + relationalModel.DefaultTables.Add("DokKontoBankowe", dokKontoBankoweTableBase); + var dokKontoBankoweMappingBase = new TableMappingBase(dokKontoBankowe, dokKontoBankoweTableBase, true); + dokKontoBankoweTableBase.AddTypeMapping(dokKontoBankoweMappingBase, false); + defaultTableMappings312.Add(dokKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)dokIdColumnBase26, dokKontoBankowe.FindProperty("DokId")!, dokKontoBankoweMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kBIdColumnBase2, dokKontoBankowe.FindProperty("KBId")!, dokKontoBankoweMappingBase); + + var tableMappings312 = new List(); + dokKontoBankowe.SetRuntimeAnnotation("Relational:TableMappings", tableMappings312); + var dokKontoBankoweTable = new Table("DokKontoBankowe", null, relationalModel); + var dokIdColumn26 = new Column("DokId", "numeric(9,0)", dokKontoBankoweTable); + dokKontoBankoweTable.Columns.Add("DokId", dokIdColumn26); + var kBIdColumn2 = new Column("KBId", "numeric(9,0)", dokKontoBankoweTable); + dokKontoBankoweTable.Columns.Add("KBId", kBIdColumn2); + var pK_DokKontoBankowe = new UniqueConstraint("PK_DokKontoBankowe", dokKontoBankoweTable, new[] { dokIdColumn26, kBIdColumn2 }); + dokKontoBankoweTable.PrimaryKey = pK_DokKontoBankowe; + var pK_DokKontoBankoweUc = RelationalModel.GetKey(this, + "DokKontoBankowe", + new[] { "DokId", "KBId" }); + pK_DokKontoBankowe.MappedKeys.Add(pK_DokKontoBankoweUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_DokKontoBankoweUc).Add(pK_DokKontoBankowe); + dokKontoBankoweTable.UniqueConstraints.Add("PK_DokKontoBankowe", pK_DokKontoBankowe); + var iX_DokKontoBankowe_KBId = new TableIndex( + "IX_DokKontoBankowe_KBId", dokKontoBankoweTable, new[] { kBIdColumn2 }, false); + var iX_DokKontoBankowe_KBIdIx = RelationalModel.GetIndex(this, + "DokKontoBankowe", + new[] { "KBId" }); + iX_DokKontoBankowe_KBId.MappedIndexes.Add(iX_DokKontoBankowe_KBIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_DokKontoBankowe_KBIdIx).Add(iX_DokKontoBankowe_KBId); + dokKontoBankoweTable.Indexes.Add("IX_DokKontoBankowe_KBId", iX_DokKontoBankowe_KBId); + relationalModel.Tables.Add(("DokKontoBankowe", null), dokKontoBankoweTable); + var dokKontoBankoweTableMapping = new TableMapping(dokKontoBankowe, dokKontoBankoweTable, true); + dokKontoBankoweTable.AddTypeMapping(dokKontoBankoweTableMapping, false); + tableMappings312.Add(dokKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(dokIdColumn26, dokKontoBankowe.FindProperty("DokId")!, dokKontoBankoweTableMapping); + RelationalModel.CreateColumnMapping(kBIdColumn2, dokKontoBankowe.FindProperty("KBId")!, dokKontoBankoweTableMapping); + + var kthTypOs = FindEntityType("KthTypOs")!; + + var defaultTableMappings313 = new List>(); + kthTypOs.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings313); + var kthTypOsTableBase = new TableBase("KthTypOs", null, relationalModel); + var kontrIdColumnBase22 = new ColumnBase("KontrId", "numeric(9,0)", kthTypOsTableBase); + kthTypOsTableBase.Columns.Add("KontrId", kontrIdColumnBase22); + var typOsIdColumnBase3 = new ColumnBase("TypOsId", "numeric(9,0)", kthTypOsTableBase); + kthTypOsTableBase.Columns.Add("TypOsId", typOsIdColumnBase3); + relationalModel.DefaultTables.Add("KthTypOs", kthTypOsTableBase); + var kthTypOsMappingBase = new TableMappingBase(kthTypOs, kthTypOsTableBase, true); + kthTypOsTableBase.AddTypeMapping(kthTypOsMappingBase, false); + defaultTableMappings313.Add(kthTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase22, kthTypOs.FindProperty("KontrId")!, kthTypOsMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)typOsIdColumnBase3, kthTypOs.FindProperty("TypOsId")!, kthTypOsMappingBase); + + var tableMappings313 = new List(); + kthTypOs.SetRuntimeAnnotation("Relational:TableMappings", tableMappings313); + var kthTypOsTable = new Table("KthTypOs", null, relationalModel); + var kontrIdColumn22 = new Column("KontrId", "numeric(9,0)", kthTypOsTable); + kthTypOsTable.Columns.Add("KontrId", kontrIdColumn22); + var typOsIdColumn3 = new Column("TypOsId", "numeric(9,0)", kthTypOsTable); + kthTypOsTable.Columns.Add("TypOsId", typOsIdColumn3); + var pK_KTHTYPOS = new UniqueConstraint("PK_KTHTYPOS", kthTypOsTable, new[] { kontrIdColumn22, typOsIdColumn3 }); + kthTypOsTable.PrimaryKey = pK_KTHTYPOS; + var pK_KTHTYPOSUc = RelationalModel.GetKey(this, + "KthTypOs", + new[] { "KontrId", "TypOsId" }); + pK_KTHTYPOS.MappedKeys.Add(pK_KTHTYPOSUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KTHTYPOSUc).Add(pK_KTHTYPOS); + kthTypOsTable.UniqueConstraints.Add("PK_KTHTYPOS", pK_KTHTYPOS); + var idx_KTHTYPOS_TYPOS = new TableIndex( + "idx_KTHTYPOS_TYPOS", kthTypOsTable, new[] { typOsIdColumn3 }, false); + var idx_KTHTYPOS_TYPOSIx = RelationalModel.GetIndex(this, + "KthTypOs", + "idx_KTHTYPOS_TYPOS"); + idx_KTHTYPOS_TYPOS.MappedIndexes.Add(idx_KTHTYPOS_TYPOSIx); + RelationalModel.GetOrCreateTableIndexes(idx_KTHTYPOS_TYPOSIx).Add(idx_KTHTYPOS_TYPOS); + kthTypOsTable.Indexes.Add("idx_KTHTYPOS_TYPOS", idx_KTHTYPOS_TYPOS); + relationalModel.Tables.Add(("KthTypOs", null), kthTypOsTable); + var kthTypOsTableMapping = new TableMapping(kthTypOs, kthTypOsTable, true); + kthTypOsTable.AddTypeMapping(kthTypOsTableMapping, false); + tableMappings313.Add(kthTypOsTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn22, kthTypOs.FindProperty("KontrId")!, kthTypOsTableMapping); + RelationalModel.CreateColumnMapping(typOsIdColumn3, kthTypOs.FindProperty("TypOsId")!, kthTypOsTableMapping); + + var kthWartosc = FindEntityType("KthWartosc")!; + + var defaultTableMappings314 = new List>(); + kthWartosc.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings314); + var kthWartoscTableBase = new TableBase("KthWartosc", null, relationalModel); + var kPWIdColumnBase0 = new ColumnBase("KPWId", "numeric(9,0)", kthWartoscTableBase); + kthWartoscTableBase.Columns.Add("KPWId", kPWIdColumnBase0); + var kontrIdColumnBase23 = new ColumnBase("KontrId", "numeric(9,0)", kthWartoscTableBase); + kthWartoscTableBase.Columns.Add("KontrId", kontrIdColumnBase23); + relationalModel.DefaultTables.Add("KthWartosc", kthWartoscTableBase); + var kthWartoscMappingBase = new TableMappingBase(kthWartosc, kthWartoscTableBase, true); + kthWartoscTableBase.AddTypeMapping(kthWartoscMappingBase, false); + defaultTableMappings314.Add(kthWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kPWIdColumnBase0, kthWartosc.FindProperty("KPWId")!, kthWartoscMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase23, kthWartosc.FindProperty("KontrId")!, kthWartoscMappingBase); + + var tableMappings314 = new List(); + kthWartosc.SetRuntimeAnnotation("Relational:TableMappings", tableMappings314); + var kthWartoscTable = new Table("KthWartosc", null, relationalModel); + var kontrIdColumn23 = new Column("KontrId", "numeric(9,0)", kthWartoscTable); + kthWartoscTable.Columns.Add("KontrId", kontrIdColumn23); + var kPWIdColumn0 = new Column("KPWId", "numeric(9,0)", kthWartoscTable); + kthWartoscTable.Columns.Add("KPWId", kPWIdColumn0); + var pK_KTHWARTOSC = new UniqueConstraint("PK_KTHWARTOSC", kthWartoscTable, new[] { kontrIdColumn23, kPWIdColumn0 }); + kthWartoscTable.PrimaryKey = pK_KTHWARTOSC; + var pK_KTHWARTOSCUc = RelationalModel.GetKey(this, + "KthWartosc", + new[] { "KontrId", "KPWId" }); + pK_KTHWARTOSC.MappedKeys.Add(pK_KTHWARTOSCUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_KTHWARTOSCUc).Add(pK_KTHWARTOSC); + kthWartoscTable.UniqueConstraints.Add("PK_KTHWARTOSC", pK_KTHWARTOSC); + var idx_KWart = new TableIndex( + "idx_KWart", kthWartoscTable, new[] { kPWIdColumn0 }, false); + var idx_KWartIx = RelationalModel.GetIndex(this, + "KthWartosc", + "idx_KWart"); + idx_KWart.MappedIndexes.Add(idx_KWartIx); + RelationalModel.GetOrCreateTableIndexes(idx_KWartIx).Add(idx_KWart); + kthWartoscTable.Indexes.Add("idx_KWart", idx_KWart); + relationalModel.Tables.Add(("KthWartosc", null), kthWartoscTable); + var kthWartoscTableMapping = new TableMapping(kthWartosc, kthWartoscTable, true); + kthWartoscTable.AddTypeMapping(kthWartoscTableMapping, false); + tableMappings314.Add(kthWartoscTableMapping); + RelationalModel.CreateColumnMapping(kPWIdColumn0, kthWartosc.FindProperty("KPWId")!, kthWartoscTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn23, kthWartosc.FindProperty("KontrId")!, kthWartoscTableMapping); + + var nrRejKarta = FindEntityType("NrRejKarta")!; + + var defaultTableMappings315 = new List>(); + nrRejKarta.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings315); + var nrRejKartaTableBase = new TableBase("NrRejKarta", null, relationalModel); + var kartaIdColumnBase1 = new ColumnBase("KartaId", "numeric(9,0)", nrRejKartaTableBase); + nrRejKartaTableBase.Columns.Add("KartaId", kartaIdColumnBase1); + var kontrIdColumnBase24 = new ColumnBase("KontrId", "numeric(9,0)", nrRejKartaTableBase); + nrRejKartaTableBase.Columns.Add("KontrId", kontrIdColumnBase24); + var nrFormatColumnBase2 = new ColumnBase("NrFormat", "varchar(60)", nrRejKartaTableBase); + nrRejKartaTableBase.Columns.Add("NrFormat", nrFormatColumnBase2); + relationalModel.DefaultTables.Add("NrRejKarta", nrRejKartaTableBase); + var nrRejKartaMappingBase = new TableMappingBase(nrRejKarta, nrRejKartaTableBase, true); + nrRejKartaTableBase.AddTypeMapping(nrRejKartaMappingBase, false); + defaultTableMappings315.Add(nrRejKartaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kartaIdColumnBase1, nrRejKarta.FindProperty("KartaId")!, nrRejKartaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase24, nrRejKarta.FindProperty("KontrId")!, nrRejKartaMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nrFormatColumnBase2, nrRejKarta.FindProperty("NrFormat")!, nrRejKartaMappingBase); + + var tableMappings315 = new List(); + nrRejKarta.SetRuntimeAnnotation("Relational:TableMappings", tableMappings315); + var nrRejKartaTable = new Table("NrRejKarta", null, relationalModel); + var kontrIdColumn24 = new Column("KontrId", "numeric(9,0)", nrRejKartaTable); + nrRejKartaTable.Columns.Add("KontrId", kontrIdColumn24); + var nrFormatColumn2 = new Column("NrFormat", "varchar(60)", nrRejKartaTable); + nrRejKartaTable.Columns.Add("NrFormat", nrFormatColumn2); + var kartaIdColumn1 = new Column("KartaId", "numeric(9,0)", nrRejKartaTable); + nrRejKartaTable.Columns.Add("KartaId", kartaIdColumn1); + var pK_NRREJKARTA = new UniqueConstraint("PK_NRREJKARTA", nrRejKartaTable, new[] { kontrIdColumn24, nrFormatColumn2, kartaIdColumn1 }); + nrRejKartaTable.PrimaryKey = pK_NRREJKARTA; + var pK_NRREJKARTAUc = RelationalModel.GetKey(this, + "NrRejKarta", + new[] { "KontrId", "NrFormat", "KartaId" }); + pK_NRREJKARTA.MappedKeys.Add(pK_NRREJKARTAUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_NRREJKARTAUc).Add(pK_NRREJKARTA); + nrRejKartaTable.UniqueConstraints.Add("PK_NRREJKARTA", pK_NRREJKARTA); + var idx_NrRejKartaId = new TableIndex( + "idx_NrRejKartaId", nrRejKartaTable, new[] { kartaIdColumn1, kontrIdColumn24, nrFormatColumn2 }, false); + var idx_NrRejKartaIdIx = RelationalModel.GetIndex(this, + "NrRejKarta", + "idx_NrRejKartaId"); + idx_NrRejKartaId.MappedIndexes.Add(idx_NrRejKartaIdIx); + RelationalModel.GetOrCreateTableIndexes(idx_NrRejKartaIdIx).Add(idx_NrRejKartaId); + nrRejKartaTable.Indexes.Add("idx_NrRejKartaId", idx_NrRejKartaId); + relationalModel.Tables.Add(("NrRejKarta", null), nrRejKartaTable); + var nrRejKartaTableMapping = new TableMapping(nrRejKarta, nrRejKartaTable, true); + nrRejKartaTable.AddTypeMapping(nrRejKartaTableMapping, false); + tableMappings315.Add(nrRejKartaTableMapping); + RelationalModel.CreateColumnMapping(kartaIdColumn1, nrRejKarta.FindProperty("KartaId")!, nrRejKartaTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn24, nrRejKarta.FindProperty("KontrId")!, nrRejKartaTableMapping); + RelationalModel.CreateColumnMapping(nrFormatColumn2, nrRejKarta.FindProperty("NrFormat")!, nrRejKartaTableMapping); + + var polMag = FindEntityType("PolMag")!; + + var defaultTableMappings316 = new List>(); + polMag.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings316); + var polMagTableBase = new TableBase("PolMag", null, relationalModel); + var magIdColumnBase10 = new ColumnBase("MagId", "numeric(9,0)", polMagTableBase); + polMagTableBase.Columns.Add("MagId", magIdColumnBase10); + var polIdColumnBase2 = new ColumnBase("PolId", "numeric(9,0)", polMagTableBase); + polMagTableBase.Columns.Add("PolId", polIdColumnBase2); + relationalModel.DefaultTables.Add("PolMag", polMagTableBase); + var polMagMappingBase = new TableMappingBase(polMag, polMagTableBase, true); + polMagTableBase.AddTypeMapping(polMagMappingBase, false); + defaultTableMappings316.Add(polMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)magIdColumnBase10, polMag.FindProperty("MagId")!, polMagMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)polIdColumnBase2, polMag.FindProperty("PolId")!, polMagMappingBase); + + var tableMappings316 = new List(); + polMag.SetRuntimeAnnotation("Relational:TableMappings", tableMappings316); + var polMagTable = new Table("PolMag", null, relationalModel); + var polIdColumn2 = new Column("PolId", "numeric(9,0)", polMagTable); + polMagTable.Columns.Add("PolId", polIdColumn2); + var magIdColumn10 = new Column("MagId", "numeric(9,0)", polMagTable); + polMagTable.Columns.Add("MagId", magIdColumn10); + var pK_POLMAG = new UniqueConstraint("PK_POLMAG", polMagTable, new[] { polIdColumn2, magIdColumn10 }); + polMagTable.PrimaryKey = pK_POLMAG; + var pK_POLMAGUc = RelationalModel.GetKey(this, + "PolMag", + new[] { "PolId", "MagId" }); + pK_POLMAG.MappedKeys.Add(pK_POLMAGUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_POLMAGUc).Add(pK_POLMAG); + polMagTable.UniqueConstraints.Add("PK_POLMAG", pK_POLMAG); + var idx_MagPol = new TableIndex( + "idx_MagPol", polMagTable, new[] { magIdColumn10 }, false); + var idx_MagPolIx = RelationalModel.GetIndex(this, + "PolMag", + "idx_MagPol"); + idx_MagPol.MappedIndexes.Add(idx_MagPolIx); + RelationalModel.GetOrCreateTableIndexes(idx_MagPolIx).Add(idx_MagPol); + polMagTable.Indexes.Add("idx_MagPol", idx_MagPol); + relationalModel.Tables.Add(("PolMag", null), polMagTable); + var polMagTableMapping = new TableMapping(polMag, polMagTable, true); + polMagTable.AddTypeMapping(polMagTableMapping, false); + tableMappings316.Add(polMagTableMapping); + RelationalModel.CreateColumnMapping(magIdColumn10, polMag.FindProperty("MagId")!, polMagTableMapping); + RelationalModel.CreateColumnMapping(polIdColumn2, polMag.FindProperty("PolId")!, polMagTableMapping); + + var przydzial = FindEntityType("Przydzial")!; + + var defaultTableMappings317 = new List>(); + przydzial.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings317); + var przydzialTableBase = new TableBase("Przydzial", null, relationalModel); + var asIdColumnBase3 = new ColumnBase("AsId", "numeric(9,0)", przydzialTableBase); + przydzialTableBase.Columns.Add("AsId", asIdColumnBase3); + var kasaIdColumnBase10 = new ColumnBase("KasaId", "numeric(9,0)", przydzialTableBase); + przydzialTableBase.Columns.Add("KasaId", kasaIdColumnBase10); + relationalModel.DefaultTables.Add("Przydzial", przydzialTableBase); + var przydzialMappingBase = new TableMappingBase(przydzial, przydzialTableBase, true); + przydzialTableBase.AddTypeMapping(przydzialMappingBase, false); + defaultTableMappings317.Add(przydzialMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asIdColumnBase3, przydzial.FindProperty("AsId")!, przydzialMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kasaIdColumnBase10, przydzial.FindProperty("KasaId")!, przydzialMappingBase); + + var tableMappings317 = new List(); + przydzial.SetRuntimeAnnotation("Relational:TableMappings", tableMappings317); + var przydzialTable = new Table("Przydzial", null, relationalModel); + var kasaIdColumn10 = new Column("KasaId", "numeric(9,0)", przydzialTable); + przydzialTable.Columns.Add("KasaId", kasaIdColumn10); + var asIdColumn3 = new Column("AsId", "numeric(9,0)", przydzialTable); + przydzialTable.Columns.Add("AsId", asIdColumn3); + var pK_PRZYDZIAL = new UniqueConstraint("PK_PRZYDZIAL", przydzialTable, new[] { kasaIdColumn10, asIdColumn3 }); + przydzialTable.PrimaryKey = pK_PRZYDZIAL; + var pK_PRZYDZIALUc = RelationalModel.GetKey(this, + "Przydzial", + new[] { "KasaId", "AsId" }); + pK_PRZYDZIAL.MappedKeys.Add(pK_PRZYDZIALUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_PRZYDZIALUc).Add(pK_PRZYDZIAL); + przydzialTable.UniqueConstraints.Add("PK_PRZYDZIAL", pK_PRZYDZIAL); + var iX_Przydzial_AsId = new TableIndex( + "IX_Przydzial_AsId", przydzialTable, new[] { asIdColumn3 }, false); + var iX_Przydzial_AsIdIx = RelationalModel.GetIndex(this, + "Przydzial", + new[] { "AsId" }); + iX_Przydzial_AsId.MappedIndexes.Add(iX_Przydzial_AsIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_Przydzial_AsIdIx).Add(iX_Przydzial_AsId); + przydzialTable.Indexes.Add("IX_Przydzial_AsId", iX_Przydzial_AsId); + relationalModel.Tables.Add(("Przydzial", null), przydzialTable); + var przydzialTableMapping = new TableMapping(przydzial, przydzialTable, true); + przydzialTable.AddTypeMapping(przydzialTableMapping, false); + tableMappings317.Add(przydzialTableMapping); + RelationalModel.CreateColumnMapping(asIdColumn3, przydzial.FindProperty("AsId")!, przydzialTableMapping); + RelationalModel.CreateColumnMapping(kasaIdColumn10, przydzial.FindProperty("KasaId")!, przydzialTableMapping); + + var sklepKthPrzydzial = FindEntityType("SklepKthPrzydzial")!; + + var defaultTableMappings318 = new List>(); + sklepKthPrzydzial.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings318); + var sklepKthPrzydzialTableBase = new TableBase("SklepKthPrzydzial", null, relationalModel); + var kPWIdColumnBase1 = new ColumnBase("KPWId", "numeric(9,0)", sklepKthPrzydzialTableBase); + sklepKthPrzydzialTableBase.Columns.Add("KPWId", kPWIdColumnBase1); + var sklepIdColumnBase114 = new ColumnBase("SklepId", "numeric(9,0)", sklepKthPrzydzialTableBase); + sklepKthPrzydzialTableBase.Columns.Add("SklepId", sklepIdColumnBase114); + relationalModel.DefaultTables.Add("SklepKthPrzydzial", sklepKthPrzydzialTableBase); + var sklepKthPrzydzialMappingBase = new TableMappingBase(sklepKthPrzydzial, sklepKthPrzydzialTableBase, true); + sklepKthPrzydzialTableBase.AddTypeMapping(sklepKthPrzydzialMappingBase, false); + defaultTableMappings318.Add(sklepKthPrzydzialMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kPWIdColumnBase1, sklepKthPrzydzial.FindProperty("KPWId")!, sklepKthPrzydzialMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase114, sklepKthPrzydzial.FindProperty("SklepId")!, sklepKthPrzydzialMappingBase); + + var tableMappings318 = new List(); + sklepKthPrzydzial.SetRuntimeAnnotation("Relational:TableMappings", tableMappings318); + var sklepKthPrzydzialTable = new Table("SklepKthPrzydzial", null, relationalModel); + var sklepIdColumn114 = new Column("SklepId", "numeric(9,0)", sklepKthPrzydzialTable); + sklepKthPrzydzialTable.Columns.Add("SklepId", sklepIdColumn114); + var kPWIdColumn1 = new Column("KPWId", "numeric(9,0)", sklepKthPrzydzialTable); + sklepKthPrzydzialTable.Columns.Add("KPWId", kPWIdColumn1); + var pK_SKLEPKTHPRZYDZIAL = new UniqueConstraint("PK_SKLEPKTHPRZYDZIAL", sklepKthPrzydzialTable, new[] { sklepIdColumn114, kPWIdColumn1 }); + sklepKthPrzydzialTable.PrimaryKey = pK_SKLEPKTHPRZYDZIAL; + var pK_SKLEPKTHPRZYDZIALUc = RelationalModel.GetKey(this, + "SklepKthPrzydzial", + new[] { "SklepId", "KPWId" }); + pK_SKLEPKTHPRZYDZIAL.MappedKeys.Add(pK_SKLEPKTHPRZYDZIALUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPKTHPRZYDZIALUc).Add(pK_SKLEPKTHPRZYDZIAL); + sklepKthPrzydzialTable.UniqueConstraints.Add("PK_SKLEPKTHPRZYDZIAL", pK_SKLEPKTHPRZYDZIAL); + var iX_SklepKthPrzydzial_KPWId = new TableIndex( + "IX_SklepKthPrzydzial_KPWId", sklepKthPrzydzialTable, new[] { kPWIdColumn1 }, false); + var iX_SklepKthPrzydzial_KPWIdIx = RelationalModel.GetIndex(this, + "SklepKthPrzydzial", + new[] { "KPWId" }); + iX_SklepKthPrzydzial_KPWId.MappedIndexes.Add(iX_SklepKthPrzydzial_KPWIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepKthPrzydzial_KPWIdIx).Add(iX_SklepKthPrzydzial_KPWId); + sklepKthPrzydzialTable.Indexes.Add("IX_SklepKthPrzydzial_KPWId", iX_SklepKthPrzydzial_KPWId); + relationalModel.Tables.Add(("SklepKthPrzydzial", null), sklepKthPrzydzialTable); + var sklepKthPrzydzialTableMapping = new TableMapping(sklepKthPrzydzial, sklepKthPrzydzialTable, true); + sklepKthPrzydzialTable.AddTypeMapping(sklepKthPrzydzialTableMapping, false); + tableMappings318.Add(sklepKthPrzydzialTableMapping); + RelationalModel.CreateColumnMapping(kPWIdColumn1, sklepKthPrzydzial.FindProperty("KPWId")!, sklepKthPrzydzialTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn114, sklepKthPrzydzial.FindProperty("SklepId")!, sklepKthPrzydzialTableMapping); + + var sklepNarzDost = FindEntityType("SklepNarzDost")!; + + var defaultTableMappings319 = new List>(); + sklepNarzDost.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings319); + var sklepNarzDostTableBase = new TableBase("SklepNarzDost", null, relationalModel); + var kontrIdColumnBase25 = new ColumnBase("KontrId", "numeric(9,0)", sklepNarzDostTableBase); + sklepNarzDostTableBase.Columns.Add("KontrId", kontrIdColumnBase25); + var sklepIdColumnBase115 = new ColumnBase("SklepId", "numeric(9,0)", sklepNarzDostTableBase); + sklepNarzDostTableBase.Columns.Add("SklepId", sklepIdColumnBase115); + var towIdColumnBase37 = new ColumnBase("TowId", "numeric(9,0)", sklepNarzDostTableBase); + sklepNarzDostTableBase.Columns.Add("TowId", towIdColumnBase37); + relationalModel.DefaultTables.Add("SklepNarzDost", sklepNarzDostTableBase); + var sklepNarzDostMappingBase = new TableMappingBase(sklepNarzDost, sklepNarzDostTableBase, true); + sklepNarzDostTableBase.AddTypeMapping(sklepNarzDostMappingBase, false); + defaultTableMappings319.Add(sklepNarzDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)kontrIdColumnBase25, sklepNarzDost.FindProperty("KontrId")!, sklepNarzDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase115, sklepNarzDost.FindProperty("SklepId")!, sklepNarzDostMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)towIdColumnBase37, sklepNarzDost.FindProperty("TowId")!, sklepNarzDostMappingBase); + + var tableMappings319 = new List(); + sklepNarzDost.SetRuntimeAnnotation("Relational:TableMappings", tableMappings319); + var sklepNarzDostTable = new Table("SklepNarzDost", null, relationalModel); + var sklepIdColumn115 = new Column("SklepId", "numeric(9,0)", sklepNarzDostTable); + sklepNarzDostTable.Columns.Add("SklepId", sklepIdColumn115); + var towIdColumn37 = new Column("TowId", "numeric(9,0)", sklepNarzDostTable); + sklepNarzDostTable.Columns.Add("TowId", towIdColumn37); + var kontrIdColumn25 = new Column("KontrId", "numeric(9,0)", sklepNarzDostTable); + sklepNarzDostTable.Columns.Add("KontrId", kontrIdColumn25); + var pK_SKLEPNARZDOST = new UniqueConstraint("PK_SKLEPNARZDOST", sklepNarzDostTable, new[] { sklepIdColumn115, towIdColumn37, kontrIdColumn25 }); + sklepNarzDostTable.PrimaryKey = pK_SKLEPNARZDOST; + var pK_SKLEPNARZDOSTUc = RelationalModel.GetKey(this, + "SklepNarzDost", + new[] { "SklepId", "TowId", "KontrId" }); + pK_SKLEPNARZDOST.MappedKeys.Add(pK_SKLEPNARZDOSTUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPNARZDOSTUc).Add(pK_SKLEPNARZDOST); + sklepNarzDostTable.UniqueConstraints.Add("PK_SKLEPNARZDOST", pK_SKLEPNARZDOST); + var idx_SklepNarzDostKth = new TableIndex( + "idx_SklepNarzDostKth", sklepNarzDostTable, new[] { kontrIdColumn25 }, false); + var idx_SklepNarzDostKthIx = RelationalModel.GetIndex(this, + "SklepNarzDost", + "idx_SklepNarzDostKth"); + idx_SklepNarzDostKth.MappedIndexes.Add(idx_SklepNarzDostKthIx); + RelationalModel.GetOrCreateTableIndexes(idx_SklepNarzDostKthIx).Add(idx_SklepNarzDostKth); + sklepNarzDostTable.Indexes.Add("idx_SklepNarzDostKth", idx_SklepNarzDostKth); + relationalModel.Tables.Add(("SklepNarzDost", null), sklepNarzDostTable); + var sklepNarzDostTableMapping = new TableMapping(sklepNarzDost, sklepNarzDostTable, true); + sklepNarzDostTable.AddTypeMapping(sklepNarzDostTableMapping, false); + tableMappings319.Add(sklepNarzDostTableMapping); + RelationalModel.CreateColumnMapping(kontrIdColumn25, sklepNarzDost.FindProperty("KontrId")!, sklepNarzDostTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn115, sklepNarzDost.FindProperty("SklepId")!, sklepNarzDostTableMapping); + RelationalModel.CreateColumnMapping(towIdColumn37, sklepNarzDost.FindProperty("TowId")!, sklepNarzDostTableMapping); + + var sklepPrzydzial = FindEntityType("SklepPrzydzial")!; + + var defaultTableMappings320 = new List>(); + sklepPrzydzial.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings320); + var sklepPrzydzialTableBase = new TableBase("SklepPrzydzial", null, relationalModel); + var asIdColumnBase4 = new ColumnBase("AsId", "numeric(9,0)", sklepPrzydzialTableBase); + sklepPrzydzialTableBase.Columns.Add("AsId", asIdColumnBase4); + var sklepIdColumnBase116 = new ColumnBase("SklepId", "numeric(9,0)", sklepPrzydzialTableBase); + sklepPrzydzialTableBase.Columns.Add("SklepId", sklepIdColumnBase116); + relationalModel.DefaultTables.Add("SklepPrzydzial", sklepPrzydzialTableBase); + var sklepPrzydzialMappingBase = new TableMappingBase(sklepPrzydzial, sklepPrzydzialTableBase, true); + sklepPrzydzialTableBase.AddTypeMapping(sklepPrzydzialMappingBase, false); + defaultTableMappings320.Add(sklepPrzydzialMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)asIdColumnBase4, sklepPrzydzial.FindProperty("AsId")!, sklepPrzydzialMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase116, sklepPrzydzial.FindProperty("SklepId")!, sklepPrzydzialMappingBase); + + var tableMappings320 = new List(); + sklepPrzydzial.SetRuntimeAnnotation("Relational:TableMappings", tableMappings320); + var sklepPrzydzialTable = new Table("SklepPrzydzial", null, relationalModel); + var sklepIdColumn116 = new Column("SklepId", "numeric(9,0)", sklepPrzydzialTable); + sklepPrzydzialTable.Columns.Add("SklepId", sklepIdColumn116); + var asIdColumn4 = new Column("AsId", "numeric(9,0)", sklepPrzydzialTable); + sklepPrzydzialTable.Columns.Add("AsId", asIdColumn4); + var pK_SKLEPPRZYDZIAL = new UniqueConstraint("PK_SKLEPPRZYDZIAL", sklepPrzydzialTable, new[] { sklepIdColumn116, asIdColumn4 }); + sklepPrzydzialTable.PrimaryKey = pK_SKLEPPRZYDZIAL; + var pK_SKLEPPRZYDZIALUc = RelationalModel.GetKey(this, + "SklepPrzydzial", + new[] { "SklepId", "AsId" }); + pK_SKLEPPRZYDZIAL.MappedKeys.Add(pK_SKLEPPRZYDZIALUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPPRZYDZIALUc).Add(pK_SKLEPPRZYDZIAL); + sklepPrzydzialTable.UniqueConstraints.Add("PK_SKLEPPRZYDZIAL", pK_SKLEPPRZYDZIAL); + var iX_SklepPrzydzial_AsId = new TableIndex( + "IX_SklepPrzydzial_AsId", sklepPrzydzialTable, new[] { asIdColumn4 }, false); + var iX_SklepPrzydzial_AsIdIx = RelationalModel.GetIndex(this, + "SklepPrzydzial", + new[] { "AsId" }); + iX_SklepPrzydzial_AsId.MappedIndexes.Add(iX_SklepPrzydzial_AsIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepPrzydzial_AsIdIx).Add(iX_SklepPrzydzial_AsId); + sklepPrzydzialTable.Indexes.Add("IX_SklepPrzydzial_AsId", iX_SklepPrzydzial_AsId); + relationalModel.Tables.Add(("SklepPrzydzial", null), sklepPrzydzialTable); + var sklepPrzydzialTableMapping = new TableMapping(sklepPrzydzial, sklepPrzydzialTable, true); + sklepPrzydzialTable.AddTypeMapping(sklepPrzydzialTableMapping, false); + tableMappings320.Add(sklepPrzydzialTableMapping); + RelationalModel.CreateColumnMapping(asIdColumn4, sklepPrzydzial.FindProperty("AsId")!, sklepPrzydzialTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn116, sklepPrzydzial.FindProperty("SklepId")!, sklepPrzydzialTableMapping); + + var sklepSklep = FindEntityType("SklepSklep")!; + + var defaultTableMappings321 = new List>(); + sklepSklep.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings321); + var sklepSklepTableBase = new TableBase("SklepSklep", null, relationalModel); + var centralaIdColumnBase = new ColumnBase("CentralaId", "numeric(9,0)", sklepSklepTableBase); + sklepSklepTableBase.Columns.Add("CentralaId", centralaIdColumnBase); + var sklepIdColumnBase117 = new ColumnBase("SklepId", "numeric(9,0)", sklepSklepTableBase); + sklepSklepTableBase.Columns.Add("SklepId", sklepIdColumnBase117); + relationalModel.DefaultTables.Add("SklepSklep", sklepSklepTableBase); + var sklepSklepMappingBase = new TableMappingBase(sklepSklep, sklepSklepTableBase, true); + sklepSklepTableBase.AddTypeMapping(sklepSklepMappingBase, false); + defaultTableMappings321.Add(sklepSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)centralaIdColumnBase, sklepSklep.FindProperty("CentralaId")!, sklepSklepMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)sklepIdColumnBase117, sklepSklep.FindProperty("SklepId")!, sklepSklepMappingBase); + + var tableMappings321 = new List(); + sklepSklep.SetRuntimeAnnotation("Relational:TableMappings", tableMappings321); + var sklepSklepTable = new Table("SklepSklep", null, relationalModel); + var centralaIdColumn = new Column("CentralaId", "numeric(9,0)", sklepSklepTable); + sklepSklepTable.Columns.Add("CentralaId", centralaIdColumn); + var sklepIdColumn117 = new Column("SklepId", "numeric(9,0)", sklepSklepTable); + sklepSklepTable.Columns.Add("SklepId", sklepIdColumn117); + var pK_SKLEPSKLEP = new UniqueConstraint("PK_SKLEPSKLEP", sklepSklepTable, new[] { centralaIdColumn, sklepIdColumn117 }); + sklepSklepTable.PrimaryKey = pK_SKLEPSKLEP; + var pK_SKLEPSKLEPUc = RelationalModel.GetKey(this, + "SklepSklep", + new[] { "CentralaId", "SklepId" }); + pK_SKLEPSKLEP.MappedKeys.Add(pK_SKLEPSKLEPUc); + RelationalModel.GetOrCreateUniqueConstraints(pK_SKLEPSKLEPUc).Add(pK_SKLEPSKLEP); + sklepSklepTable.UniqueConstraints.Add("PK_SKLEPSKLEP", pK_SKLEPSKLEP); + var iX_SklepSklep_SklepId = new TableIndex( + "IX_SklepSklep_SklepId", sklepSklepTable, new[] { sklepIdColumn117 }, false); + var iX_SklepSklep_SklepIdIx = RelationalModel.GetIndex(this, + "SklepSklep", + new[] { "SklepId" }); + iX_SklepSklep_SklepId.MappedIndexes.Add(iX_SklepSklep_SklepIdIx); + RelationalModel.GetOrCreateTableIndexes(iX_SklepSklep_SklepIdIx).Add(iX_SklepSklep_SklepId); + sklepSklepTable.Indexes.Add("IX_SklepSklep_SklepId", iX_SklepSklep_SklepId); + relationalModel.Tables.Add(("SklepSklep", null), sklepSklepTable); + var sklepSklepTableMapping = new TableMapping(sklepSklep, sklepSklepTable, true); + sklepSklepTable.AddTypeMapping(sklepSklepTableMapping, false); + tableMappings321.Add(sklepSklepTableMapping); + RelationalModel.CreateColumnMapping(centralaIdColumn, sklepSklep.FindProperty("CentralaId")!, sklepSklepTableMapping); + RelationalModel.CreateColumnMapping(sklepIdColumn117, sklepSklep.FindProperty("SklepId")!, sklepSklepTableMapping); + var fK_ARTGLOWNYTOWID = new ForeignKeyConstraint( + "FK_ARTGLOWNYTOWID", artykulTable, towarTable, + new[] { glownyTowIdColumn }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_ARTGLOWNYTOWIDFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Artykul", + new[] { "GlownyTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_ARTGLOWNYTOWID.MappedForeignKeys.Add(fK_ARTGLOWNYTOWIDFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ARTGLOWNYTOWIDFk).Add(fK_ARTGLOWNYTOWID); + artykulTable.ForeignKeyConstraints.Add(fK_ARTGLOWNYTOWID); + towarTable.ReferencingForeignKeyConstraints.Add(fK_ARTGLOWNYTOWID); + var fK_BLOKADA_REF_BLOKS_SESJAAKT = new ForeignKeyConstraint( + "FK_BLOKADA_REF_BLOKS_SESJAAKT", blokadaTable, sesjaAktywnaTable, + new[] { sesjaIdColumn }, + sesjaAktywnaTable.FindUniqueConstraint("PK_SESJAAKTYWNA")!, ReferentialAction.NoAction); + var fK_BLOKADA_REF_BLOKS_SESJAAKTFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Blokada", + new[] { "SesjaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SesjaAktywna", + new[] { "SesjaId" }); + fK_BLOKADA_REF_BLOKS_SESJAAKT.MappedForeignKeys.Add(fK_BLOKADA_REF_BLOKS_SESJAAKTFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_BLOKADA_REF_BLOKS_SESJAAKTFk).Add(fK_BLOKADA_REF_BLOKS_SESJAAKT); + blokadaTable.ForeignKeyConstraints.Add(fK_BLOKADA_REF_BLOKS_SESJAAKT); + sesjaAktywnaTable.ReferencingForeignKeyConstraints.Add(fK_BLOKADA_REF_BLOKS_SESJAAKT); + var fK_BLOKADA_REF_BLOKT_ISTW = new ForeignKeyConstraint( + "FK_BLOKADA_REF_BLOKT_ISTW", blokadaTable, istwTable, + new[] { towIdColumn, magIdColumn }, + istwTable.FindUniqueConstraint("PK_ISTW")!, ReferentialAction.NoAction); + var fK_BLOKADA_REF_BLOKT_ISTWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Blokada", + new[] { "TowId", "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Istw", + new[] { "TowId", "MagId" }); + fK_BLOKADA_REF_BLOKT_ISTW.MappedForeignKeys.Add(fK_BLOKADA_REF_BLOKT_ISTWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_BLOKADA_REF_BLOKT_ISTWFk).Add(fK_BLOKADA_REF_BLOKT_ISTW); + blokadaTable.ForeignKeyConstraints.Add(fK_BLOKADA_REF_BLOKT_ISTW); + istwTable.ReferencingForeignKeyConstraints.Add(fK_BLOKADA_REF_BLOKT_ISTW); + var fK_CESTZG_KTH = new ForeignKeyConstraint( + "FK_CESTZG_KTH", centrStanZgodyTable, kontrahentTable, + new[] { kontrIdColumn }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_CESTZG_KTHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_CESTZG_KTH.MappedForeignKeys.Add(fK_CESTZG_KTHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_CESTZG_KTHFk).Add(fK_CESTZG_KTH); + centrStanZgodyTable.ForeignKeyConstraints.Add(fK_CESTZG_KTH); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_CESTZG_KTH); + var fK_CESTZG_ZG = new ForeignKeyConstraint( + "FK_CESTZG_ZG", centrStanZgodyTable, zgodaTable, + new[] { zgIdColumn }, + zgodaTable.FindUniqueConstraint("PK_ZGODA")!, ReferentialAction.NoAction); + var fK_CESTZG_ZGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.CentrStanZgody", + new[] { "ZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + new[] { "ZgId" }); + fK_CESTZG_ZG.MappedForeignKeys.Add(fK_CESTZG_ZGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_CESTZG_ZGFk).Add(fK_CESTZG_ZG); + centrStanZgodyTable.ForeignKeyConstraints.Add(fK_CESTZG_ZG); + zgodaTable.ReferencingForeignKeyConstraints.Add(fK_CESTZG_ZG); + var fK_DlugiZasobBin_ZasobId = new ForeignKeyConstraint( + "FK_DlugiZasobBin_ZasobId", dlugiZasobBinTable, dlugiZasobTable, + new[] { zasobIdColumn0 }, + dlugiZasobTable.FindUniqueConstraint("PK_DlugiZasob")!, ReferentialAction.NoAction); + var fK_DlugiZasobBin_ZasobIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobBin", + new[] { "ZasobId" }, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + new[] { "ZasobId" }); + fK_DlugiZasobBin_ZasobId.MappedForeignKeys.Add(fK_DlugiZasobBin_ZasobIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DlugiZasobBin_ZasobIdFk).Add(fK_DlugiZasobBin_ZasobId); + dlugiZasobBinTable.ForeignKeyConstraints.Add(fK_DlugiZasobBin_ZasobId); + dlugiZasobTable.ReferencingForeignKeyConstraints.Add(fK_DlugiZasobBin_ZasobId); + var fK_DlugiZasobTxt_ZasobId = new ForeignKeyConstraint( + "FK_DlugiZasobTxt_ZasobId", dlugiZasobTxtTable, dlugiZasobTable, + new[] { zasobIdColumn1 }, + dlugiZasobTable.FindUniqueConstraint("PK_DlugiZasob")!, ReferentialAction.NoAction); + var fK_DlugiZasobTxt_ZasobIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasobTxt", + new[] { "ZasobId" }, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + new[] { "ZasobId" }); + fK_DlugiZasobTxt_ZasobId.MappedForeignKeys.Add(fK_DlugiZasobTxt_ZasobIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DlugiZasobTxt_ZasobIdFk).Add(fK_DlugiZasobTxt_ZasobId); + dlugiZasobTxtTable.ForeignKeyConstraints.Add(fK_DlugiZasobTxt_ZasobId); + dlugiZasobTable.ReferencingForeignKeyConstraints.Add(fK_DlugiZasobTxt_ZasobId); + var fK_DOK_REF_DOKMA_MAGAZYN = new ForeignKeyConstraint( + "FK_DOK_REF_DOKMA_MAGAZYN", dokTable, magazynTable, + new[] { magIdColumn0 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_DOK_REF_DOKMA_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_DOK_REF_DOKMA_MAGAZYN.MappedForeignKeys.Add(fK_DOK_REF_DOKMA_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOK_REF_DOKMA_MAGAZYNFk).Add(fK_DOK_REF_DOKMA_MAGAZYN); + dokTable.ForeignKeyConstraints.Add(fK_DOK_REF_DOKMA_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_DOK_REF_DOKMA_MAGAZYN); + var fK_DOK_REF_DOKUZ_UZYTKOWN = new ForeignKeyConstraint( + "FK_DOK_REF_DOKUZ_UZYTKOWN", dokTable, uzytkownikTable, + new[] { uzIdColumn }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_DOK_REF_DOKUZ_UZYTKOWNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_DOK_REF_DOKUZ_UZYTKOWN.MappedForeignKeys.Add(fK_DOK_REF_DOKUZ_UZYTKOWNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOK_REF_DOKUZ_UZYTKOWNFk).Add(fK_DOK_REF_DOKUZ_UZYTKOWN); + dokTable.ForeignKeyConstraints.Add(fK_DOK_REF_DOKUZ_UZYTKOWN); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_DOK_REF_DOKUZ_UZYTKOWN); + var fK_DOK_REF_DOKWA_WALUTA = new ForeignKeyConstraint( + "FK_DOK_REF_DOKWA_WALUTA", dokTable, walutaTable, + new[] { walIdColumn }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_DOK_REF_DOKWA_WALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_DOK_REF_DOKWA_WALUTA.MappedForeignKeys.Add(fK_DOK_REF_DOKWA_WALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOK_REF_DOKWA_WALUTAFk).Add(fK_DOK_REF_DOKWA_WALUTA); + dokTable.ForeignKeyConstraints.Add(fK_DOK_REF_DOKWA_WALUTA); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_DOK_REF_DOKWA_WALUTA); + var fK_Ref_DokWalIdPlatnosci = new ForeignKeyConstraint( + "FK_Ref_DokWalIdPlatnosci", dokTable, walutaTable, + new[] { walIdPlatnosciColumn }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_Ref_DokWalIdPlatnosciFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "WalIdPlatnosci" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_Ref_DokWalIdPlatnosci.MappedForeignKeys.Add(fK_Ref_DokWalIdPlatnosciFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_DokWalIdPlatnosciFk).Add(fK_Ref_DokWalIdPlatnosci); + dokTable.ForeignKeyConstraints.Add(fK_Ref_DokWalIdPlatnosci); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_Ref_DokWalIdPlatnosci); + var fK_DOKDODKT_REF_DDK_DOK = new ForeignKeyConstraint( + "FK_DOKDODKT_REF_DDK_DOK", dokDodKthTable, dokTable, + new[] { dokIdColumn0 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DOKDODKT_REF_DDK_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokDodKth", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DOKDODKT_REF_DDK_DOK.MappedForeignKeys.Add(fK_DOKDODKT_REF_DDK_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKDODKT_REF_DDK_DOKFk).Add(fK_DOKDODKT_REF_DDK_DOK); + dokDodKthTable.ForeignKeyConstraints.Add(fK_DOKDODKT_REF_DDK_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DOKDODKT_REF_DDK_DOK); + var fK_DOKDODKT_REF_DKD_KONTRAHE = new ForeignKeyConstraint( + "FK_DOKDODKT_REF_DKD_KONTRAHE", dokDodKthTable, kontrahentTable, + new[] { kontrIdColumn0 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_DOKDODKT_REF_DKD_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokDodKth", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_DOKDODKT_REF_DKD_KONTRAHE.MappedForeignKeys.Add(fK_DOKDODKT_REF_DKD_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKDODKT_REF_DKD_KONTRAHEFk).Add(fK_DOKDODKT_REF_DKD_KONTRAHE); + dokDodKthTable.ForeignKeyConstraints.Add(fK_DOKDODKT_REF_DKD_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_DOKDODKT_REF_DKD_KONTRAHE); + var fK_DOKKASA_REF_DOKKA_DOK = new ForeignKeyConstraint( + "FK_DOKKASA_REF_DOKKA_DOK", dokKasaTable, dokTable, + new[] { dokIdColumn1 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DOKKASA_REF_DOKKA_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKasa", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DOKKASA_REF_DOKKA_DOK.MappedForeignKeys.Add(fK_DOKKASA_REF_DOKKA_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKASA_REF_DOKKA_DOKFk).Add(fK_DOKKASA_REF_DOKKA_DOK); + dokKasaTable.ForeignKeyConstraints.Add(fK_DOKKASA_REF_DOKKA_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DOKKASA_REF_DOKKA_DOK); + var fK_DOKKASA_REF_KASA_KASA = new ForeignKeyConstraint( + "FK_DOKKASA_REF_KASA_KASA", dokKasaTable, kasaTable, + new[] { kasaIdColumn }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_DOKKASA_REF_KASA_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKasa", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_DOKKASA_REF_KASA_KASA.MappedForeignKeys.Add(fK_DOKKASA_REF_KASA_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKASA_REF_KASA_KASAFk).Add(fK_DOKKASA_REF_KASA_KASA); + dokKasaTable.ForeignKeyConstraints.Add(fK_DOKKASA_REF_KASA_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_DOKKASA_REF_KASA_KASA); + var fK_DOKKONTOBANK_DOK = new ForeignKeyConstraint( + "FK_DOKKONTOBANK_DOK", dokKontoBankoweTable, dokTable, + new[] { dokIdColumn26 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DOKKONTOBANK_DOKFk = RelationalModel.GetForeignKey(this, + "DokKontoBankowe", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DOKKONTOBANK_DOK.MappedForeignKeys.Add(fK_DOKKONTOBANK_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKONTOBANK_DOKFk).Add(fK_DOKKONTOBANK_DOK); + dokKontoBankoweTable.ForeignKeyConstraints.Add(fK_DOKKONTOBANK_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DOKKONTOBANK_DOK); + var fK_DOKKONTOBANK_KONTOBANK = new ForeignKeyConstraint( + "FK_DOKKONTOBANK_KONTOBANK", dokKontoBankoweTable, kontoBankoweTable, + new[] { kBIdColumn2 }, + kontoBankoweTable.FindUniqueConstraint("PK_KontoBankowe")!, ReferentialAction.NoAction); + var fK_DOKKONTOBANK_KONTOBANKFk = RelationalModel.GetForeignKey(this, + "DokKontoBankowe", + new[] { "KBId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "KBId" }); + fK_DOKKONTOBANK_KONTOBANK.MappedForeignKeys.Add(fK_DOKKONTOBANK_KONTOBANKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKONTOBANK_KONTOBANKFk).Add(fK_DOKKONTOBANK_KONTOBANK); + dokKontoBankoweTable.ForeignKeyConstraints.Add(fK_DOKKONTOBANK_KONTOBANK); + kontoBankoweTable.ReferencingForeignKeyConstraints.Add(fK_DOKKONTOBANK_KONTOBANK); + var fK_DOKKONTR_REF_DOKKO_DOK = new ForeignKeyConstraint( + "FK_DOKKONTR_REF_DOKKO_DOK", dokKontrTable, dokTable, + new[] { dokIdColumn2 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DOKKONTR_REF_DOKKO_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKontr", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DOKKONTR_REF_DOKKO_DOK.MappedForeignKeys.Add(fK_DOKKONTR_REF_DOKKO_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKONTR_REF_DOKKO_DOKFk).Add(fK_DOKKONTR_REF_DOKKO_DOK); + dokKontrTable.ForeignKeyConstraints.Add(fK_DOKKONTR_REF_DOKKO_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DOKKONTR_REF_DOKKO_DOK); + var fK_DOKKONTR_REF_KONTR_KONTRAHE = new ForeignKeyConstraint( + "FK_DOKKONTR_REF_KONTR_KONTRAHE", dokKontrTable, kontrahentTable, + new[] { kontrIdColumn1 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_DOKKONTR_REF_KONTR_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKontr", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_DOKKONTR_REF_KONTR_KONTRAHE.MappedForeignKeys.Add(fK_DOKKONTR_REF_KONTR_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKONTR_REF_KONTR_KONTRAHEFk).Add(fK_DOKKONTR_REF_KONTR_KONTRAHE); + dokKontrTable.ForeignKeyConstraints.Add(fK_DOKKONTR_REF_KONTR_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_DOKKONTR_REF_KONTR_KONTRAHE); + var fK_DOKKURS_DOK = new ForeignKeyConstraint( + "FK_DOKKURS_DOK", dokKursTable, dokTable, + new[] { dokIdColumn3 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DOKKURS_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKurs", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DOKKURS_DOK.MappedForeignKeys.Add(fK_DOKKURS_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKURS_DOKFk).Add(fK_DOKKURS_DOK); + dokKursTable.ForeignKeyConstraints.Add(fK_DOKKURS_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DOKKURS_DOK); + var fK_DOKKURS_WAL = new ForeignKeyConstraint( + "FK_DOKKURS_WAL", dokKursTable, walutaTable, + new[] { walIdColumn0 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_DOKKURS_WALFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokKurs", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_DOKKURS_WAL.MappedForeignKeys.Add(fK_DOKKURS_WALFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKKURS_WALFk).Add(fK_DOKKURS_WAL); + dokKursTable.ForeignKeyConstraints.Add(fK_DOKKURS_WAL); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_DOKKURS_WAL); + var fK_DOKPUNKT_REF_DOKPK_DOK = new ForeignKeyConstraint( + "FK_DOKPUNKT_REF_DOKPK_DOK", dokPunktyTable, dokTable, + new[] { dokIdColumn4 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DOKPUNKT_REF_DOKPK_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokPunkty", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DOKPUNKT_REF_DOKPK_DOK.MappedForeignKeys.Add(fK_DOKPUNKT_REF_DOKPK_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKPUNKT_REF_DOKPK_DOKFk).Add(fK_DOKPUNKT_REF_DOKPK_DOK); + dokPunktyTable.ForeignKeyConstraints.Add(fK_DOKPUNKT_REF_DOKPK_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DOKPUNKT_REF_DOKPK_DOK); + var fK_DOKWALUT_REF_DOKWA_DOK = new ForeignKeyConstraint( + "FK_DOKWALUT_REF_DOKWA_DOK", dokWalutaTable, dokTable, + new[] { dokIdColumn6 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DOKWALUT_REF_DOKWA_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokWaluta", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DOKWALUT_REF_DOKWA_DOK.MappedForeignKeys.Add(fK_DOKWALUT_REF_DOKWA_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKWALUT_REF_DOKWA_DOKFk).Add(fK_DOKWALUT_REF_DOKWA_DOK); + dokWalutaTable.ForeignKeyConstraints.Add(fK_DOKWALUT_REF_DOKWA_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DOKWALUT_REF_DOKWA_DOK); + var fK_DOKWALUT_REF_WALDO_WALUTA = new ForeignKeyConstraint( + "FK_DOKWALUT_REF_WALDO_WALUTA", dokWalutaTable, walutaTable, + new[] { walIdColumn1 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_DOKWALUT_REF_WALDO_WALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokWaluta", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_DOKWALUT_REF_WALDO_WALUTA.MappedForeignKeys.Add(fK_DOKWALUT_REF_WALDO_WALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOKWALUT_REF_WALDO_WALUTAFk).Add(fK_DOKWALUT_REF_WALDO_WALUTA); + dokWalutaTable.ForeignKeyConstraints.Add(fK_DOKWALUT_REF_WALDO_WALUTA); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_DOKWALUT_REF_WALDO_WALUTA); + var fK_DokWBufPow = new ForeignKeyConstraint( + "FK_DokWBufPow", dokWBufPowiazanieTable, dokTable, + new[] { dokIdColumn5 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_DokWBufPowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DokWBufPowiazanie", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_DokWBufPow.MappedForeignKeys.Add(fK_DokWBufPowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DokWBufPowFk).Add(fK_DokWBufPow); + dokWBufPowiazanieTable.ForeignKeyConstraints.Add(fK_DokWBufPow); + dokTable.ReferencingForeignKeyConstraints.Add(fK_DokWBufPow); + var fK_DOSTAWCA_REF_KTHDO_KONTRAHE = new ForeignKeyConstraint( + "FK_DOSTAWCA_REF_KTHDO_KONTRAHE", dostawcaTable, kontrahentTable, + new[] { kontrIdColumn2 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_DOSTAWCA_REF_KTHDO_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dostawca", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_DOSTAWCA_REF_KTHDO_KONTRAHE.MappedForeignKeys.Add(fK_DOSTAWCA_REF_KTHDO_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOSTAWCA_REF_KTHDO_KONTRAHEFk).Add(fK_DOSTAWCA_REF_KTHDO_KONTRAHE); + dostawcaTable.ForeignKeyConstraints.Add(fK_DOSTAWCA_REF_KTHDO_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_DOSTAWCA_REF_KTHDO_KONTRAHE); + var fK_DOSTAWCA_REF_TOWDO_TOWAR = new ForeignKeyConstraint( + "FK_DOSTAWCA_REF_TOWDO_TOWAR", dostawcaTable, towarTable, + new[] { towIdColumn0 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_DOSTAWCA_REF_TOWDO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Dostawca", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_DOSTAWCA_REF_TOWDO_TOWAR.MappedForeignKeys.Add(fK_DOSTAWCA_REF_TOWDO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_DOSTAWCA_REF_TOWDO_TOWARFk).Add(fK_DOSTAWCA_REF_TOWDO_TOWAR); + dostawcaTable.ForeignKeyConstraints.Add(fK_DOSTAWCA_REF_TOWDO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_DOSTAWCA_REF_TOWDO_TOWAR); + var ref_DostPrKth = new ForeignKeyConstraint( + "Ref_DostPrKth", dostProdTable, kontrahentTable, + new[] { dostIdColumn }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var ref_DostPrKthFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DostProd", + new[] { "DostId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + ref_DostPrKth.MappedForeignKeys.Add(ref_DostPrKthFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_DostPrKthFk).Add(ref_DostPrKth); + dostProdTable.ForeignKeyConstraints.Add(ref_DostPrKth); + kontrahentTable.ReferencingForeignKeyConstraints.Add(ref_DostPrKth); + var ref_PrDostKth = new ForeignKeyConstraint( + "Ref_PrDostKth", dostProdTable, kontrahentTable, + new[] { prodIdColumn }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var ref_PrDostKthFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DostProd", + new[] { "ProdId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + ref_PrDostKth.MappedForeignKeys.Add(ref_PrDostKthFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_PrDostKthFk).Add(ref_PrDostKth); + dostProdTable.ForeignKeyConstraints.Add(ref_PrDostKth); + kontrahentTable.ReferencingForeignKeyConstraints.Add(ref_PrDostKth); + var ref_DzienRozlPar = new ForeignKeyConstraint( + "Ref_DzienRozlPar", dzienRozlParamTable, dzienRozlTable, + new[] { dzienColumn1 }, + dzienRozlTable.FindUniqueConstraint("PK_DZIENROZL")!, ReferentialAction.NoAction); + var ref_DzienRozlParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozlParam", + new[] { "Dzien" }, + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozl", + new[] { "Dzien" }); + ref_DzienRozlPar.MappedForeignKeys.Add(ref_DzienRozlParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_DzienRozlParFk).Add(ref_DzienRozlPar); + dzienRozlParamTable.ForeignKeyConstraints.Add(ref_DzienRozlPar); + dzienRozlTable.ReferencingForeignKeyConstraints.Add(ref_DzienRozlPar); + var fK_Email_TED = new ForeignKeyConstraint( + "FK_Email_TED", emailTable, trescEmailTable, + new[] { tEDIdColumn }, + trescEmailTable.FindUniqueConstraint("PK_TrescEmail")!, ReferentialAction.NoAction); + var fK_Email_TEDFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "TEDId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + new[] { "TEId" }); + fK_Email_TED.MappedForeignKeys.Add(fK_Email_TEDFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Email_TEDFk).Add(fK_Email_TED); + emailTable.ForeignKeyConstraints.Add(fK_Email_TED); + trescEmailTable.ReferencingForeignKeyConstraints.Add(fK_Email_TED); + var fK_Email_TER = new ForeignKeyConstraint( + "FK_Email_TER", emailTable, trescEmailTable, + new[] { tERIdColumn }, + trescEmailTable.FindUniqueConstraint("PK_TrescEmail")!, ReferentialAction.NoAction); + var fK_Email_TERFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "TERId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + new[] { "TEId" }); + fK_Email_TER.MappedForeignKeys.Add(fK_Email_TERFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Email_TERFk).Add(fK_Email_TER); + emailTable.ForeignKeyConstraints.Add(fK_Email_TER); + trescEmailTable.ReferencingForeignKeyConstraints.Add(fK_Email_TER); + var fK_Email_TEW = new ForeignKeyConstraint( + "FK_Email_TEW", emailTable, trescEmailTable, + new[] { tEWIdColumn }, + trescEmailTable.FindUniqueConstraint("PK_TrescEmail")!, ReferentialAction.NoAction); + var fK_Email_TEWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "TEWId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + new[] { "TEId" }); + fK_Email_TEW.MappedForeignKeys.Add(fK_Email_TEWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Email_TEWFk).Add(fK_Email_TEW); + emailTable.ForeignKeyConstraints.Add(fK_Email_TEW); + trescEmailTable.ReferencingForeignKeyConstraints.Add(fK_Email_TEW); + var fK_Email_Uz = new ForeignKeyConstraint( + "FK_Email_Uz", emailTable, uzytkownikTable, + new[] { uzIdColumn0 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_Email_UzFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Email", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_Email_Uz.MappedForeignKeys.Add(fK_Email_UzFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Email_UzFk).Add(fK_Email_Uz); + emailTable.ForeignKeyConstraints.Add(fK_Email_Uz); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_Email_Uz); + var fK_FMZG_TYPOS = new ForeignKeyConstraint( + "FK_FMZG_TYPOS", formZgodTable, typOsTable, + new[] { typOsIdColumn }, + typOsTable.FindUniqueConstraint("PK_TYPOS")!, ReferentialAction.NoAction); + var fK_FMZG_TYPOSFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.FormZgod", + new[] { "TypOsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TypOs", + new[] { "TypOsId" }); + fK_FMZG_TYPOS.MappedForeignKeys.Add(fK_FMZG_TYPOSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_FMZG_TYPOSFk).Add(fK_FMZG_TYPOS); + formZgodTable.ForeignKeyConstraints.Add(fK_FMZG_TYPOS); + typOsTable.ReferencingForeignKeyConstraints.Add(fK_FMZG_TYPOS); + var fK_FMZG_ZGODA = new ForeignKeyConstraint( + "FK_FMZG_ZGODA", formZgodTable, zgodaTable, + new[] { zgIdColumn0 }, + zgodaTable.FindUniqueConstraint("PK_ZGODA")!, ReferentialAction.NoAction); + var fK_FMZG_ZGODAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.FormZgod", + new[] { "ZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + new[] { "ZgId" }); + fK_FMZG_ZGODA.MappedForeignKeys.Add(fK_FMZG_ZGODAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_FMZG_ZGODAFk).Add(fK_FMZG_ZGODA); + formZgodTable.ForeignKeyConstraints.Add(fK_FMZG_ZGODA); + zgodaTable.ReferencingForeignKeyConstraints.Add(fK_FMZG_ZGODA); + var fK_GRUPAUZ_REF_GRROL_UZYTKOWN = new ForeignKeyConstraint( + "FK_GRUPAUZ_REF_GRROL_UZYTKOWN", grupaUzTable, uzytkownikTable, + new[] { rolaIdColumn }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_GRUPAUZ_REF_GRROL_UZYTKOWNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaUz", + new[] { "RolaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_GRUPAUZ_REF_GRROL_UZYTKOWN.MappedForeignKeys.Add(fK_GRUPAUZ_REF_GRROL_UZYTKOWNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_GRUPAUZ_REF_GRROL_UZYTKOWNFk).Add(fK_GRUPAUZ_REF_GRROL_UZYTKOWN); + grupaUzTable.ForeignKeyConstraints.Add(fK_GRUPAUZ_REF_GRROL_UZYTKOWN); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_GRUPAUZ_REF_GRROL_UZYTKOWN); + var fK_GRUPAUZ_REF_GRUZ_UZYTKOWN = new ForeignKeyConstraint( + "FK_GRUPAUZ_REF_GRUZ_UZYTKOWN", grupaUzTable, uzytkownikTable, + new[] { uzIdColumn1 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_GRUPAUZ_REF_GRUZ_UZYTKOWNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaUz", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_GRUPAUZ_REF_GRUZ_UZYTKOWN.MappedForeignKeys.Add(fK_GRUPAUZ_REF_GRUZ_UZYTKOWNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_GRUPAUZ_REF_GRUZ_UZYTKOWNFk).Add(fK_GRUPAUZ_REF_GRUZ_UZYTKOWN); + grupaUzTable.ForeignKeyConstraints.Add(fK_GRUPAUZ_REF_GRUZ_UZYTKOWN); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_GRUPAUZ_REF_GRUZ_UZYTKOWN); + var fK_GRWARTOS_REF_GRWAR_GRUPATOW = new ForeignKeyConstraint( + "FK_GRWARTOS_REF_GRWAR_GRUPATOW", grWartoscTable, grupaTowTable, + new[] { grIdColumn }, + grupaTowTable.FindUniqueConstraint("PK_GRUPATOW")!, ReferentialAction.NoAction); + var fK_GRWARTOS_REF_GRWAR_GRUPATOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrWartosc", + new[] { "GrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaTow", + new[] { "GrId" }); + fK_GRWARTOS_REF_GRWAR_GRUPATOW.MappedForeignKeys.Add(fK_GRWARTOS_REF_GRWAR_GRUPATOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_GRWARTOS_REF_GRWAR_GRUPATOWFk).Add(fK_GRWARTOS_REF_GRWAR_GRUPATOW); + grWartoscTable.ForeignKeyConstraints.Add(fK_GRWARTOS_REF_GRWAR_GRUPATOW); + grupaTowTable.ReferencingForeignKeyConstraints.Add(fK_GRWARTOS_REF_GRWAR_GRUPATOW); + var fK_GRWARTOS_REF_PARGR_PARAMETR = new ForeignKeyConstraint( + "FK_GRWARTOS_REF_PARGR_PARAMETR", grWartoscTable, parametrTable, + new[] { parIdColumn }, + parametrTable.FindUniqueConstraint("PK_PARAMETR")!, ReferentialAction.NoAction); + var fK_GRWARTOS_REF_PARGR_PARAMETRFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.GrWartosc", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Parametr", + new[] { "ParId" }); + fK_GRWARTOS_REF_PARGR_PARAMETR.MappedForeignKeys.Add(fK_GRWARTOS_REF_PARGR_PARAMETRFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_GRWARTOS_REF_PARGR_PARAMETRFk).Add(fK_GRWARTOS_REF_PARGR_PARAMETR); + grWartoscTable.ForeignKeyConstraints.Add(fK_GRWARTOS_REF_PARGR_PARAMETR); + parametrTable.ReferencingForeignKeyConstraints.Add(fK_GRWARTOS_REF_PARGR_PARAMETR); + var fK_HARMCENY_REF_HARMC_HARMWPIS = new ForeignKeyConstraint( + "FK_HARMCENY_REF_HARMC_HARMWPIS", harmCenyTable, harmWpisTable, + new[] { harmIdColumn }, + harmWpisTable.FindUniqueConstraint("PK_HARMWPIS")!, ReferentialAction.NoAction); + var fK_HARMCENY_REF_HARMC_HARMWPISFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmCeny", + new[] { "HarmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + new[] { "HarmId" }); + fK_HARMCENY_REF_HARMC_HARMWPIS.MappedForeignKeys.Add(fK_HARMCENY_REF_HARMC_HARMWPISFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HARMCENY_REF_HARMC_HARMWPISFk).Add(fK_HARMCENY_REF_HARMC_HARMWPIS); + harmCenyTable.ForeignKeyConstraints.Add(fK_HARMCENY_REF_HARMC_HARMWPIS); + harmWpisTable.ReferencingForeignKeyConstraints.Add(fK_HARMCENY_REF_HARMC_HARMWPIS); + var fK_HARMCENY_REF_HARMT_TOWAR = new ForeignKeyConstraint( + "FK_HARMCENY_REF_HARMT_TOWAR", harmCenyTable, towarTable, + new[] { towIdColumn1 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_HARMCENY_REF_HARMT_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmCeny", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_HARMCENY_REF_HARMT_TOWAR.MappedForeignKeys.Add(fK_HARMCENY_REF_HARMT_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HARMCENY_REF_HARMT_TOWARFk).Add(fK_HARMCENY_REF_HARMT_TOWAR); + harmCenyTable.ForeignKeyConstraints.Add(fK_HARMCENY_REF_HARMT_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_HARMCENY_REF_HARMT_TOWAR); + var fK_HARMCYKL = new ForeignKeyConstraint( + "FK_HARMCYKL", harmCyklTable, harmWpisTable, + new[] { harmIdColumn0 }, + harmWpisTable.FindUniqueConstraint("PK_HARMWPIS")!, ReferentialAction.NoAction); + var fK_HARMCYKLFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmCykl", + new[] { "HarmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + new[] { "HarmId" }); + fK_HARMCYKL.MappedForeignKeys.Add(fK_HARMCYKLFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HARMCYKLFk).Add(fK_HARMCYKL); + harmCyklTable.ForeignKeyConstraints.Add(fK_HARMCYKL); + harmWpisTable.ReferencingForeignKeyConstraints.Add(fK_HARMCYKL); + var fK_HARMHARM = new ForeignKeyConstraint( + "FK_HARMHARM", harmHarmTable, harmWpisTable, + new[] { harmIdColumn1 }, + harmWpisTable.FindUniqueConstraint("PK_HARMWPIS")!, ReferentialAction.NoAction); + var fK_HARMHARMFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmHarm", + new[] { "HarmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + new[] { "HarmId" }); + fK_HARMHARM.MappedForeignKeys.Add(fK_HARMHARMFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HARMHARMFk).Add(fK_HARMHARM); + harmHarmTable.ForeignKeyConstraints.Add(fK_HARMHARM); + harmWpisTable.ReferencingForeignKeyConstraints.Add(fK_HARMHARM); + var fK_HARMPOPRZHARM = new ForeignKeyConstraint( + "FK_HARMPOPRZHARM", harmHarmTable, harmWpisTable, + new[] { poprzHarmIdColumn }, + harmWpisTable.FindUniqueConstraint("PK_HARMWPIS")!, ReferentialAction.NoAction); + var fK_HARMPOPRZHARMFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmHarm", + new[] { "PoprzHarmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + new[] { "HarmId" }); + fK_HARMPOPRZHARM.MappedForeignKeys.Add(fK_HARMPOPRZHARMFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HARMPOPRZHARMFk).Add(fK_HARMPOPRZHARM); + harmHarmTable.ForeignKeyConstraints.Add(fK_HARMPOPRZHARM); + harmWpisTable.ReferencingForeignKeyConstraints.Add(fK_HARMPOPRZHARM); + var fK_HarmRapCykl_HRId = new ForeignKeyConstraint( + "FK_HarmRapCykl_HRId", harmRapCyklTable, harmRapTable, + new[] { hRIdColumn0 }, + harmRapTable.FindUniqueConstraint("PK_HarmRap")!, ReferentialAction.NoAction); + var fK_HarmRapCykl_HRIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapCykl", + new[] { "HRId" }, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRap", + new[] { "HRId" }); + fK_HarmRapCykl_HRId.MappedForeignKeys.Add(fK_HarmRapCykl_HRIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HarmRapCykl_HRIdFk).Add(fK_HarmRapCykl_HRId); + harmRapCyklTable.ForeignKeyConstraints.Add(fK_HarmRapCykl_HRId); + harmRapTable.ReferencingForeignKeyConstraints.Add(fK_HarmRapCykl_HRId); + var fK_HarmRapParam_HRId = new ForeignKeyConstraint( + "FK_HarmRapParam_HRId", harmRapParamTable, harmRapTable, + new[] { hRIdColumn1 }, + harmRapTable.FindUniqueConstraint("PK_HarmRap")!, ReferentialAction.NoAction); + var fK_HarmRapParam_HRIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapParam", + new[] { "HRId" }, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRap", + new[] { "HRId" }); + fK_HarmRapParam_HRId.MappedForeignKeys.Add(fK_HarmRapParam_HRIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HarmRapParam_HRIdFk).Add(fK_HarmRapParam_HRId); + harmRapParamTable.ForeignKeyConstraints.Add(fK_HarmRapParam_HRId); + harmRapTable.ReferencingForeignKeyConstraints.Add(fK_HarmRapParam_HRId); + var fK_HarmRapZlecenie_HRId = new ForeignKeyConstraint( + "FK_HarmRapZlecenie_HRId", harmRapZlecenieTable, harmRapTable, + new[] { hRIdColumn2 }, + harmRapTable.FindUniqueConstraint("PK_HarmRap")!, ReferentialAction.NoAction); + var fK_HarmRapZlecenie_HRIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRapZlecenie", + new[] { "HRId" }, + "Blink.Backoffice.Services.PcmDb.Entities.HarmRap", + new[] { "HRId" }); + fK_HarmRapZlecenie_HRId.MappedForeignKeys.Add(fK_HarmRapZlecenie_HRIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HarmRapZlecenie_HRIdFk).Add(fK_HarmRapZlecenie_HRId); + harmRapZlecenieTable.ForeignKeyConstraints.Add(fK_HarmRapZlecenie_HRId); + harmRapTable.ReferencingForeignKeyConstraints.Add(fK_HarmRapZlecenie_HRId); + var fK_HARMWPIS_REF_HARMP_POLITYKA = new ForeignKeyConstraint( + "FK_HARMWPIS_REF_HARMP_POLITYKA", harmWpisTable, politykaTable, + new[] { polIdColumn }, + politykaTable.FindUniqueConstraint("PK_POLITYKA")!, ReferentialAction.NoAction); + var fK_HARMWPIS_REF_HARMP_POLITYKAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + new[] { "PolId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Polityka", + new[] { "PolId" }); + fK_HARMWPIS_REF_HARMP_POLITYKA.MappedForeignKeys.Add(fK_HARMWPIS_REF_HARMP_POLITYKAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_HARMWPIS_REF_HARMP_POLITYKAFk).Add(fK_HARMWPIS_REF_HARMP_POLITYKA); + harmWpisTable.ForeignKeyConstraints.Add(fK_HARMWPIS_REF_HARMP_POLITYKA); + politykaTable.ReferencingForeignKeyConstraints.Add(fK_HARMWPIS_REF_HARMP_POLITYKA); + var fK_Ref_HarmKraj = new ForeignKeyConstraint( + "FK_Ref_HarmKraj", harmWpisTable, krajTable, + new[] { krajIdColumn }, + krajTable.FindUniqueConstraint("PK_KRAJ")!, ReferentialAction.NoAction); + var fK_Ref_HarmKrajFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.HarmWpis", + new[] { "KrajId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "KrajId" }); + fK_Ref_HarmKraj.MappedForeignKeys.Add(fK_Ref_HarmKrajFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_HarmKrajFk).Add(fK_Ref_HarmKraj); + harmWpisTable.ForeignKeyConstraints.Add(fK_Ref_HarmKraj); + krajTable.ReferencingForeignKeyConstraints.Add(fK_Ref_HarmKraj); + var fK_ISTW_REF_ISTWM_MAGAZYN = new ForeignKeyConstraint( + "FK_ISTW_REF_ISTWM_MAGAZYN", istwTable, magazynTable, + new[] { magIdColumn1 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_ISTW_REF_ISTWM_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Istw", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_ISTW_REF_ISTWM_MAGAZYN.MappedForeignKeys.Add(fK_ISTW_REF_ISTWM_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ISTW_REF_ISTWM_MAGAZYNFk).Add(fK_ISTW_REF_ISTWM_MAGAZYN); + istwTable.ForeignKeyConstraints.Add(fK_ISTW_REF_ISTWM_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_ISTW_REF_ISTWM_MAGAZYN); + var fK_ISTW_REF_TOWIS_TOWAR = new ForeignKeyConstraint( + "FK_ISTW_REF_TOWIS_TOWAR", istwTable, towarTable, + new[] { towIdColumn2 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_ISTW_REF_TOWIS_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Istw", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_ISTW_REF_TOWIS_TOWAR.MappedForeignKeys.Add(fK_ISTW_REF_TOWIS_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ISTW_REF_TOWIS_TOWARFk).Add(fK_ISTW_REF_TOWIS_TOWAR); + istwTable.ForeignKeyConstraints.Add(fK_ISTW_REF_TOWIS_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_ISTW_REF_TOWIS_TOWAR); + var ref_KartaKonto = new ForeignKeyConstraint( + "Ref_KartaKonto", kartaLojTable, kontoLojTable, + new[] { kontoIdColumn }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_KartaKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + new[] { "KontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_KartaKonto.MappedForeignKeys.Add(ref_KartaKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_KartaKontoFk).Add(ref_KartaKonto); + kartaLojTable.ForeignKeyConstraints.Add(ref_KartaKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_KartaKonto); + var fK_KASA_REF_KASAM_MAGAZYN = new ForeignKeyConstraint( + "FK_KASA_REF_KASAM_MAGAZYN", kasaTable, magazynTable, + new[] { magIdColumn2 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_KASA_REF_KASAM_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_KASA_REF_KASAM_MAGAZYN.MappedForeignKeys.Add(fK_KASA_REF_KASAM_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASA_REF_KASAM_MAGAZYNFk).Add(fK_KASA_REF_KASAM_MAGAZYN); + kasaTable.ForeignKeyConstraints.Add(fK_KASA_REF_KASAM_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_KASA_REF_KASAM_MAGAZYN); + var fK_KASAFORMAPLATN_FPP7 = new ForeignKeyConstraint( + "FK_KASAFORMAPLATN_FPP7", kasaFormaPlatnTable, formaPlatnPos7Table, + new[] { formaIdColumn0 }, + formaPlatnPos7Table.FindUniqueConstraint("PK_FormaPlatnPos7")!, ReferentialAction.NoAction); + var fK_KASAFORMAPLATN_FPP7Fk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn", + new[] { "FormaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.FormaPlatnPos7", + new[] { "FormaId" }); + fK_KASAFORMAPLATN_FPP7.MappedForeignKeys.Add(fK_KASAFORMAPLATN_FPP7Fk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASAFORMAPLATN_FPP7Fk).Add(fK_KASAFORMAPLATN_FPP7); + kasaFormaPlatnTable.ForeignKeyConstraints.Add(fK_KASAFORMAPLATN_FPP7); + formaPlatnPos7Table.ReferencingForeignKeyConstraints.Add(fK_KASAFORMAPLATN_FPP7); + var fK_KASAFORMAPLATN_KASA = new ForeignKeyConstraint( + "FK_KASAFORMAPLATN_KASA", kasaFormaPlatnTable, kasaTable, + new[] { kasaIdColumn4 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_KASAFORMAPLATN_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasaFormaPlatn", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_KASAFORMAPLATN_KASA.MappedForeignKeys.Add(fK_KASAFORMAPLATN_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASAFORMAPLATN_KASAFk).Add(fK_KASAFORMAPLATN_KASA); + kasaFormaPlatnTable.ForeignKeyConstraints.Add(fK_KASAFORMAPLATN_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_KASAFORMAPLATN_KASA); + var fK_KASKOD_REF_KASKO_KASA = new ForeignKeyConstraint( + "FK_KASKOD_REF_KASKO_KASA", kasKodTable, kasaTable, + new[] { kasaIdColumn0 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_KASKOD_REF_KASKO_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasKod", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_KASKOD_REF_KASKO_KASA.MappedForeignKeys.Add(fK_KASKOD_REF_KASKO_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASKOD_REF_KASKO_KASAFk).Add(fK_KASKOD_REF_KASKO_KASA); + kasKodTable.ForeignKeyConstraints.Add(fK_KASKOD_REF_KASKO_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_KASKOD_REF_KASKO_KASA); + var fK_KASKOD_REF_KASKO_TOWAR = new ForeignKeyConstraint( + "FK_KASKOD_REF_KASKO_TOWAR", kasKodTable, towarTable, + new[] { towIdColumn3 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_KASKOD_REF_KASKO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasKod", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_KASKOD_REF_KASKO_TOWAR.MappedForeignKeys.Add(fK_KASKOD_REF_KASKO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASKOD_REF_KASKO_TOWARFk).Add(fK_KASKOD_REF_KASKO_TOWAR); + kasKodTable.ForeignKeyConstraints.Add(fK_KASKOD_REF_KASKO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_KASKOD_REF_KASKO_TOWAR); + var fK_KASPAR_REF_KASPA_KASA = new ForeignKeyConstraint( + "FK_KASPAR_REF_KASPA_KASA", kasParTable, kasaTable, + new[] { kasaIdColumn1 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_KASPAR_REF_KASPA_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasPar", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_KASPAR_REF_KASPA_KASA.MappedForeignKeys.Add(fK_KASPAR_REF_KASPA_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASPAR_REF_KASPA_KASAFk).Add(fK_KASPAR_REF_KASPA_KASA); + kasParTable.ForeignKeyConstraints.Add(fK_KASPAR_REF_KASPA_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_KASPAR_REF_KASPA_KASA); + var fK_KASTOW_REF_KASKO_KASA = new ForeignKeyConstraint( + "FK_KASTOW_REF_KASKO_KASA", kasTowTable, kasaTable, + new[] { kasaIdColumn2 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_KASTOW_REF_KASKO_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasTow", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_KASTOW_REF_KASKO_KASA.MappedForeignKeys.Add(fK_KASTOW_REF_KASKO_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASTOW_REF_KASKO_KASAFk).Add(fK_KASTOW_REF_KASKO_KASA); + kasTowTable.ForeignKeyConstraints.Add(fK_KASTOW_REF_KASKO_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_KASTOW_REF_KASKO_KASA); + var fK_KASTOW_REF_KASTO_TOWAR = new ForeignKeyConstraint( + "FK_KASTOW_REF_KASTO_TOWAR", kasTowTable, towarTable, + new[] { towIdColumn4 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_KASTOW_REF_KASTO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KasTow", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_KASTOW_REF_KASTO_TOWAR.MappedForeignKeys.Add(fK_KASTOW_REF_KASTO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KASTOW_REF_KASTO_TOWARFk).Add(fK_KASTOW_REF_KASTO_TOWAR); + kasTowTable.ForeignKeyConstraints.Add(fK_KASTOW_REF_KASTO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_KASTOW_REF_KASTO_TOWAR); + var fK_KATPARAM_REF_KATPA_KATEGORI = new ForeignKeyConstraint( + "FK_KATPARAM_REF_KATPA_KATEGORI", katParamTable, kategoriaTable, + new[] { katIdColumn }, + kategoriaTable.FindUniqueConstraint("PK_KATEGORIA")!, ReferentialAction.NoAction); + var fK_KATPARAM_REF_KATPA_KATEGORIFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KatParam", + new[] { "KatId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kategoria", + new[] { "KatId" }); + fK_KATPARAM_REF_KATPA_KATEGORI.MappedForeignKeys.Add(fK_KATPARAM_REF_KATPA_KATEGORIFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KATPARAM_REF_KATPA_KATEGORIFk).Add(fK_KATPARAM_REF_KATPA_KATEGORI); + katParamTable.ForeignKeyConstraints.Add(fK_KATPARAM_REF_KATPA_KATEGORI); + kategoriaTable.ReferencingForeignKeyConstraints.Add(fK_KATPARAM_REF_KATPA_KATEGORI); + var fK_KATPARAM_REF_PARKA_PARAMETR = new ForeignKeyConstraint( + "FK_KATPARAM_REF_PARKA_PARAMETR", katParamTable, parametrTable, + new[] { parIdColumn0 }, + parametrTable.FindUniqueConstraint("PK_PARAMETR")!, ReferentialAction.NoAction); + var fK_KATPARAM_REF_PARKA_PARAMETRFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KatParam", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Parametr", + new[] { "ParId" }); + fK_KATPARAM_REF_PARKA_PARAMETR.MappedForeignKeys.Add(fK_KATPARAM_REF_PARKA_PARAMETRFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KATPARAM_REF_PARKA_PARAMETRFk).Add(fK_KATPARAM_REF_PARKA_PARAMETR); + katParamTable.ForeignKeyConstraints.Add(fK_KATPARAM_REF_PARKA_PARAMETR); + parametrTable.ReferencingForeignKeyConstraints.Add(fK_KATPARAM_REF_PARKA_PARAMETR); + var fK_KODDOD_REF_KODDO_TOWAR = new ForeignKeyConstraint( + "FK_KODDOD_REF_KODDO_TOWAR", kodDodTable, towarTable, + new[] { towIdColumn5 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_KODDOD_REF_KODDO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodDod", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_KODDOD_REF_KODDO_TOWAR.MappedForeignKeys.Add(fK_KODDOD_REF_KODDO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KODDOD_REF_KODDO_TOWARFk).Add(fK_KODDOD_REF_KODDO_TOWAR); + kodDodTable.ForeignKeyConstraints.Add(fK_KODDOD_REF_KODDO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_KODDOD_REF_KODDO_TOWAR); + var ref_KodWazony = new ForeignKeyConstraint( + "Ref_KodWazony", kodWazonyTable, jMTable, + new[] { jMIdColumn0 }, + jMTable.FindUniqueConstraint("PK_JM")!, ReferentialAction.NoAction); + var ref_KodWazonyFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KodWazony", + new[] { "JMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.JM", + new[] { "JMId" }); + ref_KodWazony.MappedForeignKeys.Add(ref_KodWazonyFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_KodWazonyFk).Add(ref_KodWazony); + kodWazonyTable.ForeignKeyConstraints.Add(ref_KodWazony); + jMTable.ReferencingForeignKeyConstraints.Add(ref_KodWazony); + var fK_KOMENTAR_REF_ZMKOM_ZMIANA = new ForeignKeyConstraint( + "FK_KOMENTAR_REF_ZMKOM_ZMIANA", komentarzTable, zmianaTable, + new[] { zmIdColumn }, + zmianaTable.FindUniqueConstraint("PK_ZMIANA")!, ReferentialAction.NoAction); + var fK_KOMENTAR_REF_ZMKOM_ZMIANAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Komentarz", + new[] { "ZmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + new[] { "ZmId" }); + fK_KOMENTAR_REF_ZMKOM_ZMIANA.MappedForeignKeys.Add(fK_KOMENTAR_REF_ZMKOM_ZMIANAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KOMENTAR_REF_ZMKOM_ZMIANAFk).Add(fK_KOMENTAR_REF_ZMKOM_ZMIANA); + komentarzTable.ForeignKeyConstraints.Add(fK_KOMENTAR_REF_ZMKOM_ZMIANA); + zmianaTable.ReferencingForeignKeyConstraints.Add(fK_KOMENTAR_REF_ZMKOM_ZMIANA); + var fK_KONTOBANK_BANK = new ForeignKeyConstraint( + "FK_KONTOBANK_BANK", kontoBankoweTable, bankTable, + new[] { bankIdColumn0 }, + bankTable.FindUniqueConstraint("PK_Bank")!, ReferentialAction.NoAction); + var fK_KONTOBANK_BANKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "BankId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Bank", + new[] { "BankId" }); + fK_KONTOBANK_BANK.MappedForeignKeys.Add(fK_KONTOBANK_BANKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTOBANK_BANKFk).Add(fK_KONTOBANK_BANK); + kontoBankoweTable.ForeignKeyConstraints.Add(fK_KONTOBANK_BANK); + bankTable.ReferencingForeignKeyConstraints.Add(fK_KONTOBANK_BANK); + var fK_KONTOBANK_MAGAZYN = new ForeignKeyConstraint( + "FK_KONTOBANK_MAGAZYN", kontoBankoweTable, magazynTable, + new[] { magIdColumn3 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_KONTOBANK_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_KONTOBANK_MAGAZYN.MappedForeignKeys.Add(fK_KONTOBANK_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTOBANK_MAGAZYNFk).Add(fK_KONTOBANK_MAGAZYN); + kontoBankoweTable.ForeignKeyConstraints.Add(fK_KONTOBANK_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_KONTOBANK_MAGAZYN); + var fK_KONTOBANK_WALUTA = new ForeignKeyConstraint( + "FK_KONTOBANK_WALUTA", kontoBankoweTable, walutaTable, + new[] { walIdColumn2 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_KONTOBANK_WALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_KONTOBANK_WALUTA.MappedForeignKeys.Add(fK_KONTOBANK_WALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTOBANK_WALUTAFk).Add(fK_KONTOBANK_WALUTA); + kontoBankoweTable.ForeignKeyConstraints.Add(fK_KONTOBANK_WALUTA); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_KONTOBANK_WALUTA); + var fK_KONTOBANKKONTR_BANK = new ForeignKeyConstraint( + "FK_KONTOBANKKONTR_BANK", kontoBankoweKontrTable, bankTable, + new[] { bankIdColumn1 }, + bankTable.FindUniqueConstraint("PK_Bank")!, ReferentialAction.NoAction); + var fK_KONTOBANKKONTR_BANKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + new[] { "BankId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Bank", + new[] { "BankId" }); + fK_KONTOBANKKONTR_BANK.MappedForeignKeys.Add(fK_KONTOBANKKONTR_BANKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTOBANKKONTR_BANKFk).Add(fK_KONTOBANKKONTR_BANK); + kontoBankoweKontrTable.ForeignKeyConstraints.Add(fK_KONTOBANKKONTR_BANK); + bankTable.ReferencingForeignKeyConstraints.Add(fK_KONTOBANKKONTR_BANK); + var fK_KONTOBANKKONTR_KONTR = new ForeignKeyConstraint( + "FK_KONTOBANKKONTR_KONTR", kontoBankoweKontrTable, kontrahentTable, + new[] { kontrIdColumn3 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_KONTOBANKKONTR_KONTRFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_KONTOBANKKONTR_KONTR.MappedForeignKeys.Add(fK_KONTOBANKKONTR_KONTRFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTOBANKKONTR_KONTRFk).Add(fK_KONTOBANKKONTR_KONTR); + kontoBankoweKontrTable.ForeignKeyConstraints.Add(fK_KONTOBANKKONTR_KONTR); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_KONTOBANKKONTR_KONTR); + var fK_KONTOBANKKONTR_WALUTA = new ForeignKeyConstraint( + "FK_KONTOBANKKONTR_WALUTA", kontoBankoweKontrTable, walutaTable, + new[] { walIdColumn3 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_KONTOBANKKONTR_WALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankoweKontr", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_KONTOBANKKONTR_WALUTA.MappedForeignKeys.Add(fK_KONTOBANKKONTR_WALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTOBANKKONTR_WALUTAFk).Add(fK_KONTOBANKKONTR_WALUTA); + kontoBankoweKontrTable.ForeignKeyConstraints.Add(fK_KONTOBANKKONTR_WALUTA); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_KONTOBANKKONTR_WALUTA); + var ref_KontoKth = new ForeignKeyConstraint( + "Ref_KontoKth", kontoLojTable, kontrahentTable, + new[] { kontrIdColumn4 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var ref_KontoKthFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + ref_KontoKth.MappedForeignKeys.Add(ref_KontoKthFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_KontoKthFk).Add(ref_KontoKth); + kontoLojTable.ForeignKeyConstraints.Add(ref_KontoKth); + kontrahentTable.ReferencingForeignKeyConstraints.Add(ref_KontoKth); + var fK_KONTRAHE_REF_KTHAK_AKWIZYTO = new ForeignKeyConstraint( + "FK_KONTRAHE_REF_KTHAK_AKWIZYTO", kontrahentTable, akwizytorTable, + new[] { akwIdColumn0 }, + akwizytorTable.FindUniqueConstraint("PK_AKWIZYTOR")!, ReferentialAction.NoAction); + var fK_KONTRAHE_REF_KTHAK_AKWIZYTOFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "AkwId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Akwizytor", + new[] { "AkwId" }); + fK_KONTRAHE_REF_KTHAK_AKWIZYTO.MappedForeignKeys.Add(fK_KONTRAHE_REF_KTHAK_AKWIZYTOFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTRAHE_REF_KTHAK_AKWIZYTOFk).Add(fK_KONTRAHE_REF_KTHAK_AKWIZYTO); + kontrahentTable.ForeignKeyConstraints.Add(fK_KONTRAHE_REF_KTHAK_AKWIZYTO); + akwizytorTable.ReferencingForeignKeyConstraints.Add(fK_KONTRAHE_REF_KTHAK_AKWIZYTO); + var fK_Ref_KontrahentKraj = new ForeignKeyConstraint( + "FK_Ref_KontrahentKraj", kontrahentTable, krajTable, + new[] { kontrKrajIdColumn }, + krajTable.FindUniqueConstraint("PK_KRAJ")!, ReferentialAction.NoAction); + var fK_Ref_KontrahentKrajFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrKrajId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "KrajId" }); + fK_Ref_KontrahentKraj.MappedForeignKeys.Add(fK_Ref_KontrahentKrajFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_KontrahentKrajFk).Add(fK_Ref_KontrahentKraj); + kontrahentTable.ForeignKeyConstraints.Add(fK_Ref_KontrahentKraj); + krajTable.ReferencingForeignKeyConstraints.Add(fK_Ref_KontrahentKraj); + var fK_KONTROPI_REF_KTHOP_KONTRAHE = new ForeignKeyConstraint( + "FK_KONTROPI_REF_KTHOP_KONTRAHE", kontrOpisTable, kontrahentTable, + new[] { kontrIdColumn5 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_KONTROPI_REF_KTHOP_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KontrOpis", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_KONTROPI_REF_KTHOP_KONTRAHE.MappedForeignKeys.Add(fK_KONTROPI_REF_KTHOP_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KONTROPI_REF_KTHOP_KONTRAHEFk).Add(fK_KONTROPI_REF_KTHOP_KONTRAHE); + kontrOpisTable.ForeignKeyConstraints.Add(fK_KONTROPI_REF_KTHOP_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_KONTROPI_REF_KTHOP_KONTRAHE); + var fK_Ref_KrajWal = new ForeignKeyConstraint( + "FK_Ref_KrajWal", krajTable, walutaTable, + new[] { walIdColumn4 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_Ref_KrajWalFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_Ref_KrajWal.MappedForeignKeys.Add(fK_Ref_KrajWalFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_KrajWalFk).Add(fK_Ref_KrajWal); + krajTable.ForeignKeyConstraints.Add(fK_Ref_KrajWal); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_Ref_KrajWal); + var fK_Ref_KrajVat = new ForeignKeyConstraint( + "FK_Ref_KrajVat", krajStawkaTable, krajTable, + new[] { krajIdColumn1 }, + krajTable.FindUniqueConstraint("PK_KRAJ")!, ReferentialAction.NoAction); + var fK_Ref_KrajVatFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KrajStawka", + new[] { "KrajId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "KrajId" }); + fK_Ref_KrajVat.MappedForeignKeys.Add(fK_Ref_KrajVatFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_KrajVatFk).Add(fK_Ref_KrajVat); + krajStawkaTable.ForeignKeyConstraints.Add(fK_Ref_KrajVat); + krajTable.ReferencingForeignKeyConstraints.Add(fK_Ref_KrajVat); + var fK_KTHPARAM_REF_KPDOM_KTHPARWA = new ForeignKeyConstraint( + "FK_KTHPARAM_REF_KPDOM_KTHPARWA", kthParamTable, kthParWartoscTable, + new[] { kPWDomyslnaIdColumn }, + kthParWartoscTable.FindUniqueConstraint("PK_KTHPARWARTOSC")!, ReferentialAction.NoAction); + var fK_KTHPARAM_REF_KPDOM_KTHPARWAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KthParam", + new[] { "KPWDomyslnaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", + new[] { "KPWId" }); + fK_KTHPARAM_REF_KPDOM_KTHPARWA.MappedForeignKeys.Add(fK_KTHPARAM_REF_KPDOM_KTHPARWAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KTHPARAM_REF_KPDOM_KTHPARWAFk).Add(fK_KTHPARAM_REF_KPDOM_KTHPARWA); + kthParamTable.ForeignKeyConstraints.Add(fK_KTHPARAM_REF_KPDOM_KTHPARWA); + kthParWartoscTable.ReferencingForeignKeyConstraints.Add(fK_KTHPARAM_REF_KPDOM_KTHPARWA); + var fK_KTHPARWA_REF_KPWAR_KTHPARAM = new ForeignKeyConstraint( + "FK_KTHPARWA_REF_KPWAR_KTHPARAM", kthParWartoscTable, kthParamTable, + new[] { kthParIdColumn }, + kthParamTable.FindUniqueConstraint("PK_KTHPARAM")!, ReferentialAction.NoAction); + var fK_KTHPARWA_REF_KPWAR_KTHPARAMFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", + new[] { "KthParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KthParam", + new[] { "KthParId" }); + fK_KTHPARWA_REF_KPWAR_KTHPARAM.MappedForeignKeys.Add(fK_KTHPARWA_REF_KPWAR_KTHPARAMFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KTHPARWA_REF_KPWAR_KTHPARAMFk).Add(fK_KTHPARWA_REF_KPWAR_KTHPARAM); + kthParWartoscTable.ForeignKeyConstraints.Add(fK_KTHPARWA_REF_KPWAR_KTHPARAM); + kthParamTable.ReferencingForeignKeyConstraints.Add(fK_KTHPARWA_REF_KPWAR_KTHPARAM); + var fK_KTHTYPOS_KTH = new ForeignKeyConstraint( + "FK_KTHTYPOS_KTH", kthTypOsTable, kontrahentTable, + new[] { kontrIdColumn22 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_KTHTYPOS_KTHFk = RelationalModel.GetForeignKey(this, + "KthTypOs", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_KTHTYPOS_KTH.MappedForeignKeys.Add(fK_KTHTYPOS_KTHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KTHTYPOS_KTHFk).Add(fK_KTHTYPOS_KTH); + kthTypOsTable.ForeignKeyConstraints.Add(fK_KTHTYPOS_KTH); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_KTHTYPOS_KTH); + var fK_KTHTYPOS_TYPOS = new ForeignKeyConstraint( + "FK_KTHTYPOS_TYPOS", kthTypOsTable, typOsTable, + new[] { typOsIdColumn3 }, + typOsTable.FindUniqueConstraint("PK_TYPOS")!, ReferentialAction.NoAction); + var fK_KTHTYPOS_TYPOSFk = RelationalModel.GetForeignKey(this, + "KthTypOs", + new[] { "TypOsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TypOs", + new[] { "TypOsId" }); + fK_KTHTYPOS_TYPOS.MappedForeignKeys.Add(fK_KTHTYPOS_TYPOSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KTHTYPOS_TYPOSFk).Add(fK_KTHTYPOS_TYPOS); + kthTypOsTable.ForeignKeyConstraints.Add(fK_KTHTYPOS_TYPOS); + typOsTable.ReferencingForeignKeyConstraints.Add(fK_KTHTYPOS_TYPOS); + var fK_KTHWARTO_REF_KTHWA_KONTRAHE = new ForeignKeyConstraint( + "FK_KTHWARTO_REF_KTHWA_KONTRAHE", kthWartoscTable, kontrahentTable, + new[] { kontrIdColumn23 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_KTHWARTO_REF_KTHWA_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "KthWartosc", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_KTHWARTO_REF_KTHWA_KONTRAHE.MappedForeignKeys.Add(fK_KTHWARTO_REF_KTHWA_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KTHWARTO_REF_KTHWA_KONTRAHEFk).Add(fK_KTHWARTO_REF_KTHWA_KONTRAHE); + kthWartoscTable.ForeignKeyConstraints.Add(fK_KTHWARTO_REF_KTHWA_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_KTHWARTO_REF_KTHWA_KONTRAHE); + var fK_KTHWARTO_REF_KWPAR_KTHPARWA = new ForeignKeyConstraint( + "FK_KTHWARTO_REF_KWPAR_KTHPARWA", kthWartoscTable, kthParWartoscTable, + new[] { kPWIdColumn0 }, + kthParWartoscTable.FindUniqueConstraint("PK_KTHPARWARTOSC")!, ReferentialAction.NoAction); + var fK_KTHWARTO_REF_KWPAR_KTHPARWAFk = RelationalModel.GetForeignKey(this, + "KthWartosc", + new[] { "KPWId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", + new[] { "KPWId" }); + fK_KTHWARTO_REF_KWPAR_KTHPARWA.MappedForeignKeys.Add(fK_KTHWARTO_REF_KWPAR_KTHPARWAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KTHWARTO_REF_KWPAR_KTHPARWAFk).Add(fK_KTHWARTO_REF_KWPAR_KTHPARWA); + kthWartoscTable.ForeignKeyConstraints.Add(fK_KTHWARTO_REF_KWPAR_KTHPARWA); + kthParWartoscTable.ReferencingForeignKeyConstraints.Add(fK_KTHWARTO_REF_KWPAR_KTHPARWA); + var fK_KURSWAL_REFERENCE_WAL = new ForeignKeyConstraint( + "FK_KURSWAL_REFERENCE_WAL", kursWalutyTable, walutaTable, + new[] { walIdColumn5 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_KURSWAL_REFERENCE_WALFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.KursWaluty", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_KURSWAL_REFERENCE_WAL.MappedForeignKeys.Add(fK_KURSWAL_REFERENCE_WALFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_KURSWAL_REFERENCE_WALFk).Add(fK_KURSWAL_REFERENCE_WAL); + kursWalutyTable.ForeignKeyConstraints.Add(fK_KURSWAL_REFERENCE_WAL); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_KURSWAL_REFERENCE_WAL); + var fK_LOGVALCH_REFERENCE_LOGOPERB = new ForeignKeyConstraint( + "FK_LOGVALCH_REFERENCE_LOGOPERB", logValChangeNumTable, logOperationTable, + new[] { operationIdColumn0 }, + logOperationTable.FindUniqueConstraint("PK_LOGOPERATION")!, ReferentialAction.NoAction); + var fK_LOGVALCH_REFERENCE_LOGOPERBFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeNum", + new[] { "OperationId" }, + "Blink.Backoffice.Services.PcmDb.Entities.LogOperation", + new[] { "OperationId" }); + fK_LOGVALCH_REFERENCE_LOGOPERB.MappedForeignKeys.Add(fK_LOGVALCH_REFERENCE_LOGOPERBFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_LOGVALCH_REFERENCE_LOGOPERBFk).Add(fK_LOGVALCH_REFERENCE_LOGOPERB); + logValChangeNumTable.ForeignKeyConstraints.Add(fK_LOGVALCH_REFERENCE_LOGOPERB); + logOperationTable.ReferencingForeignKeyConstraints.Add(fK_LOGVALCH_REFERENCE_LOGOPERB); + var fK_LOGVALCH_REFERENCE_LOGOPERA = new ForeignKeyConstraint( + "FK_LOGVALCH_REFERENCE_LOGOPERA", logValChangeTxtTable, logOperationTable, + new[] { operationIdColumn1 }, + logOperationTable.FindUniqueConstraint("PK_LOGOPERATION")!, ReferentialAction.NoAction); + var fK_LOGVALCH_REFERENCE_LOGOPERAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.LogValChangeTxt", + new[] { "OperationId" }, + "Blink.Backoffice.Services.PcmDb.Entities.LogOperation", + new[] { "OperationId" }); + fK_LOGVALCH_REFERENCE_LOGOPERA.MappedForeignKeys.Add(fK_LOGVALCH_REFERENCE_LOGOPERAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_LOGVALCH_REFERENCE_LOGOPERAFk).Add(fK_LOGVALCH_REFERENCE_LOGOPERA); + logValChangeTxtTable.ForeignKeyConstraints.Add(fK_LOGVALCH_REFERENCE_LOGOPERA); + logOperationTable.ReferencingForeignKeyConstraints.Add(fK_LOGVALCH_REFERENCE_LOGOPERA); + var fK_MARZAKRE_REF_MARZA_MARZOWNI = new ForeignKeyConstraint( + "FK_MARZAKRE_REF_MARZA_MARZOWNI", marZakresTable, marzownikTable, + new[] { marIdColumn }, + marzownikTable.FindUniqueConstraint("PK_MARZOWNIK")!, ReferentialAction.NoAction); + var fK_MARZAKRE_REF_MARZA_MARZOWNIFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.MarZakres", + new[] { "MarId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + new[] { "MarId" }); + fK_MARZAKRE_REF_MARZA_MARZOWNI.MappedForeignKeys.Add(fK_MARZAKRE_REF_MARZA_MARZOWNIFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_MARZAKRE_REF_MARZA_MARZOWNIFk).Add(fK_MARZAKRE_REF_MARZA_MARZOWNI); + marZakresTable.ForeignKeyConstraints.Add(fK_MARZAKRE_REF_MARZA_MARZOWNI); + marzownikTable.ReferencingForeignKeyConstraints.Add(fK_MARZAKRE_REF_MARZA_MARZOWNI); + var fK_MARZOWNI_REF_MARAS_ASORT = new ForeignKeyConstraint( + "FK_MARZOWNI_REF_MARAS_ASORT", marzownikTable, asortTable, + new[] { asIdColumn0 }, + asortTable.FindUniqueConstraint("PK_ASORT")!, ReferentialAction.NoAction); + var fK_MARZOWNI_REF_MARAS_ASORTFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + new[] { "AsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + new[] { "AsId" }); + fK_MARZOWNI_REF_MARAS_ASORT.MappedForeignKeys.Add(fK_MARZOWNI_REF_MARAS_ASORTFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_MARZOWNI_REF_MARAS_ASORTFk).Add(fK_MARZOWNI_REF_MARAS_ASORT); + marzownikTable.ForeignKeyConstraints.Add(fK_MARZOWNI_REF_MARAS_ASORT); + asortTable.ReferencingForeignKeyConstraints.Add(fK_MARZOWNI_REF_MARAS_ASORT); + var fK_MARZOWNI_REF_MARMA_MAGAZYN = new ForeignKeyConstraint( + "FK_MARZOWNI_REF_MARMA_MAGAZYN", marzownikTable, magazynTable, + new[] { magIdColumn5 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_MARZOWNI_REF_MARMA_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_MARZOWNI_REF_MARMA_MAGAZYN.MappedForeignKeys.Add(fK_MARZOWNI_REF_MARMA_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_MARZOWNI_REF_MARMA_MAGAZYNFk).Add(fK_MARZOWNI_REF_MARMA_MAGAZYN); + marzownikTable.ForeignKeyConstraints.Add(fK_MARZOWNI_REF_MARMA_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_MARZOWNI_REF_MARMA_MAGAZYN); + var fK_MARZOWNI_REF_MARTO_TOWAR = new ForeignKeyConstraint( + "FK_MARZOWNI_REF_MARTO_TOWAR", marzownikTable, towarTable, + new[] { towIdColumn6 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_MARZOWNI_REF_MARTO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Marzownik", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_MARZOWNI_REF_MARTO_TOWAR.MappedForeignKeys.Add(fK_MARZOWNI_REF_MARTO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_MARZOWNI_REF_MARTO_TOWARFk).Add(fK_MARZOWNI_REF_MARTO_TOWAR); + marzownikTable.ForeignKeyConstraints.Add(fK_MARZOWNI_REF_MARTO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_MARZOWNI_REF_MARTO_TOWAR); + var fK_NOTATKI_REF_TOWNO_TOWAR = new ForeignKeyConstraint( + "FK_NOTATKI_REF_TOWNO_TOWAR", notatkiTable, towarTable, + new[] { towIdColumn7 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_NOTATKI_REF_TOWNO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Notatki", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_NOTATKI_REF_TOWNO_TOWAR.MappedForeignKeys.Add(fK_NOTATKI_REF_TOWNO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_NOTATKI_REF_TOWNO_TOWARFk).Add(fK_NOTATKI_REF_TOWNO_TOWAR); + notatkiTable.ForeignKeyConstraints.Add(fK_NOTATKI_REF_TOWNO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_NOTATKI_REF_TOWNO_TOWAR); + var ref_NrRejKth = new ForeignKeyConstraint( + "Ref_NrRejKth", nrRejTable, kontrahentTable, + new[] { kontrIdColumn7 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var ref_NrRejKthFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.NrRej", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + ref_NrRejKth.MappedForeignKeys.Add(ref_NrRejKthFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_NrRejKthFk).Add(ref_NrRejKth); + nrRejTable.ForeignKeyConstraints.Add(ref_NrRejKth); + kontrahentTable.ReferencingForeignKeyConstraints.Add(ref_NrRejKth); + var ref_KartaNrRej = new ForeignKeyConstraint( + "Ref_KartaNrRej", nrRejKartaTable, kartaLojTable, + new[] { kartaIdColumn1 }, + kartaLojTable.FindUniqueConstraint("PK_KARTALOJ")!, ReferentialAction.NoAction); + var ref_KartaNrRejFk = RelationalModel.GetForeignKey(this, + "NrRejKarta", + new[] { "KartaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + new[] { "KartaId" }); + ref_KartaNrRej.MappedForeignKeys.Add(ref_KartaNrRejFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_KartaNrRejFk).Add(ref_KartaNrRej); + nrRejKartaTable.ForeignKeyConstraints.Add(ref_KartaNrRej); + kartaLojTable.ReferencingForeignKeyConstraints.Add(ref_KartaNrRej); + var ref_NrRejKarta = new ForeignKeyConstraint( + "Ref_NrRejKarta", nrRejKartaTable, nrRejTable, + new[] { kontrIdColumn24, nrFormatColumn2 }, + nrRejTable.FindUniqueConstraint("PK_NRREJ")!, ReferentialAction.NoAction); + var ref_NrRejKartaFk = RelationalModel.GetForeignKey(this, + "NrRejKarta", + new[] { "KontrId", "NrFormat" }, + "Blink.Backoffice.Services.PcmDb.Entities.NrRej", + new[] { "KontrId", "NrFormat" }); + ref_NrRejKarta.MappedForeignKeys.Add(ref_NrRejKartaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_NrRejKartaFk).Add(ref_NrRejKarta); + nrRejKartaTable.ForeignKeyConstraints.Add(ref_NrRejKarta); + nrRejTable.ReferencingForeignKeyConstraints.Add(ref_NrRejKarta); + var fK_NUMMAG_REF_NUMMA_MAGAZYN = new ForeignKeyConstraint( + "FK_NUMMAG_REF_NUMMA_MAGAZYN", numMagTable, magazynTable, + new[] { magIdColumn6 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_NUMMAG_REF_NUMMA_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.NumMag", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_NUMMAG_REF_NUMMA_MAGAZYN.MappedForeignKeys.Add(fK_NUMMAG_REF_NUMMA_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_NUMMAG_REF_NUMMA_MAGAZYNFk).Add(fK_NUMMAG_REF_NUMMA_MAGAZYN); + numMagTable.ForeignKeyConstraints.Add(fK_NUMMAG_REF_NUMMA_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_NUMMAG_REF_NUMMA_MAGAZYN); + var fK_NUMMAG_REF_NUMMA_NUMDOK = new ForeignKeyConstraint( + "FK_NUMMAG_REF_NUMMA_NUMDOK", numMagTable, numDokTable, + new[] { typNumeruColumn0 }, + numDokTable.FindUniqueConstraint("PK_NUMDOK")!, ReferentialAction.NoAction); + var fK_NUMMAG_REF_NUMMA_NUMDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.NumMag", + new[] { "TypNumeru" }, + "Blink.Backoffice.Services.PcmDb.Entities.NumDok", + new[] { "TypNumeru" }); + fK_NUMMAG_REF_NUMMA_NUMDOK.MappedForeignKeys.Add(fK_NUMMAG_REF_NUMMA_NUMDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_NUMMAG_REF_NUMMA_NUMDOKFk).Add(fK_NUMMAG_REF_NUMMA_NUMDOK); + numMagTable.ForeignKeyConstraints.Add(fK_NUMMAG_REF_NUMMA_NUMDOK); + numDokTable.ReferencingForeignKeyConstraints.Add(fK_NUMMAG_REF_NUMMA_NUMDOK); + var fK_ODBIORCA_REF_KTHOD_KONTRAHE = new ForeignKeyConstraint( + "FK_ODBIORCA_REF_KTHOD_KONTRAHE", odbiorcaTable, kontrahentTable, + new[] { kontrIdColumn8 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_ODBIORCA_REF_KTHOD_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Odbiorca", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_ODBIORCA_REF_KTHOD_KONTRAHE.MappedForeignKeys.Add(fK_ODBIORCA_REF_KTHOD_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ODBIORCA_REF_KTHOD_KONTRAHEFk).Add(fK_ODBIORCA_REF_KTHOD_KONTRAHE); + odbiorcaTable.ForeignKeyConstraints.Add(fK_ODBIORCA_REF_KTHOD_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_ODBIORCA_REF_KTHOD_KONTRAHE); + var fK_ODBIORCA_REF_TOWOD_TOWAR = new ForeignKeyConstraint( + "FK_ODBIORCA_REF_TOWOD_TOWAR", odbiorcaTable, towarTable, + new[] { towIdColumn8 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_ODBIORCA_REF_TOWOD_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Odbiorca", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_ODBIORCA_REF_TOWOD_TOWAR.MappedForeignKeys.Add(fK_ODBIORCA_REF_TOWOD_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ODBIORCA_REF_TOWOD_TOWARFk).Add(fK_ODBIORCA_REF_TOWOD_TOWAR); + odbiorcaTable.ForeignKeyConstraints.Add(fK_ODBIORCA_REF_TOWOD_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_ODBIORCA_REF_TOWOD_TOWAR); + var fK_ODBPROD_REF_ODBPR_KONTRAHE = new ForeignKeyConstraint( + "FK_ODBPROD_REF_ODBPR_KONTRAHE", odbProdTable, kontrahentTable, + new[] { odbIdColumn }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_ODBPROD_REF_ODBPR_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OdbProd", + new[] { "OdbId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_ODBPROD_REF_ODBPR_KONTRAHE.MappedForeignKeys.Add(fK_ODBPROD_REF_ODBPR_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ODBPROD_REF_ODBPR_KONTRAHEFk).Add(fK_ODBPROD_REF_ODBPR_KONTRAHE); + odbProdTable.ForeignKeyConstraints.Add(fK_ODBPROD_REF_ODBPR_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_ODBPROD_REF_ODBPR_KONTRAHE); + var fK_ODBPROD_REF_PRODO_KONTRAHE = new ForeignKeyConstraint( + "FK_ODBPROD_REF_PRODO_KONTRAHE", odbProdTable, kontrahentTable, + new[] { prodIdColumn0 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_ODBPROD_REF_PRODO_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OdbProd", + new[] { "ProdId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_ODBPROD_REF_PRODO_KONTRAHE.MappedForeignKeys.Add(fK_ODBPROD_REF_PRODO_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ODBPROD_REF_PRODO_KONTRAHEFk).Add(fK_ODBPROD_REF_PRODO_KONTRAHE); + odbProdTable.ForeignKeyConstraints.Add(fK_ODBPROD_REF_PRODO_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_ODBPROD_REF_PRODO_KONTRAHE); + var fK_OFERTA_REF_OFKON_KONTRAHE = new ForeignKeyConstraint( + "FK_OFERTA_REF_OFKON_KONTRAHE", ofertaTable, kontrahentTable, + new[] { kontrIdColumn11 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_OFERTA_REF_OFKON_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oferta", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_OFERTA_REF_OFKON_KONTRAHE.MappedForeignKeys.Add(fK_OFERTA_REF_OFKON_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_OFERTA_REF_OFKON_KONTRAHEFk).Add(fK_OFERTA_REF_OFKON_KONTRAHE); + ofertaTable.ForeignKeyConstraints.Add(fK_OFERTA_REF_OFKON_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_OFERTA_REF_OFKON_KONTRAHE); + var fK_OFERTA_REF_OFTOW_TOWAR = new ForeignKeyConstraint( + "FK_OFERTA_REF_OFTOW_TOWAR", ofertaTable, towarTable, + new[] { towIdColumn9 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_OFERTA_REF_OFTOW_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oferta", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_OFERTA_REF_OFTOW_TOWAR.MappedForeignKeys.Add(fK_OFERTA_REF_OFTOW_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_OFERTA_REF_OFTOW_TOWARFk).Add(fK_OFERTA_REF_OFTOW_TOWAR); + ofertaTable.ForeignKeyConstraints.Add(fK_OFERTA_REF_OFTOW_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_OFERTA_REF_OFTOW_TOWAR); + var fK_OFKOD_REF_OFKOD_OFERTA = new ForeignKeyConstraint( + "FK_OFKOD_REF_OFKOD_OFERTA", ofKodTable, ofertaTable, + new[] { kontrIdColumn9, ofIdColumn }, + ofertaTable.FindUniqueConstraint("PK_OFERTA")!, ReferentialAction.NoAction); + var fK_OFKOD_REF_OFKOD_OFERTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OfKod", + new[] { "KontrId", "OfId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Oferta", + new[] { "KontrId", "OfId" }); + fK_OFKOD_REF_OFKOD_OFERTA.MappedForeignKeys.Add(fK_OFKOD_REF_OFKOD_OFERTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_OFKOD_REF_OFKOD_OFERTAFk).Add(fK_OFKOD_REF_OFKOD_OFERTA); + ofKodTable.ForeignKeyConstraints.Add(fK_OFKOD_REF_OFKOD_OFERTA); + ofertaTable.ReferencingForeignKeyConstraints.Add(fK_OFKOD_REF_OFKOD_OFERTA); + var fK_OFSLOWNI_REF_OFSLO_KONTRAHE = new ForeignKeyConstraint( + "FK_OFSLOWNI_REF_OFSLO_KONTRAHE", ofSlownikTable, kontrahentTable, + new[] { kontrIdColumn10 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_OFSLOWNI_REF_OFSLO_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OfSlownik", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_OFSLOWNI_REF_OFSLO_KONTRAHE.MappedForeignKeys.Add(fK_OFSLOWNI_REF_OFSLO_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_OFSLOWNI_REF_OFSLO_KONTRAHEFk).Add(fK_OFSLOWNI_REF_OFSLO_KONTRAHE); + ofSlownikTable.ForeignKeyConstraints.Add(fK_OFSLOWNI_REF_OFSLO_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_OFSLOWNI_REF_OFSLO_KONTRAHE); + var ref_OpisZdarzLojZdarzLoj = new ForeignKeyConstraint( + "Ref_OpisZdarzLojZdarzLoj", opisZdarzLojTable, zdarzLojTable, + new[] { zdarzLojIdColumn }, + zdarzLojTable.FindUniqueConstraint("PK_ZDARZLOJ")!, ReferentialAction.NoAction); + var ref_OpisZdarzLojZdarzLojFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.OpisZdarzLoj", + new[] { "ZdarzLojId" }, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + new[] { "ZdarzLojId" }); + ref_OpisZdarzLojZdarzLoj.MappedForeignKeys.Add(ref_OpisZdarzLojZdarzLojFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_OpisZdarzLojZdarzLojFk).Add(ref_OpisZdarzLojZdarzLoj); + opisZdarzLojTable.ForeignKeyConstraints.Add(ref_OpisZdarzLojZdarzLoj); + zdarzLojTable.ReferencingForeignKeyConstraints.Add(ref_OpisZdarzLojZdarzLoj); + var fK_Oplata_KontoBank = new ForeignKeyConstraint( + "FK_Oplata_KontoBank", oplataTable, kontoBankoweTable, + new[] { kBIdColumn0 }, + kontoBankoweTable.FindUniqueConstraint("PK_KontoBankowe")!, ReferentialAction.NoAction); + var fK_Oplata_KontoBankFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Oplata", + new[] { "KBId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoBankowe", + new[] { "KBId" }); + fK_Oplata_KontoBank.MappedForeignKeys.Add(fK_Oplata_KontoBankFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Oplata_KontoBankFk).Add(fK_Oplata_KontoBank); + oplataTable.ForeignKeyConstraints.Add(fK_Oplata_KontoBank); + kontoBankoweTable.ReferencingForeignKeyConstraints.Add(fK_Oplata_KontoBank); + var fK_OSOBA_REF_OSOBA_KONTRAHE = new ForeignKeyConstraint( + "FK_OSOBA_REF_OSOBA_KONTRAHE", osobaTable, kontrahentTable, + new[] { kontrIdColumn12 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_OSOBA_REF_OSOBA_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Osoba", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_OSOBA_REF_OSOBA_KONTRAHE.MappedForeignKeys.Add(fK_OSOBA_REF_OSOBA_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_OSOBA_REF_OSOBA_KONTRAHEFk).Add(fK_OSOBA_REF_OSOBA_KONTRAHE); + osobaTable.ForeignKeyConstraints.Add(fK_OSOBA_REF_OSOBA_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_OSOBA_REF_OSOBA_KONTRAHE); + var fK_PANEL_REFERENCE_UZNASKLEP = new ForeignKeyConstraint( + "FK_PANEL_REFERENCE_UZNASKLEP", panelTable, uzNaSklepTable, + new[] { uzNSIdColumn }, + uzNaSklepTable.FindUniqueConstraint("PK_UZNASKLEP")!, ReferentialAction.NoAction); + var fK_PANEL_REFERENCE_UZNASKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + new[] { "UzNSId" }, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + new[] { "UzNSId" }); + fK_PANEL_REFERENCE_UZNASKLEP.MappedForeignKeys.Add(fK_PANEL_REFERENCE_UZNASKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PANEL_REFERENCE_UZNASKLEPFk).Add(fK_PANEL_REFERENCE_UZNASKLEP); + panelTable.ForeignKeyConstraints.Add(fK_PANEL_REFERENCE_UZNASKLEP); + uzNaSklepTable.ReferencingForeignKeyConstraints.Add(fK_PANEL_REFERENCE_UZNASKLEP); + var fK_PANEL_REFERENCE_UZYTKOWNIK = new ForeignKeyConstraint( + "FK_PANEL_REFERENCE_UZYTKOWNIK", panelTable, uzytkownikTable, + new[] { uzIdColumn2 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_PANEL_REFERENCE_UZYTKOWNIKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_PANEL_REFERENCE_UZYTKOWNIK.MappedForeignKeys.Add(fK_PANEL_REFERENCE_UZYTKOWNIKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PANEL_REFERENCE_UZYTKOWNIKFk).Add(fK_PANEL_REFERENCE_UZYTKOWNIK); + panelTable.ForeignKeyConstraints.Add(fK_PANEL_REFERENCE_UZYTKOWNIK); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_PANEL_REFERENCE_UZYTKOWNIK); + var fK_PANELPARAM_REFERENCE_PANEL = new ForeignKeyConstraint( + "FK_PANELPARAM_REFERENCE_PANEL", panelParamTable, panelTable, + new[] { panelIdColumn0 }, + panelTable.FindUniqueConstraint("PK_PANEL")!, ReferentialAction.NoAction); + var fK_PANELPARAM_REFERENCE_PANELFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PanelParam", + new[] { "PanelId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + new[] { "PanelId" }); + fK_PANELPARAM_REFERENCE_PANEL.MappedForeignKeys.Add(fK_PANELPARAM_REFERENCE_PANELFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PANELPARAM_REFERENCE_PANELFk).Add(fK_PANELPARAM_REFERENCE_PANEL); + panelParamTable.ForeignKeyConstraints.Add(fK_PANELPARAM_REFERENCE_PANEL); + panelTable.ReferencingForeignKeyConstraints.Add(fK_PANELPARAM_REFERENCE_PANEL); + var fK_PARAGON_REF_PARKA_KASA = new ForeignKeyConstraint( + "FK_PARAGON_REF_PARKA_KASA", paragonTable, kasaTable, + new[] { kasaIdColumn5 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_PARAGON_REF_PARKA_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_PARAGON_REF_PARKA_KASA.MappedForeignKeys.Add(fK_PARAGON_REF_PARKA_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARAGON_REF_PARKA_KASAFk).Add(fK_PARAGON_REF_PARKA_KASA); + paragonTable.ForeignKeyConstraints.Add(fK_PARAGON_REF_PARKA_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_PARAGON_REF_PARKA_KASA); + var fK_PARAGON_REF_PARWA_WALUTA = new ForeignKeyConstraint( + "FK_PARAGON_REF_PARWA_WALUTA", paragonTable, walutaTable, + new[] { walIdColumn7 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_PARAGON_REF_PARWA_WALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_PARAGON_REF_PARWA_WALUTA.MappedForeignKeys.Add(fK_PARAGON_REF_PARWA_WALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARAGON_REF_PARWA_WALUTAFk).Add(fK_PARAGON_REF_PARWA_WALUTA); + paragonTable.ForeignKeyConstraints.Add(fK_PARAGON_REF_PARWA_WALUTA); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_PARAGON_REF_PARWA_WALUTA); + var fK_PARBON_REF_PARBO_PARAGON = new ForeignKeyConstraint( + "FK_PARBON_REF_PARBO_PARAGON", parBonTable, paragonTable, + new[] { parIdColumn1 }, + paragonTable.FindUniqueConstraint("PK_PARAGON")!, ReferentialAction.NoAction); + var fK_PARBON_REF_PARBO_PARAGONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParBon", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "ParId" }); + fK_PARBON_REF_PARBO_PARAGON.MappedForeignKeys.Add(fK_PARBON_REF_PARBO_PARAGONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARBON_REF_PARBO_PARAGONFk).Add(fK_PARBON_REF_PARBO_PARAGON); + parBonTable.ForeignKeyConstraints.Add(fK_PARBON_REF_PARBO_PARAGON); + paragonTable.ReferencingForeignKeyConstraints.Add(fK_PARBON_REF_PARBO_PARAGON); + var fK_PARPUNKT_REF_PARPK_PARAGON = new ForeignKeyConstraint( + "FK_PARPUNKT_REF_PARPK_PARAGON", parPunktyTable, paragonTable, + new[] { parIdColumn2 }, + paragonTable.FindUniqueConstraint("PK_PARAGON")!, ReferentialAction.NoAction); + var fK_PARPUNKT_REF_PARPK_PARAGONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParPunkty", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "ParId" }); + fK_PARPUNKT_REF_PARPK_PARAGON.MappedForeignKeys.Add(fK_PARPUNKT_REF_PARPK_PARAGONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARPUNKT_REF_PARPK_PARAGONFk).Add(fK_PARPUNKT_REF_PARPK_PARAGON); + parPunktyTable.ForeignKeyConstraints.Add(fK_PARPUNKT_REF_PARPK_PARAGON); + paragonTable.ReferencingForeignKeyConstraints.Add(fK_PARPUNKT_REF_PARPK_PARAGON); + var fK_PARTIA_REF_PRTPO_POZDOK = new ForeignKeyConstraint( + "FK_PARTIA_REF_PRTPO_POZDOK", partiaTable, pozDokTable, + new[] { dokIdColumn8, kolejnoscColumn10 }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var fK_PARTIA_REF_PRTPO_POZDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Partia", + new[] { "DokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + fK_PARTIA_REF_PRTPO_POZDOK.MappedForeignKeys.Add(fK_PARTIA_REF_PRTPO_POZDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARTIA_REF_PRTPO_POZDOKFk).Add(fK_PARTIA_REF_PRTPO_POZDOK); + partiaTable.ForeignKeyConstraints.Add(fK_PARTIA_REF_PRTPO_POZDOK); + pozDokTable.ReferencingForeignKeyConstraints.Add(fK_PARTIA_REF_PRTPO_POZDOK); + var fK_PARTIA_REF_PRTTO_TOWAR = new ForeignKeyConstraint( + "FK_PARTIA_REF_PRTTO_TOWAR", partiaTable, towarTable, + new[] { towIdColumn10 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_PARTIA_REF_PRTTO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Partia", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_PARTIA_REF_PRTTO_TOWAR.MappedForeignKeys.Add(fK_PARTIA_REF_PRTTO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARTIA_REF_PRTTO_TOWARFk).Add(fK_PARTIA_REF_PRTTO_TOWAR); + partiaTable.ForeignKeyConstraints.Add(fK_PARTIA_REF_PRTTO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_PARTIA_REF_PRTTO_TOWAR); + var fK_PARWALUT_REF_PARWA_PARAGON = new ForeignKeyConstraint( + "FK_PARWALUT_REF_PARWA_PARAGON", parWalutaTable, paragonTable, + new[] { parIdColumn3 }, + paragonTable.FindUniqueConstraint("PK_PARAGON")!, ReferentialAction.NoAction); + var fK_PARWALUT_REF_PARWA_PARAGONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWaluta", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "ParId" }); + fK_PARWALUT_REF_PARWA_PARAGON.MappedForeignKeys.Add(fK_PARWALUT_REF_PARWA_PARAGONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARWALUT_REF_PARWA_PARAGONFk).Add(fK_PARWALUT_REF_PARWA_PARAGON); + parWalutaTable.ForeignKeyConstraints.Add(fK_PARWALUT_REF_PARWA_PARAGON); + paragonTable.ReferencingForeignKeyConstraints.Add(fK_PARWALUT_REF_PARWA_PARAGON); + var fK_PARWALUT_REF_WALPA_WALUTA = new ForeignKeyConstraint( + "FK_PARWALUT_REF_WALPA_WALUTA", parWalutaTable, walutaTable, + new[] { walIdColumn6 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_PARWALUT_REF_WALPA_WALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWaluta", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_PARWALUT_REF_WALPA_WALUTA.MappedForeignKeys.Add(fK_PARWALUT_REF_WALPA_WALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARWALUT_REF_WALPA_WALUTAFk).Add(fK_PARWALUT_REF_WALPA_WALUTA); + parWalutaTable.ForeignKeyConstraints.Add(fK_PARWALUT_REF_WALPA_WALUTA); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_PARWALUT_REF_WALPA_WALUTA); + var fK_PARWARTO_REF_PARWA_PARAMETR = new ForeignKeyConstraint( + "FK_PARWARTO_REF_PARWA_PARAMETR", parWartoscTable, parametrTable, + new[] { parIdColumn4 }, + parametrTable.FindUniqueConstraint("PK_PARAMETR")!, ReferentialAction.NoAction); + var fK_PARWARTO_REF_PARWA_PARAMETRFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ParWartosc", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Parametr", + new[] { "ParId" }); + fK_PARWARTO_REF_PARWA_PARAMETR.MappedForeignKeys.Add(fK_PARWARTO_REF_PARWA_PARAMETRFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PARWARTO_REF_PARWA_PARAMETRFk).Add(fK_PARWARTO_REF_PARWA_PARAMETR); + parWartoscTable.ForeignKeyConstraints.Add(fK_PARWARTO_REF_PARWA_PARAMETR); + parametrTable.ReferencingForeignKeyConstraints.Add(fK_PARWARTO_REF_PARWA_PARAMETR); + var fK_PCFUSER_REFERENCE_KONTRC = new ForeignKeyConstraint( + "FK_PCFUSER_REFERENCE_KONTRC", pcfUserTable, kontrahentTable, + new[] { pcfCustomerIdColumn }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_PCFUSER_REFERENCE_KONTRCFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfCustomerId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_PCFUSER_REFERENCE_KONTRC.MappedForeignKeys.Add(fK_PCFUSER_REFERENCE_KONTRCFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PCFUSER_REFERENCE_KONTRCFk).Add(fK_PCFUSER_REFERENCE_KONTRC); + pcfUserTable.ForeignKeyConstraints.Add(fK_PCFUSER_REFERENCE_KONTRC); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_PCFUSER_REFERENCE_KONTRC); + var fK_PCFUSER_REFERENCE_KONTRL = new ForeignKeyConstraint( + "FK_PCFUSER_REFERENCE_KONTRL", pcfUserTable, kontrahentTable, + new[] { pcfLoyaltyCustomerIdColumn }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_PCFUSER_REFERENCE_KONTRLFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfLoyaltyCustomerId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_PCFUSER_REFERENCE_KONTRL.MappedForeignKeys.Add(fK_PCFUSER_REFERENCE_KONTRLFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PCFUSER_REFERENCE_KONTRLFk).Add(fK_PCFUSER_REFERENCE_KONTRL); + pcfUserTable.ForeignKeyConstraints.Add(fK_PCFUSER_REFERENCE_KONTRL); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_PCFUSER_REFERENCE_KONTRL); + var fK_PCFUSER_REFERENCE_KONTRS = new ForeignKeyConstraint( + "FK_PCFUSER_REFERENCE_KONTRS", pcfUserTable, kontrahentTable, + new[] { pcfPStationIdColumn }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_PCFUSER_REFERENCE_KONTRSFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfPStationId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_PCFUSER_REFERENCE_KONTRS.MappedForeignKeys.Add(fK_PCFUSER_REFERENCE_KONTRSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PCFUSER_REFERENCE_KONTRSFk).Add(fK_PCFUSER_REFERENCE_KONTRS); + pcfUserTable.ForeignKeyConstraints.Add(fK_PCFUSER_REFERENCE_KONTRS); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_PCFUSER_REFERENCE_KONTRS); + var fK_PcfUser = new ForeignKeyConstraint( + "FK_PcfUser", pcfUserSklepTable, pcfUserTable, + new[] { pcfUserIdColumn0 }, + pcfUserTable.FindUniqueConstraint("PK_PCFUSER")!, ReferentialAction.NoAction); + var fK_PcfUserFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep", + new[] { "PcfUserId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfUserId" }); + fK_PcfUser.MappedForeignKeys.Add(fK_PcfUserFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PcfUserFk).Add(fK_PcfUser); + pcfUserSklepTable.ForeignKeyConstraints.Add(fK_PcfUser); + pcfUserTable.ReferencingForeignKeyConstraints.Add(fK_PcfUser); + var fK_Sklep = new ForeignKeyConstraint( + "FK_Sklep", pcfUserSklepTable, sklepTable, + new[] { sklepIdColumn }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUserSklep", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_Sklep.MappedForeignKeys.Add(fK_SklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepFk).Add(fK_Sklep); + pcfUserSklepTable.ForeignKeyConstraints.Add(fK_Sklep); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_Sklep); + var fK_Pos_Shop = new ForeignKeyConstraint( + "FK_Pos_Shop", pcpPosTable, pcpShopTable, + new[] { pcpShopIdColumn }, + pcpShopTable.FindUniqueConstraint("PK_PcpShop")!, ReferentialAction.NoAction); + var fK_Pos_ShopFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpPos", + new[] { "PcpShopId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PcpShop", + new[] { "PcpShopId" }); + fK_Pos_Shop.MappedForeignKeys.Add(fK_Pos_ShopFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Pos_ShopFk).Add(fK_Pos_Shop); + pcpPosTable.ForeignKeyConstraints.Add(fK_Pos_Shop); + pcpShopTable.ReferencingForeignKeyConstraints.Add(fK_Pos_Shop); + var fK_Receipt_Customer = new ForeignKeyConstraint( + "FK_Receipt_Customer", pcpReceiptTable, kontrahentTable, + new[] { kontrIdColumn16 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_Receipt_CustomerFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_Receipt_Customer.MappedForeignKeys.Add(fK_Receipt_CustomerFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Receipt_CustomerFk).Add(fK_Receipt_Customer); + pcpReceiptTable.ForeignKeyConstraints.Add(fK_Receipt_Customer); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_Receipt_Customer); + var fK_Receipt_Pos = new ForeignKeyConstraint( + "FK_Receipt_Pos", pcpReceiptTable, pcpPosTable, + new[] { pcpPosIdColumn0 }, + pcpPosTable.FindUniqueConstraint("PK_PcpPos")!, ReferentialAction.NoAction); + var fK_Receipt_PosFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + new[] { "PcpPosId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PcpPos", + new[] { "PcpPosId" }); + fK_Receipt_Pos.MappedForeignKeys.Add(fK_Receipt_PosFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Receipt_PosFk).Add(fK_Receipt_Pos); + pcpReceiptTable.ForeignKeyConstraints.Add(fK_Receipt_Pos); + pcpPosTable.ReferencingForeignKeyConstraints.Add(fK_Receipt_Pos); + var fK_ReceiptItem_Receipt = new ForeignKeyConstraint( + "FK_ReceiptItem_Receipt", pcpReceiptItemTable, pcpReceiptTable, + new[] { pcpReceiptIdColumn0 }, + pcpReceiptTable.FindUniqueConstraint("PK_PcpReceipt")!, ReferentialAction.NoAction); + var fK_ReceiptItem_ReceiptFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptItem", + new[] { "PcpReceiptId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + new[] { "PcpReceiptId" }); + fK_ReceiptItem_Receipt.MappedForeignKeys.Add(fK_ReceiptItem_ReceiptFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ReceiptItem_ReceiptFk).Add(fK_ReceiptItem_Receipt); + pcpReceiptItemTable.ForeignKeyConstraints.Add(fK_ReceiptItem_Receipt); + pcpReceiptTable.ReferencingForeignKeyConstraints.Add(fK_ReceiptItem_Receipt); + var fK_ReceiptPayment_Receipt = new ForeignKeyConstraint( + "FK_ReceiptPayment_Receipt", pcpReceiptPaymentTable, pcpReceiptTable, + new[] { pcpReceiptIdColumn1 }, + pcpReceiptTable.FindUniqueConstraint("PK_PcpReceipt")!, ReferentialAction.NoAction); + var fK_ReceiptPayment_ReceiptFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptPayment", + new[] { "PcpReceiptId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + new[] { "PcpReceiptId" }); + fK_ReceiptPayment_Receipt.MappedForeignKeys.Add(fK_ReceiptPayment_ReceiptFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ReceiptPayment_ReceiptFk).Add(fK_ReceiptPayment_Receipt); + pcpReceiptPaymentTable.ForeignKeyConstraints.Add(fK_ReceiptPayment_Receipt); + pcpReceiptTable.ReferencingForeignKeyConstraints.Add(fK_ReceiptPayment_Receipt); + var fK_ReceiptVat_Receipt = new ForeignKeyConstraint( + "FK_ReceiptVat_Receipt", pcpReceiptVatTable, pcpReceiptTable, + new[] { pcpReceiptIdColumn2 }, + pcpReceiptTable.FindUniqueConstraint("PK_PcpReceipt")!, ReferentialAction.NoAction); + var fK_ReceiptVat_ReceiptFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptVat", + new[] { "PcpReceiptId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + new[] { "PcpReceiptId" }); + fK_ReceiptVat_Receipt.MappedForeignKeys.Add(fK_ReceiptVat_ReceiptFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ReceiptVat_ReceiptFk).Add(fK_ReceiptVat_Receipt); + pcpReceiptVatTable.ForeignKeyConstraints.Add(fK_ReceiptVat_Receipt); + pcpReceiptTable.ReferencingForeignKeyConstraints.Add(fK_ReceiptVat_Receipt); + var fK_PH_REF_PHKON_KONTRAHE = new ForeignKeyConstraint( + "FK_PH_REF_PHKON_KONTRAHE", pHTable, kontrahentTable, + new[] { kontrIdColumn13 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_PH_REF_PHKON_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PH", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_PH_REF_PHKON_KONTRAHE.MappedForeignKeys.Add(fK_PH_REF_PHKON_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PH_REF_PHKON_KONTRAHEFk).Add(fK_PH_REF_PHKON_KONTRAHE); + pHTable.ForeignKeyConstraints.Add(fK_PH_REF_PHKON_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_PH_REF_PHKON_KONTRAHE); + var fK_PHDANE_REF_PHDAN_PH = new ForeignKeyConstraint( + "FK_PHDANE_REF_PHDAN_PH", pHDaneTable, pHTable, + new[] { pHIdColumn0 }, + pHTable.FindUniqueConstraint("PK_PH")!, ReferentialAction.NoAction); + var fK_PHDANE_REF_PHDAN_PHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHDane", + new[] { "PHId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PH", + new[] { "PHId" }); + fK_PHDANE_REF_PHDAN_PH.MappedForeignKeys.Add(fK_PHDANE_REF_PHDAN_PHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PHDANE_REF_PHDAN_PHFk).Add(fK_PHDANE_REF_PHDAN_PH); + pHDaneTable.ForeignKeyConstraints.Add(fK_PHDANE_REF_PHDAN_PH); + pHTable.ReferencingForeignKeyConstraints.Add(fK_PHDANE_REF_PHDAN_PH); + var fK_PHODBDAN_REF_PHODB_PHODBIOR = new ForeignKeyConstraint( + "FK_PHODBDAN_REF_PHODB_PHODBIOR", pHOdbDaneTable, pHOdbiorcaTable, + new[] { pHIdColumn1, kontrIdColumn14 }, + pHOdbiorcaTable.FindUniqueConstraint("PK_PHODBIORCA")!, ReferentialAction.NoAction); + var fK_PHODBDAN_REF_PHODB_PHODBIORFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbDane", + new[] { "PHId", "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", + new[] { "PHId", "KontrId" }); + fK_PHODBDAN_REF_PHODB_PHODBIOR.MappedForeignKeys.Add(fK_PHODBDAN_REF_PHODB_PHODBIORFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PHODBDAN_REF_PHODB_PHODBIORFk).Add(fK_PHODBDAN_REF_PHODB_PHODBIOR); + pHOdbDaneTable.ForeignKeyConstraints.Add(fK_PHODBDAN_REF_PHODB_PHODBIOR); + pHOdbiorcaTable.ReferencingForeignKeyConstraints.Add(fK_PHODBDAN_REF_PHODB_PHODBIOR); + var fK_PHODBIOR_REF_PHODB_KONTRAHE = new ForeignKeyConstraint( + "FK_PHODBIOR_REF_PHODB_KONTRAHE", pHOdbiorcaTable, kontrahentTable, + new[] { kontrIdColumn15 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_PHODBIOR_REF_PHODB_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_PHODBIOR_REF_PHODB_KONTRAHE.MappedForeignKeys.Add(fK_PHODBIOR_REF_PHODB_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PHODBIOR_REF_PHODB_KONTRAHEFk).Add(fK_PHODBIOR_REF_PHODB_KONTRAHE); + pHOdbiorcaTable.ForeignKeyConstraints.Add(fK_PHODBIOR_REF_PHODB_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_PHODBIOR_REF_PHODB_KONTRAHE); + var fK_PHODBIOR_REF_PHODB_PH = new ForeignKeyConstraint( + "FK_PHODBIOR_REF_PHODB_PH", pHOdbiorcaTable, pHTable, + new[] { pHIdColumn2 }, + pHTable.FindUniqueConstraint("PK_PH")!, ReferentialAction.NoAction); + var fK_PHODBIOR_REF_PHODB_PHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHOdbiorca", + new[] { "PHId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PH", + new[] { "PHId" }); + fK_PHODBIOR_REF_PHODB_PH.MappedForeignKeys.Add(fK_PHODBIOR_REF_PHODB_PHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PHODBIOR_REF_PHODB_PHFk).Add(fK_PHODBIOR_REF_PHODB_PH); + pHOdbiorcaTable.ForeignKeyConstraints.Add(fK_PHODBIOR_REF_PHODB_PH); + pHTable.ReferencingForeignKeyConstraints.Add(fK_PHODBIOR_REF_PHODB_PH); + var fK_PHROZLIC_REF_PHDOK_DOK = new ForeignKeyConstraint( + "FK_PHROZLIC_REF_PHDOK_DOK", pHRozliczenieTable, dokTable, + new[] { dokIdColumn7 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_PHROZLIC_REF_PHDOK_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_PHROZLIC_REF_PHDOK_DOK.MappedForeignKeys.Add(fK_PHROZLIC_REF_PHDOK_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PHROZLIC_REF_PHDOK_DOKFk).Add(fK_PHROZLIC_REF_PHDOK_DOK); + pHRozliczenieTable.ForeignKeyConstraints.Add(fK_PHROZLIC_REF_PHDOK_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_PHROZLIC_REF_PHDOK_DOK); + var fK_PHROZLIC_REF_PHROZ_PH = new ForeignKeyConstraint( + "FK_PHROZLIC_REF_PHROZ_PH", pHRozliczenieTable, pHTable, + new[] { pHIdColumn3 }, + pHTable.FindUniqueConstraint("PK_PH")!, ReferentialAction.NoAction); + var fK_PHROZLIC_REF_PHROZ_PHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PHRozliczenie", + new[] { "PHId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PH", + new[] { "PHId" }); + fK_PHROZLIC_REF_PHROZ_PH.MappedForeignKeys.Add(fK_PHROZLIC_REF_PHROZ_PHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PHROZLIC_REF_PHROZ_PHFk).Add(fK_PHROZLIC_REF_PHROZ_PH); + pHRozliczenieTable.ForeignKeyConstraints.Add(fK_PHROZLIC_REF_PHROZ_PH); + pHTable.ReferencingForeignKeyConstraints.Add(fK_PHROZLIC_REF_PHROZ_PH); + var fK_POLMAG_REF_MAGPO_MAGAZYN = new ForeignKeyConstraint( + "FK_POLMAG_REF_MAGPO_MAGAZYN", polMagTable, magazynTable, + new[] { magIdColumn10 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_POLMAG_REF_MAGPO_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "PolMag", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_POLMAG_REF_MAGPO_MAGAZYN.MappedForeignKeys.Add(fK_POLMAG_REF_MAGPO_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POLMAG_REF_MAGPO_MAGAZYNFk).Add(fK_POLMAG_REF_MAGPO_MAGAZYN); + polMagTable.ForeignKeyConstraints.Add(fK_POLMAG_REF_MAGPO_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_POLMAG_REF_MAGPO_MAGAZYN); + var fK_POLMAG_REF_POLMA_POLITYKA = new ForeignKeyConstraint( + "FK_POLMAG_REF_POLMA_POLITYKA", polMagTable, politykaTable, + new[] { polIdColumn2 }, + politykaTable.FindUniqueConstraint("PK_POLITYKA")!, ReferentialAction.NoAction); + var fK_POLMAG_REF_POLMA_POLITYKAFk = RelationalModel.GetForeignKey(this, + "PolMag", + new[] { "PolId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Polityka", + new[] { "PolId" }); + fK_POLMAG_REF_POLMA_POLITYKA.MappedForeignKeys.Add(fK_POLMAG_REF_POLMA_POLITYKAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POLMAG_REF_POLMA_POLITYKAFk).Add(fK_POLMAG_REF_POLMA_POLITYKA); + polMagTable.ForeignKeyConstraints.Add(fK_POLMAG_REF_POLMA_POLITYKA); + politykaTable.ReferencingForeignKeyConstraints.Add(fK_POLMAG_REF_POLMA_POLITYKA); + var fK_POLPARAM_REF_POLPA_POLITYKA = new ForeignKeyConstraint( + "FK_POLPARAM_REF_POLPA_POLITYKA", polParamTable, politykaTable, + new[] { polIdColumn0 }, + politykaTable.FindUniqueConstraint("PK_POLITYKA")!, ReferentialAction.NoAction); + var fK_POLPARAM_REF_POLPA_POLITYKAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PolParam", + new[] { "PolId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Polityka", + new[] { "PolId" }); + fK_POLPARAM_REF_POLPA_POLITYKA.MappedForeignKeys.Add(fK_POLPARAM_REF_POLPA_POLITYKAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POLPARAM_REF_POLPA_POLITYKAFk).Add(fK_POLPARAM_REF_POLPA_POLITYKA); + polParamTable.ForeignKeyConstraints.Add(fK_POLPARAM_REF_POLPA_POLITYKA); + politykaTable.ReferencingForeignKeyConstraints.Add(fK_POLPARAM_REF_POLPA_POLITYKA); + var ref_PowiadomienieParamPowiadomienie = new ForeignKeyConstraint( + "Ref_PowiadomienieParamPowiadomienie", powiadomienieParamTable, powiadomienieTable, + new[] { powiadomienieIdColumn0 }, + powiadomienieTable.FindUniqueConstraint("PK_POWIADOMIENIE")!, ReferentialAction.NoAction); + var ref_PowiadomienieParamPowiadomienieFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiadomienieParam", + new[] { "PowiadomienieId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie", + new[] { "PowiadomienieId" }); + ref_PowiadomienieParamPowiadomienie.MappedForeignKeys.Add(ref_PowiadomienieParamPowiadomienieFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_PowiadomienieParamPowiadomienieFk).Add(ref_PowiadomienieParamPowiadomienie); + powiadomienieParamTable.ForeignKeyConstraints.Add(ref_PowiadomienieParamPowiadomienie); + powiadomienieTable.ReferencingForeignKeyConstraints.Add(ref_PowiadomienieParamPowiadomienie); + var fK_POWIAZAN_REF_OPAK_TOWAR = new ForeignKeyConstraint( + "FK_POWIAZAN_REF_OPAK_TOWAR", powiazanieTable, towarTable, + new[] { opakIdColumn }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_POWIAZAN_REF_OPAK_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Powiazanie", + new[] { "OpakId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_POWIAZAN_REF_OPAK_TOWAR.MappedForeignKeys.Add(fK_POWIAZAN_REF_OPAK_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POWIAZAN_REF_OPAK_TOWARFk).Add(fK_POWIAZAN_REF_OPAK_TOWAR); + powiazanieTable.ForeignKeyConstraints.Add(fK_POWIAZAN_REF_OPAK_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_POWIAZAN_REF_OPAK_TOWAR); + var fK_POWIAZAN_REF_TOWAR_TOWAR = new ForeignKeyConstraint( + "FK_POWIAZAN_REF_TOWAR_TOWAR", powiazanieTable, towarTable, + new[] { towIdColumn11 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_POWIAZAN_REF_TOWAR_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Powiazanie", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_POWIAZAN_REF_TOWAR_TOWAR.MappedForeignKeys.Add(fK_POWIAZAN_REF_TOWAR_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POWIAZAN_REF_TOWAR_TOWARFk).Add(fK_POWIAZAN_REF_TOWAR_TOWAR); + powiazanieTable.ForeignKeyConstraints.Add(fK_POWIAZAN_REF_TOWAR_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_POWIAZAN_REF_TOWAR_TOWAR); + var fK_PowiazanieProm_GrupaPromocji = new ForeignKeyConstraint( + "FK_PowiazanieProm_GrupaPromocji", powiazaniePromTable, grupaPromocjiTable, + new[] { grupaIdColumn0 }, + grupaPromocjiTable.FindUniqueConstraint("PK_GrupaPromocji")!, ReferentialAction.NoAction); + var fK_PowiazanieProm_GrupaPromocjiFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieProm", + new[] { "GrupaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaPromocji", + new[] { "GrupaId" }); + fK_PowiazanieProm_GrupaPromocji.MappedForeignKeys.Add(fK_PowiazanieProm_GrupaPromocjiFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PowiazanieProm_GrupaPromocjiFk).Add(fK_PowiazanieProm_GrupaPromocji); + powiazaniePromTable.ForeignKeyConstraints.Add(fK_PowiazanieProm_GrupaPromocji); + grupaPromocjiTable.ReferencingForeignKeyConstraints.Add(fK_PowiazanieProm_GrupaPromocji); + var fK_POWIAZANIESKLEP_REFERENCE_SKLEP = new ForeignKeyConstraint( + "FK_POWIAZANIESKLEP_REFERENCE_SKLEP", powiazanieSklepTable, sklepTable, + new[] { sklepIdColumn0 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_POWIAZANIESKLEP_REFERENCE_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieSklep", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_POWIAZANIESKLEP_REFERENCE_SKLEP.MappedForeignKeys.Add(fK_POWIAZANIESKLEP_REFERENCE_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POWIAZANIESKLEP_REFERENCE_SKLEPFk).Add(fK_POWIAZANIESKLEP_REFERENCE_SKLEP); + powiazanieSklepTable.ForeignKeyConstraints.Add(fK_POWIAZANIESKLEP_REFERENCE_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_POWIAZANIESKLEP_REFERENCE_SKLEP); + var fK_POWIAZAN_REF_POWUZ_UZYTKOWN = new ForeignKeyConstraint( + "FK_POWIAZAN_REF_POWUZ_UZYTKOWN", powiazanieUzTable, uzytkownikTable, + new[] { uzIdColumn3 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_POWIAZAN_REF_POWUZ_UZYTKOWNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUz", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_POWIAZAN_REF_POWUZ_UZYTKOWN.MappedForeignKeys.Add(fK_POWIAZAN_REF_POWUZ_UZYTKOWNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POWIAZAN_REF_POWUZ_UZYTKOWNFk).Add(fK_POWIAZAN_REF_POWUZ_UZYTKOWN); + powiazanieUzTable.ForeignKeyConstraints.Add(fK_POWIAZAN_REF_POWUZ_UZYTKOWN); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_POWIAZAN_REF_POWUZ_UZYTKOWN); + var ref_PowUzNaSklepUzNaSklep = new ForeignKeyConstraint( + "Ref_PowUzNaSklepUzNaSklep", powiazanieUzNaSklepTable, uzNaSklepTable, + new[] { uzNSIdColumn0 }, + uzNaSklepTable.FindUniqueConstraint("PK_UZNASKLEP")!, ReferentialAction.NoAction); + var ref_PowUzNaSklepUzNaSklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUzNaSklep", + new[] { "UzNSId" }, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + new[] { "UzNSId" }); + ref_PowUzNaSklepUzNaSklep.MappedForeignKeys.Add(ref_PowUzNaSklepUzNaSklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_PowUzNaSklepUzNaSklepFk).Add(ref_PowUzNaSklepUzNaSklep); + powiazanieUzNaSklepTable.ForeignKeyConstraints.Add(ref_PowUzNaSklepUzNaSklep); + uzNaSklepTable.ReferencingForeignKeyConstraints.Add(ref_PowUzNaSklepUzNaSklep); + var ref_NoweKonto = new ForeignKeyConstraint( + "Ref_NoweKonto", powKontLojTable, kontoLojTable, + new[] { noweKontoIdColumn }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_NoweKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj", + new[] { "NoweKontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_NoweKonto.MappedForeignKeys.Add(ref_NoweKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_NoweKontoFk).Add(ref_NoweKonto); + powKontLojTable.ForeignKeyConstraints.Add(ref_NoweKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_NoweKonto); + var ref_StareKonto = new ForeignKeyConstraint( + "Ref_StareKonto", powKontLojTable, kontoLojTable, + new[] { stareKontoIdColumn }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_StareKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj", + new[] { "StareKontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_StareKonto.MappedForeignKeys.Add(ref_StareKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_StareKontoFk).Add(ref_StareKonto); + powKontLojTable.ForeignKeyConstraints.Add(ref_StareKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_StareKonto); + var ref_AkcPoz = new ForeignKeyConstraint( + "Ref_AkcPoz", pozAkcyzaTable, grupaAkcyzowaTable, + new[] { grAkcIdColumn0 }, + grupaAkcyzowaTable.FindUniqueConstraint("PK_GRUPAAKCYZOWA")!, ReferentialAction.NoAction); + var ref_AkcPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza", + new[] { "GrAkcId" }, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa", + new[] { "GrAkcId" }); + ref_AkcPoz.MappedForeignKeys.Add(ref_AkcPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_AkcPozFk).Add(ref_AkcPoz); + pozAkcyzaTable.ForeignKeyConstraints.Add(ref_AkcPoz); + grupaAkcyzowaTable.ReferencingForeignKeyConstraints.Add(ref_AkcPoz); + var ref_PozAkc = new ForeignKeyConstraint( + "Ref_PozAkc", pozAkcyzaTable, pozDokTable, + new[] { dokIdColumn9, kolejnoscColumn12 }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var ref_PozAkcFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza", + new[] { "DokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + ref_PozAkc.MappedForeignKeys.Add(ref_PozAkcFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_PozAkcFk).Add(ref_PozAkc); + pozAkcyzaTable.ForeignKeyConstraints.Add(ref_PozAkc); + pozDokTable.ReferencingForeignKeyConstraints.Add(ref_PozAkc); + var fK_PozCennikDokSklep = new ForeignKeyConstraint( + "FK_PozCennikDokSklep", pozCennikDokTable, sklepTable, + new[] { sklepIdColumn1 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_PozCennikDokSklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozCennikDok", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_PozCennikDokSklep.MappedForeignKeys.Add(fK_PozCennikDokSklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PozCennikDokSklepFk).Add(fK_PozCennikDokSklep); + pozCennikDokTable.ForeignKeyConstraints.Add(fK_PozCennikDokSklep); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_PozCennikDokSklep); + var fK_POZDOK_REF_POZDO_DOK = new ForeignKeyConstraint( + "FK_POZDOK_REF_POZDO_DOK", pozDokTable, dokTable, + new[] { dokIdColumn11 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_POZDOK_REF_POZDO_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_POZDOK_REF_POZDO_DOK.MappedForeignKeys.Add(fK_POZDOK_REF_POZDO_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POZDOK_REF_POZDO_DOKFk).Add(fK_POZDOK_REF_POZDO_DOK); + pozDokTable.ForeignKeyConstraints.Add(fK_POZDOK_REF_POZDO_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_POZDOK_REF_POZDO_DOK); + var fK_POZDOK_REF_POZTO_TOWAR = new ForeignKeyConstraint( + "FK_POZDOK_REF_POZTO_TOWAR", pozDokTable, towarTable, + new[] { towIdColumn13 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_POZDOK_REF_POZTO_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_POZDOK_REF_POZTO_TOWAR.MappedForeignKeys.Add(fK_POZDOK_REF_POZTO_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POZDOK_REF_POZTO_TOWARFk).Add(fK_POZDOK_REF_POZTO_TOWAR); + pozDokTable.ForeignKeyConstraints.Add(fK_POZDOK_REF_POZTO_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_POZDOK_REF_POZTO_TOWAR); + var fK_PozDokWBufPow = new ForeignKeyConstraint( + "FK_PozDokWBufPow", pozDokWBufPowiazanieTable, pozDokTable, + new[] { dokIdColumn12, kolejnoscColumn14 }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var fK_PozDokWBufPowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozDokWBufPowiazanie", + new[] { "DokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + fK_PozDokWBufPow.MappedForeignKeys.Add(fK_PozDokWBufPowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PozDokWBufPowFk).Add(fK_PozDokWBufPow); + pozDokWBufPowiazanieTable.ForeignKeyConstraints.Add(fK_PozDokWBufPow); + pozDokTable.ReferencingForeignKeyConstraints.Add(fK_PozDokWBufPow); + var fK_POZPAR_REF_POZPA_PARAGON = new ForeignKeyConstraint( + "FK_POZPAR_REF_POZPA_PARAGON", pozParTable, paragonTable, + new[] { parIdColumn8 }, + paragonTable.FindUniqueConstraint("PK_PARAGON")!, ReferentialAction.NoAction); + var fK_POZPAR_REF_POZPA_PARAGONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "ParId" }); + fK_POZPAR_REF_POZPA_PARAGON.MappedForeignKeys.Add(fK_POZPAR_REF_POZPA_PARAGONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POZPAR_REF_POZPA_PARAGONFk).Add(fK_POZPAR_REF_POZPA_PARAGON); + pozParTable.ForeignKeyConstraints.Add(fK_POZPAR_REF_POZPA_PARAGON); + paragonTable.ReferencingForeignKeyConstraints.Add(fK_POZPAR_REF_POZPA_PARAGON); + var fK_POZPAR_REF_TOWPA_TOWAR = new ForeignKeyConstraint( + "FK_POZPAR_REF_TOWPA_TOWAR", pozParTable, towarTable, + new[] { towIdColumn14 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_POZPAR_REF_TOWPA_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_POZPAR_REF_TOWPA_TOWAR.MappedForeignKeys.Add(fK_POZPAR_REF_TOWPA_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POZPAR_REF_TOWPA_TOWARFk).Add(fK_POZPAR_REF_TOWPA_TOWAR); + pozParTable.ForeignKeyConstraints.Add(fK_POZPAR_REF_TOWPA_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_POZPAR_REF_TOWPA_TOWAR); + var fK_POZPARSZ_REF_PPSZC_POZPAR = new ForeignKeyConstraint( + "FK_POZPARSZ_REF_PPSZC_POZPAR", pozParSzczegTable, pozParTable, + new[] { parIdColumn9, kolejnoscColumn16 }, + pozParTable.FindUniqueConstraint("PK_POZPAR")!, ReferentialAction.NoAction); + var fK_POZPARSZ_REF_PPSZC_POZPARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozParSzczeg", + new[] { "ParId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + new[] { "ParId", "Kolejnosc" }); + fK_POZPARSZ_REF_PPSZC_POZPAR.MappedForeignKeys.Add(fK_POZPARSZ_REF_PPSZC_POZPARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POZPARSZ_REF_PPSZC_POZPARFk).Add(fK_POZPARSZ_REF_PPSZC_POZPAR); + pozParSzczegTable.ForeignKeyConstraints.Add(fK_POZPARSZ_REF_PPSZC_POZPAR); + pozParTable.ReferencingForeignKeyConstraints.Add(fK_POZPARSZ_REF_PPSZC_POZPAR); + var fK_POZWZ_REF_POZWZ_WZORZEC = new ForeignKeyConstraint( + "FK_POZWZ_REF_POZWZ_WZORZEC", pozWzTable, wzorzecTable, + new[] { wzIdColumn }, + wzorzecTable.FindUniqueConstraint("PK_WZORZEC")!, ReferentialAction.NoAction); + var fK_POZWZ_REF_POZWZ_WZORZECFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozWz", + new[] { "WzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Wzorzec", + new[] { "WzId" }); + fK_POZWZ_REF_POZWZ_WZORZEC.MappedForeignKeys.Add(fK_POZWZ_REF_POZWZ_WZORZECFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POZWZ_REF_POZWZ_WZORZECFk).Add(fK_POZWZ_REF_POZWZ_WZORZEC); + pozWzTable.ForeignKeyConstraints.Add(fK_POZWZ_REF_POZWZ_WZORZEC); + wzorzecTable.ReferencingForeignKeyConstraints.Add(fK_POZWZ_REF_POZWZ_WZORZEC); + var fK_POZWZ_REF_TOWWZ_TOWAR = new ForeignKeyConstraint( + "FK_POZWZ_REF_TOWWZ_TOWAR", pozWzTable, towarTable, + new[] { towIdColumn15 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_POZWZ_REF_TOWWZ_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PozWz", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_POZWZ_REF_TOWWZ_TOWAR.MappedForeignKeys.Add(fK_POZWZ_REF_TOWWZ_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_POZWZ_REF_TOWWZ_TOWARFk).Add(fK_POZWZ_REF_TOWWZ_TOWAR); + pozWzTable.ForeignKeyConstraints.Add(fK_POZWZ_REF_TOWWZ_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_POZWZ_REF_TOWWZ_TOWAR); + var fK_PROFKAS_REFERENCE_KASA = new ForeignKeyConstraint( + "FK_PROFKAS_REFERENCE_KASA", profilKasaTable, kasaTable, + new[] { kasaIdColumn6 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_PROFKAS_REFERENCE_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_PROFKAS_REFERENCE_KASA.MappedForeignKeys.Add(fK_PROFKAS_REFERENCE_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PROFKAS_REFERENCE_KASAFk).Add(fK_PROFKAS_REFERENCE_KASA); + profilKasaTable.ForeignKeyConstraints.Add(fK_PROFKAS_REFERENCE_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_PROFKAS_REFERENCE_KASA); + var fK_PROFKAS_REFERENCE_PROF = new ForeignKeyConstraint( + "FK_PROFKAS_REFERENCE_PROF", profilKasaTable, profilTable, + new[] { profilIdColumn0 }, + profilTable.FindUniqueConstraint("PK_PROFIL")!, ReferentialAction.NoAction); + var fK_PROFKAS_REFERENCE_PROFFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa", + new[] { "ProfilId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Profil", + new[] { "ProfilId" }); + fK_PROFKAS_REFERENCE_PROF.MappedForeignKeys.Add(fK_PROFKAS_REFERENCE_PROFFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PROFKAS_REFERENCE_PROFFk).Add(fK_PROFKAS_REFERENCE_PROF); + profilKasaTable.ForeignKeyConstraints.Add(fK_PROFKAS_REFERENCE_PROF); + profilTable.ReferencingForeignKeyConstraints.Add(fK_PROFKAS_REFERENCE_PROF); + var fK_PROFILKONFIG_REFERENCE_PROFIL = new ForeignKeyConstraint( + "FK_PROFILKONFIG_REFERENCE_PROFIL", profilKonfigTable, profilTable, + new[] { profilIdColumn1 }, + profilTable.FindUniqueConstraint("PK_PROFIL")!, ReferentialAction.NoAction); + var fK_PROFILKONFIG_REFERENCE_PROFILFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKonfig", + new[] { "ProfilId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Profil", + new[] { "ProfilId" }); + fK_PROFILKONFIG_REFERENCE_PROFIL.MappedForeignKeys.Add(fK_PROFILKONFIG_REFERENCE_PROFILFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PROFILKONFIG_REFERENCE_PROFILFk).Add(fK_PROFILKONFIG_REFERENCE_PROFIL); + profilKonfigTable.ForeignKeyConstraints.Add(fK_PROFILKONFIG_REFERENCE_PROFIL); + profilTable.ReferencingForeignKeyConstraints.Add(fK_PROFILKONFIG_REFERENCE_PROFIL); + var ref_PrtMagMagazyn = new ForeignKeyConstraint( + "Ref_PrtMagMagazyn", prtMagTable, magazynTable, + new[] { magIdColumn7 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var ref_PrtMagMagazynFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + ref_PrtMagMagazyn.MappedForeignKeys.Add(ref_PrtMagMagazynFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_PrtMagMagazynFk).Add(ref_PrtMagMagazyn); + prtMagTable.ForeignKeyConstraints.Add(ref_PrtMagMagazyn); + magazynTable.ReferencingForeignKeyConstraints.Add(ref_PrtMagMagazyn); + var ref_PrtMagTowar = new ForeignKeyConstraint( + "Ref_PrtMagTowar", prtMagTable, towarTable, + new[] { towIdColumn16 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var ref_PrtMagTowarFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + ref_PrtMagTowar.MappedForeignKeys.Add(ref_PrtMagTowarFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_PrtMagTowarFk).Add(ref_PrtMagTowar); + prtMagTable.ForeignKeyConstraints.Add(ref_PrtMagTowar); + towarTable.ReferencingForeignKeyConstraints.Add(ref_PrtMagTowar); + var fK_PRZYDZIA_REF_ASPRZ_ASORT = new ForeignKeyConstraint( + "FK_PRZYDZIA_REF_ASPRZ_ASORT", przydzialTable, asortTable, + new[] { asIdColumn3 }, + asortTable.FindUniqueConstraint("PK_ASORT")!, ReferentialAction.NoAction); + var fK_PRZYDZIA_REF_ASPRZ_ASORTFk = RelationalModel.GetForeignKey(this, + "Przydzial", + new[] { "AsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + new[] { "AsId" }); + fK_PRZYDZIA_REF_ASPRZ_ASORT.MappedForeignKeys.Add(fK_PRZYDZIA_REF_ASPRZ_ASORTFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PRZYDZIA_REF_ASPRZ_ASORTFk).Add(fK_PRZYDZIA_REF_ASPRZ_ASORT); + przydzialTable.ForeignKeyConstraints.Add(fK_PRZYDZIA_REF_ASPRZ_ASORT); + asortTable.ReferencingForeignKeyConstraints.Add(fK_PRZYDZIA_REF_ASPRZ_ASORT); + var fK_PRZYDZIA_REF_KASPR_KASA = new ForeignKeyConstraint( + "FK_PRZYDZIA_REF_KASPR_KASA", przydzialTable, kasaTable, + new[] { kasaIdColumn10 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_PRZYDZIA_REF_KASPR_KASAFk = RelationalModel.GetForeignKey(this, + "Przydzial", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_PRZYDZIA_REF_KASPR_KASA.MappedForeignKeys.Add(fK_PRZYDZIA_REF_KASPR_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_PRZYDZIA_REF_KASPR_KASAFk).Add(fK_PRZYDZIA_REF_KASPR_KASA); + przydzialTable.ForeignKeyConstraints.Add(fK_PRZYDZIA_REF_KASPR_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_PRZYDZIA_REF_KASPR_KASA); + var fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN = new ForeignKeyConstraint( + "FK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN", rapWartPoczDaneTable, magazynTable, + new[] { magIdColumn8 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN.MappedForeignKeys.Add(fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYNFk).Add(fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN); + rapWartPoczDaneTable.ForeignKeyConstraints.Add(fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN); + var fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ = new ForeignKeyConstraint( + "FK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ", rapWartPoczDaneTable, rapWartPoczTable, + new[] { rWPIdColumn0 }, + rapWartPoczTable.FindUniqueConstraint("PK_RAPWARTPOCZ")!, ReferentialAction.NoAction); + var fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane", + new[] { "RWPId" }, + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPocz", + new[] { "RWPId" }); + fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ.MappedForeignKeys.Add(fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZFk).Add(fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ); + rapWartPoczDaneTable.ForeignKeyConstraints.Add(fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ); + rapWartPoczTable.ReferencingForeignKeyConstraints.Add(fK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ); + var fK_REGULAAS_REFERENCE_ASORT = new ForeignKeyConstraint( + "FK_REGULAAS_REFERENCE_ASORT", regulaAsortTable, asortTable, + new[] { asIdColumn1 }, + asortTable.FindUniqueConstraint("PK_ASORT")!, ReferentialAction.NoAction); + var fK_REGULAAS_REFERENCE_ASORTFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort", + new[] { "AsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + new[] { "AsId" }); + fK_REGULAAS_REFERENCE_ASORT.MappedForeignKeys.Add(fK_REGULAAS_REFERENCE_ASORTFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_REGULAAS_REFERENCE_ASORTFk).Add(fK_REGULAAS_REFERENCE_ASORT); + regulaAsortTable.ForeignKeyConstraints.Add(fK_REGULAAS_REFERENCE_ASORT); + asortTable.ReferencingForeignKeyConstraints.Add(fK_REGULAAS_REFERENCE_ASORT); + var fK_REGULAAS_REFERENCE_REGULA = new ForeignKeyConstraint( + "FK_REGULAAS_REFERENCE_REGULA", regulaAsortTable, regulaTable, + new[] { regulaIdColumn0 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var fK_REGULAAS_REFERENCE_REGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + fK_REGULAAS_REFERENCE_REGULA.MappedForeignKeys.Add(fK_REGULAAS_REFERENCE_REGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_REGULAAS_REFERENCE_REGULAFk).Add(fK_REGULAAS_REFERENCE_REGULA); + regulaAsortTable.ForeignKeyConstraints.Add(fK_REGULAAS_REFERENCE_REGULA); + regulaTable.ReferencingForeignKeyConstraints.Add(fK_REGULAAS_REFERENCE_REGULA); + var ref_RegDokDok = new ForeignKeyConstraint( + "Ref_RegDokDok", regulaDokTable, dokTable, + new[] { dokIdColumn13 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var ref_RegDokDokFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + ref_RegDokDok.MappedForeignKeys.Add(ref_RegDokDokFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegDokDokFk).Add(ref_RegDokDok); + regulaDokTable.ForeignKeyConstraints.Add(ref_RegDokDok); + dokTable.ReferencingForeignKeyConstraints.Add(ref_RegDokDok); + var ref_RegDokKonto = new ForeignKeyConstraint( + "Ref_RegDokKonto", regulaDokTable, kontoLojTable, + new[] { kontoIdColumn1 }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_RegDokKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + new[] { "KontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_RegDokKonto.MappedForeignKeys.Add(ref_RegDokKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegDokKontoFk).Add(ref_RegDokKonto); + regulaDokTable.ForeignKeyConstraints.Add(ref_RegDokKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_RegDokKonto); + var ref_RegDokReg = new ForeignKeyConstraint( + "Ref_RegDokReg", regulaDokTable, regulaTable, + new[] { regulaIdColumn1 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var ref_RegDokRegFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + ref_RegDokReg.MappedForeignKeys.Add(ref_RegDokRegFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegDokRegFk).Add(ref_RegDokReg); + regulaDokTable.ForeignKeyConstraints.Add(ref_RegDokReg); + regulaTable.ReferencingForeignKeyConstraints.Add(ref_RegDokReg); + var fK_RgDokSzczegRgDok = new ForeignKeyConstraint( + "FK_RgDokSzczegRgDok", regulaDokSzczegTable, regulaDokTable, + new[] { dokIdColumn14, regulaIdColumn2, kolejnoscColumn19 }, + regulaDokTable.FindUniqueConstraint("PK_REGULADOK")!, ReferentialAction.NoAction); + var fK_RgDokSzczegRgDokFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDokSzczeg", + new[] { "DokId", "RegulaId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + new[] { "DokId", "RegulaId", "Kolejnosc" }); + fK_RgDokSzczegRgDok.MappedForeignKeys.Add(fK_RgDokSzczegRgDokFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RgDokSzczegRgDokFk).Add(fK_RgDokSzczegRgDok); + regulaDokSzczegTable.ForeignKeyConstraints.Add(fK_RgDokSzczegRgDok); + regulaDokTable.ReferencingForeignKeyConstraints.Add(fK_RgDokSzczegRgDok); + var fK_REGULAKOD_REGULA = new ForeignKeyConstraint( + "FK_REGULAKOD_REGULA", regulaKodTable, regulaTable, + new[] { regulaIdColumn3 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var fK_REGULAKOD_REGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaKod", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + fK_REGULAKOD_REGULA.MappedForeignKeys.Add(fK_REGULAKOD_REGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_REGULAKOD_REGULAFk).Add(fK_REGULAKOD_REGULA); + regulaKodTable.ForeignKeyConstraints.Add(fK_REGULAKOD_REGULA); + regulaTable.ReferencingForeignKeyConstraints.Add(fK_REGULAKOD_REGULA); + var ref_RegParKonto = new ForeignKeyConstraint( + "Ref_RegParKonto", regulaParTable, kontoLojTable, + new[] { kontoIdColumn2 }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_RegParKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + new[] { "KontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_RegParKonto.MappedForeignKeys.Add(ref_RegParKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegParKontoFk).Add(ref_RegParKonto); + regulaParTable.ForeignKeyConstraints.Add(ref_RegParKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_RegParKonto); + var ref_RegParPar = new ForeignKeyConstraint( + "Ref_RegParPar", regulaParTable, paragonTable, + new[] { parIdColumn10 }, + paragonTable.FindUniqueConstraint("PK_PARAGON")!, ReferentialAction.NoAction); + var ref_RegParParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Paragon", + new[] { "ParId" }); + ref_RegParPar.MappedForeignKeys.Add(ref_RegParParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegParParFk).Add(ref_RegParPar); + regulaParTable.ForeignKeyConstraints.Add(ref_RegParPar); + paragonTable.ReferencingForeignKeyConstraints.Add(ref_RegParPar); + var ref_RegParReg = new ForeignKeyConstraint( + "Ref_RegParReg", regulaParTable, regulaTable, + new[] { regulaIdColumn4 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var ref_RegParRegFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + ref_RegParReg.MappedForeignKeys.Add(ref_RegParRegFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegParRegFk).Add(ref_RegParReg); + regulaParTable.ForeignKeyConstraints.Add(ref_RegParReg); + regulaTable.ReferencingForeignKeyConstraints.Add(ref_RegParReg); + var ref_RegPar = new ForeignKeyConstraint( + "Ref_RegPar", regulaParamTable, regulaTable, + new[] { regulaIdColumn6 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var ref_RegParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaParam", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + ref_RegPar.MappedForeignKeys.Add(ref_RegParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegParFk).Add(ref_RegPar); + regulaParamTable.ForeignKeyConstraints.Add(ref_RegPar); + regulaTable.ReferencingForeignKeyConstraints.Add(ref_RegPar); + var fK_RgParSzczegRgPar = new ForeignKeyConstraint( + "FK_RgParSzczegRgPar", regulaParSzczegTable, regulaParTable, + new[] { parIdColumn11, regulaIdColumn5, kolejnoscColumn21 }, + regulaParTable.FindUniqueConstraint("PK_REGULAPAR")!, ReferentialAction.NoAction); + var fK_RgParSzczegRgParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaParSzczeg", + new[] { "ParId", "RegulaId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + new[] { "ParId", "RegulaId", "Kolejnosc" }); + fK_RgParSzczegRgPar.MappedForeignKeys.Add(fK_RgParSzczegRgParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RgParSzczegRgParFk).Add(fK_RgParSzczegRgPar); + regulaParSzczegTable.ForeignKeyConstraints.Add(fK_RgParSzczegRgPar); + regulaParTable.ReferencingForeignKeyConstraints.Add(fK_RgParSzczegRgPar); + var ref_RegPozPoz = new ForeignKeyConstraint( + "Ref_RegPozPoz", regulaPozDokTable, pozDokTable, + new[] { dokIdColumn15, kolejnoscColumn22 }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var ref_RegPozPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok", + new[] { "DokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + ref_RegPozPoz.MappedForeignKeys.Add(ref_RegPozPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozPozFk).Add(ref_RegPozPoz); + regulaPozDokTable.ForeignKeyConstraints.Add(ref_RegPozPoz); + pozDokTable.ReferencingForeignKeyConstraints.Add(ref_RegPozPoz); + var ref_RegPozReg = new ForeignKeyConstraint( + "Ref_RegPozReg", regulaPozDokTable, regulaTable, + new[] { regulaIdColumn7 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var ref_RegPozRegFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + ref_RegPozReg.MappedForeignKeys.Add(ref_RegPozRegFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozRegFk).Add(ref_RegPozReg); + regulaPozDokTable.ForeignKeyConstraints.Add(ref_RegPozReg); + regulaTable.ReferencingForeignKeyConstraints.Add(ref_RegPozReg); + var ref_RegPozSzPoz = new ForeignKeyConstraint( + "Ref_RegPozSzPoz", regulaPozDokSzczegTable, pozDokTable, + new[] { dokIdColumn16, kolejnoscColumn23 }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var ref_RegPozSzPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg", + new[] { "DokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + ref_RegPozSzPoz.MappedForeignKeys.Add(ref_RegPozSzPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozSzPozFk).Add(ref_RegPozSzPoz); + regulaPozDokSzczegTable.ForeignKeyConstraints.Add(ref_RegPozSzPoz); + pozDokTable.ReferencingForeignKeyConstraints.Add(ref_RegPozSzPoz); + var ref_RegPozSzReg = new ForeignKeyConstraint( + "Ref_RegPozSzReg", regulaPozDokSzczegTable, regulaTable, + new[] { regulaIdColumn8 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var ref_RegPozSzRegFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + ref_RegPozSzReg.MappedForeignKeys.Add(ref_RegPozSzRegFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozSzRegFk).Add(ref_RegPozSzReg); + regulaPozDokSzczegTable.ForeignKeyConstraints.Add(ref_RegPozSzReg); + regulaTable.ReferencingForeignKeyConstraints.Add(ref_RegPozSzReg); + var ref_RegPozParPar = new ForeignKeyConstraint( + "Ref_RegPozParPar", regulaPozParTable, pozParTable, + new[] { parIdColumn12, kolejnoscColumn24 }, + pozParTable.FindUniqueConstraint("PK_POZPAR")!, ReferentialAction.NoAction); + var ref_RegPozParParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar", + new[] { "ParId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + new[] { "ParId", "Kolejnosc" }); + ref_RegPozParPar.MappedForeignKeys.Add(ref_RegPozParParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozParParFk).Add(ref_RegPozParPar); + regulaPozParTable.ForeignKeyConstraints.Add(ref_RegPozParPar); + pozParTable.ReferencingForeignKeyConstraints.Add(ref_RegPozParPar); + var ref_RegPozParReg = new ForeignKeyConstraint( + "Ref_RegPozParReg", regulaPozParTable, regulaTable, + new[] { regulaIdColumn9 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var ref_RegPozParRegFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + ref_RegPozParReg.MappedForeignKeys.Add(ref_RegPozParRegFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozParRegFk).Add(ref_RegPozParReg); + regulaPozParTable.ForeignKeyConstraints.Add(ref_RegPozParReg); + regulaTable.ReferencingForeignKeyConstraints.Add(ref_RegPozParReg); + var ref_RegPozPSzPoz = new ForeignKeyConstraint( + "Ref_RegPozPSzPoz", regulaPozParSzczegTable, pozParTable, + new[] { parIdColumn13, kolejnoscColumn25 }, + pozParTable.FindUniqueConstraint("PK_POZPAR")!, ReferentialAction.NoAction); + var ref_RegPozPSzPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg", + new[] { "ParId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + new[] { "ParId", "Kolejnosc" }); + ref_RegPozPSzPoz.MappedForeignKeys.Add(ref_RegPozPSzPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozPSzPozFk).Add(ref_RegPozPSzPoz); + regulaPozParSzczegTable.ForeignKeyConstraints.Add(ref_RegPozPSzPoz); + pozParTable.ReferencingForeignKeyConstraints.Add(ref_RegPozPSzPoz); + var ref_RegPozPSzReg = new ForeignKeyConstraint( + "Ref_RegPozPSzReg", regulaPozParSzczegTable, regulaTable, + new[] { regulaIdColumn10 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var ref_RegPozPSzRegFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + ref_RegPozPSzReg.MappedForeignKeys.Add(ref_RegPozPSzRegFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RegPozPSzRegFk).Add(ref_RegPozPSzReg); + regulaPozParSzczegTable.ForeignKeyConstraints.Add(ref_RegPozPSzReg); + regulaTable.ReferencingForeignKeyConstraints.Add(ref_RegPozPSzReg); + var fK_REGULAPROG_REFERENCE_REGULA = new ForeignKeyConstraint( + "FK_REGULAPROG_REFERENCE_REGULA", regulaProgTable, regulaTable, + new[] { regulaIdColumn11 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var fK_REGULAPROG_REFERENCE_REGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaProg", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + fK_REGULAPROG_REFERENCE_REGULA.MappedForeignKeys.Add(fK_REGULAPROG_REFERENCE_REGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_REGULAPROG_REFERENCE_REGULAFk).Add(fK_REGULAPROG_REFERENCE_REGULA); + regulaProgTable.ForeignKeyConstraints.Add(fK_REGULAPROG_REFERENCE_REGULA); + regulaTable.ReferencingForeignKeyConstraints.Add(fK_REGULAPROG_REFERENCE_REGULA); + var fK_RegulaSklep_Regula = new ForeignKeyConstraint( + "FK_RegulaSklep_Regula", regulaSklepTable, regulaTable, + new[] { regulaIdColumn12 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var fK_RegulaSklep_RegulaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + fK_RegulaSklep_Regula.MappedForeignKeys.Add(fK_RegulaSklep_RegulaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RegulaSklep_RegulaFk).Add(fK_RegulaSklep_Regula); + regulaSklepTable.ForeignKeyConstraints.Add(fK_RegulaSklep_Regula); + regulaTable.ReferencingForeignKeyConstraints.Add(fK_RegulaSklep_Regula); + var fK_RegulaSklep_Sklep = new ForeignKeyConstraint( + "FK_RegulaSklep_Sklep", regulaSklepTable, sklepTable, + new[] { sklepIdColumn2 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_RegulaSklep_SklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_RegulaSklep_Sklep.MappedForeignKeys.Add(fK_RegulaSklep_SklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RegulaSklep_SklepFk).Add(fK_RegulaSklep_Sklep); + regulaSklepTable.ForeignKeyConstraints.Add(fK_RegulaSklep_Sklep); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_RegulaSklep_Sklep); + var fK_RegulaSklepAuth_PcfUser = new ForeignKeyConstraint( + "FK_RegulaSklepAuth_PcfUser", regulaSklepAuthTable, pcfUserTable, + new[] { pcfUserIdColumn1 }, + pcfUserTable.FindUniqueConstraint("PK_PCFUSER")!, ReferentialAction.NoAction); + var fK_RegulaSklepAuth_PcfUserFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", + new[] { "PcfUserId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PcfUser", + new[] { "PcfUserId" }); + fK_RegulaSklepAuth_PcfUser.MappedForeignKeys.Add(fK_RegulaSklepAuth_PcfUserFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RegulaSklepAuth_PcfUserFk).Add(fK_RegulaSklepAuth_PcfUser); + regulaSklepAuthTable.ForeignKeyConstraints.Add(fK_RegulaSklepAuth_PcfUser); + pcfUserTable.ReferencingForeignKeyConstraints.Add(fK_RegulaSklepAuth_PcfUser); + var fK_RegulaSklepAuth_Regula = new ForeignKeyConstraint( + "FK_RegulaSklepAuth_Regula", regulaSklepAuthTable, regulaTable, + new[] { regulaIdColumn13 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var fK_RegulaSklepAuth_RegulaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + fK_RegulaSklepAuth_Regula.MappedForeignKeys.Add(fK_RegulaSklepAuth_RegulaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RegulaSklepAuth_RegulaFk).Add(fK_RegulaSklepAuth_Regula); + regulaSklepAuthTable.ForeignKeyConstraints.Add(fK_RegulaSklepAuth_Regula); + regulaTable.ReferencingForeignKeyConstraints.Add(fK_RegulaSklepAuth_Regula); + var fK_RegulaSklepAuth_Sklep = new ForeignKeyConstraint( + "FK_RegulaSklepAuth_Sklep", regulaSklepAuthTable, sklepTable, + new[] { sklepIdColumn3 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_RegulaSklepAuth_SklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_RegulaSklepAuth_Sklep.MappedForeignKeys.Add(fK_RegulaSklepAuth_SklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RegulaSklepAuth_SklepFk).Add(fK_RegulaSklepAuth_Sklep); + regulaSklepAuthTable.ForeignKeyConstraints.Add(fK_RegulaSklepAuth_Sklep); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_RegulaSklepAuth_Sklep); + var fK_RegulaTekst_Regula = new ForeignKeyConstraint( + "FK_RegulaTekst_Regula", regulaTekstTable, regulaTable, + new[] { regulaIdColumn14 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var fK_RegulaTekst_RegulaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTekst", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + fK_RegulaTekst_Regula.MappedForeignKeys.Add(fK_RegulaTekst_RegulaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RegulaTekst_RegulaFk).Add(fK_RegulaTekst_Regula); + regulaTekstTable.ForeignKeyConstraints.Add(fK_RegulaTekst_Regula); + regulaTable.ReferencingForeignKeyConstraints.Add(fK_RegulaTekst_Regula); + var fK_REGULATO_REFERENCE_REGULA = new ForeignKeyConstraint( + "FK_REGULATO_REFERENCE_REGULA", regulaTowarTable, regulaTable, + new[] { regulaIdColumn15 }, + regulaTable.FindUniqueConstraint("PK_REGULA")!, ReferentialAction.NoAction); + var fK_REGULATO_REFERENCE_REGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar", + new[] { "RegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + new[] { "RegulaId" }); + fK_REGULATO_REFERENCE_REGULA.MappedForeignKeys.Add(fK_REGULATO_REFERENCE_REGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_REGULATO_REFERENCE_REGULAFk).Add(fK_REGULATO_REFERENCE_REGULA); + regulaTowarTable.ForeignKeyConstraints.Add(fK_REGULATO_REFERENCE_REGULA); + regulaTable.ReferencingForeignKeyConstraints.Add(fK_REGULATO_REFERENCE_REGULA); + var fK_REGULATO_REFERENCE_TOWAR = new ForeignKeyConstraint( + "FK_REGULATO_REFERENCE_TOWAR", regulaTowarTable, towarTable, + new[] { towIdColumn17 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_REGULATO_REFERENCE_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_REGULATO_REFERENCE_TOWAR.MappedForeignKeys.Add(fK_REGULATO_REFERENCE_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_REGULATO_REFERENCE_TOWARFk).Add(fK_REGULATO_REFERENCE_TOWAR); + regulaTowarTable.ForeignKeyConstraints.Add(fK_REGULATO_REFERENCE_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_REGULATO_REFERENCE_TOWAR); + var fK_RolaUprRola = new ForeignKeyConstraint( + "FK_RolaUprRola", rolaUprawnienieTable, rolaTable, + new[] { rolaIdColumn1 }, + rolaTable.FindUniqueConstraint("PK_ROLA")!, ReferentialAction.NoAction); + var fK_RolaUprRolaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RolaUprawnienie", + new[] { "RolaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Rola", + new[] { "RolaId" }); + fK_RolaUprRola.MappedForeignKeys.Add(fK_RolaUprRolaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RolaUprRolaFk).Add(fK_RolaUprRola); + rolaUprawnienieTable.ForeignKeyConstraints.Add(fK_RolaUprRola); + rolaTable.ReferencingForeignKeyConstraints.Add(fK_RolaUprRola); + var fK_RozbDodDokDok = new ForeignKeyConstraint( + "FK_RozbDodDokDok", rozbicieDodDokTable, dokTable, + new[] { dokIdColumn18 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_RozbDodDokDokFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozbicieDodDok", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_RozbDodDokDok.MappedForeignKeys.Add(fK_RozbDodDokDokFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_RozbDodDokDokFk).Add(fK_RozbDodDokDok); + rozbicieDodDokTable.ForeignKeyConstraints.Add(fK_RozbDodDokDok); + dokTable.ReferencingForeignKeyConstraints.Add(fK_RozbDodDokDok); + var fK_ROZBICIE_REF_SUMAD_DOK = new ForeignKeyConstraint( + "FK_ROZBICIE_REF_SUMAD_DOK", rozbicieDokTable, dokTable, + new[] { dokIdColumn19 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_ROZBICIE_REF_SUMAD_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozbicieDok", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_ROZBICIE_REF_SUMAD_DOK.MappedForeignKeys.Add(fK_ROZBICIE_REF_SUMAD_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ROZBICIE_REF_SUMAD_DOKFk).Add(fK_ROZBICIE_REF_SUMAD_DOK); + rozbicieDokTable.ForeignKeyConstraints.Add(fK_ROZBICIE_REF_SUMAD_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_ROZBICIE_REF_SUMAD_DOK); + var fK_ROZLICZA_REF_DOKRO_DOK = new ForeignKeyConstraint( + "FK_ROZLICZA_REF_DOKRO_DOK", rozliczaTable, dokTable, + new[] { rozliczanyDokIdColumn }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_ROZLICZA_REF_DOKRO_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Rozlicza", + new[] { "RozliczanyDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_ROZLICZA_REF_DOKRO_DOK.MappedForeignKeys.Add(fK_ROZLICZA_REF_DOKRO_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ROZLICZA_REF_DOKRO_DOKFk).Add(fK_ROZLICZA_REF_DOKRO_DOK); + rozliczaTable.ForeignKeyConstraints.Add(fK_ROZLICZA_REF_DOKRO_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_ROZLICZA_REF_DOKRO_DOK); + var fK_ROZLICZA_REF_DOKZB_DOK = new ForeignKeyConstraint( + "FK_ROZLICZA_REF_DOKZB_DOK", rozliczaTable, dokTable, + new[] { dokIdColumn20 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_ROZLICZA_REF_DOKZB_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Rozlicza", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_ROZLICZA_REF_DOKZB_DOK.MappedForeignKeys.Add(fK_ROZLICZA_REF_DOKZB_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ROZLICZA_REF_DOKZB_DOKFk).Add(fK_ROZLICZA_REF_DOKZB_DOK); + rozliczaTable.ForeignKeyConstraints.Add(fK_ROZLICZA_REF_DOKZB_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_ROZLICZA_REF_DOKZB_DOK); + var fK_ROZLICZE_REF_PRTRO_PARTIA = new ForeignKeyConstraint( + "FK_ROZLICZE_REF_PRTRO_PARTIA", rozliczeniePartiiTable, partiaTable, + new[] { prtDokIdColumn, prtKolejnoscColumn }, + partiaTable.FindUniqueConstraint("PK_PARTIA")!, ReferentialAction.NoAction); + var fK_ROZLICZE_REF_PRTRO_PARTIAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii", + new[] { "PrtDokId", "PrtKolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.Partia", + new[] { "DokId", "Kolejnosc" }); + fK_ROZLICZE_REF_PRTRO_PARTIA.MappedForeignKeys.Add(fK_ROZLICZE_REF_PRTRO_PARTIAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ROZLICZE_REF_PRTRO_PARTIAFk).Add(fK_ROZLICZE_REF_PRTRO_PARTIA); + rozliczeniePartiiTable.ForeignKeyConstraints.Add(fK_ROZLICZE_REF_PRTRO_PARTIA); + partiaTable.ReferencingForeignKeyConstraints.Add(fK_ROZLICZE_REF_PRTRO_PARTIA); + var fK_ROZLICZE_REF_ROZPO_POZDOK = new ForeignKeyConstraint( + "FK_ROZLICZE_REF_ROZPO_POZDOK", rozliczeniePartiiTable, pozDokTable, + new[] { rozDokIdColumn, rozKolejnoscColumn }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var fK_ROZLICZE_REF_ROZPO_POZDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii", + new[] { "RozDokId", "RozKolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + fK_ROZLICZE_REF_ROZPO_POZDOK.MappedForeignKeys.Add(fK_ROZLICZE_REF_ROZPO_POZDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ROZLICZE_REF_ROZPO_POZDOKFk).Add(fK_ROZLICZE_REF_ROZPO_POZDOK); + rozliczeniePartiiTable.ForeignKeyConstraints.Add(fK_ROZLICZE_REF_ROZPO_POZDOK); + pozDokTable.ReferencingForeignKeyConstraints.Add(fK_ROZLICZE_REF_ROZPO_POZDOK); + var ref_RozPrtMagPoz = new ForeignKeyConstraint( + "Ref_RozPrtMagPoz", rozPrtMagTable, pozDokTable, + new[] { dokIdColumn17, kolejnoscColumn27 }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var ref_RozPrtMagPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", + new[] { "DokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + ref_RozPrtMagPoz.MappedForeignKeys.Add(ref_RozPrtMagPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RozPrtMagPozFk).Add(ref_RozPrtMagPoz); + rozPrtMagTable.ForeignKeyConstraints.Add(ref_RozPrtMagPoz); + pozDokTable.ReferencingForeignKeyConstraints.Add(ref_RozPrtMagPoz); + var ref_RozPrtMagPrt = new ForeignKeyConstraint( + "Ref_RozPrtMagPrt", rozPrtMagTable, prtMagTable, + new[] { towIdColumn18, pMIdColumn0 }, + prtMagTable.FindUniqueConstraint("PK_PRTMAG")!, ReferentialAction.NoAction); + var ref_RozPrtMagPrtFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", + new[] { "TowId", "PMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + new[] { "TowId", "PMId" }); + ref_RozPrtMagPrt.MappedForeignKeys.Add(ref_RozPrtMagPrtFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_RozPrtMagPrtFk).Add(ref_RozPrtMagPrt); + rozPrtMagTable.ForeignKeyConstraints.Add(ref_RozPrtMagPrt); + prtMagTable.ReferencingForeignKeyConstraints.Add(ref_RozPrtMagPrt); + var fK_SESJA_REF_UZYSE_UZYTKOWN = new ForeignKeyConstraint( + "FK_SESJA_REF_UZYSE_UZYTKOWN", sesjaTable, uzytkownikTable, + new[] { uzIdColumn4 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SESJA_REF_UZYSE_UZYTKOWNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sesja", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_SESJA_REF_UZYSE_UZYTKOWN.MappedForeignKeys.Add(fK_SESJA_REF_UZYSE_UZYTKOWNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SESJA_REF_UZYSE_UZYTKOWNFk).Add(fK_SESJA_REF_UZYSE_UZYTKOWN); + sesjaTable.ForeignKeyConstraints.Add(fK_SESJA_REF_UZYSE_UZYTKOWN); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SESJA_REF_UZYSE_UZYTKOWN); + var fK_SESJAAKT_REF_SESAK_SESJA = new ForeignKeyConstraint( + "FK_SESJAAKT_REF_SESAK_SESJA", sesjaAktywnaTable, sesjaTable, + new[] { sesjaIdColumn1 }, + sesjaTable.FindUniqueConstraint("PK_SESJA")!, ReferentialAction.NoAction); + var fK_SESJAAKT_REF_SESAK_SESJAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SesjaAktywna", + new[] { "SesjaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sesja", + new[] { "SesjaId" }); + fK_SESJAAKT_REF_SESAK_SESJA.MappedForeignKeys.Add(fK_SESJAAKT_REF_SESAK_SESJAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SESJAAKT_REF_SESAK_SESJAFk).Add(fK_SESJAAKT_REF_SESAK_SESJA); + sesjaAktywnaTable.ForeignKeyConstraints.Add(fK_SESJAAKT_REF_SESAK_SESJA); + sesjaTable.ReferencingForeignKeyConstraints.Add(fK_SESJAAKT_REF_SESAK_SESJA); + var fK_SKLDEFKODU = new ForeignKeyConstraint( + "FK_SKLDEFKODU", skladnikDefinicjiKoduTable, definicjaKoduTable, + new[] { dKIdColumn0 }, + definicjaKoduTable.FindUniqueConstraint("PK_DEFKODU")!, ReferentialAction.NoAction); + var fK_SKLDEFKODUFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikDefinicjiKodu", + new[] { "DKId" }, + "Blink.Backoffice.Services.PcmDb.Entities.DefinicjaKodu", + new[] { "DKId" }); + fK_SKLDEFKODU.MappedForeignKeys.Add(fK_SKLDEFKODUFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLDEFKODUFk).Add(fK_SKLDEFKODU); + skladnikDefinicjiKoduTable.ForeignKeyConstraints.Add(fK_SKLDEFKODU); + definicjaKoduTable.ReferencingForeignKeyConstraints.Add(fK_SKLDEFKODU); + var fK_SKLADNIKWZORCA_REFERENCE_TOWAR = new ForeignKeyConstraint( + "FK_SKLADNIKWZORCA_REFERENCE_TOWAR", skladnikWzorcaTable, towarTable, + new[] { towIdWzorcaColumn }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_SKLADNIKWZORCA_REFERENCE_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", + new[] { "TowIdWzorca" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_SKLADNIKWZORCA_REFERENCE_TOWAR.MappedForeignKeys.Add(fK_SKLADNIKWZORCA_REFERENCE_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLADNIKWZORCA_REFERENCE_TOWARFk).Add(fK_SKLADNIKWZORCA_REFERENCE_TOWAR); + skladnikWzorcaTable.ForeignKeyConstraints.Add(fK_SKLADNIKWZORCA_REFERENCE_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_SKLADNIKWZORCA_REFERENCE_TOWAR); + var fK_Ref_KrajSklep = new ForeignKeyConstraint( + "FK_Ref_KrajSklep", sklepTable, krajTable, + new[] { krajIdColumn2 }, + krajTable.FindUniqueConstraint("PK_KRAJ")!, ReferentialAction.NoAction); + var fK_Ref_KrajSklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "KrajId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "KrajId" }); + fK_Ref_KrajSklep.MappedForeignKeys.Add(fK_Ref_KrajSklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_KrajSklepFk).Add(fK_Ref_KrajSklep); + sklepTable.ForeignKeyConstraints.Add(fK_Ref_KrajSklep); + krajTable.ReferencingForeignKeyConstraints.Add(fK_Ref_KrajSklep); + var fK_SKLEP_REF_SKLEP_KONTRAHE = new ForeignKeyConstraint( + "FK_SKLEP_REF_SKLEP_KONTRAHE", sklepTable, kontrahentTable, + new[] { sklepIdColumn4 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_SKLEP_REF_SKLEP_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_SKLEP_REF_SKLEP_KONTRAHE.MappedForeignKeys.Add(fK_SKLEP_REF_SKLEP_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEP_REF_SKLEP_KONTRAHEFk).Add(fK_SKLEP_REF_SKLEP_KONTRAHE); + sklepTable.ForeignKeyConstraints.Add(fK_SKLEP_REF_SKLEP_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_SKLEP_REF_SKLEP_KONTRAHE); + var fK_SKLEP_REF_SKLEP_MAGAZYN = new ForeignKeyConstraint( + "FK_SKLEP_REF_SKLEP_MAGAZYN", sklepTable, magazynTable, + new[] { magIdColumn9 }, + magazynTable.FindUniqueConstraint("PK_MAGAZYN")!, ReferentialAction.NoAction); + var fK_SKLEP_REF_SKLEP_MAGAZYNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "MagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Magazyn", + new[] { "MagId" }); + fK_SKLEP_REF_SKLEP_MAGAZYN.MappedForeignKeys.Add(fK_SKLEP_REF_SKLEP_MAGAZYNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEP_REF_SKLEP_MAGAZYNFk).Add(fK_SKLEP_REF_SKLEP_MAGAZYN); + sklepTable.ForeignKeyConstraints.Add(fK_SKLEP_REF_SKLEP_MAGAZYN); + magazynTable.ReferencingForeignKeyConstraints.Add(fK_SKLEP_REF_SKLEP_MAGAZYN); + var fK_SKLARTGLOWNYSKLEPTOWID = new ForeignKeyConstraint( + "FK_SKLARTGLOWNYSKLEPTOWID", sklepArtykulTable, sklepTowarTable, + new[] { sklepIdColumn5, glownySklepTowIdColumn }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLARTGLOWNYSKLEPTOWIDFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", + new[] { "SklepId", "GlownySklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLARTGLOWNYSKLEPTOWID.MappedForeignKeys.Add(fK_SKLARTGLOWNYSKLEPTOWIDFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLARTGLOWNYSKLEPTOWIDFk).Add(fK_SKLARTGLOWNYSKLEPTOWID); + sklepArtykulTable.ForeignKeyConstraints.Add(fK_SKLARTGLOWNYSKLEPTOWID); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLARTGLOWNYSKLEPTOWID); + var fK_SKLEPART_REF_SKART_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPART_REF_SKART_SKLEP", sklepArtykulTable, sklepTable, + new[] { sklepIdColumn5 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPART_REF_SKART_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPART_REF_SKART_SKLEP.MappedForeignKeys.Add(fK_SKLEPART_REF_SKART_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPART_REF_SKART_SKLEPFk).Add(fK_SKLEPART_REF_SKART_SKLEP); + sklepArtykulTable.ForeignKeyConstraints.Add(fK_SKLEPART_REF_SKART_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPART_REF_SKART_SKLEP); + var fK_SKDEFKODUSKLEP = new ForeignKeyConstraint( + "FK_SKDEFKODUSKLEP", sklepDefinicjaKoduTable, sklepTable, + new[] { sklepIdColumn7 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKDEFKODUSKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDefinicjaKodu", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKDEFKODUSKLEP.MappedForeignKeys.Add(fK_SKDEFKODUSKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKDEFKODUSKLEPFk).Add(fK_SKDEFKODUSKLEP); + sklepDefinicjaKoduTable.ForeignKeyConstraints.Add(fK_SKDEFKODUSKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKDEFKODUSKLEP); + var fK_SklepDlugiZasob_ZasobId = new ForeignKeyConstraint( + "FK_SklepDlugiZasob_ZasobId", sklepDlugiZasobTable, dlugiZasobTable, + new[] { zasobIdColumn2 }, + dlugiZasobTable.FindUniqueConstraint("PK_DlugiZasob")!, ReferentialAction.NoAction); + var fK_SklepDlugiZasob_ZasobIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDlugiZasob", + new[] { "ZasobId" }, + "Blink.Backoffice.Services.PcmDb.Entities.DlugiZasob", + new[] { "ZasobId" }); + fK_SklepDlugiZasob_ZasobId.MappedForeignKeys.Add(fK_SklepDlugiZasob_ZasobIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepDlugiZasob_ZasobIdFk).Add(fK_SklepDlugiZasob_ZasobId); + sklepDlugiZasobTable.ForeignKeyConstraints.Add(fK_SklepDlugiZasob_ZasobId); + dlugiZasobTable.ReferencingForeignKeyConstraints.Add(fK_SklepDlugiZasob_ZasobId); + var fK_SKLEPDOK_REF_OBROT_SKLEPKON = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_OBROT_SKLEPKON", sklepDokTable, sklepKontrTable, + new[] { sklepIdColumn9, sklepKontrIdColumn }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_OBROT_SKLEPKONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKLEPDOK_REF_OBROT_SKLEPKON.MappedForeignKeys.Add(fK_SKLEPDOK_REF_OBROT_SKLEPKONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_OBROT_SKLEPKONFk).Add(fK_SKLEPDOK_REF_OBROT_SKLEPKON); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_OBROT_SKLEPKON); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_OBROT_SKLEPKON); + var fK_SKLEPDOK_REF_OBROT_SKLEPPLAT = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_OBROT_SKLEPPLAT", sklepDokTable, sklepKontrTable, + new[] { sklepIdColumn9, sklepPlatnikIdColumn }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_OBROT_SKLEPPLATFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepPlatnikId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKLEPDOK_REF_OBROT_SKLEPPLAT.MappedForeignKeys.Add(fK_SKLEPDOK_REF_OBROT_SKLEPPLATFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_OBROT_SKLEPPLATFk).Add(fK_SKLEPDOK_REF_OBROT_SKLEPPLAT); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_OBROT_SKLEPPLAT); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_OBROT_SKLEPPLAT); + var fK_SKLEPDOK_REF_SKDOK_DOK = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDOK_DOK", sklepDokTable, dokTable, + new[] { dokIdColumn21 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDOK_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_SKLEPDOK_REF_SKDOK_DOK.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDOK_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDOK_DOKFk).Add(fK_SKLEPDOK_REF_SKDOK_DOK); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_DOK); + var fK_SKLEPDOK_REF_SKDOK_SKLEPKAS = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDOK_SKLEPKAS", sklepDokTable, sklepKasaTable, + new[] { sklepIdColumn9, sklepKasaIdColumn }, + sklepKasaTable.FindUniqueConstraint("PK_SKLEPKASA")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDOK_SKLEPKASFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepKasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + new[] { "SklepId", "SklepKasaId" }); + fK_SKLEPDOK_REF_SKDOK_SKLEPKAS.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPKASFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDOK_SKLEPKASFk).Add(fK_SKLEPDOK_REF_SKDOK_SKLEPKAS); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPKAS); + sklepKasaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPKAS); + var fK_SKLEPDOK_REF_SKDOK_SKLEPMAG = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDOK_SKLEPMAG", sklepDokTable, sklepMagazynTable, + new[] { sklepIdColumn9, sklepMagIdColumn }, + sklepMagazynTable.FindUniqueConstraint("PK_SKLEPMAGAZYN")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDOK_SKLEPMAGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepMagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + new[] { "SklepId", "SklepMagId" }); + fK_SKLEPDOK_REF_SKDOK_SKLEPMAG.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPMAGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDOK_SKLEPMAGFk).Add(fK_SKLEPDOK_REF_SKDOK_SKLEPMAG); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPMAG); + sklepMagazynTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPMAG); + var fK_SKLEPDOK_REF_SKDOK_SKLEPUZY = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDOK_SKLEPUZY", sklepDokTable, sklepUzytkownikTable, + new[] { sklepIdColumn9, sklepUzIdColumn }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDOK_SKLEPUZYFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SKLEPDOK_REF_SKDOK_SKLEPUZY.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPUZYFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDOK_SKLEPUZYFk).Add(fK_SKLEPDOK_REF_SKDOK_SKLEPUZY); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPUZY); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPUZY); + var fK_SKLEPDOK_REF_SKDWP_SKLEPWAL = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDWP_SKLEPWAL", sklepDokTable, sklepWalutaTable, + new[] { sklepIdColumn9, sklepWalIdColumn }, + sklepWalutaTable.FindUniqueConstraint("PK_SK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDWP_SKLEPWALFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepWalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + fK_SKLEPDOK_REF_SKDWP_SKLEPWAL.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDWP_SKLEPWALFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDWP_SKLEPWALFk).Add(fK_SKLEPDOK_REF_SKDWP_SKLEPWAL); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDWP_SKLEPWAL); + sklepWalutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDWP_SKLEPWAL); + var fK_SKLEPDOK_REF_SKLEP_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKLEP_SKLEP", sklepDokTable, sklepTable, + new[] { sklepIdColumn9 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKLEP_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPDOK_REF_SKLEP_SKLEP.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKLEP_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKLEP_SKLEPFk).Add(fK_SKLEPDOK_REF_SKLEP_SKLEP); + sklepDokTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKLEP_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKLEP_SKLEP); + var fK_SKLEPDOK_REF_SKDDK_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDDK_SKLEPDOK", sklepDokDodKthTable, sklepDokTable, + new[] { sklepIdColumn10, sklepDokIdColumn0 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDDK_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPDOK_REF_SKDDK_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDDK_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDDK_SKLEPDOKFk).Add(fK_SKLEPDOK_REF_SKDDK_SKLEPDOK); + sklepDokDodKthTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDDK_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDDK_SKLEPDOK); + var fK_SKLEPDOK_REF_SKDKD_SKLEPKON = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDKD_SKLEPKON", sklepDokDodKthTable, sklepKontrTable, + new[] { sklepIdColumn10, sklepKontrIdColumn0 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDKD_SKLEPKONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKLEPDOK_REF_SKDKD_SKLEPKON.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDKD_SKLEPKONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDKD_SKLEPKONFk).Add(fK_SKLEPDOK_REF_SKDKD_SKLEPKON); + sklepDokDodKthTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDKD_SKLEPKON); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDKD_SKLEPKON); + var fK_SKLDOKKURS_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLDOKKURS_SKLEPDOK", sklepDokKursTable, sklepDokTable, + new[] { sklepIdColumn11, sklepDokIdColumn1 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLDOKKURS_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLDOKKURS_SKLEPDOK.MappedForeignKeys.Add(fK_SKLDOKKURS_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLDOKKURS_SKLEPDOKFk).Add(fK_SKLDOKKURS_SKLEPDOK); + sklepDokKursTable.ForeignKeyConstraints.Add(fK_SKLDOKKURS_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLDOKKURS_SKLEPDOK); + var fK_SKLDOKKURS_WAL = new ForeignKeyConstraint( + "FK_SKLDOKKURS_WAL", sklepDokKursTable, sklepWalutaTable, + new[] { sklepIdColumn11, sklepWalIdColumn0 }, + sklepWalutaTable.FindUniqueConstraint("PK_SK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLDOKKURS_WALFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs", + new[] { "SklepId", "SklepWalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + fK_SKLDOKKURS_WAL.MappedForeignKeys.Add(fK_SKLDOKKURS_WALFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLDOKKURS_WALFk).Add(fK_SKLDOKKURS_WAL); + sklepDokKursTable.ForeignKeyConstraints.Add(fK_SKLDOKKURS_WAL); + sklepWalutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLDOKKURS_WAL); + var fK_SKLEPDOK_REF_SKDOK_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDOK_SKLEPDOK", sklepDokPunktyTable, sklepDokTable, + new[] { sklepIdColumn12, sklepDokIdColumn2 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDOK_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokPunkty", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPDOK_REF_SKDOK_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDOK_SKLEPDOKFk).Add(fK_SKLEPDOK_REF_SKDOK_SKLEPDOK); + sklepDokPunktyTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDOK_SKLEPDOK); + var fK_SKLEPDOK_REF_SKDWZ_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKDWZ_SKLEPDOK", sklepDokWalutaTable, sklepDokTable, + new[] { sklepIdColumn13, sklepDokIdColumn3 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKDWZ_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPDOK_REF_SKDWZ_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKDWZ_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKDWZ_SKLEPDOKFk).Add(fK_SKLEPDOK_REF_SKDWZ_SKLEPDOK); + sklepDokWalutaTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDWZ_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKDWZ_SKLEPDOK); + var fK_SKLEPDOK_REF_SKWD_SKLEPWAL = new ForeignKeyConstraint( + "FK_SKLEPDOK_REF_SKWD_SKLEPWAL", sklepDokWalutaTable, sklepWalutaTable, + new[] { sklepIdColumn13, sklepWalIdColumn1 }, + sklepWalutaTable.FindUniqueConstraint("PK_SK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLEPDOK_REF_SKWD_SKLEPWALFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta", + new[] { "SklepId", "SklepWalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + fK_SKLEPDOK_REF_SKWD_SKLEPWAL.MappedForeignKeys.Add(fK_SKLEPDOK_REF_SKWD_SKLEPWALFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOK_REF_SKWD_SKLEPWALFk).Add(fK_SKLEPDOK_REF_SKWD_SKLEPWAL); + sklepDokWalutaTable.ForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKWD_SKLEPWAL); + sklepWalutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOK_REF_SKWD_SKLEPWAL); + var fK_SKLEPDOS_REF_DOSTS_SKLEPKON = new ForeignKeyConstraint( + "FK_SKLEPDOS_REF_DOSTS_SKLEPKON", sklepDostTable, sklepKontrTable, + new[] { sklepIdColumn14, sklepKontrIdColumn1 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKLEPDOS_REF_DOSTS_SKLEPKONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDost", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKLEPDOS_REF_DOSTS_SKLEPKON.MappedForeignKeys.Add(fK_SKLEPDOS_REF_DOSTS_SKLEPKONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOS_REF_DOSTS_SKLEPKONFk).Add(fK_SKLEPDOS_REF_DOSTS_SKLEPKON); + sklepDostTable.ForeignKeyConstraints.Add(fK_SKLEPDOS_REF_DOSTS_SKLEPKON); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOS_REF_DOSTS_SKLEPKON); + var fK_SKLEPDOS_REF_SKLEP_SKLEPTOW = new ForeignKeyConstraint( + "FK_SKLEPDOS_REF_SKLEP_SKLEPTOW", sklepDostTable, sklepTowarTable, + new[] { sklepIdColumn14, sklepTowIdColumn }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPDOS_REF_SKLEP_SKLEPTOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDost", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPDOS_REF_SKLEP_SKLEPTOW.MappedForeignKeys.Add(fK_SKLEPDOS_REF_SKLEP_SKLEPTOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPDOS_REF_SKLEP_SKLEPTOWFk).Add(fK_SKLEPDOS_REF_SKLEP_SKLEPTOW); + sklepDostTable.ForeignKeyConstraints.Add(fK_SKLEPDOS_REF_SKLEP_SKLEPTOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPDOS_REF_SKLEP_SKLEPTOW); + var ref_SkDzienRozl = new ForeignKeyConstraint( + "Ref_SkDzienRozl", sklepDzienRozlTable, sklepTable, + new[] { sklepIdColumn15 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var ref_SkDzienRozlFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + ref_SkDzienRozl.MappedForeignKeys.Add(ref_SkDzienRozlFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkDzienRozlFk).Add(ref_SkDzienRozl); + sklepDzienRozlTable.ForeignKeyConstraints.Add(ref_SkDzienRozl); + sklepTable.ReferencingForeignKeyConstraints.Add(ref_SkDzienRozl); + var ref_SkDzienRozlPar = new ForeignKeyConstraint( + "Ref_SkDzienRozlPar", sklepDzienRozlParamTable, sklepDzienRozlTable, + new[] { sklepIdColumn16, dzienColumn5 }, + sklepDzienRozlTable.FindUniqueConstraint("PK_SKLEPDZIENROZL")!, ReferentialAction.NoAction); + var ref_SkDzienRozlParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozlParam", + new[] { "SklepId", "Dzien" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", + new[] { "SklepId", "Dzien" }); + ref_SkDzienRozlPar.MappedForeignKeys.Add(ref_SkDzienRozlParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkDzienRozlParFk).Add(ref_SkDzienRozlPar); + sklepDzienRozlParamTable.ForeignKeyConstraints.Add(ref_SkDzienRozlPar); + sklepDzienRozlTable.ReferencingForeignKeyConstraints.Add(ref_SkDzienRozlPar); + var fK_SklepEmail_TED = new ForeignKeyConstraint( + "FK_SklepEmail_TED", sklepEmailTable, sklepTrescEmailTable, + new[] { sklepIdColumn17, sklepTEDIdColumn }, + sklepTrescEmailTable.FindUniqueConstraint("PK_SklepTrescEmail")!, ReferentialAction.NoAction); + var fK_SklepEmail_TEDFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepTEDId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + new[] { "SklepId", "SklepTEId" }); + fK_SklepEmail_TED.MappedForeignKeys.Add(fK_SklepEmail_TEDFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepEmail_TEDFk).Add(fK_SklepEmail_TED); + sklepEmailTable.ForeignKeyConstraints.Add(fK_SklepEmail_TED); + sklepTrescEmailTable.ReferencingForeignKeyConstraints.Add(fK_SklepEmail_TED); + var fK_SklepEmail_TER = new ForeignKeyConstraint( + "FK_SklepEmail_TER", sklepEmailTable, sklepTrescEmailTable, + new[] { sklepIdColumn17, sklepTERIdColumn }, + sklepTrescEmailTable.FindUniqueConstraint("PK_SklepTrescEmail")!, ReferentialAction.NoAction); + var fK_SklepEmail_TERFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepTERId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + new[] { "SklepId", "SklepTEId" }); + fK_SklepEmail_TER.MappedForeignKeys.Add(fK_SklepEmail_TERFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepEmail_TERFk).Add(fK_SklepEmail_TER); + sklepEmailTable.ForeignKeyConstraints.Add(fK_SklepEmail_TER); + sklepTrescEmailTable.ReferencingForeignKeyConstraints.Add(fK_SklepEmail_TER); + var fK_SklepEmail_TEW = new ForeignKeyConstraint( + "FK_SklepEmail_TEW", sklepEmailTable, sklepTrescEmailTable, + new[] { sklepIdColumn17, sklepTEWIdColumn }, + sklepTrescEmailTable.FindUniqueConstraint("PK_SklepTrescEmail")!, ReferentialAction.NoAction); + var fK_SklepEmail_TEWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepTEWId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + new[] { "SklepId", "SklepTEId" }); + fK_SklepEmail_TEW.MappedForeignKeys.Add(fK_SklepEmail_TEWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepEmail_TEWFk).Add(fK_SklepEmail_TEW); + sklepEmailTable.ForeignKeyConstraints.Add(fK_SklepEmail_TEW); + sklepTrescEmailTable.ReferencingForeignKeyConstraints.Add(fK_SklepEmail_TEW); + var fK_SklepEmail_Uz = new ForeignKeyConstraint( + "FK_SklepEmail_Uz", sklepEmailTable, sklepUzytkownikTable, + new[] { sklepIdColumn17, sklepUzIdColumn0 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SklepEmail_UzFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SklepEmail_Uz.MappedForeignKeys.Add(fK_SklepEmail_UzFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepEmail_UzFk).Add(fK_SklepEmail_Uz); + sklepEmailTable.ForeignKeyConstraints.Add(fK_SklepEmail_Uz); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SklepEmail_Uz); + var fK_SKLEPFLA_REF_SKLEP_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPFLA_REF_SKLEP_SKLEP", sklepFlagiTable, sklepTable, + new[] { sklepIdColumn18 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPFLA_REF_SKLEP_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPFLA_REF_SKLEP_SKLEP.MappedForeignKeys.Add(fK_SKLEPFLA_REF_SKLEP_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPFLA_REF_SKLEP_SKLEPFk).Add(fK_SKLEPFLA_REF_SKLEP_SKLEP); + sklepFlagiTable.ForeignKeyConstraints.Add(fK_SKLEPFLA_REF_SKLEP_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPFLA_REF_SKLEP_SKLEP); + var fK_SKLEPFLA_REF_SKLEP_TOWAR = new ForeignKeyConstraint( + "FK_SKLEPFLA_REF_SKLEP_TOWAR", sklepFlagiTable, towarTable, + new[] { towIdColumn19 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPFLA_REF_SKLEP_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_SKLEPFLA_REF_SKLEP_TOWAR.MappedForeignKeys.Add(fK_SKLEPFLA_REF_SKLEP_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPFLA_REF_SKLEP_TOWARFk).Add(fK_SKLEPFLA_REF_SKLEP_TOWAR); + sklepFlagiTable.ForeignKeyConstraints.Add(fK_SKLEPFLA_REF_SKLEP_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPFLA_REF_SKLEP_TOWAR); + var fK_SKFPP7_SKLEP = new ForeignKeyConstraint( + "FK_SKFPP7_SKLEP", sklepFormaPlatnPos7Table, sklepTable, + new[] { sklepIdColumn20 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKFPP7_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormaPlatnPos7", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKFPP7_SKLEP.MappedForeignKeys.Add(fK_SKFPP7_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKFPP7_SKLEPFk).Add(fK_SKFPP7_SKLEP); + sklepFormaPlatnPos7Table.ForeignKeyConstraints.Add(fK_SKFPP7_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKFPP7_SKLEP); + var fK_SKFMZG_SKTYPOS = new ForeignKeyConstraint( + "FK_SKFMZG_SKTYPOS", sklepFormZgodTable, sklepTypOsTable, + new[] { sklepIdColumn19, sklepTypOsIdColumn }, + sklepTypOsTable.FindUniqueConstraint("PK_SKLEPTYPOS")!, ReferentialAction.NoAction); + var fK_SKFMZG_SKTYPOSFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod", + new[] { "SklepId", "SklepTypOsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + new[] { "SklepId", "SklepTypOsId" }); + fK_SKFMZG_SKTYPOS.MappedForeignKeys.Add(fK_SKFMZG_SKTYPOSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKFMZG_SKTYPOSFk).Add(fK_SKFMZG_SKTYPOS); + sklepFormZgodTable.ForeignKeyConstraints.Add(fK_SKFMZG_SKTYPOS); + sklepTypOsTable.ReferencingForeignKeyConstraints.Add(fK_SKFMZG_SKTYPOS); + var fK_SKFMZG_SKZGODA = new ForeignKeyConstraint( + "FK_SKFMZG_SKZGODA", sklepFormZgodTable, sklepZgodaTable, + new[] { sklepIdColumn19, sklepZgIdColumn }, + sklepZgodaTable.FindUniqueConstraint("PK_SKLEPZGODA")!, ReferentialAction.NoAction); + var fK_SKFMZG_SKZGODAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod", + new[] { "SklepId", "SklepZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + new[] { "SklepId", "SklepZgId" }); + fK_SKFMZG_SKZGODA.MappedForeignKeys.Add(fK_SKFMZG_SKZGODAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKFMZG_SKZGODAFk).Add(fK_SKFMZG_SKZGODA); + sklepFormZgodTable.ForeignKeyConstraints.Add(fK_SKFMZG_SKZGODA); + sklepZgodaTable.ReferencingForeignKeyConstraints.Add(fK_SKFMZG_SKZGODA); + var ref_SkGrAkc = new ForeignKeyConstraint( + "Ref_SkGrAkc", sklepGrupaAkcyzowaTable, sklepTable, + new[] { sklepIdColumn21 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var ref_SkGrAkcFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + ref_SkGrAkc.MappedForeignKeys.Add(ref_SkGrAkcFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkGrAkcFk).Add(ref_SkGrAkc); + sklepGrupaAkcyzowaTable.ForeignKeyConstraints.Add(ref_SkGrAkc); + sklepTable.ReferencingForeignKeyConstraints.Add(ref_SkGrAkc); + var fK_SKLEPGRU_REF_SKGRR_SKLEPUZY = new ForeignKeyConstraint( + "FK_SKLEPGRU_REF_SKGRR_SKLEPUZY", sklepGrupaUzTable, sklepUzytkownikTable, + new[] { sklepIdColumn23, sklepRolaIdColumn }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKLEPGRU_REF_SKGRR_SKLEPUZYFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz", + new[] { "SklepId", "SklepRolaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SKLEPGRU_REF_SKGRR_SKLEPUZY.MappedForeignKeys.Add(fK_SKLEPGRU_REF_SKGRR_SKLEPUZYFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPGRU_REF_SKGRR_SKLEPUZYFk).Add(fK_SKLEPGRU_REF_SKGRR_SKLEPUZY); + sklepGrupaUzTable.ForeignKeyConstraints.Add(fK_SKLEPGRU_REF_SKGRR_SKLEPUZY); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPGRU_REF_SKGRR_SKLEPUZY); + var fK_SKLEPGRU_REF_SKGRU_SKLEPUZY = new ForeignKeyConstraint( + "FK_SKLEPGRU_REF_SKGRU_SKLEPUZY", sklepGrupaUzTable, sklepUzytkownikTable, + new[] { sklepIdColumn23, sklepUzIdColumn1 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKLEPGRU_REF_SKGRU_SKLEPUZYFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SKLEPGRU_REF_SKGRU_SKLEPUZY.MappedForeignKeys.Add(fK_SKLEPGRU_REF_SKGRU_SKLEPUZYFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPGRU_REF_SKGRU_SKLEPUZYFk).Add(fK_SKLEPGRU_REF_SKGRU_SKLEPUZY); + sklepGrupaUzTable.ForeignKeyConstraints.Add(fK_SKLEPGRU_REF_SKGRU_SKLEPUZY); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPGRU_REF_SKGRU_SKLEPUZY); + var fK_SKLEPIST_REF_SKMAG_SKLEPMAG = new ForeignKeyConstraint( + "FK_SKLEPIST_REF_SKMAG_SKLEPMAG", sklepIstwTable, sklepMagazynTable, + new[] { sklepIdColumn24, sklepMagIdColumn0 }, + sklepMagazynTable.FindUniqueConstraint("PK_SKLEPMAGAZYN")!, ReferentialAction.NoAction); + var fK_SKLEPIST_REF_SKMAG_SKLEPMAGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepIstw", + new[] { "SklepId", "SklepMagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + new[] { "SklepId", "SklepMagId" }); + fK_SKLEPIST_REF_SKMAG_SKLEPMAG.MappedForeignKeys.Add(fK_SKLEPIST_REF_SKMAG_SKLEPMAGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPIST_REF_SKMAG_SKLEPMAGFk).Add(fK_SKLEPIST_REF_SKMAG_SKLEPMAG); + sklepIstwTable.ForeignKeyConstraints.Add(fK_SKLEPIST_REF_SKMAG_SKLEPMAG); + sklepMagazynTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPIST_REF_SKMAG_SKLEPMAG); + var fK_SKLEPIST_REF_SKTOW_SKLEPTOW = new ForeignKeyConstraint( + "FK_SKLEPIST_REF_SKTOW_SKLEPTOW", sklepIstwTable, sklepTowarTable, + new[] { sklepIdColumn24, sklepTowIdColumn0 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPIST_REF_SKTOW_SKLEPTOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepIstw", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPIST_REF_SKTOW_SKLEPTOW.MappedForeignKeys.Add(fK_SKLEPIST_REF_SKTOW_SKLEPTOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPIST_REF_SKTOW_SKLEPTOWFk).Add(fK_SKLEPIST_REF_SKTOW_SKLEPTOW); + sklepIstwTable.ForeignKeyConstraints.Add(fK_SKLEPIST_REF_SKTOW_SKLEPTOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPIST_REF_SKTOW_SKLEPTOW); + var ref_SKartaKonto = new ForeignKeyConstraint( + "Ref_SKartaKonto", sklepKartaLojTable, sklepKontoLojTable, + new[] { sklepIdColumn25, sklepKontoIdColumn }, + sklepKontoLojTable.FindUniqueConstraint("PK_SKLEPKONTOLOJ")!, ReferentialAction.NoAction); + var ref_SKartaKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", + new[] { "SklepId", "SklepKontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + new[] { "SklepId", "SklepKontoId" }); + ref_SKartaKonto.MappedForeignKeys.Add(ref_SKartaKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SKartaKontoFk).Add(ref_SKartaKonto); + sklepKartaLojTable.ForeignKeyConstraints.Add(ref_SKartaKonto); + sklepKontoLojTable.ReferencingForeignKeyConstraints.Add(ref_SKartaKonto); + var ref_SKrtLoj_Sklep = new ForeignKeyConstraint( + "Ref_SKrtLoj_Sklep", sklepKartaLojTable, sklepTable, + new[] { sklepIdColumn25 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var ref_SKrtLoj_SklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + ref_SKrtLoj_Sklep.MappedForeignKeys.Add(ref_SKrtLoj_SklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SKrtLoj_SklepFk).Add(ref_SKrtLoj_Sklep); + sklepKartaLojTable.ForeignKeyConstraints.Add(ref_SKrtLoj_Sklep); + sklepTable.ReferencingForeignKeyConstraints.Add(ref_SKrtLoj_Sklep); + var fK_SKLEPKAS_REF_SKKAS_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPKAS_REF_SKKAS_SKLEP", sklepKasaTable, sklepTable, + new[] { sklepIdColumn26 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPKAS_REF_SKKAS_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPKAS_REF_SKKAS_SKLEP.MappedForeignKeys.Add(fK_SKLEPKAS_REF_SKKAS_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKAS_REF_SKKAS_SKLEPFk).Add(fK_SKLEPKAS_REF_SKKAS_SKLEP); + sklepKasaTable.ForeignKeyConstraints.Add(fK_SKLEPKAS_REF_SKKAS_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKAS_REF_SKKAS_SKLEP); + var fK_SKLEPKAS_REF_SKMAG_SKLEPMAG = new ForeignKeyConstraint( + "FK_SKLEPKAS_REF_SKMAG_SKLEPMAG", sklepKasaTable, sklepMagazynTable, + new[] { sklepIdColumn26, sklepMagIdColumn1 }, + sklepMagazynTable.FindUniqueConstraint("PK_SKLEPMAGAZYN")!, ReferentialAction.NoAction); + var fK_SKLEPKAS_REF_SKMAG_SKLEPMAGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + new[] { "SklepId", "SklepMagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + new[] { "SklepId", "SklepMagId" }); + fK_SKLEPKAS_REF_SKMAG_SKLEPMAG.MappedForeignKeys.Add(fK_SKLEPKAS_REF_SKMAG_SKLEPMAGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKAS_REF_SKMAG_SKLEPMAGFk).Add(fK_SKLEPKAS_REF_SKMAG_SKLEPMAG); + sklepKasaTable.ForeignKeyConstraints.Add(fK_SKLEPKAS_REF_SKMAG_SKLEPMAG); + sklepMagazynTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKAS_REF_SKMAG_SKLEPMAG); + var fK_SKKASAFORMAPLATN_SKFPP7 = new ForeignKeyConstraint( + "FK_SKKASAFORMAPLATN_SKFPP7", sklepKasaFormaPlatnTable, sklepFormaPlatnPos7Table, + new[] { sklepIdColumn27, sklepFormaIdColumn0 }, + sklepFormaPlatnPos7Table.FindUniqueConstraint("PK_SklepFormaPlatnPos7")!, ReferentialAction.NoAction); + var fK_SKKASAFORMAPLATN_SKFPP7Fk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn", + new[] { "SklepId", "SklepFormaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormaPlatnPos7", + new[] { "SklepId", "SklepFormaId" }); + fK_SKKASAFORMAPLATN_SKFPP7.MappedForeignKeys.Add(fK_SKKASAFORMAPLATN_SKFPP7Fk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKKASAFORMAPLATN_SKFPP7Fk).Add(fK_SKKASAFORMAPLATN_SKFPP7); + sklepKasaFormaPlatnTable.ForeignKeyConstraints.Add(fK_SKKASAFORMAPLATN_SKFPP7); + sklepFormaPlatnPos7Table.ReferencingForeignKeyConstraints.Add(fK_SKKASAFORMAPLATN_SKFPP7); + var fK_SKKASAFORMAPLATN_SKKASA = new ForeignKeyConstraint( + "FK_SKKASAFORMAPLATN_SKKASA", sklepKasaFormaPlatnTable, sklepKasaTable, + new[] { sklepIdColumn27, sklepKasaIdColumn1 }, + sklepKasaTable.FindUniqueConstraint("PK_SKLEPKASA")!, ReferentialAction.NoAction); + var fK_SKKASAFORMAPLATN_SKKASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn", + new[] { "SklepId", "SklepKasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + new[] { "SklepId", "SklepKasaId" }); + fK_SKKASAFORMAPLATN_SKKASA.MappedForeignKeys.Add(fK_SKKASAFORMAPLATN_SKKASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKKASAFORMAPLATN_SKKASAFk).Add(fK_SKKASAFORMAPLATN_SKKASA); + sklepKasaFormaPlatnTable.ForeignKeyConstraints.Add(fK_SKKASAFORMAPLATN_SKKASA); + sklepKasaTable.ReferencingForeignKeyConstraints.Add(fK_SKKASAFORMAPLATN_SKKASA); + var fK_SKLEPKONTOBANK_SKLEPBANK = new ForeignKeyConstraint( + "FK_SKLEPKONTOBANK_SKLEPBANK", sklepKontoBankoweTable, sklepBankTable, + new[] { sklepIdColumn28, sklepBankIdColumn0 }, + sklepBankTable.FindUniqueConstraint("PK_SklepBank")!, ReferentialAction.NoAction); + var fK_SKLEPKONTOBANK_SKLEPBANKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", + new[] { "SklepId", "SklepBankId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepBank", + new[] { "SklepId", "SklepBankId" }); + fK_SKLEPKONTOBANK_SKLEPBANK.MappedForeignKeys.Add(fK_SKLEPKONTOBANK_SKLEPBANKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKONTOBANK_SKLEPBANKFk).Add(fK_SKLEPKONTOBANK_SKLEPBANK); + sklepKontoBankoweTable.ForeignKeyConstraints.Add(fK_SKLEPKONTOBANK_SKLEPBANK); + sklepBankTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKONTOBANK_SKLEPBANK); + var fK_SKLEPKONTOBANK_SKLEPWALUTA = new ForeignKeyConstraint( + "FK_SKLEPKONTOBANK_SKLEPWALUTA", sklepKontoBankoweTable, sklepWalutaTable, + new[] { sklepIdColumn28, sklepWalIdColumn2 }, + sklepWalutaTable.FindUniqueConstraint("PK_SK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLEPKONTOBANK_SKLEPWALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", + new[] { "SklepId", "SklepWalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + fK_SKLEPKONTOBANK_SKLEPWALUTA.MappedForeignKeys.Add(fK_SKLEPKONTOBANK_SKLEPWALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKONTOBANK_SKLEPWALUTAFk).Add(fK_SKLEPKONTOBANK_SKLEPWALUTA); + sklepKontoBankoweTable.ForeignKeyConstraints.Add(fK_SKLEPKONTOBANK_SKLEPWALUTA); + sklepWalutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKONTOBANK_SKLEPWALUTA); + var fK_SKLEPKONTOBANKKONTR_SKLEPBANK = new ForeignKeyConstraint( + "FK_SKLEPKONTOBANKKONTR_SKLEPBANK", sklepKontoBankoweKontrTable, sklepBankTable, + new[] { sklepIdColumn29, sklepBankIdColumn1 }, + sklepBankTable.FindUniqueConstraint("PK_SklepBank")!, ReferentialAction.NoAction); + var fK_SKLEPKONTOBANKKONTR_SKLEPBANKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + new[] { "SklepId", "SklepBankId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepBank", + new[] { "SklepId", "SklepBankId" }); + fK_SKLEPKONTOBANKKONTR_SKLEPBANK.MappedForeignKeys.Add(fK_SKLEPKONTOBANKKONTR_SKLEPBANKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKONTOBANKKONTR_SKLEPBANKFk).Add(fK_SKLEPKONTOBANKKONTR_SKLEPBANK); + sklepKontoBankoweKontrTable.ForeignKeyConstraints.Add(fK_SKLEPKONTOBANKKONTR_SKLEPBANK); + sklepBankTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKONTOBANKKONTR_SKLEPBANK); + var fK_SKLEPKONTOBANKKONTR_SKLEPKONTR = new ForeignKeyConstraint( + "FK_SKLEPKONTOBANKKONTR_SKLEPKONTR", sklepKontoBankoweKontrTable, sklepKontrTable, + new[] { sklepIdColumn29, sklepKontrIdColumn2 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKLEPKONTOBANKKONTR_SKLEPKONTRFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKLEPKONTOBANKKONTR_SKLEPKONTR.MappedForeignKeys.Add(fK_SKLEPKONTOBANKKONTR_SKLEPKONTRFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKONTOBANKKONTR_SKLEPKONTRFk).Add(fK_SKLEPKONTOBANKKONTR_SKLEPKONTR); + sklepKontoBankoweKontrTable.ForeignKeyConstraints.Add(fK_SKLEPKONTOBANKKONTR_SKLEPKONTR); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKONTOBANKKONTR_SKLEPKONTR); + var fK_SKLEPKONTOBANKKONTR_SKLEPWALUTA = new ForeignKeyConstraint( + "FK_SKLEPKONTOBANKKONTR_SKLEPWALUTA", sklepKontoBankoweKontrTable, sklepWalutaTable, + new[] { sklepIdColumn29, sklepWalIdColumn3 }, + sklepWalutaTable.FindUniqueConstraint("PK_SK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLEPKONTOBANKKONTR_SKLEPWALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + new[] { "SklepId", "SklepWalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + fK_SKLEPKONTOBANKKONTR_SKLEPWALUTA.MappedForeignKeys.Add(fK_SKLEPKONTOBANKKONTR_SKLEPWALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKONTOBANKKONTR_SKLEPWALUTAFk).Add(fK_SKLEPKONTOBANKKONTR_SKLEPWALUTA); + sklepKontoBankoweKontrTable.ForeignKeyConstraints.Add(fK_SKLEPKONTOBANKKONTR_SKLEPWALUTA); + sklepWalutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKONTOBANKKONTR_SKLEPWALUTA); + var ref_SKLoj_KLoj = new ForeignKeyConstraint( + "Ref_SKLoj_KLoj", sklepKontoLojTable, kontoLojTable, + new[] { kontoIdColumn3 }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_SKLoj_KLojFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + new[] { "KontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_SKLoj_KLoj.MappedForeignKeys.Add(ref_SKLoj_KLojFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SKLoj_KLojFk).Add(ref_SKLoj_KLoj); + sklepKontoLojTable.ForeignKeyConstraints.Add(ref_SKLoj_KLoj); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_SKLoj_KLoj); + var ref_SKLoj_SKth = new ForeignKeyConstraint( + "Ref_SKLoj_SKth", sklepKontoLojTable, sklepKontrTable, + new[] { sklepIdColumn30, sklepKontrIdColumn3 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var ref_SKLoj_SKthFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + ref_SKLoj_SKth.MappedForeignKeys.Add(ref_SKLoj_SKthFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SKLoj_SKthFk).Add(ref_SKLoj_SKth); + sklepKontoLojTable.ForeignKeyConstraints.Add(ref_SKLoj_SKth); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(ref_SKLoj_SKth); + var ref_SKntLoj_Sklep = new ForeignKeyConstraint( + "Ref_SKntLoj_Sklep", sklepKontoLojTable, sklepTable, + new[] { sklepIdColumn30 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var ref_SKntLoj_SklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + ref_SKntLoj_Sklep.MappedForeignKeys.Add(ref_SKntLoj_SklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SKntLoj_SklepFk).Add(ref_SKntLoj_Sklep); + sklepKontoLojTable.ForeignKeyConstraints.Add(ref_SKntLoj_Sklep); + sklepTable.ReferencingForeignKeyConstraints.Add(ref_SKntLoj_Sklep); + var fK_SKLEPKON_REF_KTHSK_KONTRAHE = new ForeignKeyConstraint( + "FK_SKLEPKON_REF_KTHSK_KONTRAHE", sklepKontrTable, kontrahentTable, + new[] { kontrIdColumn18 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_SKLEPKON_REF_KTHSK_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_SKLEPKON_REF_KTHSK_KONTRAHE.MappedForeignKeys.Add(fK_SKLEPKON_REF_KTHSK_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKON_REF_KTHSK_KONTRAHEFk).Add(fK_SKLEPKON_REF_KTHSK_KONTRAHE); + sklepKontrTable.ForeignKeyConstraints.Add(fK_SKLEPKON_REF_KTHSK_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKON_REF_KTHSK_KONTRAHE); + var fK_SKLEPKON_REF_SKLEP_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPKON_REF_SKLEP_SKLEP", sklepKontrTable, sklepTable, + new[] { sklepIdColumn31 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPKON_REF_SKLEP_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPKON_REF_SKLEP_SKLEP.MappedForeignKeys.Add(fK_SKLEPKON_REF_SKLEP_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKON_REF_SKLEP_SKLEPFk).Add(fK_SKLEPKON_REF_SKLEP_SKLEP); + sklepKontrTable.ForeignKeyConstraints.Add(fK_SKLEPKON_REF_SKLEP_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKON_REF_SKLEP_SKLEP); + var fK_SKLEPKON_REF_SKKTH_SKLEPKON = new ForeignKeyConstraint( + "FK_SKLEPKON_REF_SKKTH_SKLEPKON", sklepKontrOpisTable, sklepKontrTable, + new[] { sklepIdColumn32, sklepKontrIdColumn5 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKLEPKON_REF_SKKTH_SKLEPKONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontrOpis", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKLEPKON_REF_SKKTH_SKLEPKON.MappedForeignKeys.Add(fK_SKLEPKON_REF_SKKTH_SKLEPKONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKON_REF_SKKTH_SKLEPKONFk).Add(fK_SKLEPKON_REF_SKKTH_SKLEPKON); + sklepKontrOpisTable.ForeignKeyConstraints.Add(fK_SKLEPKON_REF_SKKTH_SKLEPKON); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKON_REF_SKKTH_SKLEPKON); + var fK_SklKontrSklKontr = new ForeignKeyConstraint( + "FK_SklKontrSklKontr", sklepKontrSklepTable, kontrahentTable, + new[] { sklepIdColumn33 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_SklKontrSklKontrFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontrSklep", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_SklKontrSklKontr.MappedForeignKeys.Add(fK_SklKontrSklKontrFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklKontrSklKontrFk).Add(fK_SklKontrSklKontr); + sklepKontrSklepTable.ForeignKeyConstraints.Add(fK_SklKontrSklKontr); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_SklKontrSklKontr); + var fK_SKLEPKTH_REF_SKKTH_KTHPARWA = new ForeignKeyConstraint( + "FK_SKLEPKTH_REF_SKKTH_KTHPARWA", sklepKthPrzydzialTable, kthParWartoscTable, + new[] { kPWIdColumn1 }, + kthParWartoscTable.FindUniqueConstraint("PK_KTHPARWARTOSC")!, ReferentialAction.NoAction); + var fK_SKLEPKTH_REF_SKKTH_KTHPARWAFk = RelationalModel.GetForeignKey(this, + "SklepKthPrzydzial", + new[] { "KPWId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KthParWartosc", + new[] { "KPWId" }); + fK_SKLEPKTH_REF_SKKTH_KTHPARWA.MappedForeignKeys.Add(fK_SKLEPKTH_REF_SKKTH_KTHPARWAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKTH_REF_SKKTH_KTHPARWAFk).Add(fK_SKLEPKTH_REF_SKKTH_KTHPARWA); + sklepKthPrzydzialTable.ForeignKeyConstraints.Add(fK_SKLEPKTH_REF_SKKTH_KTHPARWA); + kthParWartoscTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKTH_REF_SKKTH_KTHPARWA); + var fK_SKLEPKTH_REF_SKKTH_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPKTH_REF_SKKTH_SKLEP", sklepKthPrzydzialTable, sklepTable, + new[] { sklepIdColumn114 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPKTH_REF_SKKTH_SKLEPFk = RelationalModel.GetForeignKey(this, + "SklepKthPrzydzial", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPKTH_REF_SKKTH_SKLEP.MappedForeignKeys.Add(fK_SKLEPKTH_REF_SKKTH_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPKTH_REF_SKKTH_SKLEPFk).Add(fK_SKLEPKTH_REF_SKKTH_SKLEP); + sklepKthPrzydzialTable.ForeignKeyConstraints.Add(fK_SKLEPKTH_REF_SKKTH_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPKTH_REF_SKKTH_SKLEP); + var fK_SKKTHTYPOS_SKKTH = new ForeignKeyConstraint( + "FK_SKKTHTYPOS_SKKTH", sklepKthTypOsTable, sklepKontrTable, + new[] { sklepIdColumn34, sklepKontrIdColumn7 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKKTHTYPOS_SKKTHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKKTHTYPOS_SKKTH.MappedForeignKeys.Add(fK_SKKTHTYPOS_SKKTHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKKTHTYPOS_SKKTHFk).Add(fK_SKKTHTYPOS_SKKTH); + sklepKthTypOsTable.ForeignKeyConstraints.Add(fK_SKKTHTYPOS_SKKTH); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKKTHTYPOS_SKKTH); + var fK_SKKTHTYPOS_SKTYPOS = new ForeignKeyConstraint( + "FK_SKKTHTYPOS_SKTYPOS", sklepKthTypOsTable, sklepTypOsTable, + new[] { sklepIdColumn34, sklepTypOsIdColumn0 }, + sklepTypOsTable.FindUniqueConstraint("PK_SKLEPTYPOS")!, ReferentialAction.NoAction); + var fK_SKKTHTYPOS_SKTYPOSFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs", + new[] { "SklepId", "SklepTypOsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + new[] { "SklepId", "SklepTypOsId" }); + fK_SKKTHTYPOS_SKTYPOS.MappedForeignKeys.Add(fK_SKKTHTYPOS_SKTYPOSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKKTHTYPOS_SKTYPOSFk).Add(fK_SKKTHTYPOS_SKTYPOS); + sklepKthTypOsTable.ForeignKeyConstraints.Add(fK_SKKTHTYPOS_SKTYPOS); + sklepTypOsTable.ReferencingForeignKeyConstraints.Add(fK_SKKTHTYPOS_SKTYPOS); + var fK_SKLEPMAG_REF_SKMAG_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPMAG_REF_SKMAG_SKLEP", sklepMagazynTable, sklepTable, + new[] { sklepIdColumn35 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPMAG_REF_SKMAG_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPMAG_REF_SKMAG_SKLEP.MappedForeignKeys.Add(fK_SKLEPMAG_REF_SKMAG_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPMAG_REF_SKMAG_SKLEPFk).Add(fK_SKLEPMAG_REF_SKMAG_SKLEP); + sklepMagazynTable.ForeignKeyConstraints.Add(fK_SKLEPMAG_REF_SKMAG_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPMAG_REF_SKMAG_SKLEP); + var fK_SKLEPNAR_REF_SKLEP_KONTRAHE = new ForeignKeyConstraint( + "FK_SKLEPNAR_REF_SKLEP_KONTRAHE", sklepNarzDostTable, kontrahentTable, + new[] { kontrIdColumn25 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_SKLEPNAR_REF_SKLEP_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "SklepNarzDost", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_SKLEPNAR_REF_SKLEP_KONTRAHE.MappedForeignKeys.Add(fK_SKLEPNAR_REF_SKLEP_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPNAR_REF_SKLEP_KONTRAHEFk).Add(fK_SKLEPNAR_REF_SKLEP_KONTRAHE); + sklepNarzDostTable.ForeignKeyConstraints.Add(fK_SKLEPNAR_REF_SKLEP_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPNAR_REF_SKLEP_KONTRAHE); + var fK_SKLEPNAR_REF_SKLEP_SKLEPFLA = new ForeignKeyConstraint( + "FK_SKLEPNAR_REF_SKLEP_SKLEPFLA", sklepNarzDostTable, sklepFlagiTable, + new[] { sklepIdColumn115, towIdColumn37 }, + sklepFlagiTable.FindUniqueConstraint("PK_SKLEPFLAGI")!, ReferentialAction.NoAction); + var fK_SKLEPNAR_REF_SKLEP_SKLEPFLAFk = RelationalModel.GetForeignKey(this, + "SklepNarzDost", + new[] { "SklepId", "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + new[] { "SklepId", "TowId" }); + fK_SKLEPNAR_REF_SKLEP_SKLEPFLA.MappedForeignKeys.Add(fK_SKLEPNAR_REF_SKLEP_SKLEPFLAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPNAR_REF_SKLEP_SKLEPFLAFk).Add(fK_SKLEPNAR_REF_SKLEP_SKLEPFLA); + sklepNarzDostTable.ForeignKeyConstraints.Add(fK_SKLEPNAR_REF_SKLEP_SKLEPFLA); + sklepFlagiTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPNAR_REF_SKLEP_SKLEPFLA); + var fK_SKLEPNOT_REF_SKNOT_SKLEPTOW = new ForeignKeyConstraint( + "FK_SKLEPNOT_REF_SKNOT_SKLEPTOW", sklepNotatkiTable, sklepTowarTable, + new[] { sklepIdColumn36, sklepTowIdColumn1 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPNOT_REF_SKNOT_SKLEPTOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNotatki", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPNOT_REF_SKNOT_SKLEPTOW.MappedForeignKeys.Add(fK_SKLEPNOT_REF_SKNOT_SKLEPTOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPNOT_REF_SKNOT_SKLEPTOWFk).Add(fK_SKLEPNOT_REF_SKNOT_SKLEPTOW); + sklepNotatkiTable.ForeignKeyConstraints.Add(fK_SKLEPNOT_REF_SKNOT_SKLEPTOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPNOT_REF_SKNOT_SKLEPTOW); + var ref_SkNrRejKth = new ForeignKeyConstraint( + "Ref_SkNrRejKth", sklepNrRejTable, sklepKontrTable, + new[] { sklepIdColumn37, sklepKontrIdColumn8 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var ref_SkNrRejKthFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + ref_SkNrRejKth.MappedForeignKeys.Add(ref_SkNrRejKthFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkNrRejKthFk).Add(ref_SkNrRejKth); + sklepNrRejTable.ForeignKeyConstraints.Add(ref_SkNrRejKth); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(ref_SkNrRejKth); + var ref_SkKartaNrRej = new ForeignKeyConstraint( + "Ref_SkKartaNrRej", sklepNrRejKartaTable, sklepKartaLojTable, + new[] { sklepIdColumn38, sklepKartaIdColumn0 }, + sklepKartaLojTable.FindUniqueConstraint("PK_SKLEPKARTALOJ")!, ReferentialAction.NoAction); + var ref_SkKartaNrRejFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta", + new[] { "SklepId", "SklepKartaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", + new[] { "SklepId", "SklepKartaId" }); + ref_SkKartaNrRej.MappedForeignKeys.Add(ref_SkKartaNrRejFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkKartaNrRejFk).Add(ref_SkKartaNrRej); + sklepNrRejKartaTable.ForeignKeyConstraints.Add(ref_SkKartaNrRej); + sklepKartaLojTable.ReferencingForeignKeyConstraints.Add(ref_SkKartaNrRej); + var ref_SkNrRejKarta = new ForeignKeyConstraint( + "Ref_SkNrRejKarta", sklepNrRejKartaTable, sklepNrRejTable, + new[] { sklepIdColumn38, sklepKontrIdColumn9, nrFormatColumn1 }, + sklepNrRejTable.FindUniqueConstraint("PK_SKLEPNRREJ")!, ReferentialAction.NoAction); + var ref_SkNrRejKartaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta", + new[] { "SklepId", "SklepKontrId", "NrFormat" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej", + new[] { "SklepId", "SklepKontrId", "NrFormat" }); + ref_SkNrRejKarta.MappedForeignKeys.Add(ref_SkNrRejKartaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkNrRejKartaFk).Add(ref_SkNrRejKarta); + sklepNrRejKartaTable.ForeignKeyConstraints.Add(ref_SkNrRejKarta); + sklepNrRejTable.ReferencingForeignKeyConstraints.Add(ref_SkNrRejKarta); + var fK_SKOPLATA_SKLEP = new ForeignKeyConstraint( + "FK_SKOPLATA_SKLEP", sklepOplataTable, sklepTable, + new[] { sklepIdColumn39 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKOPLATA_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepOplata", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKOPLATA_SKLEP.MappedForeignKeys.Add(fK_SKOPLATA_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKOPLATA_SKLEPFk).Add(fK_SKOPLATA_SKLEP); + sklepOplataTable.ForeignKeyConstraints.Add(fK_SKOPLATA_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKOPLATA_SKLEP); + var fK_SKLEPPANEL_REFERENCE_PANEL = new ForeignKeyConstraint( + "FK_SKLEPPANEL_REFERENCE_PANEL", sklepPanelTable, panelTable, + new[] { panelIdColumn1 }, + panelTable.FindUniqueConstraint("PK_PANEL")!, ReferentialAction.NoAction); + var fK_SKLEPPANEL_REFERENCE_PANELFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", + new[] { "PanelId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Panel", + new[] { "PanelId" }); + fK_SKLEPPANEL_REFERENCE_PANEL.MappedForeignKeys.Add(fK_SKLEPPANEL_REFERENCE_PANELFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPANEL_REFERENCE_PANELFk).Add(fK_SKLEPPANEL_REFERENCE_PANEL); + sklepPanelTable.ForeignKeyConstraints.Add(fK_SKLEPPANEL_REFERENCE_PANEL); + panelTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPANEL_REFERENCE_PANEL); + var fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK = new ForeignKeyConstraint( + "FK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK", sklepPanelTable, sklepUzytkownikTable, + new[] { sklepIdColumn40, sklepUzIdColumn2 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK.MappedForeignKeys.Add(fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIKFk).Add(fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK); + sklepPanelTable.ForeignKeyConstraints.Add(fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK); + var fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL = new ForeignKeyConstraint( + "FK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL", sklepPanelParamTable, sklepPanelTable, + new[] { sklepIdColumn41, sklepPanelIdColumn0 }, + sklepPanelTable.FindUniqueConstraint("PK_SKLEP_PANEL")!, ReferentialAction.NoAction); + var fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANELFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanelParam", + new[] { "SklepId", "SklepPanelId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", + new[] { "SklepId", "SklepPanelId" }); + fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL.MappedForeignKeys.Add(fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANELFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANELFk).Add(fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL); + sklepPanelParamTable.ForeignKeyConstraints.Add(fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL); + sklepPanelTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL); + var fK_SKLEPPAR_REF_SKLEP_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKLEP_SKLEP", sklepParagonTable, sklepTable, + new[] { sklepIdColumn45 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKLEP_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPPAR_REF_SKLEP_SKLEP.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKLEP_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKLEP_SKLEPFk).Add(fK_SKLEPPAR_REF_SKLEP_SKLEP); + sklepParagonTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKLEP_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKLEP_SKLEP); + var fK_SKLEPPAR_REF_SKPAR_SKLEPKAS = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKPAR_SKLEPKAS", sklepParagonTable, sklepKasaTable, + new[] { sklepIdColumn45, sklepKasaIdColumn2 }, + sklepKasaTable.FindUniqueConstraint("PK_SKLEPKASA")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKPAR_SKLEPKASFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepKasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + new[] { "SklepId", "SklepKasaId" }); + fK_SKLEPPAR_REF_SKPAR_SKLEPKAS.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPKASFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKPAR_SKLEPKASFk).Add(fK_SKLEPPAR_REF_SKPAR_SKLEPKAS); + sklepParagonTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPKAS); + sklepKasaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPKAS); + var fK_SKLEPPAR_REF_SKPAR_SKLEPWAL = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKPAR_SKLEPWAL", sklepParagonTable, sklepWalutaTable, + new[] { sklepIdColumn45, sklepWalIdColumn5 }, + sklepWalutaTable.FindUniqueConstraint("PK_SK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKPAR_SKLEPWALFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepWalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + fK_SKLEPPAR_REF_SKPAR_SKLEPWAL.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPWALFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKPAR_SKLEPWALFk).Add(fK_SKLEPPAR_REF_SKPAR_SKLEPWAL); + sklepParagonTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPWAL); + sklepWalutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPWAL); + var fK_SKLEPPAR_REF_SKPB_SKLEPPAR = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKPB_SKLEPPAR", sklepParBonTable, sklepParagonTable, + new[] { sklepIdColumn42, sklepParIdColumn }, + sklepParagonTable.FindUniqueConstraint("PK_SKLEPPARAGON")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKPB_SKLEPPARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParBon", + new[] { "SklepId", "SklepParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepParId" }); + fK_SKLEPPAR_REF_SKPB_SKLEPPAR.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKPB_SKLEPPARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKPB_SKLEPPARFk).Add(fK_SKLEPPAR_REF_SKPB_SKLEPPAR); + sklepParBonTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPB_SKLEPPAR); + sklepParagonTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPB_SKLEPPAR); + var fK_SKLEPPAR_REF_SKPAR_SKLEPPAR = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKPAR_SKLEPPAR", sklepParPunktyTable, sklepParagonTable, + new[] { sklepIdColumn43, sklepParIdColumn0 }, + sklepParagonTable.FindUniqueConstraint("PK_SKLEPPARAGON")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKPAR_SKLEPPARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParPunkty", + new[] { "SklepId", "SklepParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepParId" }); + fK_SKLEPPAR_REF_SKPAR_SKLEPPAR.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPPARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKPAR_SKLEPPARFk).Add(fK_SKLEPPAR_REF_SKPAR_SKLEPPAR); + sklepParPunktyTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPPAR); + sklepParagonTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPAR_SKLEPPAR); + var fK_SKLEPPAR_REF_SKPRT_SKLEPPOZ = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKPRT_SKLEPPOZ", sklepPartiaTable, sklepPozDokTable, + new[] { sklepIdColumn46, sklepDokIdColumn4, kolejnoscColumn35 }, + sklepPozDokTable.FindUniqueConstraint("PK_SKLEPPOZDOK")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKPRT_SKLEPPOZFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + fK_SKLEPPAR_REF_SKPRT_SKLEPPOZ.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKPRT_SKLEPPOZFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKPRT_SKLEPPOZFk).Add(fK_SKLEPPAR_REF_SKPRT_SKLEPPOZ); + sklepPartiaTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPRT_SKLEPPOZ); + sklepPozDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPRT_SKLEPPOZ); + var fK_SKLEPPAR_REF_SKPRT_SKLEPTOW = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKPRT_SKLEPTOW", sklepPartiaTable, sklepTowarTable, + new[] { sklepIdColumn46, sklepTowIdColumn2 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKPRT_SKLEPTOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPPAR_REF_SKPRT_SKLEPTOW.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKPRT_SKLEPTOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKPRT_SKLEPTOWFk).Add(fK_SKLEPPAR_REF_SKPRT_SKLEPTOW); + sklepPartiaTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPRT_SKLEPTOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPRT_SKLEPTOW); + var fK_SKLEPPAR_REF_SKPWZ_SKLEPPAR = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKPWZ_SKLEPPAR", sklepParWalutaTable, sklepParagonTable, + new[] { sklepIdColumn44, sklepParIdColumn1 }, + sklepParagonTable.FindUniqueConstraint("PK_SKLEPPARAGON")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKPWZ_SKLEPPARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta", + new[] { "SklepId", "SklepParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepParId" }); + fK_SKLEPPAR_REF_SKPWZ_SKLEPPAR.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKPWZ_SKLEPPARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKPWZ_SKLEPPARFk).Add(fK_SKLEPPAR_REF_SKPWZ_SKLEPPAR); + sklepParWalutaTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPWZ_SKLEPPAR); + sklepParagonTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKPWZ_SKLEPPAR); + var fK_SKLEPPAR_REF_SKWAL_SKLEPWAL = new ForeignKeyConstraint( + "FK_SKLEPPAR_REF_SKWAL_SKLEPWAL", sklepParWalutaTable, sklepWalutaTable, + new[] { sklepIdColumn44, sklepWalIdColumn4 }, + sklepWalutaTable.FindUniqueConstraint("PK_SK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLEPPAR_REF_SKWAL_SKLEPWALFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta", + new[] { "SklepId", "SklepWalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId", "SklepWalId" }); + fK_SKLEPPAR_REF_SKWAL_SKLEPWAL.MappedForeignKeys.Add(fK_SKLEPPAR_REF_SKWAL_SKLEPWALFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPAR_REF_SKWAL_SKLEPWALFk).Add(fK_SKLEPPAR_REF_SKWAL_SKLEPWAL); + sklepParWalutaTable.ForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKWAL_SKLEPWAL); + sklepWalutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPAR_REF_SKWAL_SKLEPWAL); + var fK_SklPowProm_SklGrupaPromocji = new ForeignKeyConstraint( + "FK_SklPowProm_SklGrupaPromocji", sklepPowiazaniePromTable, sklepGrupaPromocjiTable, + new[] { sklepIdColumn48, sklepGrupaIdColumn0 }, + sklepGrupaPromocjiTable.FindUniqueConstraint("PK_SklepGrupaPromocji")!, ReferentialAction.NoAction); + var fK_SklPowProm_SklGrupaPromocjiFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieProm", + new[] { "SklepId", "SklepGrupaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaPromocji", + new[] { "SklepId", "SklepGrupaId" }); + fK_SklPowProm_SklGrupaPromocji.MappedForeignKeys.Add(fK_SklPowProm_SklGrupaPromocjiFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklPowProm_SklGrupaPromocjiFk).Add(fK_SklPowProm_SklGrupaPromocji); + sklepPowiazaniePromTable.ForeignKeyConstraints.Add(fK_SklPowProm_SklGrupaPromocji); + sklepGrupaPromocjiTable.ReferencingForeignKeyConstraints.Add(fK_SklPowProm_SklGrupaPromocji); + var fK_SKLEPPOW_REF_SKPOW_SKLEPUZY = new ForeignKeyConstraint( + "FK_SKLEPPOW_REF_SKPOW_SKLEPUZY", sklepPowiazanieUzTable, sklepUzytkownikTable, + new[] { sklepIdColumn49, sklepUzIdColumn3 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKLEPPOW_REF_SKPOW_SKLEPUZYFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieUz", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SKLEPPOW_REF_SKPOW_SKLEPUZY.MappedForeignKeys.Add(fK_SKLEPPOW_REF_SKPOW_SKLEPUZYFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPOW_REF_SKPOW_SKLEPUZYFk).Add(fK_SKLEPPOW_REF_SKPOW_SKLEPUZY); + sklepPowiazanieUzTable.ForeignKeyConstraints.Add(fK_SKLEPPOW_REF_SKPOW_SKLEPUZY); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPOW_REF_SKPOW_SKLEPUZY); + var ref_SklepNoweKonto = new ForeignKeyConstraint( + "Ref_SklepNoweKonto", sklepPowKontLojTable, sklepKontoLojTable, + new[] { sklepIdColumn47, sklepNoweKontoIdColumn }, + sklepKontoLojTable.FindUniqueConstraint("PK_SKLEPKONTOLOJ")!, ReferentialAction.NoAction); + var ref_SklepNoweKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", + new[] { "SklepId", "SklepNoweKontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + new[] { "SklepId", "SklepKontoId" }); + ref_SklepNoweKonto.MappedForeignKeys.Add(ref_SklepNoweKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SklepNoweKontoFk).Add(ref_SklepNoweKonto); + sklepPowKontLojTable.ForeignKeyConstraints.Add(ref_SklepNoweKonto); + sklepKontoLojTable.ReferencingForeignKeyConstraints.Add(ref_SklepNoweKonto); + var ref_SklepStareKonto = new ForeignKeyConstraint( + "Ref_SklepStareKonto", sklepPowKontLojTable, sklepKontoLojTable, + new[] { sklepIdColumn47, sklepStareKontoIdColumn }, + sklepKontoLojTable.FindUniqueConstraint("PK_SKLEPKONTOLOJ")!, ReferentialAction.NoAction); + var ref_SklepStareKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", + new[] { "SklepId", "SklepStareKontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + new[] { "SklepId", "SklepKontoId" }); + ref_SklepStareKonto.MappedForeignKeys.Add(ref_SklepStareKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SklepStareKontoFk).Add(ref_SklepStareKonto); + sklepPowKontLojTable.ForeignKeyConstraints.Add(ref_SklepStareKonto); + sklepKontoLojTable.ReferencingForeignKeyConstraints.Add(ref_SklepStareKonto); + var ref_SkAkcPoz = new ForeignKeyConstraint( + "Ref_SkAkcPoz", sklepPozAkcyzaTable, sklepGrupaAkcyzowaTable, + new[] { sklepIdColumn50, sklepGrAkcIdColumn0 }, + sklepGrupaAkcyzowaTable.FindUniqueConstraint("PK_SKLEPGRUPAAKCYZOWA")!, ReferentialAction.NoAction); + var ref_SkAkcPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza", + new[] { "SklepId", "SklepGrAkcId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa", + new[] { "SklepId", "SklepGrAkcId" }); + ref_SkAkcPoz.MappedForeignKeys.Add(ref_SkAkcPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkAkcPozFk).Add(ref_SkAkcPoz); + sklepPozAkcyzaTable.ForeignKeyConstraints.Add(ref_SkAkcPoz); + sklepGrupaAkcyzowaTable.ReferencingForeignKeyConstraints.Add(ref_SkAkcPoz); + var ref_SkPozAkc = new ForeignKeyConstraint( + "Ref_SkPozAkc", sklepPozAkcyzaTable, sklepPozDokTable, + new[] { sklepIdColumn50, sklepDokIdColumn5, kolejnoscColumn36 }, + sklepPozDokTable.FindUniqueConstraint("PK_SKLEPPOZDOK")!, ReferentialAction.NoAction); + var ref_SkPozAkcFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + ref_SkPozAkc.MappedForeignKeys.Add(ref_SkPozAkcFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkPozAkcFk).Add(ref_SkPozAkc); + sklepPozAkcyzaTable.ForeignKeyConstraints.Add(ref_SkPozAkc); + sklepPozDokTable.ReferencingForeignKeyConstraints.Add(ref_SkPozAkc); + var fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK", sklepPozDokTable, sklepDokTable, + new[] { sklepIdColumn51, sklepDokIdColumn6 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOKFk).Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK); + sklepPozDokTable.ForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK); + var fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW = new ForeignKeyConstraint( + "FK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW", sklepPozDokTable, sklepTowarTable, + new[] { sklepIdColumn51, sklepTowIdColumn3 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW.MappedForeignKeys.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOWFk).Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW); + sklepPozDokTable.ForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW); + var fK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR = new ForeignKeyConstraint( + "FK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR", sklepPozParTable, sklepParagonTable, + new[] { sklepIdColumn52, sklepParIdColumn3 }, + sklepParagonTable.FindUniqueConstraint("PK_SKLEPPARAGON")!, ReferentialAction.NoAction); + var fK_SKLEPPOZ_REF_SKPOZ_SKLEPPARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + new[] { "SklepId", "SklepParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepParId" }); + fK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR.MappedForeignKeys.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPPARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPOZ_REF_SKPOZ_SKLEPPARFk).Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR); + sklepPozParTable.ForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR); + sklepParagonTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR); + var fK_SKLEPPOZ_REF_SKTOW_SKLEPTOW = new ForeignKeyConstraint( + "FK_SKLEPPOZ_REF_SKTOW_SKLEPTOW", sklepPozParTable, sklepTowarTable, + new[] { sklepIdColumn52, sklepTowIdColumn4 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPPOZ_REF_SKTOW_SKLEPTOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPPOZ_REF_SKTOW_SKLEPTOW.MappedForeignKeys.Add(fK_SKLEPPOZ_REF_SKTOW_SKLEPTOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPOZ_REF_SKTOW_SKLEPTOWFk).Add(fK_SKLEPPOZ_REF_SKTOW_SKLEPTOW); + sklepPozParTable.ForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKTOW_SKLEPTOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKTOW_SKLEPTOW); + var fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ = new ForeignKeyConstraint( + "FK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ", sklepPozParSzczegTable, sklepPozParTable, + new[] { sklepIdColumn53, sklepParIdColumn4, kolejnoscColumn39 }, + sklepPozParTable.FindUniqueConstraint("PK_SKLEPPOZPAR")!, ReferentialAction.NoAction); + var fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozParSzczeg", + new[] { "SklepId", "SklepParId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + new[] { "SklepId", "SklepParId", "Kolejnosc" }); + fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ.MappedForeignKeys.Add(fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZFk).Add(fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ); + sklepPozParSzczegTable.ForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ); + sklepPozParTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ); + var fK_SKLEPPROFIL_REFERENCE_PROFIL = new ForeignKeyConstraint( + "FK_SKLEPPROFIL_REFERENCE_PROFIL", sklepProfilTable, profilTable, + new[] { profilIdColumn2 }, + profilTable.FindUniqueConstraint("PK_PROFIL")!, ReferentialAction.NoAction); + var fK_SKLEPPROFIL_REFERENCE_PROFILFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", + new[] { "ProfilId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Profil", + new[] { "ProfilId" }); + fK_SKLEPPROFIL_REFERENCE_PROFIL.MappedForeignKeys.Add(fK_SKLEPPROFIL_REFERENCE_PROFILFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPROFIL_REFERENCE_PROFILFk).Add(fK_SKLEPPROFIL_REFERENCE_PROFIL); + sklepProfilTable.ForeignKeyConstraints.Add(fK_SKLEPPROFIL_REFERENCE_PROFIL); + profilTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPROFIL_REFERENCE_PROFIL); + var fK_SKLEPPROFIL_REFERENCE_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPPROFIL_REFERENCE_SKLEP", sklepProfilTable, sklepTable, + new[] { sklepIdColumn54 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPPROFIL_REFERENCE_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPPROFIL_REFERENCE_SKLEP.MappedForeignKeys.Add(fK_SKLEPPROFIL_REFERENCE_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPROFIL_REFERENCE_SKLEPFk).Add(fK_SKLEPPROFIL_REFERENCE_SKLEP); + sklepProfilTable.ForeignKeyConstraints.Add(fK_SKLEPPROFIL_REFERENCE_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPROFIL_REFERENCE_SKLEP); + var fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL = new ForeignKeyConstraint( + "FK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL", sklepProfilKonfigTable, sklepProfilTable, + new[] { sklepIdColumn55, sklepProfilIdColumn0 }, + sklepProfilTable.FindUniqueConstraint("PK_SKLEPPROFIL")!, ReferentialAction.NoAction); + var fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFILFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfilKonfig", + new[] { "SklepId", "SklepProfilId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", + new[] { "SklepId", "SklepProfilId" }); + fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL.MappedForeignKeys.Add(fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFILFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFILFk).Add(fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL); + sklepProfilKonfigTable.ForeignKeyConstraints.Add(fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL); + sklepProfilTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL); + var ref_SkPrtMagMagazyn = new ForeignKeyConstraint( + "Ref_SkPrtMagMagazyn", sklepPrtMagTable, sklepMagazynTable, + new[] { sklepIdColumn56, sklepMagIdColumn5 }, + sklepMagazynTable.FindUniqueConstraint("PK_SKLEPMAGAZYN")!, ReferentialAction.NoAction); + var ref_SkPrtMagMagazynFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + new[] { "SklepId", "SklepMagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + new[] { "SklepId", "SklepMagId" }); + ref_SkPrtMagMagazyn.MappedForeignKeys.Add(ref_SkPrtMagMagazynFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkPrtMagMagazynFk).Add(ref_SkPrtMagMagazyn); + sklepPrtMagTable.ForeignKeyConstraints.Add(ref_SkPrtMagMagazyn); + sklepMagazynTable.ReferencingForeignKeyConstraints.Add(ref_SkPrtMagMagazyn); + var ref_SkPrtMagTowar = new ForeignKeyConstraint( + "Ref_SkPrtMagTowar", sklepPrtMagTable, sklepTowarTable, + new[] { sklepIdColumn56, sklepTowIdColumn5 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var ref_SkPrtMagTowarFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + ref_SkPrtMagTowar.MappedForeignKeys.Add(ref_SkPrtMagTowarFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkPrtMagTowarFk).Add(ref_SkPrtMagTowar); + sklepPrtMagTable.ForeignKeyConstraints.Add(ref_SkPrtMagTowar); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(ref_SkPrtMagTowar); + var fK_SKLEPPRZ_REF_SKLEP_ASORT = new ForeignKeyConstraint( + "FK_SKLEPPRZ_REF_SKLEP_ASORT", sklepPrzydzialTable, asortTable, + new[] { asIdColumn4 }, + asortTable.FindUniqueConstraint("PK_ASORT")!, ReferentialAction.NoAction); + var fK_SKLEPPRZ_REF_SKLEP_ASORTFk = RelationalModel.GetForeignKey(this, + "SklepPrzydzial", + new[] { "AsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + new[] { "AsId" }); + fK_SKLEPPRZ_REF_SKLEP_ASORT.MappedForeignKeys.Add(fK_SKLEPPRZ_REF_SKLEP_ASORTFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPRZ_REF_SKLEP_ASORTFk).Add(fK_SKLEPPRZ_REF_SKLEP_ASORT); + sklepPrzydzialTable.ForeignKeyConstraints.Add(fK_SKLEPPRZ_REF_SKLEP_ASORT); + asortTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPRZ_REF_SKLEP_ASORT); + var fK_SKLEPPRZ_REF_SKLEP_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPPRZ_REF_SKLEP_SKLEP", sklepPrzydzialTable, sklepTable, + new[] { sklepIdColumn116 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPPRZ_REF_SKLEP_SKLEPFk = RelationalModel.GetForeignKey(this, + "SklepPrzydzial", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPPRZ_REF_SKLEP_SKLEP.MappedForeignKeys.Add(fK_SKLEPPRZ_REF_SKLEP_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPPRZ_REF_SKLEP_SKLEPFk).Add(fK_SKLEPPRZ_REF_SKLEP_SKLEP); + sklepPrzydzialTable.ForeignKeyConstraints.Add(fK_SKLEPPRZ_REF_SKLEP_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPPRZ_REF_SKLEP_SKLEP); + var fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP", sklepRapWartPoczTable, sklepTable, + new[] { sklepIdColumn57 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP.MappedForeignKeys.Add(fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEPFk).Add(fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP); + sklepRapWartPoczTable.ForeignKeyConstraints.Add(fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP); + var fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG = new ForeignKeyConstraint( + "FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG", sklepRapWartPoczDaneTable, sklepMagazynTable, + new[] { sklepIdColumn58, sklepMagIdColumn6 }, + sklepMagazynTable.FindUniqueConstraint("PK_SKLEPMAGAZYN")!, ReferentialAction.NoAction); + var fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane", + new[] { "SklepId", "SklepMagId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + new[] { "SklepId", "SklepMagId" }); + fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG.MappedForeignKeys.Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAGFk).Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG); + sklepRapWartPoczDaneTable.ForeignKeyConstraints.Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG); + sklepMagazynTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG); + var fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ = new ForeignKeyConstraint( + "FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ", sklepRapWartPoczDaneTable, sklepRapWartPoczTable, + new[] { sklepIdColumn58, sklepRWPIdColumn0 }, + sklepRapWartPoczTable.FindUniqueConstraint("PK_SKLEPRAPWARTPOCZ")!, ReferentialAction.NoAction); + var fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane", + new[] { "SklepId", "SklepRWPId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz", + new[] { "SklepId", "SklepRWPId" }); + fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ.MappedForeignKeys.Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZFk).Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ); + sklepRapWartPoczDaneTable.ForeignKeyConstraints.Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ); + sklepRapWartPoczTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ); + var fK_SKLEPREGULA_REFERENCE_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPREGULA_REFERENCE_SKLEP", sklepRegulaTable, sklepTable, + new[] { sklepIdColumn59 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPREGULA_REFERENCE_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPREGULA_REFERENCE_SKLEP.MappedForeignKeys.Add(fK_SKLEPREGULA_REFERENCE_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPREGULA_REFERENCE_SKLEPFk).Add(fK_SKLEPREGULA_REFERENCE_SKLEP); + sklepRegulaTable.ForeignKeyConstraints.Add(fK_SKLEPREGULA_REFERENCE_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPREGULA_REFERENCE_SKLEP); + var fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA = new ForeignKeyConstraint( + "FK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA", sklepRegulaAsortTable, sklepRegulaTable, + new[] { sklepIdColumn60, sklepRegulaIdColumn0 }, + sklepRegulaTable.FindUniqueConstraint("PK_SKLEPREGULA")!, ReferentialAction.NoAction); + var fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaAsort", + new[] { "SklepId", "SklepRegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + new[] { "SklepId", "SklepRegulaId" }); + fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA.MappedForeignKeys.Add(fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULAFk).Add(fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA); + sklepRegulaAsortTable.ForeignKeyConstraints.Add(fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA); + sklepRegulaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA); + var ref_SkRegDokDok = new ForeignKeyConstraint( + "Ref_SkRegDokDok", sklepRegulaDokTable, sklepDokTable, + new[] { sklepIdColumn61, sklepDokIdColumn7 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var ref_SkRegDokDokFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + ref_SkRegDokDok.MappedForeignKeys.Add(ref_SkRegDokDokFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegDokDokFk).Add(ref_SkRegDokDok); + sklepRegulaDokTable.ForeignKeyConstraints.Add(ref_SkRegDokDok); + sklepDokTable.ReferencingForeignKeyConstraints.Add(ref_SkRegDokDok); + var ref_SkRegDokKonto = new ForeignKeyConstraint( + "Ref_SkRegDokKonto", sklepRegulaDokTable, kontoLojTable, + new[] { kontoIdColumn4 }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_SkRegDokKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", + new[] { "KontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_SkRegDokKonto.MappedForeignKeys.Add(ref_SkRegDokKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegDokKontoFk).Add(ref_SkRegDokKonto); + sklepRegulaDokTable.ForeignKeyConstraints.Add(ref_SkRegDokKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_SkRegDokKonto); + var fK_SklRgDokSzczegSklRgDok = new ForeignKeyConstraint( + "FK_SklRgDokSzczegSklRgDok", sklepRegulaDokSzczegTable, sklepRegulaDokTable, + new[] { sklepIdColumn62, sklepDokIdColumn8, sklepRegulaIdColumn2, kolejnoscColumn41 }, + sklepRegulaDokTable.FindUniqueConstraint("PK_SKLEPREGULADOK")!, ReferentialAction.NoAction); + var fK_SklRgDokSzczegSklRgDokFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDokSzczeg", + new[] { "SklepId", "SklepDokId", "SklepRegulaId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", + new[] { "SklepId", "SklepDokId", "SklepRegulaId", "Kolejnosc" }); + fK_SklRgDokSzczegSklRgDok.MappedForeignKeys.Add(fK_SklRgDokSzczegSklRgDokFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklRgDokSzczegSklRgDokFk).Add(fK_SklRgDokSzczegSklRgDok); + sklepRegulaDokSzczegTable.ForeignKeyConstraints.Add(fK_SklRgDokSzczegSklRgDok); + sklepRegulaDokTable.ReferencingForeignKeyConstraints.Add(fK_SklRgDokSzczegSklRgDok); + var fK_SKL_REGULAKOD_REGULA = new ForeignKeyConstraint( + "FK_SKL_REGULAKOD_REGULA", sklepRegulaKodTable, sklepRegulaTable, + new[] { sklepIdColumn63, sklepRegulaIdColumn3 }, + sklepRegulaTable.FindUniqueConstraint("PK_SKLEPREGULA")!, ReferentialAction.NoAction); + var fK_SKL_REGULAKOD_REGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaKod", + new[] { "SklepId", "SklepRegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + new[] { "SklepId", "SklepRegulaId" }); + fK_SKL_REGULAKOD_REGULA.MappedForeignKeys.Add(fK_SKL_REGULAKOD_REGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKL_REGULAKOD_REGULAFk).Add(fK_SKL_REGULAKOD_REGULA); + sklepRegulaKodTable.ForeignKeyConstraints.Add(fK_SKL_REGULAKOD_REGULA); + sklepRegulaTable.ReferencingForeignKeyConstraints.Add(fK_SKL_REGULAKOD_REGULA); + var ref_SkRegParKonto = new ForeignKeyConstraint( + "Ref_SkRegParKonto", sklepRegulaParTable, kontoLojTable, + new[] { kontoIdColumn5 }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_SkRegParKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", + new[] { "KontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_SkRegParKonto.MappedForeignKeys.Add(ref_SkRegParKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegParKontoFk).Add(ref_SkRegParKonto); + sklepRegulaParTable.ForeignKeyConstraints.Add(ref_SkRegParKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_SkRegParKonto); + var ref_SkRegParPar = new ForeignKeyConstraint( + "Ref_SkRegParPar", sklepRegulaParTable, sklepParagonTable, + new[] { sklepIdColumn64, sklepParIdColumn5 }, + sklepParagonTable.FindUniqueConstraint("PK_SKLEPPARAGON")!, ReferentialAction.NoAction); + var ref_SkRegParParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", + new[] { "SklepId", "SklepParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + new[] { "SklepId", "SklepParId" }); + ref_SkRegParPar.MappedForeignKeys.Add(ref_SkRegParParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegParParFk).Add(ref_SkRegParPar); + sklepRegulaParTable.ForeignKeyConstraints.Add(ref_SkRegParPar); + sklepParagonTable.ReferencingForeignKeyConstraints.Add(ref_SkRegParPar); + var fK_SKLEPREGULAPA_REFERENCE_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPREGULAPA_REFERENCE_SKLEP", sklepRegulaParamTable, sklepTable, + new[] { sklepIdColumn66 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPREGULAPA_REFERENCE_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParam", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPREGULAPA_REFERENCE_SKLEP.MappedForeignKeys.Add(fK_SKLEPREGULAPA_REFERENCE_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPREGULAPA_REFERENCE_SKLEPFk).Add(fK_SKLEPREGULAPA_REFERENCE_SKLEP); + sklepRegulaParamTable.ForeignKeyConstraints.Add(fK_SKLEPREGULAPA_REFERENCE_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPREGULAPA_REFERENCE_SKLEP); + var fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA = new ForeignKeyConstraint( + "FK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA", sklepRegulaParamTable, sklepRegulaTable, + new[] { sklepIdColumn66, sklepRegulaIdColumn6 }, + sklepRegulaTable.FindUniqueConstraint("PK_SKLEPREGULA")!, ReferentialAction.NoAction); + var fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParam", + new[] { "SklepId", "SklepRegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + new[] { "SklepId", "SklepRegulaId" }); + fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA.MappedForeignKeys.Add(fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULAFk).Add(fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA); + sklepRegulaParamTable.ForeignKeyConstraints.Add(fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA); + sklepRegulaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA); + var fK_SklRgParSzczegSklRPar = new ForeignKeyConstraint( + "FK_SklRgParSzczegSklRPar", sklepRegulaParSzczegTable, sklepRegulaParTable, + new[] { sklepIdColumn65, sklepParIdColumn6, sklepRegulaIdColumn5, kolejnoscColumn43 }, + sklepRegulaParTable.FindUniqueConstraint("PK_SKLEPREGULAPAR")!, ReferentialAction.NoAction); + var fK_SklRgParSzczegSklRParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParSzczeg", + new[] { "SklepId", "SklepParId", "SklepRegulaId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", + new[] { "SklepId", "SklepParId", "SklepRegulaId", "Kolejnosc" }); + fK_SklRgParSzczegSklRPar.MappedForeignKeys.Add(fK_SklRgParSzczegSklRParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklRgParSzczegSklRParFk).Add(fK_SklRgParSzczegSklRPar); + sklepRegulaParSzczegTable.ForeignKeyConstraints.Add(fK_SklRgParSzczegSklRPar); + sklepRegulaParTable.ReferencingForeignKeyConstraints.Add(fK_SklRgParSzczegSklRPar); + var ref_SkRegPozPoz = new ForeignKeyConstraint( + "Ref_SkRegPozPoz", sklepRegulaPozDokTable, sklepPozDokTable, + new[] { sklepIdColumn67, sklepDokIdColumn9, kolejnoscColumn44 }, + sklepPozDokTable.FindUniqueConstraint("PK_SKLEPPOZDOK")!, ReferentialAction.NoAction); + var ref_SkRegPozPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + ref_SkRegPozPoz.MappedForeignKeys.Add(ref_SkRegPozPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegPozPozFk).Add(ref_SkRegPozPoz); + sklepRegulaPozDokTable.ForeignKeyConstraints.Add(ref_SkRegPozPoz); + sklepPozDokTable.ReferencingForeignKeyConstraints.Add(ref_SkRegPozPoz); + var ref_SkRegPozSzPoz = new ForeignKeyConstraint( + "Ref_SkRegPozSzPoz", sklepRegulaPozDokSzczegTable, sklepPozDokTable, + new[] { sklepIdColumn68, sklepDokIdColumn10, kolejnoscColumn45 }, + sklepPozDokTable.FindUniqueConstraint("PK_SKLEPPOZDOK")!, ReferentialAction.NoAction); + var ref_SkRegPozSzPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDokSzczeg", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + ref_SkRegPozSzPoz.MappedForeignKeys.Add(ref_SkRegPozSzPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegPozSzPozFk).Add(ref_SkRegPozSzPoz); + sklepRegulaPozDokSzczegTable.ForeignKeyConstraints.Add(ref_SkRegPozSzPoz); + sklepPozDokTable.ReferencingForeignKeyConstraints.Add(ref_SkRegPozSzPoz); + var ref_SkRegPozPar = new ForeignKeyConstraint( + "Ref_SkRegPozPar", sklepRegulaPozParTable, sklepPozParTable, + new[] { sklepIdColumn69, sklepParIdColumn7, kolejnoscColumn46 }, + sklepPozParTable.FindUniqueConstraint("PK_SKLEPPOZPAR")!, ReferentialAction.NoAction); + var ref_SkRegPozParFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozPar", + new[] { "SklepId", "SklepParId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + new[] { "SklepId", "SklepParId", "Kolejnosc" }); + ref_SkRegPozPar.MappedForeignKeys.Add(ref_SkRegPozParFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegPozParFk).Add(ref_SkRegPozPar); + sklepRegulaPozParTable.ForeignKeyConstraints.Add(ref_SkRegPozPar); + sklepPozParTable.ReferencingForeignKeyConstraints.Add(ref_SkRegPozPar); + var ref_SkRegPozPSzPoz = new ForeignKeyConstraint( + "Ref_SkRegPozPSzPoz", sklepRegulaPozParSzczegTable, sklepPozParTable, + new[] { sklepIdColumn70, sklepParIdColumn8, kolejnoscColumn47 }, + sklepPozParTable.FindUniqueConstraint("PK_SKLEPPOZPAR")!, ReferentialAction.NoAction); + var ref_SkRegPozPSzPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozParSzczeg", + new[] { "SklepId", "SklepParId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + new[] { "SklepId", "SklepParId", "Kolejnosc" }); + ref_SkRegPozPSzPoz.MappedForeignKeys.Add(ref_SkRegPozPSzPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRegPozPSzPozFk).Add(ref_SkRegPozPSzPoz); + sklepRegulaPozParSzczegTable.ForeignKeyConstraints.Add(ref_SkRegPozPSzPoz); + sklepPozParTable.ReferencingForeignKeyConstraints.Add(ref_SkRegPozPSzPoz); + var fK_SkRegulaTekst_SkRegula = new ForeignKeyConstraint( + "FK_SkRegulaTekst_SkRegula", sklepRegulaTekstTable, sklepRegulaTable, + new[] { sklepIdColumn71, sklepRegulaIdColumn11 }, + sklepRegulaTable.FindUniqueConstraint("PK_SKLEPREGULA")!, ReferentialAction.NoAction); + var fK_SkRegulaTekst_SkRegulaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTekst", + new[] { "SklepId", "SklepRegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + new[] { "SklepId", "SklepRegulaId" }); + fK_SkRegulaTekst_SkRegula.MappedForeignKeys.Add(fK_SkRegulaTekst_SkRegulaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SkRegulaTekst_SkRegulaFk).Add(fK_SkRegulaTekst_SkRegula); + sklepRegulaTekstTable.ForeignKeyConstraints.Add(fK_SkRegulaTekst_SkRegula); + sklepRegulaTable.ReferencingForeignKeyConstraints.Add(fK_SkRegulaTekst_SkRegula); + var fK_SKLEPREGULATO_REFERENCE_SKLEPREGULA = new ForeignKeyConstraint( + "FK_SKLEPREGULATO_REFERENCE_SKLEPREGULA", sklepRegulaTowarTable, sklepRegulaTable, + new[] { sklepIdColumn72, sklepRegulaIdColumn12 }, + sklepRegulaTable.FindUniqueConstraint("PK_SKLEPREGULA")!, ReferentialAction.NoAction); + var fK_SKLEPREGULATO_REFERENCE_SKLEPREGULAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar", + new[] { "SklepId", "SklepRegulaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + new[] { "SklepId", "SklepRegulaId" }); + fK_SKLEPREGULATO_REFERENCE_SKLEPREGULA.MappedForeignKeys.Add(fK_SKLEPREGULATO_REFERENCE_SKLEPREGULAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPREGULATO_REFERENCE_SKLEPREGULAFk).Add(fK_SKLEPREGULATO_REFERENCE_SKLEPREGULA); + sklepRegulaTowarTable.ForeignKeyConstraints.Add(fK_SKLEPREGULATO_REFERENCE_SKLEPREGULA); + sklepRegulaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPREGULATO_REFERENCE_SKLEPREGULA); + var fK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR = new ForeignKeyConstraint( + "FK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR", sklepRegulaTowarTable, sklepTowarTable, + new[] { sklepIdColumn72, sklepTowIdColumn6 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPREGULATO_REFERENCE_SKLEPTOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR.MappedForeignKeys.Add(fK_SKLEPREGULATO_REFERENCE_SKLEPTOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPREGULATO_REFERENCE_SKLEPTOWARFk).Add(fK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR); + sklepRegulaTowarTable.ForeignKeyConstraints.Add(fK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR); + var ref_SklepRolaRola = new ForeignKeyConstraint( + "Ref_SklepRolaRola", sklepRolaTable, rolaTable, + new[] { centrRolaIdColumn0 }, + rolaTable.FindUniqueConstraint("PK_ROLA")!, ReferentialAction.NoAction); + var ref_SklepRolaRolaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRola", + new[] { "CentrRolaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Rola", + new[] { "RolaId" }); + ref_SklepRolaRola.MappedForeignKeys.Add(ref_SklepRolaRolaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SklepRolaRolaFk).Add(ref_SklepRolaRola); + sklepRolaTable.ForeignKeyConstraints.Add(ref_SklepRolaRola); + rolaTable.ReferencingForeignKeyConstraints.Add(ref_SklepRolaRola); + var ref_SklepRolaSklep = new ForeignKeyConstraint( + "Ref_SklepRolaSklep", sklepRolaTable, sklepTable, + new[] { sklepIdColumn73 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var ref_SklepRolaSklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRola", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + ref_SklepRolaSklep.MappedForeignKeys.Add(ref_SklepRolaSklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SklepRolaSklepFk).Add(ref_SklepRolaSklep); + sklepRolaTable.ForeignKeyConstraints.Add(ref_SklepRolaSklep); + sklepTable.ReferencingForeignKeyConstraints.Add(ref_SklepRolaSklep); + var fK_SklRolaUprSklRola = new ForeignKeyConstraint( + "FK_SklRolaUprSklRola", sklepRolaUprawnienieTable, sklepRolaTable, + new[] { sklepIdColumn74, sklepRolaIdColumn1 }, + sklepRolaTable.FindUniqueConstraint("PK_SKLEPROLA")!, ReferentialAction.NoAction); + var fK_SklRolaUprSklRolaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRolaUprawnienie", + new[] { "SklepId", "SklepRolaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRola", + new[] { "SklepId", "SklepRolaId" }); + fK_SklRolaUprSklRola.MappedForeignKeys.Add(fK_SklRolaUprSklRolaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklRolaUprSklRolaFk).Add(fK_SklRolaUprSklRola); + sklepRolaUprawnienieTable.ForeignKeyConstraints.Add(fK_SklRolaUprSklRola); + sklepRolaTable.ReferencingForeignKeyConstraints.Add(fK_SklRolaUprSklRola); + var fK_SklepRozbDodDokDok = new ForeignKeyConstraint( + "FK_SklepRozbDodDokDok", sklepRozbicieDodDokTable, sklepDokTable, + new[] { sklepIdColumn76, sklepDokIdColumn12 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SklepRozbDodDokDokFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDodDok", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SklepRozbDodDokDok.MappedForeignKeys.Add(fK_SklepRozbDodDokDokFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepRozbDodDokDokFk).Add(fK_SklepRozbDodDokDok); + sklepRozbicieDodDokTable.ForeignKeyConstraints.Add(fK_SklepRozbDodDokDok); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SklepRozbDodDokDok); + var fK_SKLEPROZ_REF_SKLEP_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPROZ_REF_SKLEP_SKLEPDOK", sklepRozbicieDokTable, sklepDokTable, + new[] { sklepIdColumn77, sklepDokIdColumn13 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPROZ_REF_SKLEP_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDok", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPROZ_REF_SKLEP_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPROZ_REF_SKLEP_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPROZ_REF_SKLEP_SKLEPDOKFk).Add(fK_SKLEPROZ_REF_SKLEP_SKLEPDOK); + sklepRozbicieDokTable.ForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKLEP_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKLEP_SKLEPDOK); + var fK_SKLEPROZ_REF_SKKOG_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPROZ_REF_SKKOG_SKLEPDOK", sklepRozliczaTable, sklepDokTable, + new[] { rozliczanySklepIdColumn, rozliczanySklepDokIdColumn }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPROZ_REF_SKKOG_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza", + new[] { "RozliczanySklepId", "RozliczanySklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPROZ_REF_SKKOG_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPROZ_REF_SKKOG_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPROZ_REF_SKKOG_SKLEPDOKFk).Add(fK_SKLEPROZ_REF_SKKOG_SKLEPDOK); + sklepRozliczaTable.ForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKKOG_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKKOG_SKLEPDOK); + var fK_SKLEPROZ_REF_SKKTO_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPROZ_REF_SKKTO_SKLEPDOK", sklepRozliczaTable, sklepDokTable, + new[] { sklepIdColumn79, sklepDokIdColumn14 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPROZ_REF_SKKTO_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPROZ_REF_SKKTO_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPROZ_REF_SKKTO_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPROZ_REF_SKKTO_SKLEPDOKFk).Add(fK_SKLEPROZ_REF_SKKTO_SKLEPDOK); + sklepRozliczaTable.ForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKKTO_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKKTO_SKLEPDOK); + var fK_SKLEPROZ_REF_SKPRT_SKLEPPAR = new ForeignKeyConstraint( + "FK_SKLEPROZ_REF_SKPRT_SKLEPPAR", sklepRozlPartiiTable, sklepPartiaTable, + new[] { sklepIdColumn78, prtSklepDokIdColumn, prtKolejnoscColumn0 }, + sklepPartiaTable.FindUniqueConstraint("PK_SKLEPPARTIA")!, ReferentialAction.NoAction); + var fK_SKLEPROZ_REF_SKPRT_SKLEPPARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii", + new[] { "SklepId", "PrtSklepDokId", "PrtKolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + fK_SKLEPROZ_REF_SKPRT_SKLEPPAR.MappedForeignKeys.Add(fK_SKLEPROZ_REF_SKPRT_SKLEPPARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPROZ_REF_SKPRT_SKLEPPARFk).Add(fK_SKLEPROZ_REF_SKPRT_SKLEPPAR); + sklepRozlPartiiTable.ForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKPRT_SKLEPPAR); + sklepPartiaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKPRT_SKLEPPAR); + var fK_SKLEPROZ_REF_SKROZ_SKLEPPOZ = new ForeignKeyConstraint( + "FK_SKLEPROZ_REF_SKROZ_SKLEPPOZ", sklepRozlPartiiTable, sklepPozDokTable, + new[] { sklepIdColumn78, rozSklepDokIdColumn, rozKolejnoscColumn0 }, + sklepPozDokTable.FindUniqueConstraint("PK_SKLEPPOZDOK")!, ReferentialAction.NoAction); + var fK_SKLEPROZ_REF_SKROZ_SKLEPPOZFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii", + new[] { "SklepId", "RozSklepDokId", "RozKolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + fK_SKLEPROZ_REF_SKROZ_SKLEPPOZ.MappedForeignKeys.Add(fK_SKLEPROZ_REF_SKROZ_SKLEPPOZFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPROZ_REF_SKROZ_SKLEPPOZFk).Add(fK_SKLEPROZ_REF_SKROZ_SKLEPPOZ); + sklepRozlPartiiTable.ForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKROZ_SKLEPPOZ); + sklepPozDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPROZ_REF_SKROZ_SKLEPPOZ); + var ref_SkRozPrtMagPoz = new ForeignKeyConstraint( + "Ref_SkRozPrtMagPoz", sklepRozPrtMagTable, sklepPozDokTable, + new[] { sklepIdColumn75, sklepDokIdColumn11, kolejnoscColumn48 }, + sklepPozDokTable.FindUniqueConstraint("PK_SKLEPPOZDOK")!, ReferentialAction.NoAction); + var ref_SkRozPrtMagPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + ref_SkRozPrtMagPoz.MappedForeignKeys.Add(ref_SkRozPrtMagPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRozPrtMagPozFk).Add(ref_SkRozPrtMagPoz); + sklepRozPrtMagTable.ForeignKeyConstraints.Add(ref_SkRozPrtMagPoz); + sklepPozDokTable.ReferencingForeignKeyConstraints.Add(ref_SkRozPrtMagPoz); + var ref_SkRozPrtMagPrt = new ForeignKeyConstraint( + "Ref_SkRozPrtMagPrt", sklepRozPrtMagTable, sklepPrtMagTable, + new[] { sklepIdColumn75, sklepTowIdColumn7, pMIdColumn2 }, + sklepPrtMagTable.FindUniqueConstraint("PK_SKLEPPRTMAG")!, ReferentialAction.NoAction); + var ref_SkRozPrtMagPrtFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag", + new[] { "SklepId", "SklepTowId", "PMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + new[] { "SklepId", "SklepTowId", "PMId" }); + ref_SkRozPrtMagPrt.MappedForeignKeys.Add(ref_SkRozPrtMagPrtFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkRozPrtMagPrtFk).Add(ref_SkRozPrtMagPrt); + sklepRozPrtMagTable.ForeignKeyConstraints.Add(ref_SkRozPrtMagPrt); + sklepPrtMagTable.ReferencingForeignKeyConstraints.Add(ref_SkRozPrtMagPrt); + var fK_SKSKLDEFKODUDEFDOKU = new ForeignKeyConstraint( + "FK_SKSKLDEFKODUDEFDOKU", sklepSkladnikDefinicjiKoduTable, sklepDefinicjaKoduTable, + new[] { sklepIdColumn80, sklepDKIdColumn0 }, + sklepDefinicjaKoduTable.FindUniqueConstraint("PK_SKDEFKODU")!, ReferentialAction.NoAction); + var fK_SKSKLDEFKODUDEFDOKUFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikDefinicjiKodu", + new[] { "SklepId", "SklepDKId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDefinicjaKodu", + new[] { "SklepId", "SklepDKId" }); + fK_SKSKLDEFKODUDEFDOKU.MappedForeignKeys.Add(fK_SKSKLDEFKODUDEFDOKUFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKSKLDEFKODUDEFDOKUFk).Add(fK_SKSKLDEFKODUDEFDOKU); + sklepSkladnikDefinicjiKoduTable.ForeignKeyConstraints.Add(fK_SKSKLDEFKODUDEFDOKU); + sklepDefinicjaKoduTable.ReferencingForeignKeyConstraints.Add(fK_SKSKLDEFKODUDEFDOKU); + var fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR = new ForeignKeyConstraint( + "FK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR", sklepSkladnikWzorcaTable, sklepTowarTable, + new[] { sklepIdColumn81, sklepTowIdWzorcaColumn }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", + new[] { "SklepId", "SklepTowIdWzorca" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR.MappedForeignKeys.Add(fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWARFk).Add(fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR); + sklepSkladnikWzorcaTable.ForeignKeyConstraints.Add(fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR); + var fK_SKLEPSKL_REF_SKCEN_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPSKL_REF_SKCEN_SKLEP", sklepSklepTable, sklepTable, + new[] { centralaIdColumn }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPSKL_REF_SKCEN_SKLEPFk = RelationalModel.GetForeignKey(this, + "SklepSklep", + new[] { "CentralaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPSKL_REF_SKCEN_SKLEP.MappedForeignKeys.Add(fK_SKLEPSKL_REF_SKCEN_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPSKL_REF_SKCEN_SKLEPFk).Add(fK_SKLEPSKL_REF_SKCEN_SKLEP); + sklepSklepTable.ForeignKeyConstraints.Add(fK_SKLEPSKL_REF_SKCEN_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPSKL_REF_SKCEN_SKLEP); + var fK_SKLEPSKL_REF_SKSKL_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPSKL_REF_SKSKL_SKLEP", sklepSklepTable, sklepTable, + new[] { sklepIdColumn117 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPSKL_REF_SKSKL_SKLEPFk = RelationalModel.GetForeignKey(this, + "SklepSklep", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPSKL_REF_SKSKL_SKLEP.MappedForeignKeys.Add(fK_SKLEPSKL_REF_SKSKL_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPSKL_REF_SKSKL_SKLEPFk).Add(fK_SKLEPSKL_REF_SKSKL_SKLEP); + sklepSklepTable.ForeignKeyConstraints.Add(fK_SKLEPSKL_REF_SKSKL_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPSKL_REF_SKSKL_SKLEP); + var ref_SkStanPrtDzien = new ForeignKeyConstraint( + "Ref_SkStanPrtDzien", sklepStanPrtMagTable, sklepDzienRozlTable, + new[] { sklepIdColumn82, dzienColumn7 }, + sklepDzienRozlTable.FindUniqueConstraint("PK_SKLEPDZIENROZL")!, ReferentialAction.NoAction); + var ref_SkStanPrtDzienFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag", + new[] { "SklepId", "Dzien" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", + new[] { "SklepId", "Dzien" }); + ref_SkStanPrtDzien.MappedForeignKeys.Add(ref_SkStanPrtDzienFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkStanPrtDzienFk).Add(ref_SkStanPrtDzien); + sklepStanPrtMagTable.ForeignKeyConstraints.Add(ref_SkStanPrtDzien); + sklepDzienRozlTable.ReferencingForeignKeyConstraints.Add(ref_SkStanPrtDzien); + var ref_SkStanPrtMag = new ForeignKeyConstraint( + "Ref_SkStanPrtMag", sklepStanPrtMagTable, sklepPrtMagTable, + new[] { sklepIdColumn82, sklepTowIdColumn8, pMIdColumn3 }, + sklepPrtMagTable.FindUniqueConstraint("PK_SKLEPPRTMAG")!, ReferentialAction.NoAction); + var ref_SkStanPrtMagFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag", + new[] { "SklepId", "SklepTowId", "PMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + new[] { "SklepId", "SklepTowId", "PMId" }); + ref_SkStanPrtMag.MappedForeignKeys.Add(ref_SkStanPrtMagFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkStanPrtMagFk).Add(ref_SkStanPrtMag); + sklepStanPrtMagTable.ForeignKeyConstraints.Add(ref_SkStanPrtMag); + sklepPrtMagTable.ReferencingForeignKeyConstraints.Add(ref_SkStanPrtMag); + var ref_SklepSzczegPrtMag = new ForeignKeyConstraint( + "Ref_SklepSzczegPrtMag", sklepSzczegPrtMagTable, sklepPrtMagTable, + new[] { sklepIdColumn83, sklepTowIdColumn9, pMIdColumn4 }, + sklepPrtMagTable.FindUniqueConstraint("PK_SKLEPPRTMAG")!, ReferentialAction.NoAction); + var ref_SklepSzczegPrtMagFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSzczegPrtMag", + new[] { "SklepId", "SklepTowId", "PMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + new[] { "SklepId", "SklepTowId", "PMId" }); + ref_SklepSzczegPrtMag.MappedForeignKeys.Add(ref_SklepSzczegPrtMagFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SklepSzczegPrtMagFk).Add(ref_SklepSzczegPrtMag); + sklepSzczegPrtMagTable.ForeignKeyConstraints.Add(ref_SklepSzczegPrtMag); + sklepPrtMagTable.ReferencingForeignKeyConstraints.Add(ref_SklepSzczegPrtMag); + var fK_SKLEPTEK_REF_SKLEP_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPTEK_REF_SKLEP_SKLEPDOK", sklepTekstDokTable, sklepDokTable, + new[] { sklepIdColumn84, sklepDokIdColumn15 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPTEK_REF_SKLEP_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstDok", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPTEK_REF_SKLEP_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPTEK_REF_SKLEP_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPTEK_REF_SKLEP_SKLEPDOKFk).Add(fK_SKLEPTEK_REF_SKLEP_SKLEPDOK); + sklepTekstDokTable.ForeignKeyConstraints.Add(fK_SKLEPTEK_REF_SKLEP_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPTEK_REF_SKLEP_SKLEPDOK); + var ref_SklepTekstPoz = new ForeignKeyConstraint( + "Ref_SklepTekstPoz", sklepTekstPozTable, sklepPozDokTable, + new[] { sklepIdColumn85, sklepDokIdColumn16, kolejnoscColumn52 }, + sklepPozDokTable.FindUniqueConstraint("PK_SKLEPPOZDOK")!, ReferentialAction.NoAction); + var ref_SklepTekstPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstPoz", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + new[] { "SklepId", "SklepDokId", "Kolejnosc" }); + ref_SklepTekstPoz.MappedForeignKeys.Add(ref_SklepTekstPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SklepTekstPozFk).Add(ref_SklepTekstPoz); + sklepTekstPozTable.ForeignKeyConstraints.Add(ref_SklepTekstPoz); + sklepPozDokTable.ReferencingForeignKeyConstraints.Add(ref_SklepTekstPoz); + var fK_SKTXTZG_SKZGODA = new ForeignKeyConstraint( + "FK_SKTXTZG_SKZGODA", sklepTekstZgodyTable, sklepZgodaTable, + new[] { sklepIdColumn86, sklepZgIdColumn0 }, + sklepZgodaTable.FindUniqueConstraint("PK_SKLEPZGODA")!, ReferentialAction.NoAction); + var fK_SKTXTZG_SKZGODAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstZgody", + new[] { "SklepId", "SklepZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + new[] { "SklepId", "SklepZgId" }); + fK_SKTXTZG_SKZGODA.MappedForeignKeys.Add(fK_SKTXTZG_SKZGODAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKTXTZG_SKZGODAFk).Add(fK_SKTXTZG_SKZGODA); + sklepTekstZgodyTable.ForeignKeyConstraints.Add(fK_SKTXTZG_SKZGODA); + sklepZgodaTable.ReferencingForeignKeyConstraints.Add(fK_SKTXTZG_SKZGODA); + var ref_SkAkcTow = new ForeignKeyConstraint( + "Ref_SkAkcTow", sklepTowAkcyzaTable, sklepGrupaAkcyzowaTable, + new[] { sklepIdColumn87, sklepGrAkcIdColumn1 }, + sklepGrupaAkcyzowaTable.FindUniqueConstraint("PK_SKLEPGRUPAAKCYZOWA")!, ReferentialAction.NoAction); + var ref_SkAkcTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza", + new[] { "SklepId", "SklepGrAkcId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa", + new[] { "SklepId", "SklepGrAkcId" }); + ref_SkAkcTow.MappedForeignKeys.Add(ref_SkAkcTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkAkcTowFk).Add(ref_SkAkcTow); + sklepTowAkcyzaTable.ForeignKeyConstraints.Add(ref_SkAkcTow); + sklepGrupaAkcyzowaTable.ReferencingForeignKeyConstraints.Add(ref_SkAkcTow); + var ref_SkTowAkc = new ForeignKeyConstraint( + "Ref_SkTowAkc", sklepTowAkcyzaTable, sklepTowarTable, + new[] { sklepIdColumn87, sklepTowIdColumn10 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var ref_SkTowAkcFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + ref_SkTowAkc.MappedForeignKeys.Add(ref_SkTowAkcFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkTowAkcFk).Add(ref_SkTowAkc); + sklepTowAkcyzaTable.ForeignKeyConstraints.Add(ref_SkTowAkc); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(ref_SkTowAkc); + var fK_SKLEPTOW_REF_SKLEP_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPTOW_REF_SKLEP_SKLEP", sklepTowarTable, sklepTable, + new[] { sklepIdColumn96 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPTOW_REF_SKLEP_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPTOW_REF_SKLEP_SKLEP.MappedForeignKeys.Add(fK_SKLEPTOW_REF_SKLEP_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPTOW_REF_SKLEP_SKLEPFk).Add(fK_SKLEPTOW_REF_SKLEP_SKLEP); + sklepTowarTable.ForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKLEP_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKLEP_SKLEP); + var fK_SKLEPTOW_REF_SKLEP_SKLEPKON = new ForeignKeyConstraint( + "FK_SKLEPTOW_REF_SKLEP_SKLEPKON", sklepTowarTable, sklepKontrTable, + new[] { sklepIdColumn96, sklepProducentColumn }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKLEPTOW_REF_SKLEP_SKLEPKONFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepProducent" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKLEPTOW_REF_SKLEP_SKLEPKON.MappedForeignKeys.Add(fK_SKLEPTOW_REF_SKLEP_SKLEPKONFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPTOW_REF_SKLEP_SKLEPKONFk).Add(fK_SKLEPTOW_REF_SKLEP_SKLEPKON); + sklepTowarTable.ForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKLEP_SKLEPKON); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKLEP_SKLEPKON); + var fK_SKLEPTOW_REF_SKLEP_TOWAR = new ForeignKeyConstraint( + "FK_SKLEPTOW_REF_SKLEP_TOWAR", sklepTowarTable, towarTable, + new[] { towIdColumn20 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPTOW_REF_SKLEP_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_SKLEPTOW_REF_SKLEP_TOWAR.MappedForeignKeys.Add(fK_SKLEPTOW_REF_SKLEP_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPTOW_REF_SKLEP_TOWARFk).Add(fK_SKLEPTOW_REF_SKLEP_TOWAR); + sklepTowarTable.ForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKLEP_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKLEP_TOWAR); + var fK_SKLEPTOW_REF_SKTOW_SKLEPART = new ForeignKeyConstraint( + "FK_SKLEPTOW_REF_SKTOW_SKLEPART", sklepTowarTable, sklepArtykulTable, + new[] { sklepIdColumn96, sklepArtIdColumn0 }, + sklepArtykulTable.FindUniqueConstraint("PK_SKLEPARTYKUL")!, ReferentialAction.NoAction); + var fK_SKLEPTOW_REF_SKTOW_SKLEPARTFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepArtId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", + new[] { "SklepId", "SklepArtId" }); + fK_SKLEPTOW_REF_SKTOW_SKLEPART.MappedForeignKeys.Add(fK_SKLEPTOW_REF_SKTOW_SKLEPARTFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPTOW_REF_SKTOW_SKLEPARTFk).Add(fK_SKLEPTOW_REF_SKTOW_SKLEPART); + sklepTowarTable.ForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKTOW_SKLEPART); + sklepArtykulTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPTOW_REF_SKTOW_SKLEPART); + var fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA = new ForeignKeyConstraint( + "FK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA", sklepTowarSkladnikaTable, sklepSkladnikWzorcaTable, + new[] { sklepIdColumn97, sklepSkWzIdColumn0 }, + sklepSkladnikWzorcaTable.FindUniqueConstraint("PK_SKLEPSKLADNIKWZORCA")!, ReferentialAction.NoAction); + var fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika", + new[] { "SklepId", "SklepSkWzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", + new[] { "SklepId", "SklepSkWzId" }); + fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA.MappedForeignKeys.Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCAFk).Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA); + sklepTowarSkladnikaTable.ForeignKeyConstraints.Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA); + sklepSkladnikWzorcaTable.ReferencingForeignKeyConstraints.Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA); + var fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR = new ForeignKeyConstraint( + "FK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR", sklepTowarSkladnikaTable, sklepTowarTable, + new[] { sklepIdColumn97, sklepTowIdColumn20 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR.MappedForeignKeys.Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWARFk).Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR); + sklepTowarSkladnikaTable.ForeignKeyConstraints.Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR); + var ref_SkDodTow = new ForeignKeyConstraint( + "Ref_SkDodTow", sklepTowDodatekTable, sklepTowarTable, + new[] { sklepIdColumn88, dodSklepTowIdColumn }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var ref_SkDodTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek", + new[] { "SklepId", "DodSklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + ref_SkDodTow.MappedForeignKeys.Add(ref_SkDodTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkDodTowFk).Add(ref_SkDodTow); + sklepTowDodatekTable.ForeignKeyConstraints.Add(ref_SkDodTow); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(ref_SkDodTow); + var ref_SkTowDod = new ForeignKeyConstraint( + "Ref_SkTowDod", sklepTowDodatekTable, sklepTowarTable, + new[] { sklepIdColumn88, sklepTowIdColumn11 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var ref_SkTowDodFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + ref_SkTowDod.MappedForeignKeys.Add(ref_SkTowDodFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkTowDodFk).Add(ref_SkTowDod); + sklepTowDodatekTable.ForeignKeyConstraints.Add(ref_SkTowDod); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(ref_SkTowDod); + var fK_SkTowIntParamSkTowar = new ForeignKeyConstraint( + "FK_SkTowIntParamSkTowar", sklepTowIntParamTable, sklepTowarTable, + new[] { sklepIdColumn89, sklepTowIdColumn12 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SkTowIntParamSkTowarFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowIntParam", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SkTowIntParamSkTowar.MappedForeignKeys.Add(fK_SkTowIntParamSkTowarFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SkTowIntParamSkTowarFk).Add(fK_SkTowIntParamSkTowar); + sklepTowIntParamTable.ForeignKeyConstraints.Add(fK_SkTowIntParamSkTowar); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SkTowIntParamSkTowar); + var fK_SKLEPTOW_REF_KODSK_SKLEPTOW = new ForeignKeyConstraint( + "FK_SKLEPTOW_REF_KODSK_SKLEPTOW", sklepTowKodTable, sklepTowarTable, + new[] { sklepIdColumn90, sklepTowIdColumn13 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKLEPTOW_REF_KODSK_SKLEPTOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowKod", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKLEPTOW_REF_KODSK_SKLEPTOW.MappedForeignKeys.Add(fK_SKLEPTOW_REF_KODSK_SKLEPTOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPTOW_REF_KODSK_SKLEPTOWFk).Add(fK_SKLEPTOW_REF_KODSK_SKLEPTOW); + sklepTowKodTable.ForeignKeyConstraints.Add(fK_SKLEPTOW_REF_KODSK_SKLEPTOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPTOW_REF_KODSK_SKLEPTOW); + var fK_SklepTowParWB_ParId = new ForeignKeyConstraint( + "FK_SklepTowParWB_ParId", sklepTowParWiseBaseTable, parWiseBaseTable, + new[] { parIdColumn14 }, + parWiseBaseTable.FindUniqueConstraint("PK_ParWiseBase")!, ReferentialAction.NoAction); + var fK_SklepTowParWB_ParIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase", + new[] { "ParId" }); + fK_SklepTowParWB_ParId.MappedForeignKeys.Add(fK_SklepTowParWB_ParIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepTowParWB_ParIdFk).Add(fK_SklepTowParWB_ParId); + sklepTowParWiseBaseTable.ForeignKeyConstraints.Add(fK_SklepTowParWB_ParId); + parWiseBaseTable.ReferencingForeignKeyConstraints.Add(fK_SklepTowParWB_ParId); + var fK_SklepTowParWB_SklepTowId = new ForeignKeyConstraint( + "FK_SklepTowParWB_SklepTowId", sklepTowParWiseBaseTable, sklepTowarTable, + new[] { sklepIdColumn91, sklepTowIdColumn14 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SklepTowParWB_SklepTowIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SklepTowParWB_SklepTowId.MappedForeignKeys.Add(fK_SklepTowParWB_SklepTowIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepTowParWB_SklepTowIdFk).Add(fK_SklepTowParWB_SklepTowId); + sklepTowParWiseBaseTable.ForeignKeyConstraints.Add(fK_SklepTowParWB_SklepTowId); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SklepTowParWB_SklepTowId); + var ref_SkPowTowPow_SkTow = new ForeignKeyConstraint( + "Ref_SkPowTowPow_SkTow", sklepTowPowiazanieTable, sklepTowarTable, + new[] { sklepIdColumn92, powSklepTowIdColumn }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var ref_SkPowTowPow_SkTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie", + new[] { "SklepId", "PowSklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + ref_SkPowTowPow_SkTow.MappedForeignKeys.Add(ref_SkPowTowPow_SkTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkPowTowPow_SkTowFk).Add(ref_SkPowTowPow_SkTow); + sklepTowPowiazanieTable.ForeignKeyConstraints.Add(ref_SkPowTowPow_SkTow); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(ref_SkPowTowPow_SkTow); + var ref_SkTowPow_SkTow = new ForeignKeyConstraint( + "Ref_SkTowPow_SkTow", sklepTowPowiazanieTable, sklepTowarTable, + new[] { sklepIdColumn92, sklepTowIdColumn15 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var ref_SkTowPow_SkTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + ref_SkTowPow_SkTow.MappedForeignKeys.Add(ref_SkTowPow_SkTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SkTowPow_SkTowFk).Add(ref_SkTowPow_SkTow); + sklepTowPowiazanieTable.ForeignKeyConstraints.Add(ref_SkTowPow_SkTow); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(ref_SkTowPow_SkTow); + var fK_SKTWSTR_TOW = new ForeignKeyConstraint( + "FK_SKTWSTR_TOW", sklepTowStratyTable, sklepTowarTable, + new[] { sklepIdColumn93, sklepTowIdColumn16 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SKTWSTR_TOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowStraty", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SKTWSTR_TOW.MappedForeignKeys.Add(fK_SKTWSTR_TOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKTWSTR_TOWFk).Add(fK_SKTWSTR_TOW); + sklepTowStratyTable.ForeignKeyConstraints.Add(fK_SKTWSTR_TOW); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SKTWSTR_TOW); + var fK_SklepTowZamiennik_Tow = new ForeignKeyConstraint( + "FK_SklepTowZamiennik_Tow", sklepTowZamiennikTable, sklepTowarTable, + new[] { sklepIdColumn94, sklepTowIdColumn17 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SklepTowZamiennik_TowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SklepTowZamiennik_Tow.MappedForeignKeys.Add(fK_SklepTowZamiennik_TowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepTowZamiennik_TowFk).Add(fK_SklepTowZamiennik_Tow); + sklepTowZamiennikTable.ForeignKeyConstraints.Add(fK_SklepTowZamiennik_Tow); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SklepTowZamiennik_Tow); + var fK_SklepTowZamiennik_Zam = new ForeignKeyConstraint( + "FK_SklepTowZamiennik_Zam", sklepTowZamiennikTable, sklepZamiennikTable, + new[] { sklepIdColumn94, sklepZmIdColumn }, + sklepZamiennikTable.FindUniqueConstraint("PK_SKLEPZAMIENNIK")!, ReferentialAction.NoAction); + var fK_SklepTowZamiennik_ZamFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik", + new[] { "SklepId", "SklepZmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZamiennik", + new[] { "SklepId", "SklepZmId" }); + fK_SklepTowZamiennik_Zam.MappedForeignKeys.Add(fK_SklepTowZamiennik_ZamFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepTowZamiennik_ZamFk).Add(fK_SklepTowZamiennik_Zam); + sklepTowZamiennikTable.ForeignKeyConstraints.Add(fK_SklepTowZamiennik_Zam); + sklepZamiennikTable.ReferencingForeignKeyConstraints.Add(fK_SklepTowZamiennik_Zam); + var fK_SkTowZdjecia_SkTow = new ForeignKeyConstraint( + "FK_SkTowZdjecia_SkTow", sklepTowZdjeciaTable, sklepTowarTable, + new[] { sklepIdColumn95, sklepTowIdColumn18 }, + sklepTowarTable.FindUniqueConstraint("PK_SKLEPTOWAR")!, ReferentialAction.NoAction); + var fK_SkTowZdjecia_SkTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZdjecia", + new[] { "SklepId", "SklepTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + new[] { "SklepId", "SklepTowId" }); + fK_SkTowZdjecia_SkTow.MappedForeignKeys.Add(fK_SkTowZdjecia_SkTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SkTowZdjecia_SkTowFk).Add(fK_SkTowZdjecia_SkTow); + sklepTowZdjeciaTable.ForeignKeyConstraints.Add(fK_SkTowZdjecia_SkTow); + sklepTowarTable.ReferencingForeignKeyConstraints.Add(fK_SkTowZdjecia_SkTow); + var fK_SklepTrescEmail_Uz = new ForeignKeyConstraint( + "FK_SklepTrescEmail_Uz", sklepTrescEmailTable, sklepUzytkownikTable, + new[] { sklepIdColumn98, sklepUzIdColumn4 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SklepTrescEmail_UzFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SklepTrescEmail_Uz.MappedForeignKeys.Add(fK_SklepTrescEmail_UzFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepTrescEmail_UzFk).Add(fK_SklepTrescEmail_Uz); + sklepTrescEmailTable.ForeignKeyConstraints.Add(fK_SklepTrescEmail_Uz); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SklepTrescEmail_Uz); + var fK_SklepTrescEmail_Pe = new ForeignKeyConstraint( + "FK_SklepTrescEmail_Pe", sklepTrescEmailTekstTable, sklepTrescEmailTable, + new[] { sklepIdColumn99, sklepTEIdColumn0 }, + sklepTrescEmailTable.FindUniqueConstraint("PK_SklepTrescEmail")!, ReferentialAction.NoAction); + var fK_SklepTrescEmail_PeFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmailTekst", + new[] { "SklepId", "SklepTEId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + new[] { "SklepId", "SklepTEId" }); + fK_SklepTrescEmail_Pe.MappedForeignKeys.Add(fK_SklepTrescEmail_PeFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SklepTrescEmail_PeFk).Add(fK_SklepTrescEmail_Pe); + sklepTrescEmailTekstTable.ForeignKeyConstraints.Add(fK_SklepTrescEmail_Pe); + sklepTrescEmailTable.ReferencingForeignKeyConstraints.Add(fK_SklepTrescEmail_Pe); + var fK_SKTYPOS_SKLEP = new ForeignKeyConstraint( + "FK_SKTYPOS_SKLEP", sklepTypOsTable, sklepTable, + new[] { sklepIdColumn100 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKTYPOS_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKTYPOS_SKLEP.MappedForeignKeys.Add(fK_SKTYPOS_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKTYPOS_SKLEPFk).Add(fK_SKTYPOS_SKLEP); + sklepTypOsTable.ForeignKeyConstraints.Add(fK_SKTYPOS_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKTYPOS_SKLEP); + var fK_SKTYPOS_TYPOS = new ForeignKeyConstraint( + "FK_SKTYPOS_TYPOS", sklepTypOsTable, typOsTable, + new[] { typOsIdColumn0 }, + typOsTable.FindUniqueConstraint("PK_TYPOS")!, ReferentialAction.NoAction); + var fK_SKTYPOS_TYPOSFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + new[] { "TypOsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TypOs", + new[] { "TypOsId" }); + fK_SKTYPOS_TYPOS.MappedForeignKeys.Add(fK_SKTYPOS_TYPOSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKTYPOS_TYPOSFk).Add(fK_SKTYPOS_TYPOS); + sklepTypOsTable.ForeignKeyConstraints.Add(fK_SKTYPOS_TYPOS); + typOsTable.ReferencingForeignKeyConstraints.Add(fK_SKTYPOS_TYPOS); + var fK_SKLEPUPR_REF_SKUPR_SKLEPUZY = new ForeignKeyConstraint( + "FK_SKLEPUPR_REF_SKUPR_SKLEPUZY", sklepUprawnienieTable, sklepUzytkownikTable, + new[] { sklepIdColumn101, sklepUzIdColumn5 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKLEPUPR_REF_SKUPR_SKLEPUZYFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUprawnienie", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SKLEPUPR_REF_SKUPR_SKLEPUZY.MappedForeignKeys.Add(fK_SKLEPUPR_REF_SKUPR_SKLEPUZYFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPUPR_REF_SKUPR_SKLEPUZYFk).Add(fK_SKLEPUPR_REF_SKUPR_SKLEPUZY); + sklepUprawnienieTable.ForeignKeyConstraints.Add(fK_SKLEPUPR_REF_SKUPR_SKLEPUZY); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPUPR_REF_SKUPR_SKLEPUZY); + var fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL = new ForeignKeyConstraint( + "FK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL", sklepUzytkownikTable, sklepProfilTable, + new[] { sklepIdColumn102, sklepProfilIdColumn1 }, + sklepProfilTable.FindUniqueConstraint("PK_SKLEPPROFIL")!, ReferentialAction.NoAction); + var fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFILFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepProfilId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", + new[] { "SklepId", "SklepProfilId" }); + fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL.MappedForeignKeys.Add(fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFILFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFILFk).Add(fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL); + sklepUzytkownikTable.ForeignKeyConstraints.Add(fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL); + sklepProfilTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL); + var fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK = new ForeignKeyConstraint( + "FK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK", sklepUzytkownikTable, uzytkownikTable, + new[] { uzIdColumn5 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK.MappedForeignKeys.Add(fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIKFk).Add(fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK); + sklepUzytkownikTable.ForeignKeyConstraints.Add(fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK); + var fK_SKLEPUZY_REF_SKUZ_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPUZY_REF_SKUZ_SKLEP", sklepUzytkownikTable, sklepTable, + new[] { sklepIdColumn102 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPUZY_REF_SKUZ_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPUZY_REF_SKUZ_SKLEP.MappedForeignKeys.Add(fK_SKLEPUZY_REF_SKUZ_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPUZY_REF_SKUZ_SKLEPFk).Add(fK_SKLEPUZY_REF_SKUZ_SKLEP); + sklepUzytkownikTable.ForeignKeyConstraints.Add(fK_SKLEPUZY_REF_SKUZ_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPUZY_REF_SKUZ_SKLEP); + var fK_SKLEPWAL_REF_SKWAL_SKLEP = new ForeignKeyConstraint( + "FK_SKLEPWAL_REF_SKWAL_SKLEP", sklepWalutaTable, sklepTable, + new[] { sklepIdColumn103 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKLEPWAL_REF_SKWAL_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKLEPWAL_REF_SKWAL_SKLEP.MappedForeignKeys.Add(fK_SKLEPWAL_REF_SKWAL_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPWAL_REF_SKWAL_SKLEPFk).Add(fK_SKLEPWAL_REF_SKWAL_SKLEP); + sklepWalutaTable.ForeignKeyConstraints.Add(fK_SKLEPWAL_REF_SKWAL_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPWAL_REF_SKWAL_SKLEP); + var fK_SKLEPWAL_REF_SKWAL_WALUTA = new ForeignKeyConstraint( + "FK_SKLEPWAL_REF_SKWAL_WALUTA", sklepWalutaTable, walutaTable, + new[] { walIdColumn8 }, + walutaTable.FindUniqueConstraint("PK_WALUTA")!, ReferentialAction.NoAction); + var fK_SKLEPWAL_REF_SKWAL_WALUTAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + new[] { "WalId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + new[] { "WalId" }); + fK_SKLEPWAL_REF_SKWAL_WALUTA.MappedForeignKeys.Add(fK_SKLEPWAL_REF_SKWAL_WALUTAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPWAL_REF_SKWAL_WALUTAFk).Add(fK_SKLEPWAL_REF_SKWAL_WALUTA); + sklepWalutaTable.ForeignKeyConstraints.Add(fK_SKLEPWAL_REF_SKWAL_WALUTA); + walutaTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPWAL_REF_SKWAL_WALUTA); + var fK_SKLEPZAL_REF_SKDOD_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPZAL_REF_SKDOD_SKLEPDOK", sklepZaleznoscTable, sklepDokTable, + new[] { poprzedniSklepIdColumn, poprzedniSklepDokIdColumn }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPZAL_REF_SKDOD_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc", + new[] { "PoprzedniSklepId", "PoprzedniSklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPZAL_REF_SKDOD_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPZAL_REF_SKDOD_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPZAL_REF_SKDOD_SKLEPDOKFk).Add(fK_SKLEPZAL_REF_SKDOD_SKLEPDOK); + sklepZaleznoscTable.ForeignKeyConstraints.Add(fK_SKLEPZAL_REF_SKDOD_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPZAL_REF_SKDOD_SKLEPDOK); + var fK_SKLEPZAL_REF_SKODD_SKLEPDOK = new ForeignKeyConstraint( + "FK_SKLEPZAL_REF_SKODD_SKLEPDOK", sklepZaleznoscTable, sklepDokTable, + new[] { sklepIdColumn104, sklepDokIdColumn17 }, + sklepDokTable.FindUniqueConstraint("PK_SKLEPDOK")!, ReferentialAction.NoAction); + var fK_SKLEPZAL_REF_SKODD_SKLEPDOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc", + new[] { "SklepId", "SklepDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + new[] { "SklepId", "SklepDokId" }); + fK_SKLEPZAL_REF_SKODD_SKLEPDOK.MappedForeignKeys.Add(fK_SKLEPZAL_REF_SKODD_SKLEPDOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKLEPZAL_REF_SKODD_SKLEPDOKFk).Add(fK_SKLEPZAL_REF_SKODD_SKLEPDOK); + sklepZaleznoscTable.ForeignKeyConstraints.Add(fK_SKLEPZAL_REF_SKODD_SKLEPDOK); + sklepDokTable.ReferencingForeignKeyConstraints.Add(fK_SKLEPZAL_REF_SKODD_SKLEPDOK); + var ref_SklepZasobSklep = new ForeignKeyConstraint( + "Ref_SklepZasobSklep", sklepZasobTable, sklepTable, + new[] { sklepIdColumn106 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var ref_SklepZasobSklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZasob", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + ref_SklepZasobSklep.MappedForeignKeys.Add(ref_SklepZasobSklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SklepZasobSklepFk).Add(ref_SklepZasobSklep); + sklepZasobTable.ForeignKeyConstraints.Add(ref_SklepZasobSklep); + sklepTable.ReferencingForeignKeyConstraints.Add(ref_SklepZasobSklep); + var fK_SKZDOSUZ = new ForeignKeyConstraint( + "FK_SKZDOSUZ", sklepZdarzOsTable, sklepUzytkownikTable, + new[] { sklepIdColumn107, sklepUzIdColumn7 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_SKZDOSUZFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + fK_SKZDOSUZ.MappedForeignKeys.Add(fK_SKZDOSUZFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKZDOSUZFk).Add(fK_SKZDOSUZ); + sklepZdarzOsTable.ForeignKeyConstraints.Add(fK_SKZDOSUZ); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_SKZDOSUZ); + var fK_SKZDOS_SKKTH = new ForeignKeyConstraint( + "FK_SKZDOS_SKKTH", sklepZdarzOsTable, sklepKontrTable, + new[] { sklepIdColumn107, sklepKontrIdColumn11 }, + sklepKontrTable.FindUniqueConstraint("PK_SKLEPKONTR")!, ReferentialAction.NoAction); + var fK_SKZDOS_SKKTHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + new[] { "SklepId", "SklepKontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + new[] { "SklepId", "SklepKontrId" }); + fK_SKZDOS_SKKTH.MappedForeignKeys.Add(fK_SKZDOS_SKKTHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKZDOS_SKKTHFk).Add(fK_SKZDOS_SKKTH); + sklepZdarzOsTable.ForeignKeyConstraints.Add(fK_SKZDOS_SKKTH); + sklepKontrTable.ReferencingForeignKeyConstraints.Add(fK_SKZDOS_SKKTH); + var fK_SKZDOS_SKTPOS = new ForeignKeyConstraint( + "FK_SKZDOS_SKTPOS", sklepZdarzOsTable, sklepTypOsTable, + new[] { sklepIdColumn107, sklepTypOsIdColumn2 }, + sklepTypOsTable.FindUniqueConstraint("PK_SKLEPTYPOS")!, ReferentialAction.NoAction); + var fK_SKZDOS_SKTPOSFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + new[] { "SklepId", "SklepTypOsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + new[] { "SklepId", "SklepTypOsId" }); + fK_SKZDOS_SKTPOS.MappedForeignKeys.Add(fK_SKZDOS_SKTPOSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKZDOS_SKTPOSFk).Add(fK_SKZDOS_SKTPOS); + sklepZdarzOsTable.ForeignKeyConstraints.Add(fK_SKZDOS_SKTPOS); + sklepTypOsTable.ReferencingForeignKeyConstraints.Add(fK_SKZDOS_SKTPOS); + var fK_SKZDOS_SKZG = new ForeignKeyConstraint( + "FK_SKZDOS_SKZG", sklepZdarzOsTable, sklepZgodaTable, + new[] { sklepIdColumn107, sklepZgIdColumn1 }, + sklepZgodaTable.FindUniqueConstraint("PK_SKLEPZGODA")!, ReferentialAction.NoAction); + var fK_SKZDOS_SKZGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + new[] { "SklepId", "SklepZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + new[] { "SklepId", "SklepZgId" }); + fK_SKZDOS_SKZG.MappedForeignKeys.Add(fK_SKZDOS_SKZGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKZDOS_SKZGFk).Add(fK_SKZDOS_SKZG); + sklepZdarzOsTable.ForeignKeyConstraints.Add(fK_SKZDOS_SKZG); + sklepZgodaTable.ReferencingForeignKeyConstraints.Add(fK_SKZDOS_SKZG); + var fK_SKZDOSOPIS = new ForeignKeyConstraint( + "FK_SKZDOSOPIS", sklepZdarzOsOpisTable, sklepZdarzOsTable, + new[] { sklepIdColumn108, sklepKontrIdColumn12, kiedyColumn5 }, + sklepZdarzOsTable.FindUniqueConstraint("PK_SKLEPZDARZOS")!, ReferentialAction.NoAction); + var fK_SKZDOSOPISFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOsOpis", + new[] { "SklepId", "SklepKontrId", "Kiedy" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + new[] { "SklepId", "SklepKontrId", "Kiedy" }); + fK_SKZDOSOPIS.MappedForeignKeys.Add(fK_SKZDOSOPISFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKZDOSOPISFk).Add(fK_SKZDOSOPIS); + sklepZdarzOsOpisTable.ForeignKeyConstraints.Add(fK_SKZDOSOPIS); + sklepZdarzOsTable.ReferencingForeignKeyConstraints.Add(fK_SKZDOSOPIS); + var fK_SKZG_SKLEP = new ForeignKeyConstraint( + "FK_SKZG_SKLEP", sklepZgodaTable, sklepTable, + new[] { sklepIdColumn109 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_SKZG_SKLEPFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_SKZG_SKLEP.MappedForeignKeys.Add(fK_SKZG_SKLEPFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKZG_SKLEPFk).Add(fK_SKZG_SKLEP); + sklepZgodaTable.ForeignKeyConstraints.Add(fK_SKZG_SKLEP); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_SKZG_SKLEP); + var fK_SKZG_ZGODA = new ForeignKeyConstraint( + "FK_SKZG_ZGODA", sklepZgodaTable, zgodaTable, + new[] { zgIdColumn1 }, + zgodaTable.FindUniqueConstraint("PK_ZGODA")!, ReferentialAction.NoAction); + var fK_SKZG_ZGODAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + new[] { "ZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + new[] { "ZgId" }); + fK_SKZG_ZGODA.MappedForeignKeys.Add(fK_SKZG_ZGODAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SKZG_ZGODAFk).Add(fK_SKZG_ZGODA); + sklepZgodaTable.ForeignKeyConstraints.Add(fK_SKZG_ZGODA); + zgodaTable.ReferencingForeignKeyConstraints.Add(fK_SKZG_ZGODA); + var ref_StanPrtDzien = new ForeignKeyConstraint( + "Ref_StanPrtDzien", stanPrtMagTable, dzienRozlTable, + new[] { dzienColumn8 }, + dzienRozlTable.FindUniqueConstraint("PK_DZIENROZL")!, ReferentialAction.NoAction); + var ref_StanPrtDzienFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag", + new[] { "Dzien" }, + "Blink.Backoffice.Services.PcmDb.Entities.DzienRozl", + new[] { "Dzien" }); + ref_StanPrtDzien.MappedForeignKeys.Add(ref_StanPrtDzienFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_StanPrtDzienFk).Add(ref_StanPrtDzien); + stanPrtMagTable.ForeignKeyConstraints.Add(ref_StanPrtDzien); + dzienRozlTable.ReferencingForeignKeyConstraints.Add(ref_StanPrtDzien); + var ref_StanPrtMag = new ForeignKeyConstraint( + "Ref_StanPrtMag", stanPrtMagTable, prtMagTable, + new[] { towIdColumn21, pMIdColumn5 }, + prtMagTable.FindUniqueConstraint("PK_PRTMAG")!, ReferentialAction.NoAction); + var ref_StanPrtMagFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag", + new[] { "TowId", "PMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + new[] { "TowId", "PMId" }); + ref_StanPrtMag.MappedForeignKeys.Add(ref_StanPrtMagFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_StanPrtMagFk).Add(ref_StanPrtMag); + stanPrtMagTable.ForeignKeyConstraints.Add(ref_StanPrtMag); + prtMagTable.ReferencingForeignKeyConstraints.Add(ref_StanPrtMag); + var fK_STZG_KTH = new ForeignKeyConstraint( + "FK_STZG_KTH", stanZgodyTable, kontrahentTable, + new[] { kontrIdColumn19 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_STZG_KTHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanZgody", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_STZG_KTH.MappedForeignKeys.Add(fK_STZG_KTHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_STZG_KTHFk).Add(fK_STZG_KTH); + stanZgodyTable.ForeignKeyConstraints.Add(fK_STZG_KTH); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_STZG_KTH); + var fK_STZG_ZG = new ForeignKeyConstraint( + "FK_STZG_ZG", stanZgodyTable, zgodaTable, + new[] { zgIdColumn2 }, + zgodaTable.FindUniqueConstraint("PK_ZGODA")!, ReferentialAction.NoAction); + var fK_STZG_ZGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.StanZgody", + new[] { "ZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + new[] { "ZgId" }); + fK_STZG_ZG.MappedForeignKeys.Add(fK_STZG_ZGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_STZG_ZGFk).Add(fK_STZG_ZG); + stanZgodyTable.ForeignKeyConstraints.Add(fK_STZG_ZG); + zgodaTable.ReferencingForeignKeyConstraints.Add(fK_STZG_ZG); + var fK_SUBSYS_TOW = new ForeignKeyConstraint( + "FK_SUBSYS_TOW", subsysTable, towarTable, + new[] { towIdColumn22 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_SUBSYS_TOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Subsys", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_SUBSYS_TOW.MappedForeignKeys.Add(fK_SUBSYS_TOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_SUBSYS_TOWFk).Add(fK_SUBSYS_TOW); + subsysTable.ForeignKeyConstraints.Add(fK_SUBSYS_TOW); + towarTable.ReferencingForeignKeyConstraints.Add(fK_SUBSYS_TOW); + var ref_SzczegPrtMag = new ForeignKeyConstraint( + "Ref_SzczegPrtMag", szczegPrtMagTable, prtMagTable, + new[] { towIdColumn23, pMIdColumn6 }, + prtMagTable.FindUniqueConstraint("PK_PRTMAG")!, ReferentialAction.NoAction); + var ref_SzczegPrtMagFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.SzczegPrtMag", + new[] { "TowId", "PMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + new[] { "TowId", "PMId" }); + ref_SzczegPrtMag.MappedForeignKeys.Add(ref_SzczegPrtMagFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_SzczegPrtMagFk).Add(ref_SzczegPrtMag); + szczegPrtMagTable.ForeignKeyConstraints.Add(ref_SzczegPrtMag); + prtMagTable.ReferencingForeignKeyConstraints.Add(ref_SzczegPrtMag); + var ref_TabAkc = new ForeignKeyConstraint( + "Ref_TabAkc", tabelaAkcyzowaTable, grupaAkcyzowaTable, + new[] { grAkcIdColumn1 }, + grupaAkcyzowaTable.FindUniqueConstraint("PK_GRUPAAKCYZOWA")!, ReferentialAction.NoAction); + var ref_TabAkcFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TabelaAkcyzowa", + new[] { "GrAkcId" }, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa", + new[] { "GrAkcId" }); + ref_TabAkc.MappedForeignKeys.Add(ref_TabAkcFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_TabAkcFk).Add(ref_TabAkc); + tabelaAkcyzowaTable.ForeignKeyConstraints.Add(ref_TabAkc); + grupaAkcyzowaTable.ReferencingForeignKeyConstraints.Add(ref_TabAkc); + var fK_TEKSTDOK_REF_TEKST_DOK = new ForeignKeyConstraint( + "FK_TEKSTDOK_REF_TEKST_DOK", tekstDokTable, dokTable, + new[] { dokIdColumn22 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_TEKSTDOK_REF_TEKST_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstDok", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_TEKSTDOK_REF_TEKST_DOK.MappedForeignKeys.Add(fK_TEKSTDOK_REF_TEKST_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TEKSTDOK_REF_TEKST_DOKFk).Add(fK_TEKSTDOK_REF_TEKST_DOK); + tekstDokTable.ForeignKeyConstraints.Add(fK_TEKSTDOK_REF_TEKST_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_TEKSTDOK_REF_TEKST_DOK); + var ref_TekstPoz = new ForeignKeyConstraint( + "Ref_TekstPoz", tekstPozTable, pozDokTable, + new[] { dokIdColumn23, kolejnoscColumn60 }, + pozDokTable.FindUniqueConstraint("PK_POZDOK")!, ReferentialAction.NoAction); + var ref_TekstPozFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstPoz", + new[] { "DokId", "Kolejnosc" }, + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + new[] { "DokId", "Kolejnosc" }); + ref_TekstPoz.MappedForeignKeys.Add(ref_TekstPozFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_TekstPozFk).Add(ref_TekstPoz); + tekstPozTable.ForeignKeyConstraints.Add(ref_TekstPoz); + pozDokTable.ReferencingForeignKeyConstraints.Add(ref_TekstPoz); + var fK_TXTZG_ZGODA = new ForeignKeyConstraint( + "FK_TXTZG_ZGODA", tekstZgodyTable, zgodaTable, + new[] { zgIdColumn3 }, + zgodaTable.FindUniqueConstraint("PK_ZGODA")!, ReferentialAction.NoAction); + var fK_TXTZG_ZGODAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TekstZgody", + new[] { "ZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + new[] { "ZgId" }); + fK_TXTZG_ZGODA.MappedForeignKeys.Add(fK_TXTZG_ZGODAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TXTZG_ZGODAFk).Add(fK_TXTZG_ZGODA); + tekstZgodyTable.ForeignKeyConstraints.Add(fK_TXTZG_ZGODA); + zgodaTable.ReferencingForeignKeyConstraints.Add(fK_TXTZG_ZGODA); + var ref_AkcTow = new ForeignKeyConstraint( + "Ref_AkcTow", towAkcyzaTable, grupaAkcyzowaTable, + new[] { grAkcIdColumn2 }, + grupaAkcyzowaTable.FindUniqueConstraint("PK_GRUPAAKCYZOWA")!, ReferentialAction.NoAction); + var ref_AkcTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza", + new[] { "GrAkcId" }, + "Blink.Backoffice.Services.PcmDb.Entities.GrupaAkcyzowa", + new[] { "GrAkcId" }); + ref_AkcTow.MappedForeignKeys.Add(ref_AkcTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_AkcTowFk).Add(ref_AkcTow); + towAkcyzaTable.ForeignKeyConstraints.Add(ref_AkcTow); + grupaAkcyzowaTable.ReferencingForeignKeyConstraints.Add(ref_AkcTow); + var ref_TowAkc = new ForeignKeyConstraint( + "Ref_TowAkc", towAkcyzaTable, towarTable, + new[] { towIdColumn24 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var ref_TowAkcFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + ref_TowAkc.MappedForeignKeys.Add(ref_TowAkcFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_TowAkcFk).Add(ref_TowAkc); + towAkcyzaTable.ForeignKeyConstraints.Add(ref_TowAkc); + towarTable.ReferencingForeignKeyConstraints.Add(ref_TowAkc); + var fK_Ref_TowarKrajPochodzenia = new ForeignKeyConstraint( + "FK_Ref_TowarKrajPochodzenia", towarTable, krajTable, + new[] { krajIdPochodzeniaColumn }, + krajTable.FindUniqueConstraint("PK_KRAJ")!, ReferentialAction.NoAction); + var fK_Ref_TowarKrajPochodzeniaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "KrajIdPochodzenia" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "KrajId" }); + fK_Ref_TowarKrajPochodzenia.MappedForeignKeys.Add(fK_Ref_TowarKrajPochodzeniaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_TowarKrajPochodzeniaFk).Add(fK_Ref_TowarKrajPochodzenia); + towarTable.ForeignKeyConstraints.Add(fK_Ref_TowarKrajPochodzenia); + krajTable.ReferencingForeignKeyConstraints.Add(fK_Ref_TowarKrajPochodzenia); + var fK_TOWAR_REF_PRODU_KONTRAHE = new ForeignKeyConstraint( + "FK_TOWAR_REF_PRODU_KONTRAHE", towarTable, kontrahentTable, + new[] { producentColumn1 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_TOWAR_REF_PRODU_KONTRAHEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "Producent" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_TOWAR_REF_PRODU_KONTRAHE.MappedForeignKeys.Add(fK_TOWAR_REF_PRODU_KONTRAHEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWAR_REF_PRODU_KONTRAHEFk).Add(fK_TOWAR_REF_PRODU_KONTRAHE); + towarTable.ForeignKeyConstraints.Add(fK_TOWAR_REF_PRODU_KONTRAHE); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_TOWAR_REF_PRODU_KONTRAHE); + var fK_TOWAR_REF_TOWAR_ARTYKUL = new ForeignKeyConstraint( + "FK_TOWAR_REF_TOWAR_ARTYKUL", towarTable, artykulTable, + new[] { artIdColumn0 }, + artykulTable.FindUniqueConstraint("PK_ARTYKUL")!, ReferentialAction.NoAction); + var fK_TOWAR_REF_TOWAR_ARTYKULFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "ArtId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Artykul", + new[] { "ArtId" }); + fK_TOWAR_REF_TOWAR_ARTYKUL.MappedForeignKeys.Add(fK_TOWAR_REF_TOWAR_ARTYKULFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWAR_REF_TOWAR_ARTYKULFk).Add(fK_TOWAR_REF_TOWAR_ARTYKUL); + towarTable.ForeignKeyConstraints.Add(fK_TOWAR_REF_TOWAR_ARTYKUL); + artykulTable.ReferencingForeignKeyConstraints.Add(fK_TOWAR_REF_TOWAR_ARTYKUL); + var fK_TOWAR_REF_TOWAS_ASORT = new ForeignKeyConstraint( + "FK_TOWAR_REF_TOWAS_ASORT", towarTable, asortTable, + new[] { asIdColumn2 }, + asortTable.FindUniqueConstraint("PK_ASORT")!, ReferentialAction.NoAction); + var fK_TOWAR_REF_TOWAS_ASORTFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "AsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Asort", + new[] { "AsId" }); + fK_TOWAR_REF_TOWAS_ASORT.MappedForeignKeys.Add(fK_TOWAR_REF_TOWAS_ASORTFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWAR_REF_TOWAS_ASORTFk).Add(fK_TOWAR_REF_TOWAS_ASORT); + towarTable.ForeignKeyConstraints.Add(fK_TOWAR_REF_TOWAS_ASORT); + asortTable.ReferencingForeignKeyConstraints.Add(fK_TOWAR_REF_TOWAS_ASORT); + var fK_TOWAR_REF_TOWJM_JM = new ForeignKeyConstraint( + "FK_TOWAR_REF_TOWJM_JM", towarTable, jMTable, + new[] { jMIdColumn1 }, + jMTable.FindUniqueConstraint("PK_JM")!, ReferentialAction.NoAction); + var fK_TOWAR_REF_TOWJM_JMFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "JMId" }, + "Blink.Backoffice.Services.PcmDb.Entities.JM", + new[] { "JMId" }); + fK_TOWAR_REF_TOWJM_JM.MappedForeignKeys.Add(fK_TOWAR_REF_TOWJM_JMFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWAR_REF_TOWJM_JMFk).Add(fK_TOWAR_REF_TOWJM_JM); + towarTable.ForeignKeyConstraints.Add(fK_TOWAR_REF_TOWJM_JM); + jMTable.ReferencingForeignKeyConstraints.Add(fK_TOWAR_REF_TOWJM_JM); + var fK_TOWAR_REF_TOWKA_KATEGORI = new ForeignKeyConstraint( + "FK_TOWAR_REF_TOWKA_KATEGORI", towarTable, kategoriaTable, + new[] { katIdColumn1 }, + kategoriaTable.FindUniqueConstraint("PK_KATEGORIA")!, ReferentialAction.NoAction); + var fK_TOWAR_REF_TOWKA_KATEGORIFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "KatId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kategoria", + new[] { "KatId" }); + fK_TOWAR_REF_TOWKA_KATEGORI.MappedForeignKeys.Add(fK_TOWAR_REF_TOWKA_KATEGORIFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWAR_REF_TOWKA_KATEGORIFk).Add(fK_TOWAR_REF_TOWKA_KATEGORI); + towarTable.ForeignKeyConstraints.Add(fK_TOWAR_REF_TOWKA_KATEGORI); + kategoriaTable.ReferencingForeignKeyConstraints.Add(fK_TOWAR_REF_TOWKA_KATEGORI); + var fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA = new ForeignKeyConstraint( + "FK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA", towarSkladnikaTable, skladnikWzorcaTable, + new[] { skWzIdColumn1 }, + skladnikWzorcaTable.FindUniqueConstraint("PK_SKLADNIKWZORCA")!, ReferentialAction.NoAction); + var fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", + new[] { "SkWzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", + new[] { "SkWzId" }); + fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA.MappedForeignKeys.Add(fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCAFk).Add(fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA); + towarSkladnikaTable.ForeignKeyConstraints.Add(fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA); + skladnikWzorcaTable.ReferencingForeignKeyConstraints.Add(fK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA); + var fK_TOWARSKLADNIKA_REFERENCE_TOWAR = new ForeignKeyConstraint( + "FK_TOWARSKLADNIKA_REFERENCE_TOWAR", towarSkladnikaTable, towarTable, + new[] { towIdColumn36 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_TOWARSKLADNIKA_REFERENCE_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_TOWARSKLADNIKA_REFERENCE_TOWAR.MappedForeignKeys.Add(fK_TOWARSKLADNIKA_REFERENCE_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWARSKLADNIKA_REFERENCE_TOWARFk).Add(fK_TOWARSKLADNIKA_REFERENCE_TOWAR); + towarSkladnikaTable.ForeignKeyConstraints.Add(fK_TOWARSKLADNIKA_REFERENCE_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_TOWARSKLADNIKA_REFERENCE_TOWAR); + var ref_DodTow = new ForeignKeyConstraint( + "Ref_DodTow", towDodatekTable, towarTable, + new[] { dodTowIdColumn }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var ref_DodTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowDodatek", + new[] { "DodTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + ref_DodTow.MappedForeignKeys.Add(ref_DodTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_DodTowFk).Add(ref_DodTow); + towDodatekTable.ForeignKeyConstraints.Add(ref_DodTow); + towarTable.ReferencingForeignKeyConstraints.Add(ref_DodTow); + var ref_TowDod = new ForeignKeyConstraint( + "Ref_TowDod", towDodatekTable, towarTable, + new[] { towIdColumn25 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var ref_TowDodFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowDodatek", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + ref_TowDod.MappedForeignKeys.Add(ref_TowDodFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_TowDodFk).Add(ref_TowDod); + towDodatekTable.ForeignKeyConstraints.Add(ref_TowDod); + towarTable.ReferencingForeignKeyConstraints.Add(ref_TowDod); + var fK_TowIntParamTowar = new ForeignKeyConstraint( + "FK_TowIntParamTowar", towIntParamTable, towarTable, + new[] { towIdColumn26 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_TowIntParamTowarFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowIntParam", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_TowIntParamTowar.MappedForeignKeys.Add(fK_TowIntParamTowarFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TowIntParamTowarFk).Add(fK_TowIntParamTowar); + towIntParamTable.ForeignKeyConstraints.Add(fK_TowIntParamTowar); + towarTable.ReferencingForeignKeyConstraints.Add(fK_TowIntParamTowar); + var fK_Ref_KrajTow = new ForeignKeyConstraint( + "FK_Ref_KrajTow", towKrajTable, krajTable, + new[] { krajIdColumn3 }, + krajTable.FindUniqueConstraint("PK_KRAJ")!, ReferentialAction.NoAction); + var fK_Ref_KrajTowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowKraj", + new[] { "KrajId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kraj", + new[] { "KrajId" }); + fK_Ref_KrajTow.MappedForeignKeys.Add(fK_Ref_KrajTowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_KrajTowFk).Add(fK_Ref_KrajTow); + towKrajTable.ForeignKeyConstraints.Add(fK_Ref_KrajTow); + krajTable.ReferencingForeignKeyConstraints.Add(fK_Ref_KrajTow); + var fK_Ref_TowKraj = new ForeignKeyConstraint( + "FK_Ref_TowKraj", towKrajTable, towarTable, + new[] { towIdColumn27 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_Ref_TowKrajFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowKraj", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_Ref_TowKraj.MappedForeignKeys.Add(fK_Ref_TowKrajFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ref_TowKrajFk).Add(fK_Ref_TowKraj); + towKrajTable.ForeignKeyConstraints.Add(fK_Ref_TowKraj); + towarTable.ReferencingForeignKeyConstraints.Add(fK_Ref_TowKraj); + var fK_TowParWB_ParId = new ForeignKeyConstraint( + "FK_TowParWB_ParId", towParWiseBaseTable, parWiseBaseTable, + new[] { parIdColumn15 }, + parWiseBaseTable.FindUniqueConstraint("PK_ParWiseBase")!, ReferentialAction.NoAction); + var fK_TowParWB_ParIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.ParWiseBase", + new[] { "ParId" }); + fK_TowParWB_ParId.MappedForeignKeys.Add(fK_TowParWB_ParIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TowParWB_ParIdFk).Add(fK_TowParWB_ParId); + towParWiseBaseTable.ForeignKeyConstraints.Add(fK_TowParWB_ParId); + parWiseBaseTable.ReferencingForeignKeyConstraints.Add(fK_TowParWB_ParId); + var fK_TowParWB_TowId = new ForeignKeyConstraint( + "FK_TowParWB_TowId", towParWiseBaseTable, towarTable, + new[] { towIdColumn28 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_TowParWB_TowIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_TowParWB_TowId.MappedForeignKeys.Add(fK_TowParWB_TowIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TowParWB_TowIdFk).Add(fK_TowParWB_TowId); + towParWiseBaseTable.ForeignKeyConstraints.Add(fK_TowParWB_TowId); + towarTable.ReferencingForeignKeyConstraints.Add(fK_TowParWB_TowId); + var ref_PowTowPow_Tow = new ForeignKeyConstraint( + "Ref_PowTowPow_Tow", towPowiazanieTable, towarTable, + new[] { powTowIdColumn }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var ref_PowTowPow_TowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie", + new[] { "PowTowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + ref_PowTowPow_Tow.MappedForeignKeys.Add(ref_PowTowPow_TowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_PowTowPow_TowFk).Add(ref_PowTowPow_Tow); + towPowiazanieTable.ForeignKeyConstraints.Add(ref_PowTowPow_Tow); + towarTable.ReferencingForeignKeyConstraints.Add(ref_PowTowPow_Tow); + var ref_TowPow_Tow = new ForeignKeyConstraint( + "Ref_TowPow_Tow", towPowiazanieTable, towarTable, + new[] { towIdColumn29 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var ref_TowPow_TowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + ref_TowPow_Tow.MappedForeignKeys.Add(ref_TowPow_TowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_TowPow_TowFk).Add(ref_TowPow_Tow); + towPowiazanieTable.ForeignKeyConstraints.Add(ref_TowPow_Tow); + towarTable.ReferencingForeignKeyConstraints.Add(ref_TowPow_Tow); + var fK_TWSTR_TOW = new ForeignKeyConstraint( + "FK_TWSTR_TOW", towStratyTable, towarTable, + new[] { towIdColumn30 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_TWSTR_TOWFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowStraty", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_TWSTR_TOW.MappedForeignKeys.Add(fK_TWSTR_TOWFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TWSTR_TOWFk).Add(fK_TWSTR_TOW); + towStratyTable.ForeignKeyConstraints.Add(fK_TWSTR_TOW); + towarTable.ReferencingForeignKeyConstraints.Add(fK_TWSTR_TOW); + var fK_TWSTRSKL_SKL = new ForeignKeyConstraint( + "FK_TWSTRSKL_SKL", towStratyDlaSklepuTable, sklepTable, + new[] { sklepIdColumn110 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var fK_TWSTRSKL_SKLFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + fK_TWSTRSKL_SKL.MappedForeignKeys.Add(fK_TWSTRSKL_SKLFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TWSTRSKL_SKLFk).Add(fK_TWSTRSKL_SKL); + towStratyDlaSklepuTable.ForeignKeyConstraints.Add(fK_TWSTRSKL_SKL); + sklepTable.ReferencingForeignKeyConstraints.Add(fK_TWSTRSKL_SKL); + var fK_TWSTRSKL_TWSTR = new ForeignKeyConstraint( + "FK_TWSTRSKL_TWSTR", towStratyDlaSklepuTable, towStratyTable, + new[] { towIdColumn31, idxRodzStratColumn1 }, + towStratyTable.FindUniqueConstraint("PK_TOWSTRATY")!, ReferentialAction.NoAction); + var fK_TWSTRSKL_TWSTRFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu", + new[] { "TowId", "IdxRodzStrat" }, + "Blink.Backoffice.Services.PcmDb.Entities.TowStraty", + new[] { "TowId", "IdxRodzStrat" }); + fK_TWSTRSKL_TWSTR.MappedForeignKeys.Add(fK_TWSTRSKL_TWSTRFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TWSTRSKL_TWSTRFk).Add(fK_TWSTRSKL_TWSTR); + towStratyDlaSklepuTable.ForeignKeyConstraints.Add(fK_TWSTRSKL_TWSTR); + towStratyTable.ReferencingForeignKeyConstraints.Add(fK_TWSTRSKL_TWSTR); + var fK_TOWWARTO_REF_PARTO_PARAMETR = new ForeignKeyConstraint( + "FK_TOWWARTO_REF_PARTO_PARAMETR", towWartoscTable, parametrTable, + new[] { parIdColumn16 }, + parametrTable.FindUniqueConstraint("PK_PARAMETR")!, ReferentialAction.NoAction); + var fK_TOWWARTO_REF_PARTO_PARAMETRFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowWartosc", + new[] { "ParId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Parametr", + new[] { "ParId" }); + fK_TOWWARTO_REF_PARTO_PARAMETR.MappedForeignKeys.Add(fK_TOWWARTO_REF_PARTO_PARAMETRFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWWARTO_REF_PARTO_PARAMETRFk).Add(fK_TOWWARTO_REF_PARTO_PARAMETR); + towWartoscTable.ForeignKeyConstraints.Add(fK_TOWWARTO_REF_PARTO_PARAMETR); + parametrTable.ReferencingForeignKeyConstraints.Add(fK_TOWWARTO_REF_PARTO_PARAMETR); + var fK_TOWWARTO_REF_TOWWA_TOWAR = new ForeignKeyConstraint( + "FK_TOWWARTO_REF_TOWWA_TOWAR", towWartoscTable, towarTable, + new[] { towIdColumn32 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_TOWWARTO_REF_TOWWA_TOWARFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowWartosc", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_TOWWARTO_REF_TOWWA_TOWAR.MappedForeignKeys.Add(fK_TOWWARTO_REF_TOWWA_TOWARFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TOWWARTO_REF_TOWWA_TOWARFk).Add(fK_TOWWARTO_REF_TOWWA_TOWAR); + towWartoscTable.ForeignKeyConstraints.Add(fK_TOWWARTO_REF_TOWWA_TOWAR); + towarTable.ReferencingForeignKeyConstraints.Add(fK_TOWWARTO_REF_TOWWA_TOWAR); + var fK_TowZamiennik_Tow = new ForeignKeyConstraint( + "FK_TowZamiennik_Tow", towZamiennikTable, towarTable, + new[] { towIdColumn33 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_TowZamiennik_TowFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_TowZamiennik_Tow.MappedForeignKeys.Add(fK_TowZamiennik_TowFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TowZamiennik_TowFk).Add(fK_TowZamiennik_Tow); + towZamiennikTable.ForeignKeyConstraints.Add(fK_TowZamiennik_Tow); + towarTable.ReferencingForeignKeyConstraints.Add(fK_TowZamiennik_Tow); + var fK_TowZamiennik_Zam = new ForeignKeyConstraint( + "FK_TowZamiennik_Zam", towZamiennikTable, zamiennikTable, + new[] { zmIdColumn1 }, + zamiennikTable.FindUniqueConstraint("PK_ZAMIENNIK")!, ReferentialAction.NoAction); + var fK_TowZamiennik_ZamFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik", + new[] { "ZmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zamiennik", + new[] { "ZmId" }); + fK_TowZamiennik_Zam.MappedForeignKeys.Add(fK_TowZamiennik_ZamFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TowZamiennik_ZamFk).Add(fK_TowZamiennik_Zam); + towZamiennikTable.ForeignKeyConstraints.Add(fK_TowZamiennik_Zam); + zamiennikTable.ReferencingForeignKeyConstraints.Add(fK_TowZamiennik_Zam); + var fK_TowZdjecia_TowId = new ForeignKeyConstraint( + "FK_TowZdjecia_TowId", towZdjeciaTable, towarTable, + new[] { towIdColumn34 }, + towarTable.FindUniqueConstraint("PK_TOWAR")!, ReferentialAction.NoAction); + var fK_TowZdjecia_TowIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TowZdjecia", + new[] { "TowId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + new[] { "TowId" }); + fK_TowZdjecia_TowId.MappedForeignKeys.Add(fK_TowZdjecia_TowIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TowZdjecia_TowIdFk).Add(fK_TowZdjecia_TowId); + towZdjeciaTable.ForeignKeyConstraints.Add(fK_TowZdjecia_TowId); + towarTable.ReferencingForeignKeyConstraints.Add(fK_TowZdjecia_TowId); + var fK_TrescEmail_Uz = new ForeignKeyConstraint( + "FK_TrescEmail_Uz", trescEmailTable, uzytkownikTable, + new[] { uzIdColumn6 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_TrescEmail_UzFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_TrescEmail_Uz.MappedForeignKeys.Add(fK_TrescEmail_UzFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TrescEmail_UzFk).Add(fK_TrescEmail_Uz); + trescEmailTable.ForeignKeyConstraints.Add(fK_TrescEmail_Uz); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_TrescEmail_Uz); + var fK_TrescEmail_Pe = new ForeignKeyConstraint( + "FK_TrescEmail_Pe", trescEmailTekstTable, trescEmailTable, + new[] { tEIdColumn0 }, + trescEmailTable.FindUniqueConstraint("PK_TrescEmail")!, ReferentialAction.NoAction); + var fK_TrescEmail_PeFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmailTekst", + new[] { "TEId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + new[] { "TEId" }); + fK_TrescEmail_Pe.MappedForeignKeys.Add(fK_TrescEmail_PeFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_TrescEmail_PeFk).Add(fK_TrescEmail_Pe); + trescEmailTekstTable.ForeignKeyConstraints.Add(fK_TrescEmail_Pe); + trescEmailTable.ReferencingForeignKeyConstraints.Add(fK_TrescEmail_Pe); + var fK_Ulica_MId = new ForeignKeyConstraint( + "FK_Ulica_MId", ulicaTable, miastoTable, + new[] { mIdColumn0 }, + miastoTable.FindUniqueConstraint("PK_Miasto")!, ReferentialAction.NoAction); + var fK_Ulica_MIdFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Ulica", + new[] { "MId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Miasto", + new[] { "MId" }); + fK_Ulica_MId.MappedForeignKeys.Add(fK_Ulica_MIdFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_Ulica_MIdFk).Add(fK_Ulica_MId); + ulicaTable.ForeignKeyConstraints.Add(fK_Ulica_MId); + miastoTable.ReferencingForeignKeyConstraints.Add(fK_Ulica_MId); + var fK_UPRAWNIE_REF_UZUPR_UZYTKOWN = new ForeignKeyConstraint( + "FK_UPRAWNIE_REF_UZUPR_UZYTKOWN", uprawnienieTable, uzytkownikTable, + new[] { uzIdColumn7 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_UPRAWNIE_REF_UZUPR_UZYTKOWNFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Uprawnienie", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_UPRAWNIE_REF_UZUPR_UZYTKOWN.MappedForeignKeys.Add(fK_UPRAWNIE_REF_UZUPR_UZYTKOWNFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_UPRAWNIE_REF_UZUPR_UZYTKOWNFk).Add(fK_UPRAWNIE_REF_UZUPR_UZYTKOWN); + uprawnienieTable.ForeignKeyConstraints.Add(fK_UPRAWNIE_REF_UZUPR_UZYTKOWN); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_UPRAWNIE_REF_UZUPR_UZYTKOWN); + var ref_UprNaSklepUzNaSklep = new ForeignKeyConstraint( + "Ref_UprNaSklepUzNaSklep", uprawnienieNaSklepTable, uzNaSklepTable, + new[] { uzNSIdColumn1 }, + uzNaSklepTable.FindUniqueConstraint("PK_UZNASKLEP")!, ReferentialAction.NoAction); + var ref_UprNaSklepUzNaSklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.UprawnienieNaSklep", + new[] { "UzNSId" }, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + new[] { "UzNSId" }); + ref_UprNaSklepUzNaSklep.MappedForeignKeys.Add(ref_UprNaSklepUzNaSklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_UprNaSklepUzNaSklepFk).Add(ref_UprNaSklepUzNaSklep); + uprawnienieNaSklepTable.ForeignKeyConstraints.Add(ref_UprNaSklepUzNaSklep); + uzNaSklepTable.ReferencingForeignKeyConstraints.Add(ref_UprNaSklepUzNaSklep); + var ref_UzNaSklepSklep = new ForeignKeyConstraint( + "Ref_UzNaSklepSklep", uzNaSklepTable, sklepTable, + new[] { sklepIdColumn111 }, + sklepTable.FindUniqueConstraint("PK_SKLEP")!, ReferentialAction.NoAction); + var ref_UzNaSklepSklepFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + new[] { "SklepId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + new[] { "SklepId" }); + ref_UzNaSklepSklep.MappedForeignKeys.Add(ref_UzNaSklepSklepFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_UzNaSklepSklepFk).Add(ref_UzNaSklepSklep); + uzNaSklepTable.ForeignKeyConstraints.Add(ref_UzNaSklepSklep); + sklepTable.ReferencingForeignKeyConstraints.Add(ref_UzNaSklepSklep); + var ref_UzNaSklepSklepUz = new ForeignKeyConstraint( + "Ref_UzNaSklepSklepUz", uzNaSklepTable, sklepUzytkownikTable, + new[] { sklepIdColumn111, sklepUzIdColumn8 }, + sklepUzytkownikTable.FindUniqueConstraint("PK_SKLEPUZYTKOWNIK")!, ReferentialAction.NoAction); + var ref_UzNaSklepSklepUzFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + new[] { "SklepId", "SklepUzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + new[] { "SklepId", "SklepUzId" }); + ref_UzNaSklepSklepUz.MappedForeignKeys.Add(ref_UzNaSklepSklepUzFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_UzNaSklepSklepUzFk).Add(ref_UzNaSklepSklepUz); + uzNaSklepTable.ForeignKeyConstraints.Add(ref_UzNaSklepSklepUz); + sklepUzytkownikTable.ReferencingForeignKeyConstraints.Add(ref_UzNaSklepSklepUz); + var fK_UZYTKOWINK_REFERENCE_PROFIL = new ForeignKeyConstraint( + "FK_UZYTKOWINK_REFERENCE_PROFIL", uzytkownikTable, profilTable, + new[] { profilIdColumn3 }, + profilTable.FindUniqueConstraint("PK_PROFIL")!, ReferentialAction.NoAction); + var fK_UZYTKOWINK_REFERENCE_PROFILFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "ProfilId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Profil", + new[] { "ProfilId" }); + fK_UZYTKOWINK_REFERENCE_PROFIL.MappedForeignKeys.Add(fK_UZYTKOWINK_REFERENCE_PROFILFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_UZYTKOWINK_REFERENCE_PROFILFk).Add(fK_UZYTKOWINK_REFERENCE_PROFIL); + uzytkownikTable.ForeignKeyConstraints.Add(fK_UZYTKOWINK_REFERENCE_PROFIL); + profilTable.ReferencingForeignKeyConstraints.Add(fK_UZYTKOWINK_REFERENCE_PROFIL); + var fK_ZALEZNOS_REF_DODOK_DOK = new ForeignKeyConstraint( + "FK_ZALEZNOS_REF_DODOK_DOK", zaleznoscTable, dokTable, + new[] { poprzedniDokIdColumn }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_ZALEZNOS_REF_DODOK_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc", + new[] { "PoprzedniDokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_ZALEZNOS_REF_DODOK_DOK.MappedForeignKeys.Add(fK_ZALEZNOS_REF_DODOK_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZALEZNOS_REF_DODOK_DOKFk).Add(fK_ZALEZNOS_REF_DODOK_DOK); + zaleznoscTable.ForeignKeyConstraints.Add(fK_ZALEZNOS_REF_DODOK_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_ZALEZNOS_REF_DODOK_DOK); + var fK_ZALEZNOS_REF_ODDOK_DOK = new ForeignKeyConstraint( + "FK_ZALEZNOS_REF_ODDOK_DOK", zaleznoscTable, dokTable, + new[] { dokIdColumn24 }, + dokTable.FindUniqueConstraint("PK_DOK")!, ReferentialAction.NoAction); + var fK_ZALEZNOS_REF_ODDOK_DOKFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc", + new[] { "DokId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Dok", + new[] { "DokId" }); + fK_ZALEZNOS_REF_ODDOK_DOK.MappedForeignKeys.Add(fK_ZALEZNOS_REF_ODDOK_DOKFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZALEZNOS_REF_ODDOK_DOKFk).Add(fK_ZALEZNOS_REF_ODDOK_DOK); + zaleznoscTable.ForeignKeyConstraints.Add(fK_ZALEZNOS_REF_ODDOK_DOK); + dokTable.ReferencingForeignKeyConstraints.Add(fK_ZALEZNOS_REF_ODDOK_DOK); + var ref_ZdarzKarta = new ForeignKeyConstraint( + "Ref_ZdarzKarta", zdarzLojTable, kartaLojTable, + new[] { kartaIdColumn0 }, + kartaLojTable.FindUniqueConstraint("PK_KARTALOJ")!, ReferentialAction.NoAction); + var ref_ZdarzKartaFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + new[] { "KartaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KartaLoj", + new[] { "KartaId" }); + ref_ZdarzKarta.MappedForeignKeys.Add(ref_ZdarzKartaFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_ZdarzKartaFk).Add(ref_ZdarzKarta); + zdarzLojTable.ForeignKeyConstraints.Add(ref_ZdarzKarta); + kartaLojTable.ReferencingForeignKeyConstraints.Add(ref_ZdarzKarta); + var ref_ZdarzKonto = new ForeignKeyConstraint( + "Ref_ZdarzKonto", zdarzLojTable, kontoLojTable, + new[] { kontoIdColumn6 }, + kontoLojTable.FindUniqueConstraint("PK_KONTOLOJ")!, ReferentialAction.NoAction); + var ref_ZdarzKontoFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + new[] { "KontoId" }, + "Blink.Backoffice.Services.PcmDb.Entities.KontoLoj", + new[] { "KontoId" }); + ref_ZdarzKonto.MappedForeignKeys.Add(ref_ZdarzKontoFk); + RelationalModel.GetOrCreateForeignKeyConstraints(ref_ZdarzKontoFk).Add(ref_ZdarzKonto); + zdarzLojTable.ForeignKeyConstraints.Add(ref_ZdarzKonto); + kontoLojTable.ReferencingForeignKeyConstraints.Add(ref_ZdarzKonto); + var fK_ZDOSUZ = new ForeignKeyConstraint( + "FK_ZDOSUZ", zdarzOsTable, uzytkownikTable, + new[] { uzIdColumn9 }, + uzytkownikTable.FindUniqueConstraint("PK_UZYTKOWNIK")!, ReferentialAction.NoAction); + var fK_ZDOSUZFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + new[] { "UzId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + new[] { "UzId" }); + fK_ZDOSUZ.MappedForeignKeys.Add(fK_ZDOSUZFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZDOSUZFk).Add(fK_ZDOSUZ); + zdarzOsTable.ForeignKeyConstraints.Add(fK_ZDOSUZ); + uzytkownikTable.ReferencingForeignKeyConstraints.Add(fK_ZDOSUZ); + var fK_ZDOS_KTH = new ForeignKeyConstraint( + "FK_ZDOS_KTH", zdarzOsTable, kontrahentTable, + new[] { kontrIdColumn20 }, + kontrahentTable.FindUniqueConstraint("PK_KONTRAHENT")!, ReferentialAction.NoAction); + var fK_ZDOS_KTHFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + new[] { "KontrId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kontrahent", + new[] { "KontrId" }); + fK_ZDOS_KTH.MappedForeignKeys.Add(fK_ZDOS_KTHFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZDOS_KTHFk).Add(fK_ZDOS_KTH); + zdarzOsTable.ForeignKeyConstraints.Add(fK_ZDOS_KTH); + kontrahentTable.ReferencingForeignKeyConstraints.Add(fK_ZDOS_KTH); + var fK_ZDOS_TPOS = new ForeignKeyConstraint( + "FK_ZDOS_TPOS", zdarzOsTable, typOsTable, + new[] { typOsIdColumn2 }, + typOsTable.FindUniqueConstraint("PK_TYPOS")!, ReferentialAction.NoAction); + var fK_ZDOS_TPOSFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + new[] { "TypOsId" }, + "Blink.Backoffice.Services.PcmDb.Entities.TypOs", + new[] { "TypOsId" }); + fK_ZDOS_TPOS.MappedForeignKeys.Add(fK_ZDOS_TPOSFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZDOS_TPOSFk).Add(fK_ZDOS_TPOS); + zdarzOsTable.ForeignKeyConstraints.Add(fK_ZDOS_TPOS); + typOsTable.ReferencingForeignKeyConstraints.Add(fK_ZDOS_TPOS); + var fK_ZDOS_ZG = new ForeignKeyConstraint( + "FK_ZDOS_ZG", zdarzOsTable, zgodaTable, + new[] { zgIdColumn4 }, + zgodaTable.FindUniqueConstraint("PK_ZGODA")!, ReferentialAction.NoAction); + var fK_ZDOS_ZGFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + new[] { "ZgId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + new[] { "ZgId" }); + fK_ZDOS_ZG.MappedForeignKeys.Add(fK_ZDOS_ZGFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZDOS_ZGFk).Add(fK_ZDOS_ZG); + zdarzOsTable.ForeignKeyConstraints.Add(fK_ZDOS_ZG); + zgodaTable.ReferencingForeignKeyConstraints.Add(fK_ZDOS_ZG); + var fK_ZDOSOPIS = new ForeignKeyConstraint( + "FK_ZDOSOPIS", zdarzOsOpisTable, zdarzOsTable, + new[] { kontrIdColumn21, kiedyColumn9 }, + zdarzOsTable.FindUniqueConstraint("PK_ZDARZOS")!, ReferentialAction.NoAction); + var fK_ZDOSOPISFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOsOpis", + new[] { "KontrId", "Kiedy" }, + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + new[] { "KontrId", "Kiedy" }); + fK_ZDOSOPIS.MappedForeignKeys.Add(fK_ZDOSOPISFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZDOSOPISFk).Add(fK_ZDOSOPIS); + zdarzOsOpisTable.ForeignKeyConstraints.Add(fK_ZDOSOPIS); + zdarzOsTable.ReferencingForeignKeyConstraints.Add(fK_ZDOSOPIS); + var fK_ZLECENIE_REF_ZLECK_KASA = new ForeignKeyConstraint( + "FK_ZLECENIE_REF_ZLECK_KASA", zlecenieTable, kasaTable, + new[] { kasaIdColumn9 }, + kasaTable.FindUniqueConstraint("PK_KASA")!, ReferentialAction.NoAction); + var fK_ZLECENIE_REF_ZLECK_KASAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zlecenie", + new[] { "KasaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Kasa", + new[] { "KasaId" }); + fK_ZLECENIE_REF_ZLECK_KASA.MappedForeignKeys.Add(fK_ZLECENIE_REF_ZLECK_KASAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZLECENIE_REF_ZLECK_KASAFk).Add(fK_ZLECENIE_REF_ZLECK_KASA); + zlecenieTable.ForeignKeyConstraints.Add(fK_ZLECENIE_REF_ZLECK_KASA); + kasaTable.ReferencingForeignKeyConstraints.Add(fK_ZLECENIE_REF_ZLECK_KASA); + var fK_ZLECKOMU_REF_ZLECK_ZLECENIE = new ForeignKeyConstraint( + "FK_ZLECKOMU_REF_ZLECK_ZLECENIE", zlecKomunikatTable, zlecenieTable, + new[] { kasaIdColumn7, zlecIdColumn }, + zlecenieTable.FindUniqueConstraint("PK_ZLECENIE")!, ReferentialAction.NoAction); + var fK_ZLECKOMU_REF_ZLECK_ZLECENIEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZlecKomunikat", + new[] { "KasaId", "ZlecId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zlecenie", + new[] { "KasaId", "ZlecId" }); + fK_ZLECKOMU_REF_ZLECK_ZLECENIE.MappedForeignKeys.Add(fK_ZLECKOMU_REF_ZLECK_ZLECENIEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZLECKOMU_REF_ZLECK_ZLECENIEFk).Add(fK_ZLECKOMU_REF_ZLECK_ZLECENIE); + zlecKomunikatTable.ForeignKeyConstraints.Add(fK_ZLECKOMU_REF_ZLECK_ZLECENIE); + zlecenieTable.ReferencingForeignKeyConstraints.Add(fK_ZLECKOMU_REF_ZLECK_ZLECENIE); + var fK_ZLECPARA_REF_ZLECP_ZLECENIE = new ForeignKeyConstraint( + "FK_ZLECPARA_REF_ZLECP_ZLECENIE", zlecParamTable, zlecenieTable, + new[] { kasaIdColumn8, zlecIdColumn0 }, + zlecenieTable.FindUniqueConstraint("PK_ZLECENIE")!, ReferentialAction.NoAction); + var fK_ZLECPARA_REF_ZLECP_ZLECENIEFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZlecParam", + new[] { "KasaId", "ZlecId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zlecenie", + new[] { "KasaId", "ZlecId" }); + fK_ZLECPARA_REF_ZLECP_ZLECENIE.MappedForeignKeys.Add(fK_ZLECPARA_REF_ZLECP_ZLECENIEFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZLECPARA_REF_ZLECP_ZLECENIEFk).Add(fK_ZLECPARA_REF_ZLECP_ZLECENIE); + zlecParamTable.ForeignKeyConstraints.Add(fK_ZLECPARA_REF_ZLECP_ZLECENIE); + zlecenieTable.ReferencingForeignKeyConstraints.Add(fK_ZLECPARA_REF_ZLECP_ZLECENIE); + var fK_ZMIANA_REF_SESJA_SESJA = new ForeignKeyConstraint( + "FK_ZMIANA_REF_SESJA_SESJA", zmianaTable, sesjaTable, + new[] { sesjaIdColumn2 }, + sesjaTable.FindUniqueConstraint("PK_SESJA")!, ReferentialAction.NoAction); + var fK_ZMIANA_REF_SESJA_SESJAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + new[] { "SesjaId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Sesja", + new[] { "SesjaId" }); + fK_ZMIANA_REF_SESJA_SESJA.MappedForeignKeys.Add(fK_ZMIANA_REF_SESJA_SESJAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZMIANA_REF_SESJA_SESJAFk).Add(fK_ZMIANA_REF_SESJA_SESJA); + zmianaTable.ForeignKeyConstraints.Add(fK_ZMIANA_REF_SESJA_SESJA); + sesjaTable.ReferencingForeignKeyConstraints.Add(fK_ZMIANA_REF_SESJA_SESJA); + var fK_ZMIANATA_REF_ZMTAB_ZMIANA = new ForeignKeyConstraint( + "FK_ZMIANATA_REF_ZMTAB_ZMIANA", zmianaTabeliTable, zmianaTable, + new[] { zmIdColumn4 }, + zmianaTable.FindUniqueConstraint("PK_ZMIANA")!, ReferentialAction.NoAction); + var fK_ZMIANATA_REF_ZMTAB_ZMIANAFk = RelationalModel.GetForeignKey(this, + "Blink.Backoffice.Services.PcmDb.Entities.ZmianaTabeli", + new[] { "ZmId" }, + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + new[] { "ZmId" }); + fK_ZMIANATA_REF_ZMTAB_ZMIANA.MappedForeignKeys.Add(fK_ZMIANATA_REF_ZMTAB_ZMIANAFk); + RelationalModel.GetOrCreateForeignKeyConstraints(fK_ZMIANATA_REF_ZMTAB_ZMIANAFk).Add(fK_ZMIANATA_REF_ZMTAB_ZMIANA); + zmianaTabeliTable.ForeignKeyConstraints.Add(fK_ZMIANATA_REF_ZMTAB_ZMIANA); + zmianaTable.ReferencingForeignKeyConstraints.Add(fK_ZMIANATA_REF_ZMTAB_ZMIANA); + return relationalModel.MakeReadOnly(); + } + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpPosEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpPosEntityType.cs new file mode 100644 index 0000000..d08a133 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpPosEntityType.cs @@ -0,0 +1,289 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcpPosEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcpPos", + typeof(PcpPos), + baseEntityType); + + var pcpPosId = runtimeEntityType.AddProperty( + "PcpPosId", + typeof(int), + propertyInfo: typeof(PcpPos).GetProperty("PcpPosId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + pcpPosId.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + pcpPosId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var active = runtimeEntityType.AddProperty( + "Active", + typeof(short), + propertyInfo: typeof(PcpPos).GetProperty("Active", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + active.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + active.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var created = runtimeEntityType.AddProperty( + "Created", + typeof(DateTime), + propertyInfo: typeof(PcpPos).GetProperty("Created", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + created.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + created.AddAnnotation("Relational:ColumnType", "datetime"); + created.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var fiscalUniqueNoDfl = runtimeEntityType.AddProperty( + "FiscalUniqueNoDfl", + typeof(string), + propertyInfo: typeof(PcpPos).GetProperty("FiscalUniqueNoDfl", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + fiscalUniqueNoDfl.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + fiscalUniqueNoDfl.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcpShopId = runtimeEntityType.AddProperty( + "PcpShopId", + typeof(int), + propertyInfo: typeof(PcpPos).GetProperty("PcpShopId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + pcpShopId.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + pcpShopId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posCode = runtimeEntityType.AddProperty( + "PosCode", + typeof(string), + propertyInfo: typeof(PcpPos).GetProperty("PosCode", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + posCode.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + posCode.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posName = runtimeEntityType.AddProperty( + "PosName", + typeof(string), + propertyInfo: typeof(PcpPos).GetProperty("PosName", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + posName.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + posName.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posNo = runtimeEntityType.AddProperty( + "PosNo", + typeof(short), + propertyInfo: typeof(PcpPos).GetProperty("PosNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + posNo.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + posNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var updated = runtimeEntityType.AddProperty( + "Updated", + typeof(DateTime), + propertyInfo: typeof(PcpPos).GetProperty("Updated", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + updated.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + updated.AddAnnotation("Relational:ColumnType", "datetime"); + updated.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcpPosId }); + runtimeEntityType.SetPrimaryKey(key); + + var ixPcpPosPcpShopId = runtimeEntityType.AddIndex( + new[] { pcpShopId }, + name: "IxPcpPosPcpShopId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcpShopId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PcpShopId") }), + principalEntityType, + required: true); + + var pcpShop = declaringEntityType.AddNavigation("PcpShop", + runtimeForeignKey, + onDependent: true, + typeof(PcpShop), + propertyInfo: typeof(PcpPos).GetProperty("PcpShop", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcpPos = principalEntityType.AddNavigation("PcpPos", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PcpShop).GetProperty("PcpPos", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Pos_Shop"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcpPos"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptEntityType.cs new file mode 100644 index 0000000..5c99d3e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptEntityType.cs @@ -0,0 +1,602 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcpReceiptEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceipt", + typeof(PcpReceipt), + baseEntityType); + + var pcpReceiptId = runtimeEntityType.AddProperty( + "PcpReceiptId", + typeof(decimal), + propertyInfo: typeof(PcpReceipt).GetProperty("PcpReceiptId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pcpReceiptId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcpReceiptId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcpReceiptId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var cashier = runtimeEntityType.AddProperty( + "Cashier", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("Cashier", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + cashier.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + cashier.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var created = runtimeEntityType.AddProperty( + "Created", + typeof(DateTime), + propertyInfo: typeof(PcpReceipt).GetProperty("Created", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + created.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + created.AddAnnotation("Relational:ColumnType", "datetime"); + created.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var customerCode = runtimeEntityType.AddProperty( + "CustomerCode", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("CustomerCode", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + customerCode.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + customerCode.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var customerNip = runtimeEntityType.AddProperty( + "CustomerNip", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("CustomerNip", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 16, + unicode: false); + customerNip.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(16)", + size: 16)); + customerNip.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var docNo = runtimeEntityType.AddProperty( + "DocNo", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("DocNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + docNo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + docNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var fiscalUniqueNo = runtimeEntityType.AddProperty( + "FiscalUniqueNo", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("FiscalUniqueNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + fiscalUniqueNo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + fiscalUniqueNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal?), + propertyInfo: typeof(PcpReceipt).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var operationDateTime = runtimeEntityType.AddProperty( + "OperationDateTime", + typeof(DateTime), + propertyInfo: typeof(PcpReceipt).GetProperty("OperationDateTime", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + operationDateTime.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + operationDateTime.AddAnnotation("Relational:ColumnType", "datetime"); + operationDateTime.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcpPosId = runtimeEntityType.AddProperty( + "PcpPosId", + typeof(int), + propertyInfo: typeof(PcpReceipt).GetProperty("PcpPosId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + pcpPosId.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + pcpPosId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posCode = runtimeEntityType.AddProperty( + "PosCode", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("PosCode", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + posCode.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + posCode.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posNo = runtimeEntityType.AddProperty( + "PosNo", + typeof(short?), + propertyInfo: typeof(PcpReceipt).GetProperty("PosNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + posNo.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + posNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var printerNumber = runtimeEntityType.AddProperty( + "PrinterNumber", + typeof(int?), + propertyInfo: typeof(PcpReceipt).GetProperty("PrinterNumber", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + printerNumber.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + printerNumber.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var receiptSysNo = runtimeEntityType.AddProperty( + "ReceiptSysNo", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("ReceiptSysNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 32, + unicode: false); + receiptSysNo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + receiptSysNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNo = runtimeEntityType.AddProperty( + "ShopNo", + typeof(short?), + propertyInfo: typeof(PcpReceipt).GetProperty("ShopNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + shopNo.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + shopNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalBrutto = runtimeEntityType.AddProperty( + "TotalBrutto", + typeof(decimal), + propertyInfo: typeof(PcpReceipt).GetProperty("TotalBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + totalBrutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalBrutto.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalDiscount = runtimeEntityType.AddProperty( + "TotalDiscount", + typeof(decimal?), + propertyInfo: typeof(PcpReceipt).GetProperty("TotalDiscount", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + totalDiscount.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalDiscount.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalDiscount.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalNetto = runtimeEntityType.AddProperty( + "TotalNetto", + typeof(decimal?), + propertyInfo: typeof(PcpReceipt).GetProperty("TotalNetto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + totalNetto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalNetto.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalNetto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var transUUID = runtimeEntityType.AddProperty( + "TransUUID", + typeof(string), + propertyInfo: typeof(PcpReceipt).GetProperty("TransUUID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + transUUID.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + transUUID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var updated = runtimeEntityType.AddProperty( + "Updated", + typeof(DateTime), + propertyInfo: typeof(PcpReceipt).GetProperty("Updated", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + updated.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + updated.AddAnnotation("Relational:ColumnType", "datetime"); + updated.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcpReceiptId }); + runtimeEntityType.SetPrimaryKey(key); + + var ixPcpReceiptCustomerCode = runtimeEntityType.AddIndex( + new[] { customerCode }, + name: "IxPcpReceiptCustomerCode"); + + var ixPcpReceiptKontrId = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "IxPcpReceiptKontrId"); + + var ixPcpReceiptPcpPosId = runtimeEntityType.AddIndex( + new[] { pcpPosId }, + name: "IxPcpReceiptPcpPosId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(PcpReceipt).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcpReceipt = principalEntityType.AddNavigation("PcpReceipt", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("PcpReceipt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Receipt_Customer"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcpPosId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PcpPosId") }), + principalEntityType, + required: true); + + var pcpPos = declaringEntityType.AddNavigation("PcpPos", + runtimeForeignKey, + onDependent: true, + typeof(PcpPos), + propertyInfo: typeof(PcpReceipt).GetProperty("PcpPos", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcpReceipt = principalEntityType.AddNavigation("PcpReceipt", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PcpPos).GetProperty("PcpReceipt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpPos).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Receipt_Pos"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcpReceipt"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptItemEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptItemEntityType.cs new file mode 100644 index 0000000..a1f0a2c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptItemEntityType.cs @@ -0,0 +1,445 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcpReceiptItemEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptItem", + typeof(PcpReceiptItem), + baseEntityType); + + var pcpReceiptItemId = runtimeEntityType.AddProperty( + "PcpReceiptItemId", + typeof(decimal), + propertyInfo: typeof(PcpReceiptItem).GetProperty("PcpReceiptItemId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pcpReceiptItemId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcpReceiptItemId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcpReceiptItemId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var barcode = runtimeEntityType.AddProperty( + "Barcode", + typeof(string), + propertyInfo: typeof(PcpReceiptItem).GetProperty("Barcode", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + barcode.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + barcode.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var discountType = runtimeEntityType.AddProperty( + "DiscountType", + typeof(short), + propertyInfo: typeof(PcpReceiptItem).GetProperty("DiscountType", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + discountType.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + discountType.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var discountValue = runtimeEntityType.AddProperty( + "DiscountValue", + typeof(decimal), + propertyInfo: typeof(PcpReceiptItem).GetProperty("DiscountValue", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + discountValue.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + discountValue.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + discountValue.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var isReturn = runtimeEntityType.AddProperty( + "IsReturn", + typeof(short), + propertyInfo: typeof(PcpReceiptItem).GetProperty("IsReturn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + isReturn.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + isReturn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcpReceiptId = runtimeEntityType.AddProperty( + "PcpReceiptId", + typeof(decimal), + propertyInfo: typeof(PcpReceiptItem).GetProperty("PcpReceiptId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + pcpReceiptId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcpReceiptId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcpReceiptId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var price = runtimeEntityType.AddProperty( + "Price", + typeof(decimal), + propertyInfo: typeof(PcpReceiptItem).GetProperty("Price", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + price.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + price.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + price.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var productName = runtimeEntityType.AddProperty( + "ProductName", + typeof(string), + propertyInfo: typeof(PcpReceiptItem).GetProperty("ProductName", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 128, + unicode: false); + productName.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(128)", + size: 128)); + productName.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var productType = runtimeEntityType.AddProperty( + "ProductType", + typeof(short), + propertyInfo: typeof(PcpReceiptItem).GetProperty("ProductType", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + productType.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + productType.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var quantity = runtimeEntityType.AddProperty( + "Quantity", + typeof(decimal), + propertyInfo: typeof(PcpReceiptItem).GetProperty("Quantity", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + quantity.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,4)", + precision: 14, + scale: 4)); + quantity.AddAnnotation("Relational:ColumnType", "decimal(14, 4)"); + quantity.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalBrutto = runtimeEntityType.AddProperty( + "TotalBrutto", + typeof(decimal), + propertyInfo: typeof(PcpReceiptItem).GetProperty("TotalBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + totalBrutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalBrutto.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalDiscount = runtimeEntityType.AddProperty( + "TotalDiscount", + typeof(decimal), + propertyInfo: typeof(PcpReceiptItem).GetProperty("TotalDiscount", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + totalDiscount.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalDiscount.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalDiscount.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalNetto = runtimeEntityType.AddProperty( + "TotalNetto", + typeof(decimal?), + propertyInfo: typeof(PcpReceiptItem).GetProperty("TotalNetto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + totalNetto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalNetto.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalNetto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var vatChar = runtimeEntityType.AddProperty( + "VatChar", + typeof(string), + propertyInfo: typeof(PcpReceiptItem).GetProperty("VatChar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 1, + unicode: false); + vatChar.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(1)", + size: 1)); + vatChar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var vatRate = runtimeEntityType.AddProperty( + "VatRate", + typeof(decimal?), + propertyInfo: typeof(PcpReceiptItem).GetProperty("VatRate", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + vatRate.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(6,2)", + precision: 6)); + vatRate.AddAnnotation("Relational:ColumnType", "decimal(6, 2)"); + vatRate.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcpReceiptItemId }); + runtimeEntityType.SetPrimaryKey(key); + + var ixPcpReceiptItemPcpReceiptId = runtimeEntityType.AddIndex( + new[] { pcpReceiptId }, + name: "IxPcpReceiptItemPcpReceiptId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcpReceiptId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PcpReceiptId") }), + principalEntityType, + required: true); + + var pcpReceipt = declaringEntityType.AddNavigation("PcpReceipt", + runtimeForeignKey, + onDependent: true, + typeof(PcpReceipt), + propertyInfo: typeof(PcpReceiptItem).GetProperty("PcpReceipt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptItem).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcpReceiptItem = principalEntityType.AddNavigation("PcpReceiptItem", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PcpReceipt).GetProperty("PcpReceiptItem", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ReceiptItem_Receipt"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcpReceiptItem"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptPaymentEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptPaymentEntityType.cs new file mode 100644 index 0000000..540eafd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptPaymentEntityType.cs @@ -0,0 +1,277 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcpReceiptPaymentEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptPayment", + typeof(PcpReceiptPayment), + baseEntityType); + + var pcpReceiptPaymentId = runtimeEntityType.AddProperty( + "PcpReceiptPaymentId", + typeof(decimal), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("PcpReceiptPaymentId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pcpReceiptPaymentId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcpReceiptPaymentId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcpReceiptPaymentId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var changeInCurrency = runtimeEntityType.AddProperty( + "ChangeInCurrency", + typeof(decimal), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("ChangeInCurrency", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + changeInCurrency.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,4)", + precision: 14, + scale: 4)); + changeInCurrency.AddAnnotation("Relational:ColumnType", "decimal(14, 4)"); + changeInCurrency.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var changeRef = runtimeEntityType.AddProperty( + "ChangeRef", + typeof(decimal), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("ChangeRef", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + changeRef.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + changeRef.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + changeRef.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var currency = runtimeEntityType.AddProperty( + "Currency", + typeof(string), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("Currency", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 8, + unicode: false); + currency.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(8)", + size: 8)); + currency.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paymentForm = runtimeEntityType.AddProperty( + "PaymentForm", + typeof(short), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("PaymentForm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + paymentForm.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + paymentForm.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcpReceiptId = runtimeEntityType.AddProperty( + "PcpReceiptId", + typeof(decimal), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("PcpReceiptId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + pcpReceiptId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcpReceiptId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcpReceiptId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valueInCurrency = runtimeEntityType.AddProperty( + "ValueInCurrency", + typeof(decimal), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("ValueInCurrency", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + valueInCurrency.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,4)", + precision: 14, + scale: 4)); + valueInCurrency.AddAnnotation("Relational:ColumnType", "decimal(14, 4)"); + valueInCurrency.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var valueRef = runtimeEntityType.AddProperty( + "ValueRef", + typeof(decimal), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("ValueRef", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + valueRef.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + valueRef.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + valueRef.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcpReceiptPaymentId }); + runtimeEntityType.SetPrimaryKey(key); + + var ixPcpReceiptPaymentPcpReceiptId = runtimeEntityType.AddIndex( + new[] { pcpReceiptId }, + name: "IxPcpReceiptPaymentPcpReceiptId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcpReceiptId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PcpReceiptId") }), + principalEntityType, + required: true); + + var pcpReceipt = declaringEntityType.AddNavigation("PcpReceipt", + runtimeForeignKey, + onDependent: true, + typeof(PcpReceipt), + propertyInfo: typeof(PcpReceiptPayment).GetProperty("PcpReceipt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptPayment).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcpReceiptPayment = principalEntityType.AddNavigation("PcpReceiptPayment", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PcpReceipt).GetProperty("PcpReceiptPayment", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ReceiptPayment_Receipt"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcpReceiptPayment"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptVatEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptVatEntityType.cs new file mode 100644 index 0000000..0e29fc9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpReceiptVatEntityType.cs @@ -0,0 +1,228 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcpReceiptVatEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcpReceiptVat", + typeof(PcpReceiptVat), + baseEntityType); + + var pcpReceiptVatId = runtimeEntityType.AddProperty( + "PcpReceiptVatId", + typeof(decimal), + propertyInfo: typeof(PcpReceiptVat).GetProperty("PcpReceiptVatId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptVat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pcpReceiptVatId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcpReceiptVatId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcpReceiptVatId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var pcpReceiptId = runtimeEntityType.AddProperty( + "PcpReceiptId", + typeof(decimal), + propertyInfo: typeof(PcpReceiptVat).GetProperty("PcpReceiptId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptVat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + pcpReceiptId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pcpReceiptId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pcpReceiptId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalBrutto = runtimeEntityType.AddProperty( + "TotalBrutto", + typeof(decimal), + propertyInfo: typeof(PcpReceiptVat).GetProperty("TotalBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptVat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + totalBrutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalBrutto.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var totalVat = runtimeEntityType.AddProperty( + "TotalVat", + typeof(decimal), + propertyInfo: typeof(PcpReceiptVat).GetProperty("TotalVat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptVat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + totalVat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,2)", + precision: 14)); + totalVat.AddAnnotation("Relational:ColumnType", "decimal(14, 2)"); + totalVat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var vatChar = runtimeEntityType.AddProperty( + "VatChar", + typeof(string), + propertyInfo: typeof(PcpReceiptVat).GetProperty("VatChar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptVat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 1, + unicode: false); + vatChar.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(1)", + size: 1)); + vatChar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var vatRate = runtimeEntityType.AddProperty( + "VatRate", + typeof(decimal), + propertyInfo: typeof(PcpReceiptVat).GetProperty("VatRate", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptVat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + vatRate.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(6,2)", + precision: 6)); + vatRate.AddAnnotation("Relational:ColumnType", "decimal(6, 2)"); + vatRate.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcpReceiptVatId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { pcpReceiptId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcpReceiptId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PcpReceiptId") }), + principalEntityType, + required: true); + + var pcpReceipt = declaringEntityType.AddNavigation("PcpReceipt", + runtimeForeignKey, + onDependent: true, + typeof(PcpReceipt), + propertyInfo: typeof(PcpReceiptVat).GetProperty("PcpReceipt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceiptVat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pcpReceiptVat = principalEntityType.AddNavigation("PcpReceiptVat", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PcpReceipt).GetProperty("PcpReceiptVat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpReceipt).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ReceiptVat_Receipt"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcpReceiptVat"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpShopEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpShopEntityType.cs new file mode 100644 index 0000000..79ecbb2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PcpShopEntityType.cs @@ -0,0 +1,492 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PcpShopEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PcpShop", + typeof(PcpShop), + baseEntityType); + + var pcpShopId = runtimeEntityType.AddProperty( + "PcpShopId", + typeof(int), + propertyInfo: typeof(PcpShop).GetProperty("PcpShopId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + pcpShopId.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + pcpShopId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var active = runtimeEntityType.AddProperty( + "Active", + typeof(short), + propertyInfo: typeof(PcpShop).GetProperty("Active", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + active.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + active.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var created = runtimeEntityType.AddProperty( + "Created", + typeof(DateTime), + propertyInfo: typeof(PcpShop).GetProperty("Created", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + created.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + created.AddAnnotation("Relational:ColumnType", "datetime"); + created.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopAddrOnReceipt0 = runtimeEntityType.AddProperty( + "ShopAddrOnReceipt0", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopAddrOnReceipt0", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 64, + unicode: false); + shopAddrOnReceipt0.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopAddrOnReceipt0.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopAddrOnReceipt1 = runtimeEntityType.AddProperty( + "ShopAddrOnReceipt1", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopAddrOnReceipt1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + shopAddrOnReceipt1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopAddrOnReceipt1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopAddrOnReceipt2 = runtimeEntityType.AddProperty( + "ShopAddrOnReceipt2", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopAddrOnReceipt2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + shopAddrOnReceipt2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopAddrOnReceipt2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopAddrOnReceipt3 = runtimeEntityType.AddProperty( + "ShopAddrOnReceipt3", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopAddrOnReceipt3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + shopAddrOnReceipt3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopAddrOnReceipt3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopLicenseKey = runtimeEntityType.AddProperty( + "ShopLicenseKey", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopLicenseKey", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + shopLicenseKey.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopLicenseKey.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopLicenseValidFrom = runtimeEntityType.AddProperty( + "ShopLicenseValidFrom", + typeof(DateTime?), + propertyInfo: typeof(PcpShop).GetProperty("ShopLicenseValidFrom", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + shopLicenseValidFrom.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + shopLicenseValidFrom.AddAnnotation("Relational:ColumnType", "datetime"); + shopLicenseValidFrom.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopLicenseValidTo = runtimeEntityType.AddProperty( + "ShopLicenseValidTo", + typeof(DateTime?), + propertyInfo: typeof(PcpShop).GetProperty("ShopLicenseValidTo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + shopLicenseValidTo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + shopLicenseValidTo.AddAnnotation("Relational:ColumnType", "datetime"); + shopLicenseValidTo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopName = runtimeEntityType.AddProperty( + "ShopName", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopName", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 64, + unicode: false); + shopName.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopName.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNameOnReceipt0 = runtimeEntityType.AddProperty( + "ShopNameOnReceipt0", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopNameOnReceipt0", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 64, + unicode: false); + shopNameOnReceipt0.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopNameOnReceipt0.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNameOnReceipt1 = runtimeEntityType.AddProperty( + "ShopNameOnReceipt1", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopNameOnReceipt1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + shopNameOnReceipt1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopNameOnReceipt1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNameOnReceipt2 = runtimeEntityType.AddProperty( + "ShopNameOnReceipt2", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopNameOnReceipt2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + shopNameOnReceipt2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopNameOnReceipt2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNameOnReceipt3 = runtimeEntityType.AddProperty( + "ShopNameOnReceipt3", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopNameOnReceipt3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + shopNameOnReceipt3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + shopNameOnReceipt3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNip = runtimeEntityType.AddProperty( + "ShopNip", + typeof(string), + propertyInfo: typeof(PcpShop).GetProperty("ShopNip", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 16, + unicode: false); + shopNip.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(16)", + size: 16)); + shopNip.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNo = runtimeEntityType.AddProperty( + "ShopNo", + typeof(short?), + propertyInfo: typeof(PcpShop).GetProperty("ShopNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + shopNo.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + shopNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var updated = runtimeEntityType.AddProperty( + "Updated", + typeof(DateTime), + propertyInfo: typeof(PcpShop).GetProperty("Updated", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcpShop).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + updated.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + updated.AddAnnotation("Relational:ColumnType", "datetime"); + updated.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { pcpShopId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PcpShop"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolMagEntityType.cs new file mode 100644 index 0000000..8be02af --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolMagEntityType.cs @@ -0,0 +1,125 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PolMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "PolMag", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var polId = runtimeEntityType.AddProperty( + "PolId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + polId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + polId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + polId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { polId, magId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POLMAG"); + + var idx_MagPol = runtimeEntityType.AddIndex( + new[] { magId }, + name: "idx_MagPol"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POLMAG_REF_MAGPO_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PolId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PolId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POLMAG_REF_POLMA_POLITYKA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PolMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolParamEntityType.cs new file mode 100644 index 0000000..dac6a7b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolParamEntityType.cs @@ -0,0 +1,176 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PolParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PolParam", + typeof(PolParam), + baseEntityType); + + var polId = runtimeEntityType.AddProperty( + "PolId", + typeof(decimal), + propertyInfo: typeof(PolParam).GetProperty("PolId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PolParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + polId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + polId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + polId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parGrupa = runtimeEntityType.AddProperty( + "ParGrupa", + typeof(string), + propertyInfo: typeof(PolParam).GetProperty("ParGrupa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PolParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parGrupa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parGrupa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(PolParam).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PolParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parWartosc = runtimeEntityType.AddProperty( + "ParWartosc", + typeof(string), + propertyInfo: typeof(PolParam).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PolParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + parWartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parWartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { polId, parGrupa, parNazwa }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POLPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PolId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PolId") }), + principalEntityType, + required: true); + + var pol = declaringEntityType.AddNavigation("Pol", + runtimeForeignKey, + onDependent: true, + typeof(Polityka), + propertyInfo: typeof(PolParam).GetProperty("Pol", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PolParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var polParam = principalEntityType.AddNavigation("PolParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Polityka).GetProperty("PolParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POLPARAM_REF_POLPA_POLITYKA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PolParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolitykaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolitykaEntityType.cs new file mode 100644 index 0000000..9cfd050 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PolitykaEntityType.cs @@ -0,0 +1,197 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PolitykaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Polityka", + typeof(Polityka), + baseEntityType); + + var polId = runtimeEntityType.AddProperty( + "PolId", + typeof(decimal), + propertyInfo: typeof(Polityka).GetProperty("PolId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + polId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + polId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + polId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Polityka).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrPolId = runtimeEntityType.AddProperty( + "CentrPolId", + typeof(decimal?), + propertyInfo: typeof(Polityka).GetProperty("CentrPolId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrPolId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrPolId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrPolId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Polityka).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zastosowanie = runtimeEntityType.AddProperty( + "Zastosowanie", + typeof(short), + propertyInfo: typeof(Polityka).GetProperty("Zastosowanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zastosowanie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zastosowanie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { polId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POLITYKA"); + + var idx_CentrPolId = runtimeEntityType.AddIndex( + new[] { centrPolId }, + name: "idx_CentrPolId"); + + return runtimeEntityType; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Mag", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("PolId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("PolId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Polityka).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Polityka).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Pol"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Polityka"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowKontLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowKontLojEntityType.cs new file mode 100644 index 0000000..e1ab160 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowKontLojEntityType.cs @@ -0,0 +1,176 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowKontLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PowKontLoj", + typeof(PowKontLoj), + baseEntityType); + + var noweKontoId = runtimeEntityType.AddProperty( + "NoweKontoId", + typeof(decimal), + propertyInfo: typeof(PowKontLoj).GetProperty("NoweKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + noweKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + noweKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + noweKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzajPow = runtimeEntityType.AddProperty( + "RodzajPow", + typeof(short), + propertyInfo: typeof(PowKontLoj).GetProperty("RodzajPow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzajPow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzajPow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stareKontoId = runtimeEntityType.AddProperty( + "StareKontoId", + typeof(decimal), + propertyInfo: typeof(PowKontLoj).GetProperty("StareKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stareKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + stareKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + stareKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { noweKontoId, rodzajPow }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POWKONTLOJ"); + + var idx_PowStareKLoj = runtimeEntityType.AddIndex( + new[] { stareKontoId }, + name: "idx_PowStareKLoj"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("NoweKontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType, + required: true); + + var noweKonto = declaringEntityType.AddNavigation("NoweKonto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(PowKontLoj).GetProperty("NoweKonto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powKontLojNoweKonto = principalEntityType.AddNavigation("PowKontLojNoweKonto", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("PowKontLojNoweKonto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_NoweKonto"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("StareKontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType, + required: true); + + var stareKonto = declaringEntityType.AddNavigation("StareKonto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(PowKontLoj).GetProperty("StareKonto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powKontLojStareKonto = principalEntityType.AddNavigation("PowKontLojStareKonto", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("PowKontLojStareKonto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_StareKonto"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PowKontLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiadomienieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiadomienieEntityType.cs new file mode 100644 index 0000000..5e52668 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiadomienieEntityType.cs @@ -0,0 +1,372 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowiadomienieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Powiadomienie", + typeof(Powiadomienie), + baseEntityType); + + var powiadomienieId = runtimeEntityType.AddProperty( + "PowiadomienieId", + typeof(decimal), + propertyInfo: typeof(Powiadomienie).GetProperty("PowiadomienieId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + powiadomienieId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powiadomienieId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powiadomienieId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var adresat = runtimeEntityType.AddProperty( + "Adresat", + typeof(string), + propertyInfo: typeof(Powiadomienie).GetProperty("Adresat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + adresat.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + adresat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Powiadomienie).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kategoria = runtimeEntityType.AddProperty( + "Kategoria", + typeof(short), + propertyInfo: typeof(Powiadomienie).GetProperty("Kategoria", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kategoria.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kategoria.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nadawca = runtimeEntityType.AddProperty( + "Nadawca", + typeof(string), + propertyInfo: typeof(Powiadomienie).GetProperty("Nadawca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + nadawca.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + nadawca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var naglowek = runtimeEntityType.AddProperty( + "Naglowek", + typeof(string), + propertyInfo: typeof(Powiadomienie).GetProperty("Naglowek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 128, + unicode: false); + naglowek.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(128)", + size: 128)); + naglowek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posNo = runtimeEntityType.AddProperty( + "PosNo", + typeof(string), + propertyInfo: typeof(Powiadomienie).GetProperty("PosNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 32, + unicode: false); + posNo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + posNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNo = runtimeEntityType.AddProperty( + "ShopNo", + typeof(string), + propertyInfo: typeof(Powiadomienie).GetProperty("ShopNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 32, + unicode: false); + shopNo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + shopNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(Powiadomienie).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tresc = runtimeEntityType.AddProperty( + "Tresc", + typeof(string), + propertyInfo: typeof(Powiadomienie).GetProperty("Tresc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 2048, + unicode: false); + tresc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(2048)", + size: 2048)); + tresc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(Powiadomienie).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzono = runtimeEntityType.AddProperty( + "Utworzono", + typeof(DateTime), + propertyInfo: typeof(Powiadomienie).GetProperty("Utworzono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + utworzono.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzono.AddAnnotation("Relational:ColumnType", "datetime"); + utworzono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Powiadomienie).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { powiadomienieId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POWIADOMIENIE"); + + var ixPowiadomienie_ShopNoPosNo = runtimeEntityType.AddIndex( + new[] { shopNo, posNo }, + name: "IxPowiadomienie_ShopNoPosNo"); + + var ixPowiadomienie_Status = runtimeEntityType.AddIndex( + new[] { status }, + name: "IxPowiadomienie_Status"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Powiadomienie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiadomienieParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiadomienieParamEntityType.cs new file mode 100644 index 0000000..b42df50 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiadomienieParamEntityType.cs @@ -0,0 +1,190 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowiadomienieParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PowiadomienieParam", + typeof(PowiadomienieParam), + baseEntityType); + + var powiadomienieId = runtimeEntityType.AddProperty( + "PowiadomienieId", + typeof(decimal), + propertyInfo: typeof(PowiadomienieParam).GetProperty("PowiadomienieId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiadomienieParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + powiadomienieId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powiadomienieId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powiadomienieId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(PowiadomienieParam).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiadomienieParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(PowiadomienieParam).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiadomienieParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int?), + propertyInfo: typeof(PowiadomienieParam).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiadomienieParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(string), + propertyInfo: typeof(PowiadomienieParam).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiadomienieParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + param2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { powiadomienieId, znaczenie, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POWIADOMIENIEPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PowiadomienieId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PowiadomienieId") }), + principalEntityType, + required: true); + + var powiadomienie = declaringEntityType.AddNavigation("Powiadomienie", + runtimeForeignKey, + onDependent: true, + typeof(Powiadomienie), + propertyInfo: typeof(PowiadomienieParam).GetProperty("Powiadomienie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiadomienieParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powiadomienieParam = principalEntityType.AddNavigation("PowiadomienieParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Powiadomienie).GetProperty("PowiadomienieParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiadomienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_PowiadomienieParamPowiadomienie"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PowiadomienieParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieEntityType.cs new file mode 100644 index 0000000..fa6e297 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieEntityType.cs @@ -0,0 +1,202 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowiazanieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Powiazanie", + typeof(Powiazanie), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Powiazanie).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWOpak = runtimeEntityType.AddProperty( + "IleWOpak", + typeof(decimal), + propertyInfo: typeof(Powiazanie).GetProperty("IleWOpak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ileWOpak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWOpak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWOpak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opakId = runtimeEntityType.AddProperty( + "OpakId", + typeof(decimal), + propertyInfo: typeof(Powiazanie).GetProperty("OpakId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + opakId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + opakId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + opakId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tandem = runtimeEntityType.AddProperty( + "Tandem", + typeof(short), + propertyInfo: typeof(Powiazanie).GetProperty("Tandem", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + tandem.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tandem.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POWIAZANIE"); + + var idx_OpakId = runtimeEntityType.AddIndex( + new[] { opakId }, + name: "idx_OpakId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("OpakId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var opak = declaringEntityType.AddNavigation("Opak", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Powiazanie).GetProperty("Opak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powiazanieOpak = principalEntityType.AddNavigation("PowiazanieOpak", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("PowiazanieOpak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POWIAZAN_REF_OPAK_TOWAR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + unique: true, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Powiazanie).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Powiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powiazanieTow = principalEntityType.AddNavigation("PowiazanieTow", + runtimeForeignKey, + onDependent: false, + typeof(Powiazanie), + propertyInfo: typeof(Towar).GetProperty("PowiazanieTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POWIAZAN_REF_TOWAR_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Powiazanie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazaniePromEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazaniePromEntityType.cs new file mode 100644 index 0000000..75dafb4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazaniePromEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowiazaniePromEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieProm", + typeof(PowiazanieProm), + baseEntityType); + + var promId = runtimeEntityType.AddProperty( + "PromId", + typeof(decimal), + propertyInfo: typeof(PowiazanieProm).GetProperty("PromId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + promId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + promId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + promId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupaId = runtimeEntityType.AddProperty( + "GrupaId", + typeof(decimal), + propertyInfo: typeof(PowiazanieProm).GetProperty("GrupaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + grupaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grupaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grupaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(PowiazanieProm).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { promId, grupaId, rodzaj }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { grupaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("GrupaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("GrupaId") }), + principalEntityType, + required: true); + + var grupa = declaringEntityType.AddNavigation("Grupa", + runtimeForeignKey, + onDependent: true, + typeof(GrupaPromocji), + propertyInfo: typeof(PowiazanieProm).GetProperty("Grupa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powiazanieProm = principalEntityType.AddNavigation("PowiazanieProm", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(GrupaPromocji).GetProperty("PowiazanieProm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PowiazanieProm_GrupaPromocji"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PowiazanieProm"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieSklepEntityType.cs new file mode 100644 index 0000000..13f6ad4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieSklepEntityType.cs @@ -0,0 +1,198 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowiazanieSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieSklep", + typeof(PowiazanieSklep), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(PowiazanieSklep).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal), + propertyInfo: typeof(PowiazanieSklep).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(PowiazanieSklep).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short?), + propertyInfo: typeof(PowiazanieSklep).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(PowiazanieSklep).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, id, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POWIAZANIE_SKLEP"); + + var powiazanieSklepTyp = runtimeEntityType.AddIndex( + new[] { typ }, + name: "PowiazanieSklepTyp"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(PowiazanieSklep).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powiazanieSklep = principalEntityType.AddNavigation("PowiazanieSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("PowiazanieSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POWIAZANIESKLEP_REFERENCE_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PowiazanieSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieUzEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieUzEntityType.cs new file mode 100644 index 0000000..c2f791d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieUzEntityType.cs @@ -0,0 +1,148 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowiazanieUzEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUz", + typeof(PowiazanieUz), + baseEntityType); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal), + propertyInfo: typeof(PowiazanieUz).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzajPow = runtimeEntityType.AddProperty( + "RodzajPow", + typeof(short), + propertyInfo: typeof(PowiazanieUz).GetProperty("RodzajPow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzajPow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzajPow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal), + propertyInfo: typeof(PowiazanieUz).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { uzId, rodzajPow, id }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POWIAZANIEUZ"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType, + required: true); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(PowiazanieUz).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powiazanieUz = principalEntityType.AddNavigation("PowiazanieUz", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("PowiazanieUz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POWIAZAN_REF_POWUZ_UZYTKOWN"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PowiazanieUz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieUzNaSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieUzNaSklepEntityType.cs new file mode 100644 index 0000000..4a236c8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PowiazanieUzNaSklepEntityType.cs @@ -0,0 +1,148 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PowiazanieUzNaSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PowiazanieUzNaSklep", + typeof(PowiazanieUzNaSklep), + baseEntityType); + + var uzNSId = runtimeEntityType.AddProperty( + "UzNSId", + typeof(decimal), + propertyInfo: typeof(PowiazanieUzNaSklep).GetProperty("UzNSId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + uzNSId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzNSId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzNSId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzajPow = runtimeEntityType.AddProperty( + "RodzajPow", + typeof(short), + propertyInfo: typeof(PowiazanieUzNaSklep).GetProperty("RodzajPow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzajPow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzajPow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal), + propertyInfo: typeof(PowiazanieUzNaSklep).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { uzNSId, rodzajPow, id }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POWIAZANIEUZNASKLEP"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzNSId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzNSId") }), + principalEntityType, + required: true); + + var uzNS = declaringEntityType.AddNavigation("UzNS", + runtimeForeignKey, + onDependent: true, + typeof(UzNaSklep), + propertyInfo: typeof(PowiazanieUzNaSklep).GetProperty("UzNS", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PowiazanieUzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var powiazanieUzNaSklep = principalEntityType.AddNavigation("PowiazanieUzNaSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(UzNaSklep).GetProperty("PowiazanieUzNaSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_PowUzNaSklepUzNaSklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PowiazanieUzNaSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozAkcyzaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozAkcyzaEntityType.cs new file mode 100644 index 0000000..a3f4b56 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozAkcyzaEntityType.cs @@ -0,0 +1,203 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PozAkcyzaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PozAkcyza", + typeof(PozAkcyza), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(PozAkcyza).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(PozAkcyza).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grAkcId = runtimeEntityType.AddProperty( + "GrAkcId", + typeof(decimal), + propertyInfo: typeof(PozAkcyza).GetProperty("GrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + grAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal), + propertyInfo: typeof(PozAkcyza).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc, grAkcId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POZAKCYZA"); + + var idx_PozAkcGr = runtimeEntityType.AddIndex( + new[] { grAkcId }, + name: "idx_PozAkcGr"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("GrAkcId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("GrAkcId") }), + principalEntityType, + required: true); + + var grAkc = declaringEntityType.AddNavigation("GrAkc", + runtimeForeignKey, + onDependent: true, + typeof(GrupaAkcyzowa), + propertyInfo: typeof(PozAkcyza).GetProperty("GrAkc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozAkcyza = principalEntityType.AddNavigation("PozAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("PozAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_AkcPoz"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(PozAkcyza).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozAkcyza = principalEntityType.AddNavigation("PozAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozDok).GetProperty("PozAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_PozAkc"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PozAkcyza"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozCennikDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozCennikDokEntityType.cs new file mode 100644 index 0000000..f8ef299 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozCennikDokEntityType.cs @@ -0,0 +1,307 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PozCennikDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PozCennikDok", + typeof(PozCennikDok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(PozCennikDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(PozCennikDok).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(PozCennikDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var doKiedyPrzyjecie = runtimeEntityType.AddProperty( + "DoKiedyPrzyjecie", + typeof(DateTime?), + propertyInfo: typeof(PozCennikDok).GetProperty("DoKiedyPrzyjecie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + doKiedyPrzyjecie.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + doKiedyPrzyjecie.AddAnnotation("Relational:ColumnType", "datetime"); + doKiedyPrzyjecie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przydzial = runtimeEntityType.AddProperty( + "Przydzial", + typeof(short?), + propertyInfo: typeof(PozCennikDok).GetProperty("Przydzial", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + przydzial.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + przydzial.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short?), + propertyInfo: typeof(PozCennikDok).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var statusZam = runtimeEntityType.AddProperty( + "StatusZam", + typeof(short?), + propertyInfo: typeof(PozCennikDok).GetProperty("StatusZam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + statusZam.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + statusZam.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmDoKiedyPrzyjecie = runtimeEntityType.AddProperty( + "ZmDoKiedyPrzyjecie", + typeof(short?), + propertyInfo: typeof(PozCennikDok).GetProperty("ZmDoKiedyPrzyjecie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmDoKiedyPrzyjecie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + zmDoKiedyPrzyjecie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmPrzydzial = runtimeEntityType.AddProperty( + "ZmPrzydzial", + typeof(short?), + propertyInfo: typeof(PozCennikDok).GetProperty("ZmPrzydzial", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmPrzydzial.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + zmPrzydzial.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmStatusZam = runtimeEntityType.AddProperty( + "ZmStatusZam", + typeof(short?), + propertyInfo: typeof(PozCennikDok).GetProperty("ZmStatusZam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmStatusZam.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + zmStatusZam.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, towId, sklepId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POZCENNIKDOK"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(PozCennikDok).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozCennikDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozCennikDok = principalEntityType.AddNavigation("PozCennikDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("PozCennikDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PozCennikDokSklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PozCennikDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozDokEntityType.cs new file mode 100644 index 0000000..652a142 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozDokEntityType.cs @@ -0,0 +1,639 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PozDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PozDok", + typeof(PozDok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(PozDok).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDet = runtimeEntityType.AddProperty( + "CenaDet", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("CenaDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDomyslna = runtimeEntityType.AddProperty( + "CenaDomyslna", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("CenaDomyslna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDomyslna.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDomyslna.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDomyslna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaMag = runtimeEntityType.AddProperty( + "CenaMag", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("CenaMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaPoRab = runtimeEntityType.AddProperty( + "CenaPoRab", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("CenaPoRab", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaPoRab.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaPoRab.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaPoRab.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaPrzedRab = runtimeEntityType.AddProperty( + "CenaPrzedRab", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("CenaPrzedRab", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaPrzedRab.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaPrzedRab.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaPrzedRab.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWZgrzewce = runtimeEntityType.AddProperty( + "IleWZgrzewce", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("IleWZgrzewce", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ileWZgrzewce.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWZgrzewce.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWZgrzewce.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscMinus = runtimeEntityType.AddProperty( + "IloscMinus", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("IloscMinus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + iloscMinus.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscMinus.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscMinus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscPlus = runtimeEntityType.AddProperty( + "IloscPlus", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("IloscPlus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + iloscPlus.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscPlus.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscPlus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var metoda = runtimeEntityType.AddProperty( + "Metoda", + typeof(short), + propertyInfo: typeof(PozDok).GetProperty("Metoda", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + metoda.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + metoda.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal?), + propertyInfo: typeof(PozDok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrPozycji = runtimeEntityType.AddProperty( + "NrPozycji", + typeof(int), + propertyInfo: typeof(PozDok).GetProperty("NrPozycji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + nrPozycji.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + nrPozycji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal?), + propertyInfo: typeof(PozDok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short), + propertyInfo: typeof(PozDok).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatProc = runtimeEntityType.AddProperty( + "RabatProc", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("RabatProc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatProc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatProc.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatProc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(PozDok).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawkaDod = runtimeEntityType.AddProperty( + "StawkaDod", + typeof(short?), + propertyInfo: typeof(PozDok).GetProperty("StawkaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawkaDod.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + stawkaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPoz = runtimeEntityType.AddProperty( + "TypPoz", + typeof(short), + propertyInfo: typeof(PozDok).GetProperty("TypPoz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPoz.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPoz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typTowaru = runtimeEntityType.AddProperty( + "TypTowaru", + typeof(short), + propertyInfo: typeof(PozDok).GetProperty("TypTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typTowaru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal), + propertyInfo: typeof(PozDok).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POZDOK"); + + var idx_PozDokDokIdNrPozycji = runtimeEntityType.AddIndex( + new[] { dokId, nrPozycji }, + name: "idx_PozDokDokIdNrPozycji"); + + var idx_PozDokTowId = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_PozDokTowId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(PozDok).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozDok = principalEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POZDOK_REF_POZDO_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(PozDok).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozDok = principalEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POZDOK_REF_POZTO_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PozDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozDokWBufPowiazanieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozDokWBufPowiazanieEntityType.cs new file mode 100644 index 0000000..03691f1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozDokWBufPowiazanieEntityType.cs @@ -0,0 +1,221 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PozDokWBufPowiazanieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PozDokWBufPowiazanie", + typeof(PozDokWBufPowiazanie), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(PozDokWBufPowiazanie).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(PozDokWBufPowiazanie).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jakiePow = runtimeEntityType.AddProperty( + "JakiePow", + typeof(short), + propertyInfo: typeof(PozDokWBufPowiazanie).GetProperty("JakiePow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + jakiePow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + jakiePow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ktorePow = runtimeEntityType.AddProperty( + "KtorePow", + typeof(short), + propertyInfo: typeof(PozDokWBufPowiazanie).GetProperty("KtorePow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + ktorePow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + ktorePow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal?), + propertyInfo: typeof(PozDokWBufPowiazanie).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param = runtimeEntityType.AddProperty( + "Param", + typeof(string), + propertyInfo: typeof(PozDokWBufPowiazanie).GetProperty("Param", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + param.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc, jakiePow, ktorePow }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POZDOKWBUFPOWIAZANIE"); + + var idx_PozDokWBufId = runtimeEntityType.AddIndex( + new[] { id }, + name: "idx_PozDokWBufId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(PozDokWBufPowiazanie).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDokWBufPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozDokWBufPowiazanie = principalEntityType.AddNavigation("PozDokWBufPowiazanie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozDok).GetProperty("PozDokWBufPowiazanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PozDokWBufPow"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PozDokWBufPowiazanie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozParEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozParEntityType.cs new file mode 100644 index 0000000..9e39aa9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozParEntityType.cs @@ -0,0 +1,348 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PozParEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PozPar", + typeof(PozPar), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(PozPar).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(PozPar).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupaGTU = runtimeEntityType.AddProperty( + "GrupaGTU", + typeof(string), + propertyInfo: typeof(PozPar).GetProperty("GrupaGTU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 4, + unicode: false); + grupaGTU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(4)", + size: 4)); + grupaGTU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal), + propertyInfo: typeof(PozPar).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(PozPar).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatKwot = runtimeEntityType.AddProperty( + "RabatKwot", + typeof(decimal), + propertyInfo: typeof(PozPar).GetProperty("RabatKwot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatKwot.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rabatKwot.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rabatKwot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(PozPar).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(PozPar).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPozPar = runtimeEntityType.AddProperty( + "TypPozPar", + typeof(short), + propertyInfo: typeof(PozPar).GetProperty("TypPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPozPar.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPozPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartoscBrutto = runtimeEntityType.AddProperty( + "WartoscBrutto", + typeof(decimal), + propertyInfo: typeof(PozPar).GetProperty("WartoscBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + wartoscBrutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartoscBrutto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartoscBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POZPAR"); + + var idx_PozParTowId = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_PozParTowId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Paragon), + propertyInfo: typeof(PozPar).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozPar = principalEntityType.AddNavigation("PozPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Paragon).GetProperty("PozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POZPAR_REF_POZPA_PARAGON"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(PozPar).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozPar = principalEntityType.AddNavigation("PozPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("PozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POZPAR_REF_TOWPA_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PozPar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozParSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozParSzczegEntityType.cs new file mode 100644 index 0000000..9d859dc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozParSzczegEntityType.cs @@ -0,0 +1,146 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PozParSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PozParSzczeg", + typeof(PozParSzczeg), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(PozParSzczeg).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(PozParSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodInfo = runtimeEntityType.AddProperty( + "DodInfo", + typeof(string), + propertyInfo: typeof(PozParSzczeg).GetProperty("DodInfo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + dodInfo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + dodInfo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POZPARSZCZEG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + unique: true, + required: true); + + var pozPar = declaringEntityType.AddNavigation("PozPar", + runtimeForeignKey, + onDependent: true, + typeof(PozPar), + propertyInfo: typeof(PozParSzczeg).GetProperty("PozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozParSzczeg = principalEntityType.AddNavigation("PozParSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(PozParSzczeg), + propertyInfo: typeof(PozPar).GetProperty("PozParSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POZPARSZ_REF_PPSZC_POZPAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PozParSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozWzEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozWzEntityType.cs new file mode 100644 index 0000000..aad7e26 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PozWzEntityType.cs @@ -0,0 +1,227 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PozWzEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PozWz", + typeof(PozWz), + baseEntityType); + + var wzId = runtimeEntityType.AddProperty( + "WzId", + typeof(decimal), + propertyInfo: typeof(PozWz).GetProperty("WzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozWz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + wzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + wzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + wzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(PozWz).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozWz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscMinus = runtimeEntityType.AddProperty( + "IloscMinus", + typeof(decimal), + propertyInfo: typeof(PozWz).GetProperty("IloscMinus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozWz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + iloscMinus.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscMinus.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscMinus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscPlus = runtimeEntityType.AddProperty( + "IloscPlus", + typeof(decimal), + propertyInfo: typeof(PozWz).GetProperty("IloscPlus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozWz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + iloscPlus.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscPlus.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscPlus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(PozWz).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozWz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { wzId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_POZWZ"); + + var index = runtimeEntityType.AddIndex( + new[] { towId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(PozWz).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozWz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozWz = principalEntityType.AddNavigation("PozWz", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("PozWz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POZWZ_REF_TOWWZ_TOWAR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WzId") }), + principalEntityType, + required: true); + + var wz = declaringEntityType.AddNavigation("Wz", + runtimeForeignKey, + onDependent: true, + typeof(Wzorzec), + propertyInfo: typeof(PozWz).GetProperty("Wz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozWz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var pozWz = principalEntityType.AddNavigation("PozWz", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Wzorzec).GetProperty("PozWz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_POZWZ_REF_POZWZ_WZORZEC"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PozWz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilEntityType.cs new file mode 100644 index 0000000..7a550cb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilEntityType.cs @@ -0,0 +1,191 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ProfilEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Profil", + typeof(Profil), + baseEntityType); + + var profilId = runtimeEntityType.AddProperty( + "ProfilId", + typeof(decimal), + propertyInfo: typeof(Profil).GetProperty("ProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + profilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + profilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + profilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short?), + propertyInfo: typeof(Profil).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Profil).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(Profil).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzony = runtimeEntityType.AddProperty( + "Utworzony", + typeof(DateTime?), + propertyInfo: typeof(Profil).GetProperty("Utworzony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + utworzony.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzony.AddAnnotation("Relational:ColumnType", "datetime"); + utworzony.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(Profil).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { profilId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PROFIL"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Profil"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilKasaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilKasaEntityType.cs new file mode 100644 index 0000000..afddf45 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilKasaEntityType.cs @@ -0,0 +1,154 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ProfilKasaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKasa", + typeof(ProfilKasa), + baseEntityType); + + var profilId = runtimeEntityType.AddProperty( + "ProfilId", + typeof(decimal), + propertyInfo: typeof(ProfilKasa).GetProperty("ProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + profilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + profilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + profilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(ProfilKasa).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { profilId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PROFKAS"); + + var index = runtimeEntityType.AddIndex( + new[] { kasaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(ProfilKasa).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var profilKasa = principalEntityType.AddNavigation("ProfilKasa", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("ProfilKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PROFKAS_REFERENCE_KASA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ProfilId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ProfilId") }), + principalEntityType, + unique: true, + required: true); + + var profil = declaringEntityType.AddNavigation("Profil", + runtimeForeignKey, + onDependent: true, + typeof(Profil), + propertyInfo: typeof(ProfilKasa).GetProperty("Profil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var profilKasa = principalEntityType.AddNavigation("ProfilKasa", + runtimeForeignKey, + onDependent: false, + typeof(ProfilKasa), + propertyInfo: typeof(Profil).GetProperty("ProfilKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PROFKAS_REFERENCE_PROF"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ProfilKasa"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilKonfigEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilKonfigEntityType.cs new file mode 100644 index 0000000..2a8154a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ProfilKonfigEntityType.cs @@ -0,0 +1,249 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ProfilKonfigEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ProfilKonfig", + typeof(ProfilKonfig), + baseEntityType); + + var profilId = runtimeEntityType.AddProperty( + "ProfilId", + typeof(decimal), + propertyInfo: typeof(ProfilKonfig).GetProperty("ProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + profilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + profilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + profilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parGrupa = runtimeEntityType.AddProperty( + "ParGrupa", + typeof(string), + propertyInfo: typeof(ProfilKonfig).GetProperty("ParGrupa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 255, + unicode: false); + parGrupa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parGrupa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(ProfilKonfig).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 255, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejny = runtimeEntityType.AddProperty( + "Kolejny", + typeof(short), + propertyInfo: typeof(ProfilKonfig).GetProperty("Kolejny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzony = runtimeEntityType.AddProperty( + "Utworzony", + typeof(DateTime?), + propertyInfo: typeof(ProfilKonfig).GetProperty("Utworzony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + utworzony.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzony.AddAnnotation("Relational:ColumnType", "datetime"); + utworzony.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(string), + propertyInfo: typeof(ProfilKonfig).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + wartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(ProfilKonfig).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { profilId, parGrupa, parNazwa, kolejny }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PROFIL_KONFIG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ProfilId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ProfilId") }), + principalEntityType, + required: true); + + var profil = declaringEntityType.AddNavigation("Profil", + runtimeForeignKey, + onDependent: true, + typeof(Profil), + propertyInfo: typeof(ProfilKonfig).GetProperty("Profil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var profilKonfig = principalEntityType.AddNavigation("ProfilKonfig", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Profil).GetProperty("ProfilKonfig", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PROFILKONFIG_REFERENCE_PROFIL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ProfilKonfig"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PrtMagEntityType.cs new file mode 100644 index 0000000..bbce6b4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PrtMagEntityType.cs @@ -0,0 +1,584 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.PrtMag", + typeof(PrtMag), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(PrtMag).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(PrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaSpDet = runtimeEntityType.AddProperty( + "CenaSpDet", + typeof(decimal?), + propertyInfo: typeof(PrtMag).GetProperty("CenaSpDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaSpDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaSpDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaSpDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZak = runtimeEntityType.AddProperty( + "CenaZak", + typeof(decimal), + propertyInfo: typeof(PrtMag).GetProperty("CenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime?), + propertyInfo: typeof(PrtMag).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataWazn = runtimeEntityType.AddProperty( + "DataWazn", + typeof(DateTime?), + propertyInfo: typeof(PrtMag).GetProperty("DataWazn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataWazn.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataWazn.AddAnnotation("Relational:ColumnType", "datetime"); + dataWazn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dostarczono = runtimeEntityType.AddProperty( + "Dostarczono", + typeof(decimal?), + propertyInfo: typeof(PrtMag).GetProperty("Dostarczono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dostarczono.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + dostarczono.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + dostarczono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnyWDniu = runtimeEntityType.AddProperty( + "KolejnyWDniu", + typeof(int?), + propertyInfo: typeof(PrtMag).GetProperty("KolejnyWDniu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kolejnyWDniu.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + kolejnyWDniu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal?), + propertyInfo: typeof(PrtMag).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(PrtMag).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDostawy = runtimeEntityType.AddProperty( + "NrDostawy", + typeof(string), + propertyInfo: typeof(PrtMag).GetProperty("NrDostawy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrDostawy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrDostawy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrPartii = runtimeEntityType.AddProperty( + "NrPartii", + typeof(string), + propertyInfo: typeof(PrtMag).GetProperty("NrPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrPartii.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrPozycji = runtimeEntityType.AddProperty( + "NrPozycji", + typeof(int?), + propertyInfo: typeof(PrtMag).GetProperty("NrPozycji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrPozycji.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + nrPozycji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pozostalo = runtimeEntityType.AddProperty( + "Pozostalo", + typeof(decimal), + propertyInfo: typeof(PrtMag).GetProperty("Pozostalo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + pozostalo.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + pozostalo.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + pozostalo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwacja = runtimeEntityType.AddProperty( + "Rezerwacja", + typeof(decimal?), + propertyInfo: typeof(PrtMag).GetProperty("Rezerwacja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rezerwacja.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rezerwacja.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rezerwacja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(PrtMag).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(PrtMag).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(PrtMag).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaIstotna = runtimeEntityType.AddProperty( + "ZmianaIstotna", + typeof(DateTime?), + propertyInfo: typeof(PrtMag).GetProperty("ZmianaIstotna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmianaIstotna.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaIstotna.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaIstotna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, pMId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PRTMAG"); + + var index = runtimeEntityType.AddIndex( + new[] { magId }); + + var idx_PrtMagFifo = runtimeEntityType.AddIndex( + new[] { towId, magId, data, kolejnyWDniu, pMId }, + name: "idx_PrtMagFifo"); + + var idx_PrtMagNrPrt = runtimeEntityType.AddIndex( + new[] { nrPartii, towId, pMId }, + name: "idx_PrtMagNrPrt"); + + var idx_PrtMagZmn = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_PrtMagZmn"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(PrtMag).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var prtMag = principalEntityType.AddNavigation("PrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("PrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_PrtMagMagazyn"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(PrtMag).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var prtMag = principalEntityType.AddNavigation("PrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("PrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_PrtMagTowar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "PrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/PrzydzialEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PrzydzialEntityType.cs new file mode 100644 index 0000000..907e7f4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/PrzydzialEntityType.cs @@ -0,0 +1,124 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class PrzydzialEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Przydzial", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var asId = runtimeEntityType.AddProperty( + "AsId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + asId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + asId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + asId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId, asId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_PRZYDZIAL"); + + var index = runtimeEntityType.AddIndex( + new[] { asId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("AsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("AsId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PRZYDZIA_REF_ASPRZ_ASORT"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_PRZYDZIA_REF_KASPR_KASA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Przydzial"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RapWartPoczDaneEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RapWartPoczDaneEntityType.cs new file mode 100644 index 0000000..eede29e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RapWartPoczDaneEntityType.cs @@ -0,0 +1,229 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RapWartPoczDaneEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPoczDane", + typeof(RapWartPoczDane), + baseEntityType); + + var rWPId = runtimeEntityType.AddProperty( + "RWPId", + typeof(decimal), + propertyInfo: typeof(RapWartPoczDane).GetProperty("RWPId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + rWPId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rWPId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rWPId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal), + propertyInfo: typeof(RapWartPoczDane).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(decimal), + propertyInfo: typeof(RapWartPoczDane).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + typ.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typ.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(short), + propertyInfo: typeof(RapWartPoczDane).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + numer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal), + propertyInfo: typeof(RapWartPoczDane).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { rWPId, magId, typ, numer }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_RAPWARTPOCZDANE"); + + var index = runtimeEntityType.AddIndex( + new[] { magId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType, + required: true); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(RapWartPoczDane).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rapWartPoczDane = principalEntityType.AddNavigation("RapWartPoczDane", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("RapWartPoczDane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RWPId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RWPId") }), + principalEntityType, + required: true); + + var rWP = declaringEntityType.AddNavigation("RWP", + runtimeForeignKey, + onDependent: true, + typeof(RapWartPocz), + propertyInfo: typeof(RapWartPoczDane).GetProperty("RWP", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rapWartPoczDane = principalEntityType.AddNavigation("RapWartPoczDane", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(RapWartPocz).GetProperty("RapWartPoczDane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RapWartPoczDane"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RapWartPoczEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RapWartPoczEntityType.cs new file mode 100644 index 0000000..2a090c5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RapWartPoczEntityType.cs @@ -0,0 +1,305 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RapWartPoczEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RapWartPocz", + typeof(RapWartPocz), + baseEntityType); + + var rWPId = runtimeEntityType.AddProperty( + "RWPId", + typeof(decimal), + propertyInfo: typeof(RapWartPocz).GetProperty("RWPId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + rWPId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rWPId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rWPId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(RapWartPocz).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime), + propertyInfo: typeof(RapWartPocz).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(short?), + propertyInfo: typeof(RapWartPocz).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(short?), + propertyInfo: typeof(RapWartPocz).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(short?), + propertyInfo: typeof(RapWartPocz).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param3.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paramTxt = runtimeEntityType.AddProperty( + "ParamTxt", + typeof(string), + propertyInfo: typeof(RapWartPocz).GetProperty("ParamTxt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + paramTxt.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + paramTxt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typRap = runtimeEntityType.AddProperty( + "TypRap", + typeof(short), + propertyInfo: typeof(RapWartPocz).GetProperty("TypRap", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typRap.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typRap.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(short?), + propertyInfo: typeof(RapWartPocz).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wersja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wykonano = runtimeEntityType.AddProperty( + "Wykonano", + typeof(DateTime), + propertyInfo: typeof(RapWartPocz).GetProperty("Wykonano", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + wykonano.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + wykonano.AddAnnotation("Relational:ColumnType", "datetime"); + wykonano.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(RapWartPocz).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { rWPId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_RAPWARTPOCZ"); + + var idx_RWP_TypRapData = runtimeEntityType.AddIndex( + new[] { typRap, data }, + name: "idx_RWP_TypRapData"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RapWartPocz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaAsortEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaAsortEntityType.cs new file mode 100644 index 0000000..2aa97af --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaAsortEntityType.cs @@ -0,0 +1,176 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaAsortEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaAsort", + typeof(RegulaAsort), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaAsort).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var asId = runtimeEntityType.AddProperty( + "AsId", + typeof(decimal), + propertyInfo: typeof(RegulaAsort).GetProperty("AsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + asId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + asId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + asId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RegulaAsort).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, asId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULAASORT"); + + var index = runtimeEntityType.AddIndex( + new[] { asId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("AsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("AsId") }), + principalEntityType, + required: true); + + var @as = declaringEntityType.AddNavigation("As", + runtimeForeignKey, + onDependent: true, + typeof(Asort), + propertyInfo: typeof(RegulaAsort).GetProperty("As", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaAsort = principalEntityType.AddNavigation("RegulaAsort", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Asort).GetProperty("RegulaAsort", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_REGULAAS_REFERENCE_ASORT"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaAsort).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaAsort = principalEntityType.AddNavigation("RegulaAsort", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaAsort", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_REGULAAS_REFERENCE_REGULA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaAsort"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaDokEntityType.cs new file mode 100644 index 0000000..774f018 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaDokEntityType.cs @@ -0,0 +1,396 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDok", + typeof(RegulaDok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(RegulaDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaDok).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaDok).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal?), + propertyInfo: typeof(RegulaDok).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja = runtimeEntityType.AddProperty( + "Opcja", + typeof(short?), + propertyInfo: typeof(RegulaDok).GetProperty("Opcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(RegulaDok).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(RegulaDok).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typReguly = runtimeEntityType.AddProperty( + "TypReguly", + typeof(short?), + propertyInfo: typeof(RegulaDok).GetProperty("TypReguly", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typReguly.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typReguly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(RegulaDok).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(RegulaDok).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(RegulaDok).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, regulaId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULADOK"); + + var index = runtimeEntityType.AddIndex( + new[] { kontoId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { regulaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(RegulaDok).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaDok = principalEntityType.AddNavigation("RegulaDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("RegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegDokDok"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType); + + var konto = declaringEntityType.AddNavigation("Konto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(RegulaDok).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaDok = principalEntityType.AddNavigation("RegulaDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("RegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegDokKonto"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaDok).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaDok = principalEntityType.AddNavigation("RegulaDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegDokReg"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaDokSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaDokSzczegEntityType.cs new file mode 100644 index 0000000..e577171 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaDokSzczegEntityType.cs @@ -0,0 +1,242 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaDokSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaDokSzczeg", + typeof(RegulaDokSzczeg), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(decimal), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + param2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + param2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(string), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + param3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, regulaId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULADOKSZCZEG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("RegulaId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("RegulaId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var regulaDok = declaringEntityType.AddNavigation("RegulaDok", + runtimeForeignKey, + onDependent: true, + typeof(RegulaDok), + propertyInfo: typeof(RegulaDokSzczeg).GetProperty("RegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaDokSzczeg = principalEntityType.AddNavigation("RegulaDokSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(RegulaDok).GetProperty("RegulaDokSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RgDokSzczegRgDok"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaDokSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaEntityType.cs new file mode 100644 index 0000000..3b5ec60 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaEntityType.cs @@ -0,0 +1,575 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Regula", + typeof(Regula), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(Regula).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Regula).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(Regula).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzasDo = runtimeEntityType.AddProperty( + "DataCzasDo", + typeof(DateTime?), + propertyInfo: typeof(Regula).GetProperty("DataCzasDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataCzasDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzasDo.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzasDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzasOd = runtimeEntityType.AddProperty( + "DataCzasOd", + typeof(DateTime?), + propertyInfo: typeof(Regula).GetProperty("DataCzasOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataCzasOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzasOd.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzasOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int1 = runtimeEntityType.AddProperty( + "Int1", + typeof(int?), + propertyInfo: typeof(Regula).GetProperty("Int1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int2 = runtimeEntityType.AddProperty( + "Int2", + typeof(int?), + propertyInfo: typeof(Regula).GetProperty("Int2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int2.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int3 = runtimeEntityType.AddProperty( + "Int3", + typeof(int?), + propertyInfo: typeof(Regula).GetProperty("Int3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int3.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int4 = runtimeEntityType.AddProperty( + "Int4", + typeof(int?), + propertyInfo: typeof(Regula).GetProperty("Int4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int4.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Regula).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number1 = runtimeEntityType.AddProperty( + "Number1", + typeof(decimal?), + propertyInfo: typeof(Regula).GetProperty("Number1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number1.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number2 = runtimeEntityType.AddProperty( + "Number2", + typeof(decimal?), + propertyInfo: typeof(Regula).GetProperty("Number2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number2.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number3 = runtimeEntityType.AddProperty( + "Number3", + typeof(decimal?), + propertyInfo: typeof(Regula).GetProperty("Number3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number3.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number4 = runtimeEntityType.AddProperty( + "Number4", + typeof(decimal?), + propertyInfo: typeof(Regula).GetProperty("Number4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number4.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var priorytet = runtimeEntityType.AddProperty( + "Priorytet", + typeof(short), + propertyInfo: typeof(Regula).GetProperty("Priorytet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + priorytet.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + priorytet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var str1 = runtimeEntityType.AddProperty( + "Str1", + typeof(string), + propertyInfo: typeof(Regula).GetProperty("Str1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 128, + unicode: false); + str1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(128)", + size: 128)); + str1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var str2 = runtimeEntityType.AddProperty( + "Str2", + typeof(string), + propertyInfo: typeof(Regula).GetProperty("Str2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 128, + unicode: false); + str2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(128)", + size: 128)); + str2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(Regula).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKarty = runtimeEntityType.AddProperty( + "TypKarty", + typeof(short?), + propertyInfo: typeof(Regula).GetProperty("TypKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typKarty.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var usunieto = runtimeEntityType.AddProperty( + "Usunieto", + typeof(DateTime?), + propertyInfo: typeof(Regula).GetProperty("Usunieto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + usunieto.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + usunieto.AddAnnotation("Relational:ColumnType", "datetime"); + usunieto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzono = runtimeEntityType.AddProperty( + "Utworzono", + typeof(DateTime?), + propertyInfo: typeof(Regula).GetProperty("Utworzono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + utworzono.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzono.AddAnnotation("Relational:ColumnType", "datetime"); + utworzono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Regula).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULA"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Regula"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaKodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaKodEntityType.cs new file mode 100644 index 0000000..b0746fe --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaKodEntityType.cs @@ -0,0 +1,271 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaKodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaKod", + typeof(RegulaKod), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaKod).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(RegulaKod).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RegulaKod).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal?), + propertyInfo: typeof(RegulaKod).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal?), + propertyInfo: typeof(RegulaKod).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var informacja = runtimeEntityType.AddProperty( + "Informacja", + typeof(string), + propertyInfo: typeof(RegulaKod).GetProperty("Informacja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + informacja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + informacja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwaTowaru = runtimeEntityType.AddProperty( + "NazwaTowaru", + typeof(string), + propertyInfo: typeof(RegulaKod).GetProperty("NazwaTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + nazwaTowaru.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwaTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parametr = runtimeEntityType.AddProperty( + "Parametr", + typeof(int?), + propertyInfo: typeof(RegulaKod).GetProperty("Parametr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + parametr.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + parametr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, kod, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaKod).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaKod = principalEntityType.AddNavigation("RegulaKod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaKod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_REGULAKOD_REGULA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaKod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParEntityType.cs new file mode 100644 index 0000000..8bb8cc6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParEntityType.cs @@ -0,0 +1,396 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaParEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPar", + typeof(RegulaPar), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(RegulaPar).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaPar).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaPar).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal?), + propertyInfo: typeof(RegulaPar).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja = runtimeEntityType.AddProperty( + "Opcja", + typeof(short?), + propertyInfo: typeof(RegulaPar).GetProperty("Opcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(RegulaPar).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(RegulaPar).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typReguly = runtimeEntityType.AddProperty( + "TypReguly", + typeof(short?), + propertyInfo: typeof(RegulaPar).GetProperty("TypReguly", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typReguly.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typReguly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(RegulaPar).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(RegulaPar).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(RegulaPar).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, regulaId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULAPAR"); + + var index = runtimeEntityType.AddIndex( + new[] { kontoId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { regulaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType); + + var konto = declaringEntityType.AddNavigation("Konto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(RegulaPar).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPar = principalEntityType.AddNavigation("RegulaPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("RegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegParKonto"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Paragon), + propertyInfo: typeof(RegulaPar).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPar = principalEntityType.AddNavigation("RegulaPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Paragon).GetProperty("RegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Paragon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegParPar"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaPar).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPar = principalEntityType.AddNavigation("RegulaPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegParReg"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaPar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParSzczegEntityType.cs new file mode 100644 index 0000000..2ef47a4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParSzczegEntityType.cs @@ -0,0 +1,242 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaParSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaParSzczeg", + typeof(RegulaParSzczeg), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(decimal), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + param2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + param2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(string), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + param3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, regulaId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULAPARSZCZEG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId"), declaringEntityType.FindProperty("RegulaId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId"), principalEntityType.FindProperty("RegulaId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var regulaPar = declaringEntityType.AddNavigation("RegulaPar", + runtimeForeignKey, + onDependent: true, + typeof(RegulaPar), + propertyInfo: typeof(RegulaParSzczeg).GetProperty("RegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaParSzczeg = principalEntityType.AddNavigation("RegulaParSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(RegulaPar).GetProperty("RegulaParSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RgParSzczegRgPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaParSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParamEntityType.cs new file mode 100644 index 0000000..7fa7b1c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaParamEntityType.cs @@ -0,0 +1,168 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaParam", + typeof(RegulaParam), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaParam).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RegulaParam).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int?), + propertyInfo: typeof(RegulaParam).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(string), + propertyInfo: typeof(RegulaParam).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + param2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULAPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaParam).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaParam = principalEntityType.AddNavigation("RegulaParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozDokEntityType.cs new file mode 100644 index 0000000..23f75a8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozDokEntityType.cs @@ -0,0 +1,250 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaPozDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDok", + typeof(RegulaPozDok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(RegulaPozDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaPozDok).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaPozDok).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(RegulaPozDok).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(RegulaPozDok).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(RegulaPozDok).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc, regulaId, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULAPOZDOK"); + + var index = runtimeEntityType.AddIndex( + new[] { regulaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaPozDok).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozDok = principalEntityType.AddNavigation("RegulaPozDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozReg"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(RegulaPozDok).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozDok = principalEntityType.AddNavigation("RegulaPozDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozDok).GetProperty("RegulaPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaPozDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozDokSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozDokSzczegEntityType.cs new file mode 100644 index 0000000..f90744b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozDokSzczegEntityType.cs @@ -0,0 +1,392 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaPozDokSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozDokSzczeg", + typeof(RegulaPozDokSzczeg), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnoscRegulaDok = runtimeEntityType.AddProperty( + "KolejnoscRegulaDok", + typeof(int), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("KolejnoscRegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnoscRegulaDok.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnoscRegulaDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja1 = runtimeEntityType.AddProperty( + "Opcja1", + typeof(short?), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Opcja1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc1 = runtimeEntityType.AddProperty( + "Wartosc1", + typeof(decimal?), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Wartosc1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc4 = runtimeEntityType.AddProperty( + "Wartosc4", + typeof(decimal?), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Wartosc4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc4.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc, regulaId, typ, kolejnoscRegulaDok }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGPOZDOKSZ"); + + var index = runtimeEntityType.AddIndex( + new[] { regulaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozDokSzczeg = principalEntityType.AddNavigation("RegulaPozDokSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaPozDokSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozSzReg"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(RegulaPozDokSzczeg).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozDokSzczeg = principalEntityType.AddNavigation("RegulaPozDokSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozDok).GetProperty("RegulaPozDokSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozSzPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaPozDokSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozParEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozParEntityType.cs new file mode 100644 index 0000000..c196c55 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozParEntityType.cs @@ -0,0 +1,250 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaPozParEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozPar", + typeof(RegulaPozPar), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(RegulaPozPar).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaPozPar).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaPozPar).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(RegulaPozPar).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(RegulaPozPar).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(RegulaPozPar).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, kolejnosc, regulaId, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULAPOZPAR"); + + var index = runtimeEntityType.AddIndex( + new[] { regulaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaPozPar).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozPar = principalEntityType.AddNavigation("RegulaPozPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozParReg"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozPar = declaringEntityType.AddNavigation("PozPar", + runtimeForeignKey, + onDependent: true, + typeof(PozPar), + propertyInfo: typeof(RegulaPozPar).GetProperty("PozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozPar = principalEntityType.AddNavigation("RegulaPozPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozPar).GetProperty("RegulaPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozParPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaPozPar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozParSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozParSzczegEntityType.cs new file mode 100644 index 0000000..0d03cd3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaPozParSzczegEntityType.cs @@ -0,0 +1,392 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaPozParSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaPozParSzczeg", + typeof(RegulaPozParSzczeg), + baseEntityType); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnoscRegulaPar = runtimeEntityType.AddProperty( + "KolejnoscRegulaPar", + typeof(int), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("KolejnoscRegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnoscRegulaPar.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnoscRegulaPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja1 = runtimeEntityType.AddProperty( + "Opcja1", + typeof(short?), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Opcja1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc1 = runtimeEntityType.AddProperty( + "Wartosc1", + typeof(decimal?), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Wartosc1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc4 = runtimeEntityType.AddProperty( + "Wartosc4", + typeof(decimal?), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Wartosc4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc4.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { parId, kolejnosc, regulaId, typ, kolejnoscRegulaPar }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGPOZPARSZ"); + + var index = runtimeEntityType.AddIndex( + new[] { regulaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozParSzczeg = principalEntityType.AddNavigation("RegulaPozParSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaPozParSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozPSzReg"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozPar = declaringEntityType.AddNavigation("PozPar", + runtimeForeignKey, + onDependent: true, + typeof(PozPar), + propertyInfo: typeof(RegulaPozParSzczeg).GetProperty("PozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaPozParSzczeg = principalEntityType.AddNavigation("RegulaPozParSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozPar).GetProperty("RegulaPozParSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RegPozPSzPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaPozParSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaProgEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaProgEntityType.cs new file mode 100644 index 0000000..d8554a3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaProgEntityType.cs @@ -0,0 +1,225 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaProgEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaProg", + typeof(RegulaProg), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaProg).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaProg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(RegulaProg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaProg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var progDo = runtimeEntityType.AddProperty( + "ProgDo", + typeof(decimal?), + propertyInfo: typeof(RegulaProg).GetProperty("ProgDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaProg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + progDo.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + progDo.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + progDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var progOd = runtimeEntityType.AddProperty( + "ProgOd", + typeof(decimal?), + propertyInfo: typeof(RegulaProg).GetProperty("ProgOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaProg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + progOd.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + progOd.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + progOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc1 = runtimeEntityType.AddProperty( + "Wartosc1", + typeof(decimal?), + propertyInfo: typeof(RegulaProg).GetProperty("Wartosc1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaProg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + wartosc1.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + wartosc1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(RegulaProg).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaProg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULAPROG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaProg).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaProg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaProg = principalEntityType.AddNavigation("RegulaProg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaProg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_REGULAPROG_REFERENCE_REGULA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaProg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaSklepAuthEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaSklepAuthEntityType.cs new file mode 100644 index 0000000..7ba2817 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaSklepAuthEntityType.cs @@ -0,0 +1,273 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaSklepAuthEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklepAuth", + typeof(RegulaSklepAuth), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzasAutoryzacji = runtimeEntityType.AddProperty( + "DataCzasAutoryzacji", + typeof(DateTime), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("DataCzasAutoryzacji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataCzasAutoryzacji.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzasAutoryzacji.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzasAutoryzacji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pcfUserId = runtimeEntityType.AddProperty( + "PcfUserId", + typeof(int), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("PcfUserId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + pcfUserId.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + pcfUserId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, sklepId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { pcfUserId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { sklepId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PcfUserId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PcfUserId") }), + principalEntityType, + required: true); + + var pcfUser = declaringEntityType.AddNavigation("PcfUser", + runtimeForeignKey, + onDependent: true, + typeof(PcfUser), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("PcfUser", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaSklepAuth = principalEntityType.AddNavigation("RegulaSklepAuth", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PcfUser).GetProperty("RegulaSklepAuth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PcfUser).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RegulaSklepAuth_PcfUser"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaSklepAuth = principalEntityType.AddNavigation("RegulaSklepAuth", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaSklepAuth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RegulaSklepAuth_Regula"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(RegulaSklepAuth).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklepAuth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaSklepAuth = principalEntityType.AddNavigation("RegulaSklepAuth", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("RegulaSklepAuth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RegulaSklepAuth_Sklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaSklepAuth"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaSklepEntityType.cs new file mode 100644 index 0000000..1d25c36 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaSklepEntityType.cs @@ -0,0 +1,200 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaSklep", + typeof(RegulaSklep), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaSklep).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(RegulaSklep).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(RegulaSklep).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(RegulaSklep).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, sklepId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULASKLEP"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaSklep).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaSklep = principalEntityType.AddNavigation("RegulaSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RegulaSklep_Regula"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(RegulaSklep).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaSklep = principalEntityType.AddNavigation("RegulaSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("RegulaSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RegulaSklep_Sklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaTekstEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaTekstEntityType.cs new file mode 100644 index 0000000..075bead --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaTekstEntityType.cs @@ -0,0 +1,145 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaTekstEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTekst", + typeof(RegulaTekst), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaTekst).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RegulaTekst).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(RegulaTekst).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaTekst).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaTekst = principalEntityType.AddNavigation("RegulaTekst", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaTekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RegulaTekst_Regula"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaTekst"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaTowarEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaTowarEntityType.cs new file mode 100644 index 0000000..a5320e9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RegulaTowarEntityType.cs @@ -0,0 +1,249 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RegulaTowarEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RegulaTowar", + typeof(RegulaTowar), + baseEntityType); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal), + propertyInfo: typeof(RegulaTowar).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(RegulaTowar).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RegulaTowar).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal?), + propertyInfo: typeof(RegulaTowar).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal?), + propertyInfo: typeof(RegulaTowar).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parametr = runtimeEntityType.AddProperty( + "Parametr", + typeof(int?), + propertyInfo: typeof(RegulaTowar).GetProperty("Parametr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + parametr.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + parametr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { regulaId, towId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_REGULATOWAR"); + + var index = runtimeEntityType.AddIndex( + new[] { towId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RegulaId") }), + principalEntityType, + required: true); + + var regula = declaringEntityType.AddNavigation("Regula", + runtimeForeignKey, + onDependent: true, + typeof(Regula), + propertyInfo: typeof(RegulaTowar).GetProperty("Regula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaTowar = principalEntityType.AddNavigation("RegulaTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Regula).GetProperty("RegulaTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Regula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_REGULATO_REFERENCE_REGULA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(RegulaTowar).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var regulaTowar = principalEntityType.AddNavigation("RegulaTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("RegulaTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_REGULATO_REFERENCE_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RegulaTowar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RolaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RolaEntityType.cs new file mode 100644 index 0000000..4e31f6b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RolaEntityType.cs @@ -0,0 +1,244 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RolaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Rola", + typeof(Rola), + baseEntityType); + + var rolaId = runtimeEntityType.AddProperty( + "RolaId", + typeof(short), + propertyInfo: typeof(Rola).GetProperty("RolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rolaId.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywna = runtimeEntityType.AddProperty( + "Aktywna", + typeof(short), + propertyInfo: typeof(Rola).GetProperty("Aktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRolaId = runtimeEntityType.AddProperty( + "CentrRolaId", + typeof(short?), + propertyInfo: typeof(Rola).GetProperty("CentrRolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRolaId.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + centrRolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslna = runtimeEntityType.AddProperty( + "Domyslna", + typeof(short?), + propertyInfo: typeof(Rola).GetProperty("Domyslna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + domyslna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + domyslna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Rola).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var priorytet = runtimeEntityType.AddProperty( + "Priorytet", + typeof(short?), + propertyInfo: typeof(Rola).GetProperty("Priorytet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + priorytet.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + priorytet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(Rola).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uprawnieniaZRoli = runtimeEntityType.AddProperty( + "UprawnieniaZRoli", + typeof(short?), + propertyInfo: typeof(Rola).GetProperty("UprawnieniaZRoli", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uprawnieniaZRoli.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + uprawnieniaZRoli.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Rola).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { rolaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ROLA"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Rola"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RolaUprawnienieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RolaUprawnienieEntityType.cs new file mode 100644 index 0000000..d14e82e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RolaUprawnienieEntityType.cs @@ -0,0 +1,136 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RolaUprawnienieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RolaUprawnienie", + typeof(RolaUprawnienie), + baseEntityType); + + var rolaId = runtimeEntityType.AddProperty( + "RolaId", + typeof(short), + propertyInfo: typeof(RolaUprawnienie).GetProperty("RolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rolaId.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(RolaUprawnienie).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jest = runtimeEntityType.AddProperty( + "Jest", + typeof(short?), + propertyInfo: typeof(RolaUprawnienie).GetProperty("Jest", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + jest.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + jest.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { rolaId, rodzaj }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ROLAUPR"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RolaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RolaId") }), + principalEntityType, + required: true); + + var rola = declaringEntityType.AddNavigation("Rola", + runtimeForeignKey, + onDependent: true, + typeof(Rola), + propertyInfo: typeof(RolaUprawnienie).GetProperty("Rola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rolaUprawnienie = principalEntityType.AddNavigation("RolaUprawnienie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Rola).GetProperty("RolaUprawnienie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RolaUprRola"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RolaUprawnienie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozPrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozPrtMagEntityType.cs new file mode 100644 index 0000000..c17d4d8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozPrtMagEntityType.cs @@ -0,0 +1,306 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RozPrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RozPrtMag", + typeof(RozPrtMag), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(RozPrtMag).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(RozPrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RozPrtMag).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(RozPrtMag).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(RozPrtMag).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime?), + propertyInfo: typeof(RozPrtMag).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscPrt = runtimeEntityType.AddProperty( + "IloscPrt", + typeof(decimal?), + propertyInfo: typeof(RozPrtMag).GetProperty("IloscPrt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + iloscPrt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscPrt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscPrt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(RozPrtMag).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, pMId, znaczenie, dokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ROZPRTMAG"); + + var idx_RozPrtMagDzien = runtimeEntityType.AddIndex( + new[] { dzien }, + name: "idx_RozPrtMagDzien"); + + var idx_RozPrtMagPoz = runtimeEntityType.AddIndex( + new[] { dokId, kolejnosc, znaczenie, pMId }, + name: "idx_RozPrtMagPoz"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(RozPrtMag).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozPrtMag = principalEntityType.AddNavigation("RozPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozDok).GetProperty("RozPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RozPrtMagPoz"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId"), declaringEntityType.FindProperty("PMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId"), principalEntityType.FindProperty("PMId") }), + principalEntityType, + required: true); + + var prtMag = declaringEntityType.AddNavigation("PrtMag", + runtimeForeignKey, + onDependent: true, + typeof(PrtMag), + propertyInfo: typeof(RozPrtMag).GetProperty("PrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozPrtMag = principalEntityType.AddNavigation("RozPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PrtMag).GetProperty("RozPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_RozPrtMagPrt"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RozPrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozbicieDodDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozbicieDodDokEntityType.cs new file mode 100644 index 0000000..32cea34 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozbicieDodDokEntityType.cs @@ -0,0 +1,299 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RozbicieDodDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RozbicieDodDok", + typeof(RozbicieDodDok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(RozbicieDodDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(RozbicieDodDok).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(RozbicieDodDok).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal), + propertyInfo: typeof(RozbicieDodDok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDet = runtimeEntityType.AddProperty( + "NettoDet", + typeof(decimal), + propertyInfo: typeof(RozbicieDodDok).GetProperty("NettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMag = runtimeEntityType.AddProperty( + "NettoMag", + typeof(decimal), + propertyInfo: typeof(RozbicieDodDok).GetProperty("NettoMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal), + propertyInfo: typeof(RozbicieDodDok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDet = runtimeEntityType.AddProperty( + "PodatekDet", + typeof(decimal), + propertyInfo: typeof(RozbicieDodDok).GetProperty("PodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMag = runtimeEntityType.AddProperty( + "PodatekMag", + typeof(decimal), + propertyInfo: typeof(RozbicieDodDok).GetProperty("PodatekMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, znaczenie, stawka }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ROZBDODDOK"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(RozbicieDodDok).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozbicieDodDok = principalEntityType.AddNavigation("RozbicieDodDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("RozbicieDodDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_RozbDodDokDok"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RozbicieDodDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozbicieDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozbicieDokEntityType.cs new file mode 100644 index 0000000..096e599 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozbicieDokEntityType.cs @@ -0,0 +1,277 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RozbicieDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RozbicieDok", + typeof(RozbicieDok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(RozbicieDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(RozbicieDok).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal), + propertyInfo: typeof(RozbicieDok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDet = runtimeEntityType.AddProperty( + "NettoDet", + typeof(decimal), + propertyInfo: typeof(RozbicieDok).GetProperty("NettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMag = runtimeEntityType.AddProperty( + "NettoMag", + typeof(decimal?), + propertyInfo: typeof(RozbicieDok).GetProperty("NettoMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nettoMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal), + propertyInfo: typeof(RozbicieDok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDet = runtimeEntityType.AddProperty( + "PodatekDet", + typeof(decimal), + propertyInfo: typeof(RozbicieDok).GetProperty("PodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMag = runtimeEntityType.AddProperty( + "PodatekMag", + typeof(decimal?), + propertyInfo: typeof(RozbicieDok).GetProperty("PodatekMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + podatekMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, stawka }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ROZBICIEDOK"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(RozbicieDok).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozbicieDok = principalEntityType.AddNavigation("RozbicieDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("RozbicieDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ROZBICIE_REF_SUMAD_DOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RozbicieDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozliczaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozliczaEntityType.cs new file mode 100644 index 0000000..f2f970e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozliczaEntityType.cs @@ -0,0 +1,228 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RozliczaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Rozlicza", + typeof(Rozlicza), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(Rozlicza).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(Rozlicza).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczanyDokId = runtimeEntityType.AddProperty( + "RozliczanyDokId", + typeof(decimal), + propertyInfo: typeof(Rozlicza).GetProperty("RozliczanyDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rozliczanyDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rozliczanyDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rozliczanyDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczenie = runtimeEntityType.AddProperty( + "Rozliczenie", + typeof(decimal), + propertyInfo: typeof(Rozlicza).GetProperty("Rozliczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rozliczenie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rozliczenie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rozliczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczeniePodatku = runtimeEntityType.AddProperty( + "RozliczeniePodatku", + typeof(decimal?), + propertyInfo: typeof(Rozlicza).GetProperty("RozliczeniePodatku", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rozliczeniePodatku.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rozliczeniePodatku.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rozliczeniePodatku.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ROZLICZA"); + + var idx_RozliczanyDokId = runtimeEntityType.AddIndex( + new[] { rozliczanyDokId }, + name: "idx_RozliczanyDokId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(Rozlicza).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozliczaDok = principalEntityType.AddNavigation("RozliczaDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("RozliczaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ROZLICZA_REF_DOKZB_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RozliczanyDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var rozliczanyDok = declaringEntityType.AddNavigation("RozliczanyDok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(Rozlicza).GetProperty("RozliczanyDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozliczaRozliczanyDok = principalEntityType.AddNavigation("RozliczaRozliczanyDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("RozliczaRozliczanyDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ROZLICZA_REF_DOKRO_DOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Rozlicza"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozliczeniePartiiEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozliczeniePartiiEntityType.cs new file mode 100644 index 0000000..7cd76a6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/RozliczeniePartiiEntityType.cs @@ -0,0 +1,225 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class RozliczeniePartiiEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.RozliczeniePartii", + typeof(RozliczeniePartii), + baseEntityType); + + var rozDokId = runtimeEntityType.AddProperty( + "RozDokId", + typeof(decimal), + propertyInfo: typeof(RozliczeniePartii).GetProperty("RozDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozliczeniePartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + rozDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rozDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rozDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozKolejnosc = runtimeEntityType.AddProperty( + "RozKolejnosc", + typeof(int), + propertyInfo: typeof(RozliczeniePartii).GetProperty("RozKolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozliczeniePartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + rozKolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + rozKolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prtDokId = runtimeEntityType.AddProperty( + "PrtDokId", + typeof(decimal), + propertyInfo: typeof(RozliczeniePartii).GetProperty("PrtDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozliczeniePartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + prtDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + prtDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + prtDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prtKolejnosc = runtimeEntityType.AddProperty( + "PrtKolejnosc", + typeof(int), + propertyInfo: typeof(RozliczeniePartii).GetProperty("PrtKolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozliczeniePartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + prtKolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + prtKolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczenie = runtimeEntityType.AddProperty( + "Rozliczenie", + typeof(decimal), + propertyInfo: typeof(RozliczeniePartii).GetProperty("Rozliczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozliczeniePartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rozliczenie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rozliczenie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rozliczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { rozDokId, rozKolejnosc, prtDokId, prtKolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ROZLICZENIEPARTII"); + + var idx_RozPrt = runtimeEntityType.AddIndex( + new[] { prtDokId, prtKolejnosc }, + name: "idx_RozPrt"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PrtDokId"), declaringEntityType.FindProperty("PrtKolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var partia = declaringEntityType.AddNavigation("Partia", + runtimeForeignKey, + onDependent: true, + typeof(Partia), + propertyInfo: typeof(RozliczeniePartii).GetProperty("Partia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozliczeniePartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozliczeniePartii = principalEntityType.AddNavigation("RozliczeniePartii", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Partia).GetProperty("RozliczeniePartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Partia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ROZLICZE_REF_PRTRO_PARTIA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RozDokId"), declaringEntityType.FindProperty("RozKolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(RozliczeniePartii).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(RozliczeniePartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var rozliczeniePartii = principalEntityType.AddNavigation("RozliczeniePartii", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozDok).GetProperty("RozliczeniePartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ROZLICZE_REF_ROZPO_POZDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "RozliczeniePartii"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SesjaAktywnaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SesjaAktywnaEntityType.cs new file mode 100644 index 0000000..3915de3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SesjaAktywnaEntityType.cs @@ -0,0 +1,171 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SesjaAktywnaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SesjaAktywna", + typeof(SesjaAktywna), + baseEntityType); + + var sesjaId = runtimeEntityType.AddProperty( + "SesjaId", + typeof(decimal), + propertyInfo: typeof(SesjaAktywna).GetProperty("SesjaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SesjaAktywna).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sesjaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sesjaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sesjaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywnosc = runtimeEntityType.AddProperty( + "Aktywnosc", + typeof(DateTime), + propertyInfo: typeof(SesjaAktywna).GetProperty("Aktywnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SesjaAktywna).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + aktywnosc.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + aktywnosc.AddAnnotation("Relational:ColumnType", "datetime"); + aktywnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var idProcesu = runtimeEntityType.AddProperty( + "IdProcesu", + typeof(string), + propertyInfo: typeof(SesjaAktywna).GetProperty("IdProcesu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SesjaAktywna).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + idProcesu.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + idProcesu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wylacznosc = runtimeEntityType.AddProperty( + "Wylacznosc", + typeof(short), + propertyInfo: typeof(SesjaAktywna).GetProperty("Wylacznosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SesjaAktywna).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + wylacznosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + wylacznosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sesjaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SESJAAKTYWNA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SesjaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SesjaId") }), + principalEntityType, + unique: true, + required: true); + + var sesja = declaringEntityType.AddNavigation("Sesja", + runtimeForeignKey, + onDependent: true, + typeof(Sesja), + propertyInfo: typeof(SesjaAktywna).GetProperty("Sesja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SesjaAktywna).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sesjaAktywna = principalEntityType.AddNavigation("SesjaAktywna", + runtimeForeignKey, + onDependent: false, + typeof(SesjaAktywna), + propertyInfo: typeof(Sesja).GetProperty("SesjaAktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SESJAAKT_REF_SESAK_SESJA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SesjaAktywna"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SesjaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SesjaEntityType.cs new file mode 100644 index 0000000..4d60278 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SesjaEntityType.cs @@ -0,0 +1,201 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SesjaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Sesja", + typeof(Sesja), + baseEntityType); + + var sesjaId = runtimeEntityType.AddProperty( + "SesjaId", + typeof(decimal), + propertyInfo: typeof(Sesja).GetProperty("SesjaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sesjaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sesjaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sesjaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var stanowisko = runtimeEntityType.AddProperty( + "Stanowisko", + typeof(string), + propertyInfo: typeof(Sesja).GetProperty("Stanowisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + stanowisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + stanowisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typAplikacji = runtimeEntityType.AddProperty( + "TypAplikacji", + typeof(short), + propertyInfo: typeof(Sesja).GetProperty("TypAplikacji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typAplikacji.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typAplikacji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal), + propertyInfo: typeof(Sesja).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(Sesja).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sesjaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SESJA"); + + var idx_SesjaUzId = runtimeEntityType.AddIndex( + new[] { uzId }, + name: "idx_SesjaUzId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType, + required: true); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(Sesja).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sesja = principalEntityType.AddNavigation("Sesja", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("Sesja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SESJA_REF_UZYSE_UZYTKOWN"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Sesja"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SkladnikDefinicjiKoduEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SkladnikDefinicjiKoduEntityType.cs new file mode 100644 index 0000000..448202c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SkladnikDefinicjiKoduEntityType.cs @@ -0,0 +1,189 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SkladnikDefinicjiKoduEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikDefinicjiKodu", + typeof(SkladnikDefinicjiKodu), + baseEntityType); + + var dKId = runtimeEntityType.AddProperty( + "DKId", + typeof(decimal), + propertyInfo: typeof(SkladnikDefinicjiKodu).GetProperty("DKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SkladnikDefinicjiKodu).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dlugosc = runtimeEntityType.AddProperty( + "Dlugosc", + typeof(short), + propertyInfo: typeof(SkladnikDefinicjiKodu).GetProperty("Dlugosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dlugosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dlugosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SkladnikDefinicjiKodu).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SkladnikDefinicjiKodu).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dKId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLDEFKODU"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DKId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DKId") }), + principalEntityType, + required: true); + + var dK = declaringEntityType.AddNavigation("DK", + runtimeForeignKey, + onDependent: true, + typeof(DefinicjaKodu), + propertyInfo: typeof(SkladnikDefinicjiKodu).GetProperty("DK", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var skladnikDefinicjiKodu = principalEntityType.AddNavigation("SkladnikDefinicjiKodu", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(DefinicjaKodu).GetProperty("SkladnikDefinicjiKodu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLDEFKODU"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SkladnikDefinicjiKodu"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SkladnikWzorcaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SkladnikWzorcaEntityType.cs new file mode 100644 index 0000000..63641f9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SkladnikWzorcaEntityType.cs @@ -0,0 +1,408 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SkladnikWzorcaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SkladnikWzorca", + typeof(SkladnikWzorca), + baseEntityType); + + var skWzId = runtimeEntityType.AddProperty( + "SkWzId", + typeof(decimal), + propertyInfo: typeof(SkladnikWzorca).GetProperty("SkWzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + skWzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + skWzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + skWzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SkladnikWzorca).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal), + propertyInfo: typeof(SkladnikWzorca).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrSkWzId = runtimeEntityType.AddProperty( + "CentrSkWzId", + typeof(decimal?), + propertyInfo: typeof(SkladnikWzorca).GetProperty("CentrSkWzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrSkWzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrSkWzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrSkWzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czyDodatek = runtimeEntityType.AddProperty( + "CzyDodatek", + typeof(short?), + propertyInfo: typeof(SkladnikWzorca).GetProperty("CzyDodatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + czyDodatek.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + czyDodatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal), + propertyInfo: typeof(SkladnikWzorca).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SkladnikWzorca).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SkladnikWzorca).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var obowiazkowy = runtimeEntityType.AddProperty( + "Obowiazkowy", + typeof(short), + propertyInfo: typeof(SkladnikWzorca).GetProperty("Obowiazkowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + obowiazkowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + obowiazkowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozneCeny = runtimeEntityType.AddProperty( + "RozneCeny", + typeof(short?), + propertyInfo: typeof(SkladnikWzorca).GetProperty("RozneCeny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rozneCeny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rozneCeny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towIdWzorca = runtimeEntityType.AddProperty( + "TowIdWzorca", + typeof(decimal?), + propertyInfo: typeof(SkladnikWzorca).GetProperty("TowIdWzorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + towIdWzorca.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towIdWzorca.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towIdWzorca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wyborWielu = runtimeEntityType.AddProperty( + "WyborWielu", + typeof(short?), + propertyInfo: typeof(SkladnikWzorca).GetProperty("WyborWielu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wyborWielu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wyborWielu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wyliczenieCeny = runtimeEntityType.AddProperty( + "WyliczenieCeny", + typeof(short?), + propertyInfo: typeof(SkladnikWzorca).GetProperty("WyliczenieCeny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wyliczenieCeny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wyliczenieCeny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SkladnikWzorca).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { skWzId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLADNIKWZORCA"); + + var idx_CentrSkWzId = runtimeEntityType.AddIndex( + new[] { centrSkWzId }, + name: "idx_CentrSkWzId"); + + var idx_SkladnikWzorca_TowIdWzorca = runtimeEntityType.AddIndex( + new[] { towIdWzorca, kolejnosc }, + name: "idx_SkladnikWzorca_TowIdWzorca"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowIdWzorca") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType); + + var towIdWzorcaNavigation = declaringEntityType.AddNavigation("TowIdWzorcaNavigation", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(SkladnikWzorca).GetProperty("TowIdWzorcaNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var skladnikWzorca = principalEntityType.AddNavigation("SkladnikWzorca", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("SkladnikWzorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLADNIKWZORCA_REFERENCE_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SkladnikWzorca"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepArtykulEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepArtykulEntityType.cs new file mode 100644 index 0000000..8bdea3b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepArtykulEntityType.cs @@ -0,0 +1,204 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepArtykulEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepArtykul", + typeof(SklepArtykul), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepArtykul).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepArtykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepArtId = runtimeEntityType.AddProperty( + "SklepArtId", + typeof(decimal), + propertyInfo: typeof(SklepArtykul).GetProperty("SklepArtId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepArtykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepArtId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepArtId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepArtId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var artNazwa = runtimeEntityType.AddProperty( + "ArtNazwa", + typeof(string), + propertyInfo: typeof(SklepArtykul).GetProperty("ArtNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepArtykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + artNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + artNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var glownySklepTowId = runtimeEntityType.AddProperty( + "GlownySklepTowId", + typeof(decimal?), + propertyInfo: typeof(SklepArtykul).GetProperty("GlownySklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepArtykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + glownySklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + glownySklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + glownySklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepArtId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPARTYKUL"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, glownySklepTowId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepArtykul).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepArtykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepArtykul = principalEntityType.AddNavigation("SklepArtykul", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepArtykul", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPART_REF_SKART_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("GlownySklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepArtykul).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepArtykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepArtykul = principalEntityType.AddNavigation("SklepArtykul", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepArtykul", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLARTGLOWNYSKLEPTOWID"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepArtykul"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepBankEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepBankEntityType.cs new file mode 100644 index 0000000..e0d3ba6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepBankEntityType.cs @@ -0,0 +1,273 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepBankEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepBank", + typeof(SklepBank), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepBank).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepBankId = runtimeEntityType.AddProperty( + "SklepBankId", + typeof(decimal), + propertyInfo: typeof(SklepBank).GetProperty("SklepBankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepBankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepBankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepBankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var adres = runtimeEntityType.AddProperty( + "Adres", + typeof(string), + propertyInfo: typeof(SklepBank).GetProperty("Adres", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + adres.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + adres.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepBank).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bankId = runtimeEntityType.AddProperty( + "BankId", + typeof(decimal?), + propertyInfo: typeof(SklepBank).GetProperty("BankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + bankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + bankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + bankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepBank).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrRozliBank = runtimeEntityType.AddProperty( + "NrRozliBank", + typeof(string), + propertyInfo: typeof(SklepBank).GetProperty("NrRozliBank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 8, + unicode: false); + nrRozliBank.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(8)", + size: 8)); + nrRozliBank.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sWIFT = runtimeEntityType.AddProperty( + "SWIFT", + typeof(string), + propertyInfo: typeof(SklepBank).GetProperty("SWIFT", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 11, + unicode: false); + sWIFT.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(11)", + size: 11)); + sWIFT.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepBank).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepBankId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepBank"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDefinicjaKoduEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDefinicjaKoduEntityType.cs new file mode 100644 index 0000000..ad79b0d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDefinicjaKoduEntityType.cs @@ -0,0 +1,294 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDefinicjaKoduEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDefinicjaKodu", + typeof(SklepDefinicjaKodu), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDKId = runtimeEntityType.AddProperty( + "SklepDKId", + typeof(decimal), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("SklepDKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dKId = runtimeEntityType.AddProperty( + "DKId", + typeof(decimal?), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("DKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDo = runtimeEntityType.AddProperty( + "DataDo", + typeof(DateTime?), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("DataDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDo.AddAnnotation("Relational:ColumnType", "datetime"); + dataDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataOd = runtimeEntityType.AddProperty( + "DataOd", + typeof(DateTime?), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("DataOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataOd.AddAnnotation("Relational:ColumnType", "datetime"); + dataOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDKId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKDEFKODU"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDefinicjaKodu = principalEntityType.AddNavigation("SklepDefinicjaKodu", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepDefinicjaKodu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKDEFKODUSKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDefinicjaKodu"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDlugiZasobEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDlugiZasobEntityType.cs new file mode 100644 index 0000000..db45b73 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDlugiZasobEntityType.cs @@ -0,0 +1,180 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDlugiZasobEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDlugiZasob", + typeof(SklepDlugiZasob), + baseEntityType); + + var zasobId = runtimeEntityType.AddProperty( + "ZasobId", + typeof(decimal), + propertyInfo: typeof(SklepDlugiZasob).GetProperty("ZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDlugiZasob).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWersja = runtimeEntityType.AddProperty( + "SklepWersja", + typeof(string), + propertyInfo: typeof(SklepDlugiZasob).GetProperty("SklepWersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + sklepWersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + sklepWersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZasobId = runtimeEntityType.AddProperty( + "SklepZasobId", + typeof(decimal), + propertyInfo: typeof(SklepDlugiZasob).GetProperty("SklepZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepZasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zasobId, sklepId }); + runtimeEntityType.SetPrimaryKey(key); + + var ixSklepDlugiZasob_SklepIdent = runtimeEntityType.AddIndex( + new[] { sklepId, sklepZasobId }, + name: "IxSklepDlugiZasob_SklepIdent"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZasobId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZasobId") }), + principalEntityType, + required: true); + + var zasob = declaringEntityType.AddNavigation("Zasob", + runtimeForeignKey, + onDependent: true, + typeof(DlugiZasob), + propertyInfo: typeof(SklepDlugiZasob).GetProperty("Zasob", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDlugiZasob = principalEntityType.AddNavigation("SklepDlugiZasob", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(DlugiZasob).GetProperty("SklepDlugiZasob", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DlugiZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepDlugiZasob_ZasobId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDlugiZasob"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokDodKthEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokDodKthEntityType.cs new file mode 100644 index 0000000..ad51bcc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokDodKthEntityType.cs @@ -0,0 +1,229 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDokDodKthEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokDodKth", + typeof(SklepDokDodKth), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDokDodKth).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepDokDodKth).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepDokDodKth).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal?), + propertyInfo: typeof(SklepDokDodKth).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepDokDodKth).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDOKDODKTH"); + + var idx_SkDDKth = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontrId }, + name: "idx_SkDDKth"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepDokDodKth).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokDodKth = principalEntityType.AddNavigation("SklepDokDodKth", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepDokDodKth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDDK_SKLEPDOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepDokDodKth).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokDodKth).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokDodKth = principalEntityType.AddNavigation("SklepDokDodKth", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepDokDodKth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDKD_SKLEPKON"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDokDodKth"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokEntityType.cs new file mode 100644 index 0000000..b5634be --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokEntityType.cs @@ -0,0 +1,2073 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDok", + typeof(SklepDok), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrDokId = runtimeEntityType.AddProperty( + "CentrDokId", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("CentrDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrEksportFK = runtimeEntityType.AddProperty( + "CentrEksportFK", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("CentrEksportFK", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + centrEksportFK.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + centrEksportFK.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenySpBrutto = runtimeEntityType.AddProperty( + "CenySpBrutto", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("CenySpBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + cenySpBrutto.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + cenySpBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenyZakBrutto = runtimeEntityType.AddProperty( + "CenyZakBrutto", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("CenyZakBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + cenyZakBrutto.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + cenyZakBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime), + propertyInfo: typeof(SklepDok).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDod = runtimeEntityType.AddProperty( + "DataDod", + typeof(DateTime), + propertyInfo: typeof(SklepDok).GetProperty("DataDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataDod.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDod.AddAnnotation("Relational:ColumnType", "datetime"); + dataDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataPom = runtimeEntityType.AddProperty( + "DataPom", + typeof(DateTime), + propertyInfo: typeof(SklepDok).GetProperty("DataPom", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataPom.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataPom.AddAnnotation("Relational:ColumnType", "datetime"); + dataPom.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var doZaplaty = runtimeEntityType.AddProperty( + "DoZaplaty", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("DoZaplaty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + doZaplaty.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + doZaplaty.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + doZaplaty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var eksportFK = runtimeEntityType.AddProperty( + "EksportFK", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("EksportFK", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + eksportFK.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + eksportFK.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaPlat = runtimeEntityType.AddProperty( + "FormaPlat", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("FormaPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + formaPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + formaPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnyWDniu = runtimeEntityType.AddProperty( + "KolejnyWDniu", + typeof(int), + propertyInfo: typeof(SklepDok).GetProperty("KolejnyWDniu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + kolejnyWDniu.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnyWDniu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota1 = runtimeEntityType.AddProperty( + "Kwota1", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota10 = runtimeEntityType.AddProperty( + "Kwota10", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota10", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota10.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota10.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota10.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota11 = runtimeEntityType.AddProperty( + "Kwota11", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("Kwota11", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota11.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota11.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota11.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota12 = runtimeEntityType.AddProperty( + "Kwota12", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("Kwota12", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota12.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota12.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota12.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota2 = runtimeEntityType.AddProperty( + "Kwota2", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota3 = runtimeEntityType.AddProperty( + "Kwota3", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota4 = runtimeEntityType.AddProperty( + "Kwota4", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota4.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota5 = runtimeEntityType.AddProperty( + "Kwota5", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota5.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota5.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota6 = runtimeEntityType.AddProperty( + "Kwota6", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota6.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota6.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota7 = runtimeEntityType.AddProperty( + "Kwota7", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota7", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota7.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota7.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota7.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota8 = runtimeEntityType.AddProperty( + "Kwota8", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota8", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota8.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota8.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota8.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota9 = runtimeEntityType.AddProperty( + "Kwota9", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Kwota9", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota9.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota9.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota9.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDet = runtimeEntityType.AddProperty( + "NettoDet", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("NettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDetUslugi = runtimeEntityType.AddProperty( + "NettoDetUslugi", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("NettoDetUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDetUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDetUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDetUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMag = runtimeEntityType.AddProperty( + "NettoMag", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("NettoMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMagUslugi = runtimeEntityType.AddProperty( + "NettoMagUslugi", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("NettoMagUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoMagUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMagUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMagUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoUslugi = runtimeEntityType.AddProperty( + "NettoUslugi", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("NettoUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDok = runtimeEntityType.AddProperty( + "NrDok", + typeof(string), + propertyInfo: typeof(SklepDok).GetProperty("NrDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nrDok.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrKolejny = runtimeEntityType.AddProperty( + "NrKolejny", + typeof(int?), + propertyInfo: typeof(SklepDok).GetProperty("NrKolejny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrKolejny.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + nrKolejny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrKolejnyMag = runtimeEntityType.AddProperty( + "NrKolejnyMag", + typeof(int?), + propertyInfo: typeof(SklepDok).GetProperty("NrKolejnyMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrKolejnyMag.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + nrKolejnyMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja1 = runtimeEntityType.AddProperty( + "Opcja1", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("Opcja1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja3 = runtimeEntityType.AddProperty( + "Opcja3", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("Opcja3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja3.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja4 = runtimeEntityType.AddProperty( + "Opcja4", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("Opcja4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcja4.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcja4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja5 = runtimeEntityType.AddProperty( + "Opcja5", + typeof(short?), + propertyInfo: typeof(SklepDok).GetProperty("Opcja5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja5.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja6 = runtimeEntityType.AddProperty( + "Opcja6", + typeof(short?), + propertyInfo: typeof(SklepDok).GetProperty("Opcja6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja6.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja7 = runtimeEntityType.AddProperty( + "Opcja7", + typeof(short?), + propertyInfo: typeof(SklepDok).GetProperty("Opcja7", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja7.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja7.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja8 = runtimeEntityType.AddProperty( + "Opcja8", + typeof(short?), + propertyInfo: typeof(SklepDok).GetProperty("Opcja8", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja8.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja8.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int), + propertyInfo: typeof(SklepDok).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(int), + propertyInfo: typeof(SklepDok).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param2.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(int), + propertyInfo: typeof(SklepDok).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param3.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param4 = runtimeEntityType.AddProperty( + "Param4", + typeof(int), + propertyInfo: typeof(SklepDok).GetProperty("Param4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param4.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param5 = runtimeEntityType.AddProperty( + "Param5", + typeof(int?), + propertyInfo: typeof(SklepDok).GetProperty("Param5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param5.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param6 = runtimeEntityType.AddProperty( + "Param6", + typeof(int?), + propertyInfo: typeof(SklepDok).GetProperty("Param6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param6.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDet = runtimeEntityType.AddProperty( + "PodatekDet", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("PodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDetUslugi = runtimeEntityType.AddProperty( + "PodatekDetUslugi", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("PodatekDetUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDetUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDetUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDetUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMag = runtimeEntityType.AddProperty( + "PodatekMag", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("PodatekMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMagUslugi = runtimeEntityType.AddProperty( + "PodatekMagUslugi", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("PodatekMagUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekMagUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMagUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMagUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekUslugi = runtimeEntityType.AddProperty( + "PodatekUslugi", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("PodatekUslugi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekUslugi.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekUslugi.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekUslugi.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatProc = runtimeEntityType.AddProperty( + "RabatProc", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("RabatProc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatProc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatProc.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatProc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var razem = runtimeEntityType.AddProperty( + "Razem", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Razem", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + razem.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + razem.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + razem.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKBId = runtimeEntityType.AddProperty( + "SklepKBId", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("SklepKBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKasaId = runtimeEntityType.AddProperty( + "SklepKasaId", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("SklepKasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepPlatnikId = runtimeEntityType.AddProperty( + "SklepPlatnikId", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("SklepPlatnikId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepPlatnikId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepPlatnikId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepPlatnikId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalIdPlatnosci = runtimeEntityType.AddProperty( + "SklepWalIdPlatnosci", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("SklepWalIdPlatnosci", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepWalIdPlatnosci.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalIdPlatnosci.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalIdPlatnosci.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var terminPlat = runtimeEntityType.AddProperty( + "TerminPlat", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("TerminPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + terminPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + terminPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typDok = runtimeEntityType.AddProperty( + "TypDok", + typeof(short), + propertyInfo: typeof(SklepDok).GetProperty("TypDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typDok.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zaplacono = runtimeEntityType.AddProperty( + "Zaplacono", + typeof(decimal), + propertyInfo: typeof(SklepDok).GetProperty("Zaplacono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + zaplacono.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + zaplacono.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + zaplacono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zaplaconoPodatek = runtimeEntityType.AddProperty( + "ZaplaconoPodatek", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("ZaplaconoPodatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zaplaconoPodatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + zaplaconoPodatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + zaplaconoPodatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zaplaconoWKasie = runtimeEntityType.AddProperty( + "ZaplaconoWKasie", + typeof(decimal?), + propertyInfo: typeof(SklepDok).GetProperty("ZaplaconoWKasie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zaplaconoWKasie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + zaplaconoWKasie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + zaplaconoWKasie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepDok).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDOK"); + + var idx_SkDokId = runtimeEntityType.AddIndex( + new[] { dokId }, + name: "idx_SkDokId"); + + var idx_SkDokKasa = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKasaId }, + name: "idx_SkDokKasa"); + + var idx_SkDokKth = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontrId }, + name: "idx_SkDokKth"); + + var idx_SkDokMag = runtimeEntityType.AddIndex( + new[] { sklepId, sklepMagId }, + name: "idx_SkDokMag"); + + var idx_SkDokPlatKth = runtimeEntityType.AddIndex( + new[] { sklepId, sklepPlatnikId }, + name: "idx_SkDokPlatKth"); + + var idx_SkDokTypDokDataKolejnyWDniu = runtimeEntityType.AddIndex( + new[] { typDok, data, kolejnyWDniu }, + name: "idx_SkDokTypDokDataKolejnyWDniu"); + + var idx_SkDokUz = runtimeEntityType.AddIndex( + new[] { sklepId, sklepUzId }, + name: "idx_SkDokUz"); + + var idx_SkDokWal = runtimeEntityType.AddIndex( + new[] { sklepId, sklepWalId }, + name: "idx_SkDokWal"); + + var idx_SkDokZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SkDokZmiana"); + + var idx_SklepDataKolejnyWDniu = runtimeEntityType.AddIndex( + new[] { sklepId, data, kolejnyWDniu }, + name: "idx_SklepDataKolejnyWDniu"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(SklepDok).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDok = principalEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDOK_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepDok).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDok = principalEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKLEP_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKasaId") }), + principalEntityType); + + var sklepKasa = declaringEntityType.AddNavigation("SklepKasa", + runtimeForeignKey, + onDependent: true, + typeof(SklepKasa), + propertyInfo: typeof(SklepDok).GetProperty("SklepKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDok = principalEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKasa).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDOK_SKLEPKAS"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepDok).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokSklepKontr = principalEntityType.AddNavigation("SklepDokSklepKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepDokSklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_OBROT_SKLEPKON"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey5(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepMagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepMagId") }), + principalEntityType, + required: true); + + var sklepMagazyn = declaringEntityType.AddNavigation("SklepMagazyn", + runtimeForeignKey, + onDependent: true, + typeof(SklepMagazyn), + propertyInfo: typeof(SklepDok).GetProperty("SklepMagazyn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDok = principalEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepMagazyn).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDOK_SKLEPMAG"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey6(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepPlatnikId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType); + + var sklepKontrNavigation = declaringEntityType.AddNavigation("SklepKontrNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepDok).GetProperty("SklepKontrNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokSklepKontrNavigation = principalEntityType.AddNavigation("SklepDokSklepKontrNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepDokSklepKontrNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_OBROT_SKLEPPLAT"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey7(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType, + required: true); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepDok).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDok = principalEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDOK_SKLEPUZY"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey8(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepWalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepWalId") }), + principalEntityType); + + var sklepWaluta = declaringEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: true, + typeof(SklepWaluta), + propertyInfo: typeof(SklepDok).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDok = principalEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDWP_SKLEPWAL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokKursEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokKursEntityType.cs new file mode 100644 index 0000000..aa21ac4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokKursEntityType.cs @@ -0,0 +1,280 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDokKursEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokKurs", + typeof(SklepDokKurs), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDokKurs).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepDokKurs).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepDokKurs).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime?), + propertyInfo: typeof(SklepDokKurs).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal?), + propertyInfo: typeof(SklepDokKurs).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrTabeli = runtimeEntityType.AddProperty( + "NrTabeli", + typeof(string), + propertyInfo: typeof(SklepDokKurs).GetProperty("NrTabeli", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrTabeli.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrTabeli.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal), + propertyInfo: typeof(SklepDokKurs).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDOKKURS"); + + var idx_SklDokKursWal = runtimeEntityType.AddIndex( + new[] { sklepId, sklepWalId }, + name: "idx_SklDokKursWal"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepDokKurs).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokKurs = principalEntityType.AddNavigation("SklepDokKurs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepDokKurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLDOKKURS_SKLEPDOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepWalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepWalId") }), + principalEntityType, + required: true); + + var sklepWaluta = declaringEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: true, + typeof(SklepWaluta), + propertyInfo: typeof(SklepDokKurs).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokKurs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokKurs = principalEntityType.AddNavigation("SklepDokKurs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepDokKurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLDOKKURS_WAL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDokKurs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokPunktyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokPunktyEntityType.cs new file mode 100644 index 0000000..94100a1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokPunktyEntityType.cs @@ -0,0 +1,221 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDokPunktyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokPunkty", + typeof(SklepDokPunkty), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDokPunkty).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepDokPunkty).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepDokPunkty).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var gdzie = runtimeEntityType.AddProperty( + "Gdzie", + typeof(short), + propertyInfo: typeof(SklepDokPunkty).GetProperty("Gdzie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + gdzie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + gdzie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(DateTime), + propertyInfo: typeof(SklepDokPunkty).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + kiedy.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + kiedy.AddAnnotation("Relational:ColumnType", "datetime"); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal), + propertyInfo: typeof(SklepDokPunkty).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, typ, gdzie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDOKPUNKTY"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepDokPunkty).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokPunkty = principalEntityType.AddNavigation("SklepDokPunkty", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepDokPunkty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDOK_SKLEPDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDokPunkty"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokWalutaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokWalutaEntityType.cs new file mode 100644 index 0000000..5f87e1b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDokWalutaEntityType.cs @@ -0,0 +1,364 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDokWalutaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDokWaluta", + typeof(SklepDokWaluta), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDokWaluta).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepDokWaluta).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal), + propertyInfo: typeof(SklepDokWaluta).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dokKwota = runtimeEntityType.AddProperty( + "DokKwota", + typeof(decimal), + propertyInfo: typeof(SklepDokWaluta).GetProperty("DokKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + dokKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + dokKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + dokKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal), + propertyInfo: typeof(SklepDokWaluta).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walKwota = runtimeEntityType.AddProperty( + "WalKwota", + typeof(decimal), + propertyInfo: typeof(SklepDokWaluta).GetProperty("WalKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walNetto = runtimeEntityType.AddProperty( + "WalNetto", + typeof(decimal?), + propertyInfo: typeof(SklepDokWaluta).GetProperty("WalNetto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walNetto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walNetto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walNetto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walNettoDet = runtimeEntityType.AddProperty( + "WalNettoDet", + typeof(decimal?), + propertyInfo: typeof(SklepDokWaluta).GetProperty("WalNettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walNettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walNettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walNettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walPodatek = runtimeEntityType.AddProperty( + "WalPodatek", + typeof(decimal?), + propertyInfo: typeof(SklepDokWaluta).GetProperty("WalPodatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walPodatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walPodatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walPodatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walPodatekDet = runtimeEntityType.AddProperty( + "WalPodatekDet", + typeof(decimal?), + propertyInfo: typeof(SklepDokWaluta).GetProperty("WalPodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walPodatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walPodatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walPodatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, sklepWalId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDOKWALUTA"); + + var idx_SkWalDok = runtimeEntityType.AddIndex( + new[] { sklepId, sklepWalId }, + name: "idx_SkWalDok"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepDokWaluta).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokWaluta = principalEntityType.AddNavigation("SklepDokWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepDokWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKDWZ_SKLEPDOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepWalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepWalId") }), + principalEntityType, + required: true); + + var sklepWaluta = declaringEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: true, + typeof(SklepWaluta), + propertyInfo: typeof(SklepDokWaluta).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDokWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDokWaluta = principalEntityType.AddNavigation("SklepDokWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepDokWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOK_REF_SKWD_SKLEPWAL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDokWaluta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDostEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDostEntityType.cs new file mode 100644 index 0000000..dadcaa4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDostEntityType.cs @@ -0,0 +1,307 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDostEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDost", + typeof(SklepDost), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDost).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepDost).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepDost).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZak = runtimeEntityType.AddProperty( + "CenaZak", + typeof(decimal?), + propertyInfo: typeof(SklepDost).GetProperty("CenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWZgrzewce = runtimeEntityType.AddProperty( + "IleWZgrzewce", + typeof(decimal?), + propertyInfo: typeof(SklepDost).GetProperty("IleWZgrzewce", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileWZgrzewce.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWZgrzewce.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWZgrzewce.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(SklepDost).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 30, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(30)", + size: 30)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzucany = runtimeEntityType.AddProperty( + "Narzucany", + typeof(short?), + propertyInfo: typeof(SklepDost).GetProperty("Narzucany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzucany.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + narzucany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatOdWart = runtimeEntityType.AddProperty( + "RabatOdWart", + typeof(decimal?), + propertyInfo: typeof(SklepDost).GetProperty("RabatOdWart", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rabatOdWart.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rabatOdWart.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rabatOdWart.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, sklepKontrId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDOST"); + + var idx_SkDostKth = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontrId }, + name: "idx_SkDostKth"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepDost).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDost = principalEntityType.AddNavigation("SklepDost", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOS_REF_DOSTS_SKLEPKON"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepDost).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDost).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDost = principalEntityType.AddNavigation("SklepDost", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPDOS_REF_SKLEP_SKLEPTOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDost"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDzienRozlEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDzienRozlEntityType.cs new file mode 100644 index 0000000..9734ba9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDzienRozlEntityType.cs @@ -0,0 +1,175 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDzienRozlEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozl", + typeof(SklepDzienRozl), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDzienRozl).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime), + propertyInfo: typeof(SklepDzienRozl).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(SklepDzienRozl).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepDzienRozl).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, dzien }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDZIENROZL"); + + var idx_SkDzienZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SkDzienZmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepDzienRozl).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDzienRozl = principalEntityType.AddNavigation("SklepDzienRozl", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepDzienRozl", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkDzienRozl"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDzienRozl"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDzienRozlParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDzienRozlParamEntityType.cs new file mode 100644 index 0000000..eae01bf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepDzienRozlParamEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepDzienRozlParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepDzienRozlParam", + typeof(SklepDzienRozlParam), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepDzienRozlParam).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime), + propertyInfo: typeof(SklepDzienRozlParam).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepDzienRozlParam).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(string), + propertyInfo: typeof(SklepDzienRozlParam).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + wartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, dzien, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPDZIENROZLPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("Dzien") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("Dzien") }), + principalEntityType, + required: true); + + var sklepDzienRozl = declaringEntityType.AddNavigation("SklepDzienRozl", + runtimeForeignKey, + onDependent: true, + typeof(SklepDzienRozl), + propertyInfo: typeof(SklepDzienRozlParam).GetProperty("SklepDzienRozl", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozlParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepDzienRozlParam = principalEntityType.AddNavigation("SklepDzienRozlParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDzienRozl).GetProperty("SklepDzienRozlParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkDzienRozlPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepDzienRozlParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepEmailEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepEmailEntityType.cs new file mode 100644 index 0000000..0f09c4a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepEmailEntityType.cs @@ -0,0 +1,670 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepEmailEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepEmail", + typeof(SklepEmail), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepEmail).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepEmId = runtimeEntityType.AddProperty( + "SklepEmId", + typeof(decimal), + propertyInfo: typeof(SklepEmail).GetProperty("SklepEmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepEmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepEmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepEmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepEmail).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var auth = runtimeEntityType.AddProperty( + "Auth", + typeof(short), + propertyInfo: typeof(SklepEmail).GetProperty("Auth", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + auth.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + auth.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var haslo = runtimeEntityType.AddProperty( + "Haslo", + typeof(string), + propertyInfo: typeof(SklepEmail).GetProperty("Haslo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + haslo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + haslo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var host = runtimeEntityType.AddProperty( + "Host", + typeof(string), + propertyInfo: typeof(SklepEmail).GetProperty("Host", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + host.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + host.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kopia = runtimeEntityType.AddProperty( + "Kopia", + typeof(short), + propertyInfo: typeof(SklepEmail).GetProperty("Kopia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kopia.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kopia.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kopiaEmail = runtimeEntityType.AddProperty( + "KopiaEmail", + typeof(string), + propertyInfo: typeof(SklepEmail).GetProperty("KopiaEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + kopiaEmail.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + kopiaEmail.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var login = runtimeEntityType.AddProperty( + "Login", + typeof(string), + propertyInfo: typeof(SklepEmail).GetProperty("Login", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + login.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + login.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nadawca = runtimeEntityType.AddProperty( + "Nadawca", + typeof(string), + propertyInfo: typeof(SklepEmail).GetProperty("Nadawca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nadawca.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nadawca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepEmail).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var port = runtimeEntityType.AddProperty( + "Port", + typeof(string), + propertyInfo: typeof(SklepEmail).GetProperty("Port", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 5, + unicode: false); + port.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(5)", + size: 5)); + port.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTEDId = runtimeEntityType.AddProperty( + "SklepTEDId", + typeof(decimal?), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTEDId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTEDId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTEDId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTEDId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTEHRId = runtimeEntityType.AddProperty( + "SklepTEHRId", + typeof(decimal?), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTEHRId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTEHRId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTEHRId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTEHRId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTERId = runtimeEntityType.AddProperty( + "SklepTERId", + typeof(decimal?), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTERId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTERId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTERId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTERId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTEWId = runtimeEntityType.AddProperty( + "SklepTEWId", + typeof(decimal?), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTEWId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTEWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTEWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTEWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTEZIId = runtimeEntityType.AddProperty( + "SklepTEZIId", + typeof(decimal?), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTEZIId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTEZIId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTEZIId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTEZIId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal?), + propertyInfo: typeof(SklepEmail).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tLS = runtimeEntityType.AddProperty( + "TLS", + typeof(short), + propertyInfo: typeof(SklepEmail).GetProperty("TLS", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + tLS.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tLS.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tLSVer = runtimeEntityType.AddProperty( + "TLSVer", + typeof(short), + propertyInfo: typeof(SklepEmail).GetProperty("TLSVer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + tLSVer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tLSVer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepEmail).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepEmId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTEDId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTERId }); + + var index1 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTEWId }); + + var index2 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepUzId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTEDId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTEId") }), + principalEntityType); + + var sklepTrescEmail = declaringEntityType.AddNavigation("SklepTrescEmail", + runtimeForeignKey, + onDependent: true, + typeof(SklepTrescEmail), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTrescEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepEmailSklepTrescEmail = principalEntityType.AddNavigation("SklepEmailSklepTrescEmail", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepEmailSklepTrescEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepEmail_TED"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTERId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTEId") }), + principalEntityType); + + var sklepTrescEmailNavigation = declaringEntityType.AddNavigation("SklepTrescEmailNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepTrescEmail), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTrescEmailNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepEmailSklepTrescEmailNavigation = principalEntityType.AddNavigation("SklepEmailSklepTrescEmailNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepEmailSklepTrescEmailNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepEmail_TER"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTEWId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTEId") }), + principalEntityType); + + var sklepTrescEmail1 = declaringEntityType.AddNavigation("SklepTrescEmail1", + runtimeForeignKey, + onDependent: true, + typeof(SklepTrescEmail), + propertyInfo: typeof(SklepEmail).GetProperty("SklepTrescEmail1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepEmailSklepTrescEmail1 = principalEntityType.AddNavigation("SklepEmailSklepTrescEmail1", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepEmailSklepTrescEmail1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepEmail_TEW"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepEmail).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepEmail = principalEntityType.AddNavigation("SklepEmail", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepEmail_Uz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepEmail"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepEntityType.cs new file mode 100644 index 0000000..0def75f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepEntityType.cs @@ -0,0 +1,565 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Sklep", + typeof(Sklep), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(Sklep).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataBO = runtimeEntityType.AddProperty( + "DataBO", + typeof(DateTime?), + propertyInfo: typeof(Sklep).GetProperty("DataBO", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataBO.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataBO.AddAnnotation("Relational:ColumnType", "datetime"); + dataBO.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnyWDniuBO = runtimeEntityType.AddProperty( + "KolejnyWDniuBO", + typeof(int?), + propertyInfo: typeof(Sklep).GetProperty("KolejnyWDniuBO", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kolejnyWDniuBO.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + kolejnyWDniuBO.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var krajId = runtimeEntityType.AddProperty( + "KrajId", + typeof(decimal?), + propertyInfo: typeof(Sklep).GetProperty("KrajId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + krajId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + krajId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + krajId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var magId = runtimeEntityType.AddProperty( + "MagId", + typeof(decimal?), + propertyInfo: typeof(Sklep).GetProperty("MagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + magId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + magId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + magId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrSeryjny = runtimeEntityType.AddProperty( + "NrSeryjny", + typeof(string), + propertyInfo: typeof(Sklep).GetProperty("NrSeryjny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nrSeryjny.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nrSeryjny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrSklepu = runtimeEntityType.AddProperty( + "NrSklepu", + typeof(short), + propertyInfo: typeof(Sklep).GetProperty("NrSklepu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + nrSklepu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + nrSklepu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var okrZamkniety = runtimeEntityType.AddProperty( + "OkrZamkniety", + typeof(DateTime?), + propertyInfo: typeof(Sklep).GetProperty("OkrZamkniety", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + okrZamkniety.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + okrZamkniety.AddAnnotation("Relational:ColumnType", "datetime"); + okrZamkniety.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ostEksport = runtimeEntityType.AddProperty( + "OstEksport", + typeof(DateTime?), + propertyInfo: typeof(Sklep).GetProperty("OstEksport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ostEksport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + ostEksport.AddAnnotation("Relational:ColumnType", "datetime"); + ostEksport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ostImport = runtimeEntityType.AddProperty( + "OstImport", + typeof(DateTime?), + propertyInfo: typeof(Sklep).GetProperty("OstImport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ostImport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + ostImport.AddAnnotation("Relational:ColumnType", "datetime"); + ostImport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pelnyImport = runtimeEntityType.AddProperty( + "PelnyImport", + typeof(short?), + propertyInfo: typeof(Sklep).GetProperty("PelnyImport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + pelnyImport.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + pelnyImport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var potwEksport = runtimeEntityType.AddProperty( + "PotwEksport", + typeof(DateTime?), + propertyInfo: typeof(Sklep).GetProperty("PotwEksport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + potwEksport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + potwEksport.AddAnnotation("Relational:ColumnType", "datetime"); + potwEksport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rola = runtimeEntityType.AddProperty( + "Rola", + typeof(short?), + propertyInfo: typeof(Sklep).GetProperty("Rola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rola.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rola.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wymImport = runtimeEntityType.AddProperty( + "WymImport", + typeof(DateTime?), + propertyInfo: typeof(Sklep).GetProperty("WymImport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wymImport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + wymImport.AddAnnotation("Relational:ColumnType", "datetime"); + wymImport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEP"); + + var index = runtimeEntityType.AddIndex( + new[] { krajId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { magId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KrajId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KrajId") }), + principalEntityType); + + var kraj = declaringEntityType.AddNavigation("Kraj", + runtimeForeignKey, + onDependent: true, + typeof(Kraj), + propertyInfo: typeof(Sklep).GetProperty("Kraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklep = principalEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kraj).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_KrajSklep"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MagId") }), + principalEntityType); + + var mag = declaringEntityType.AddNavigation("Mag", + runtimeForeignKey, + onDependent: true, + typeof(Magazyn), + propertyInfo: typeof(Sklep).GetProperty("Mag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklep = principalEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Magazyn).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Magazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEP_REF_SKLEP_MAGAZYN"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + unique: true, + required: true); + + var sklepNavigation = declaringEntityType.AddNavigation("SklepNavigation", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(Sklep).GetProperty("SklepNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklep = principalEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: false, + typeof(Sklep), + propertyInfo: typeof(Kontrahent).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEP_REF_SKLEP_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "As", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("SklepId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("SklepId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("As", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Sklep"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static RuntimeSkipNavigation CreateSkipNavigation2(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Centrala", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("SklepId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("SklepId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("Centrala", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Sklep1"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static RuntimeSkipNavigation CreateSkipNavigation3(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "KPW", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("SklepId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("SklepId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("KPW", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Sklep"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static RuntimeSkipNavigation CreateSkipNavigation4(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Sklep1", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("CentralaId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("SklepId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("Sklep1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("Centrala"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Sklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFlagiEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFlagiEntityType.cs new file mode 100644 index 0000000..6a7a88b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFlagiEntityType.cs @@ -0,0 +1,569 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepFlagiEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepFlagi", + typeof(SklepFlagi), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepFlagi).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(SklepFlagi).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short?), + propertyInfo: typeof(SklepFlagi).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokCenSp = runtimeEntityType.AddProperty( + "BlokCenSp", + typeof(short), + propertyInfo: typeof(SklepFlagi).GetProperty("BlokCenSp", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokCenSp.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokCenSp.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokCenyZak = runtimeEntityType.AddProperty( + "BlokCenyZak", + typeof(short), + propertyInfo: typeof(SklepFlagi).GetProperty("BlokCenyZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokCenyZak.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokCenyZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokDostawcow = runtimeEntityType.AddProperty( + "BlokDostawcow", + typeof(short), + propertyInfo: typeof(SklepFlagi).GetProperty("BlokDostawcow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokDostawcow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokDostawcow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokZmian = runtimeEntityType.AddProperty( + "BlokZmian", + typeof(short), + propertyInfo: typeof(SklepFlagi).GetProperty("BlokZmian", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokZmian.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokZmian.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var doKiedyPrzyjecie = runtimeEntityType.AddProperty( + "DoKiedyPrzyjecie", + typeof(DateTime?), + propertyInfo: typeof(SklepFlagi).GetProperty("DoKiedyPrzyjecie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + doKiedyPrzyjecie.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + doKiedyPrzyjecie.AddAnnotation("Relational:ColumnType", "datetime"); + doKiedyPrzyjecie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzCenaDet = runtimeEntityType.AddProperty( + "NarzCenaDet", + typeof(decimal?), + propertyInfo: typeof(SklepFlagi).GetProperty("NarzCenaDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzCenaDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + narzCenaDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + narzCenaDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzCenaDod = runtimeEntityType.AddProperty( + "NarzCenaDod", + typeof(decimal?), + propertyInfo: typeof(SklepFlagi).GetProperty("NarzCenaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzCenaDod.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + narzCenaDod.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + narzCenaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzCenaHurt = runtimeEntityType.AddProperty( + "NarzCenaHurt", + typeof(decimal?), + propertyInfo: typeof(SklepFlagi).GetProperty("NarzCenaHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzCenaHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + narzCenaHurt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + narzCenaHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzCenaNoc = runtimeEntityType.AddProperty( + "NarzCenaNoc", + typeof(decimal?), + propertyInfo: typeof(SklepFlagi).GetProperty("NarzCenaNoc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzCenaNoc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + narzCenaNoc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + narzCenaNoc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzCenaOtwarta = runtimeEntityType.AddProperty( + "NarzCenaOtwarta", + typeof(short?), + propertyInfo: typeof(SklepFlagi).GetProperty("NarzCenaOtwarta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzCenaOtwarta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + narzCenaOtwarta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzCenaZak = runtimeEntityType.AddProperty( + "NarzCenaZak", + typeof(decimal?), + propertyInfo: typeof(SklepFlagi).GetProperty("NarzCenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzCenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + narzCenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + narzCenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var statusZam = runtimeEntityType.AddProperty( + "StatusZam", + typeof(short?), + propertyInfo: typeof(SklepFlagi).GetProperty("StatusZam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + statusZam.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + statusZam.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepFlagi).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaIstotna = runtimeEntityType.AddProperty( + "ZmianaIstotna", + typeof(DateTime?), + propertyInfo: typeof(SklepFlagi).GetProperty("ZmianaIstotna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmianaIstotna.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaIstotna.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaIstotna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaTylkoCen = runtimeEntityType.AddProperty( + "ZmianaTylkoCen", + typeof(DateTime?), + propertyInfo: typeof(SklepFlagi).GetProperty("ZmianaTylkoCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmianaTylkoCen.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaTylkoCen.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaTylkoCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPFLAGI"); + + var idx_SFZmianaIstotna = runtimeEntityType.AddIndex( + new[] { sklepId, zmianaIstotna }, + name: "idx_SFZmianaIstotna"); + + var idx_SFZmianaTylkoCen = runtimeEntityType.AddIndex( + new[] { sklepId, zmianaTylkoCen }, + name: "idx_SFZmianaTylkoCen"); + + var idx_SklFlgTowSklep = runtimeEntityType.AddIndex( + new[] { towId, sklepId }, + name: "idx_SklFlgTowSklep"); + + var idx_SklepFlagZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SklepFlagZmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepFlagi).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepFlagi = principalEntityType.AddNavigation("SklepFlagi", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepFlagi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPFLA_REF_SKLEP_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(SklepFlagi).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepFlagi = principalEntityType.AddNavigation("SklepFlagi", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("SklepFlagi", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPFLA_REF_SKLEP_TOWAR"); + return runtimeForeignKey; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Kontr", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("SklepId"), joinEntityType.FindProperty("TowId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("TowId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(SklepFlagi).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFlagi).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("SklepFlagi"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepFlagi"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFormZgodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFormZgodEntityType.cs new file mode 100644 index 0000000..35df1c4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFormZgodEntityType.cs @@ -0,0 +1,224 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepFormZgodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormZgod", + typeof(SklepFormZgod), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepFormZgod).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTypOsId = runtimeEntityType.AddProperty( + "SklepTypOsId", + typeof(decimal), + propertyInfo: typeof(SklepFormZgod).GetProperty("SklepTypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTypOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTypOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTypOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZgId = runtimeEntityType.AddProperty( + "SklepZgId", + typeof(decimal), + propertyInfo: typeof(SklepFormZgod).GetProperty("SklepZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepZgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepFormZgod).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wymagana = runtimeEntityType.AddProperty( + "Wymagana", + typeof(short?), + propertyInfo: typeof(SklepFormZgod).GetProperty("Wymagana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wymagana.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wymagana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTypOsId, sklepZgId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPFORMZGOD"); + + var idx_SKFMZG_SKZGODA = runtimeEntityType.AddIndex( + new[] { sklepId, sklepZgId }, + name: "idx_SKFMZG_SKZGODA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTypOsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTypOsId") }), + principalEntityType, + required: true); + + var sklepTypOs = declaringEntityType.AddNavigation("SklepTypOs", + runtimeForeignKey, + onDependent: true, + typeof(SklepTypOs), + propertyInfo: typeof(SklepFormZgod).GetProperty("SklepTypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepFormZgod = principalEntityType.AddNavigation("SklepFormZgod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTypOs).GetProperty("SklepFormZgod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKFMZG_SKTYPOS"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepZgId") }), + principalEntityType, + required: true); + + var sklepZgoda = declaringEntityType.AddNavigation("SklepZgoda", + runtimeForeignKey, + onDependent: true, + typeof(SklepZgoda), + propertyInfo: typeof(SklepFormZgod).GetProperty("SklepZgoda", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormZgod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepFormZgod = principalEntityType.AddNavigation("SklepFormZgod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepZgoda).GetProperty("SklepFormZgod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKFMZG_SKZGODA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepFormZgod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFormaPlatnPos7EntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFormaPlatnPos7EntityType.cs new file mode 100644 index 0000000..6d02793 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepFormaPlatnPos7EntityType.cs @@ -0,0 +1,337 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepFormaPlatnPos7EntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepFormaPlatnPos7", + typeof(SklepFormaPlatnPos7), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepFormaId = runtimeEntityType.AddProperty( + "SklepFormaId", + typeof(decimal), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("SklepFormaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepFormaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepFormaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepFormaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var autoryzacja = runtimeEntityType.AddProperty( + "Autoryzacja", + typeof(short?), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Autoryzacja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + autoryzacja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + autoryzacja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaId = runtimeEntityType.AddProperty( + "FormaId", + typeof(decimal?), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("FormaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + formaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + formaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + formaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(decimal?), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kolejnosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kolejnosc.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var reszta = runtimeEntityType.AddProperty( + "Reszta", + typeof(short), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Reszta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + reszta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + reszta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var serwisPlatniczy = runtimeEntityType.AddProperty( + "SerwisPlatniczy", + typeof(string), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("SerwisPlatniczy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + serwisPlatniczy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + serwisPlatniczy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepFormaId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepFormaPlatnPos7 = principalEntityType.AddNavigation("SklepFormaPlatnPos7", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepFormaPlatnPos7", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKFPP7_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepFormaPlatnPos7"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaAkcyzowaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaAkcyzowaEntityType.cs new file mode 100644 index 0000000..242847e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaAkcyzowaEntityType.cs @@ -0,0 +1,177 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepGrupaAkcyzowaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaAkcyzowa", + typeof(SklepGrupaAkcyzowa), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepGrupaAkcyzowa).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepGrAkcId = runtimeEntityType.AddProperty( + "SklepGrAkcId", + typeof(decimal), + propertyInfo: typeof(SklepGrupaAkcyzowa).GetProperty("SklepGrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepGrAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepGrAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepGrAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrGrAkcId = runtimeEntityType.AddProperty( + "CentrGrAkcId", + typeof(decimal?), + propertyInfo: typeof(SklepGrupaAkcyzowa).GetProperty("CentrGrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrGrAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrGrAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrGrAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(SklepGrupaAkcyzowa).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepGrAkcId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPGRUPAAKCYZOWA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepGrupaAkcyzowa).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepGrupaAkcyzowa = principalEntityType.AddNavigation("SklepGrupaAkcyzowa", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepGrupaAkcyzowa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkGrAkc"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepGrupaAkcyzowa"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaPromocjiEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaPromocjiEntityType.cs new file mode 100644 index 0000000..bbff0a8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaPromocjiEntityType.cs @@ -0,0 +1,242 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepGrupaPromocjiEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaPromocji", + typeof(SklepGrupaPromocji), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepGrupaId = runtimeEntityType.AddProperty( + "SklepGrupaId", + typeof(decimal), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("SklepGrupaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepGrupaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepGrupaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepGrupaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywna = runtimeEntityType.AddProperty( + "Aktywna", + typeof(short), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("Aktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupaId = runtimeEntityType.AddProperty( + "GrupaId", + typeof(decimal?), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("GrupaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + grupaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grupaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grupaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepGrupaId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepGrupaPromocji"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaUzEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaUzEntityType.cs new file mode 100644 index 0000000..7f1e52f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepGrupaUzEntityType.cs @@ -0,0 +1,182 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepGrupaUzEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepGrupaUz", + typeof(SklepGrupaUz), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepGrupaUz).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal), + propertyInfo: typeof(SklepGrupaUz).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRolaId = runtimeEntityType.AddProperty( + "SklepRolaId", + typeof(decimal), + propertyInfo: typeof(SklepGrupaUz).GetProperty("SklepRolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepRolaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRolaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepUzId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SK_GR_UZ"); + + var idx_SkRola = runtimeEntityType.AddIndex( + new[] { sklepId, sklepRolaId }, + name: "idx_SkRola"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRolaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType, + required: true); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepGrupaUz).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepGrupaUzSklepUzytkownik = principalEntityType.AddNavigation("SklepGrupaUzSklepUzytkownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepGrupaUzSklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPGRU_REF_SKGRR_SKLEPUZY"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType, + unique: true, + required: true); + + var sklepUzytkownikNavigation = declaringEntityType.AddNavigation("SklepUzytkownikNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepGrupaUz).GetProperty("SklepUzytkownikNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepGrupaUzSklepUzytkownikNavigation = principalEntityType.AddNavigation("SklepGrupaUzSklepUzytkownikNavigation", + runtimeForeignKey, + onDependent: false, + typeof(SklepGrupaUz), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepGrupaUzSklepUzytkownikNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPGRU_REF_SKGRU_SKLEPUZY"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepGrupaUz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepIstwEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepIstwEntityType.cs new file mode 100644 index 0000000..4f7db42 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepIstwEntityType.cs @@ -0,0 +1,311 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepIstwEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepIstw", + typeof(SklepIstw), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepIstw).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepIstw).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal), + propertyInfo: typeof(SklepIstw).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaMag = runtimeEntityType.AddProperty( + "CenaMag", + typeof(decimal), + propertyInfo: typeof(SklepIstw).GetProperty("CenaMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwacjaMag = runtimeEntityType.AddProperty( + "RezerwacjaMag", + typeof(decimal?), + propertyInfo: typeof(SklepIstw).GetProperty("RezerwacjaMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rezerwacjaMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rezerwacjaMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rezerwacjaMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanMag = runtimeEntityType.AddProperty( + "StanMag", + typeof(decimal), + propertyInfo: typeof(SklepIstw).GetProperty("StanMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanMax = runtimeEntityType.AddProperty( + "StanMax", + typeof(decimal), + propertyInfo: typeof(SklepIstw).GetProperty("StanMax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanMax.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanMax.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanMax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanMin = runtimeEntityType.AddProperty( + "StanMin", + typeof(decimal), + propertyInfo: typeof(SklepIstw).GetProperty("StanMin", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanMin.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanMin.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanMin.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, sklepMagId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPISTW"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepMagId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepMagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepMagId") }), + principalEntityType, + required: true); + + var sklepMagazyn = declaringEntityType.AddNavigation("SklepMagazyn", + runtimeForeignKey, + onDependent: true, + typeof(SklepMagazyn), + propertyInfo: typeof(SklepIstw).GetProperty("SklepMagazyn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepIstw = principalEntityType.AddNavigation("SklepIstw", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepMagazyn).GetProperty("SklepIstw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPIST_REF_SKMAG_SKLEPMAG"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepIstw).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepIstw).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepIstw = principalEntityType.AddNavigation("SklepIstw", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepIstw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPIST_REF_SKTOW_SKLEPTOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepIstw"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKartaLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKartaLojEntityType.cs new file mode 100644 index 0000000..b21e2a3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKartaLojEntityType.cs @@ -0,0 +1,385 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKartaLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKartaLoj", + typeof(SklepKartaLoj), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKartaLoj).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKartaId = runtimeEntityType.AddProperty( + "SklepKartaId", + typeof(decimal), + propertyInfo: typeof(SklepKartaLoj).GetProperty("SklepKartaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKartaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKartaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKartaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKarty = runtimeEntityType.AddProperty( + "KodKarty", + typeof(string), + propertyInfo: typeof(SklepKartaLoj).GetProperty("KodKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + kodKarty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kodKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis1 = runtimeEntityType.AddProperty( + "Opis1", + typeof(string), + propertyInfo: typeof(SklepKartaLoj).GetProperty("Opis1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + opis1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + opis1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis2 = runtimeEntityType.AddProperty( + "Opis2", + typeof(string), + propertyInfo: typeof(SklepKartaLoj).GetProperty("Opis2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + opis2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + opis2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posiadacz = runtimeEntityType.AddProperty( + "Posiadacz", + typeof(string), + propertyInfo: typeof(SklepKartaLoj).GetProperty("Posiadacz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + posiadacz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + posiadacz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontoId = runtimeEntityType.AddProperty( + "SklepKontoId", + typeof(decimal), + propertyInfo: typeof(SklepKartaLoj).GetProperty("SklepKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKarty = runtimeEntityType.AddProperty( + "TypKarty", + typeof(short), + propertyInfo: typeof(SklepKartaLoj).GetProperty("TypKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typKarty.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uniewazniono = runtimeEntityType.AddProperty( + "Uniewazniono", + typeof(DateTime?), + propertyInfo: typeof(SklepKartaLoj).GetProperty("Uniewazniono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uniewazniono.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + uniewazniono.AddAnnotation("Relational:ColumnType", "datetime"); + uniewazniono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waznaDo = runtimeEntityType.AddProperty( + "WaznaDo", + typeof(DateTime?), + propertyInfo: typeof(SklepKartaLoj).GetProperty("WaznaDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waznaDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + waznaDo.AddAnnotation("Relational:ColumnType", "datetime"); + waznaDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waznaOd = runtimeEntityType.AddProperty( + "WaznaOd", + typeof(DateTime?), + propertyInfo: typeof(SklepKartaLoj).GetProperty("WaznaOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waznaOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + waznaOd.AddAnnotation("Relational:ColumnType", "datetime"); + waznaOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKartaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPKARTALOJ"); + + var idx_SKLoj_KodKarty = runtimeEntityType.AddIndex( + new[] { kodKarty }, + name: "idx_SKLoj_KodKarty"); + + var idx_SKLoj_SKonto = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontoId }, + name: "idx_SKLoj_SKonto"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepKartaLoj).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKartaLoj = principalEntityType.AddNavigation("SklepKartaLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepKartaLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SKrtLoj_Sklep"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontoId") }), + principalEntityType, + required: true); + + var sklepKontoLoj = declaringEntityType.AddNavigation("SklepKontoLoj", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontoLoj), + propertyInfo: typeof(SklepKartaLoj).GetProperty("SklepKontoLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKartaLoj = principalEntityType.AddNavigation("SklepKartaLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontoLoj).GetProperty("SklepKartaLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SKartaKonto"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKartaLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKasaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKasaEntityType.cs new file mode 100644 index 0000000..96da79d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKasaEntityType.cs @@ -0,0 +1,344 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKasaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasa", + typeof(SklepKasa), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKasa).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKasaId = runtimeEntityType.AddProperty( + "SklepKasaId", + typeof(decimal), + propertyInfo: typeof(SklepKasa).GetProperty("SklepKasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepKasa).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepKasa).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrUnikatowy = runtimeEntityType.AddProperty( + "NrUnikatowy", + typeof(string), + propertyInfo: typeof(SklepKasa).GetProperty("NrUnikatowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 30, + unicode: false); + nrUnikatowy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(30)", + size: 30)); + nrUnikatowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(short), + propertyInfo: typeof(SklepKasa).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + numer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SklepKasa).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal), + propertyInfo: typeof(SklepKasa).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanowisko = runtimeEntityType.AddProperty( + "Stanowisko", + typeof(string), + propertyInfo: typeof(SklepKasa).GetProperty("Stanowisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + stanowisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + stanowisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(string), + propertyInfo: typeof(SklepKasa).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + typ.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKasaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPKASA"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepMagId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepKasa).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKasa = principalEntityType.AddNavigation("SklepKasa", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKAS_REF_SKKAS_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepMagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepMagId") }), + principalEntityType, + required: true); + + var sklepMagazyn = declaringEntityType.AddNavigation("SklepMagazyn", + runtimeForeignKey, + onDependent: true, + typeof(SklepMagazyn), + propertyInfo: typeof(SklepKasa).GetProperty("SklepMagazyn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKasa = principalEntityType.AddNavigation("SklepKasa", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepMagazyn).GetProperty("SklepKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKAS_REF_SKMAG_SKLEPMAG"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKasa"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKasaFormaPlatnEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKasaFormaPlatnEntityType.cs new file mode 100644 index 0000000..41f558f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKasaFormaPlatnEntityType.cs @@ -0,0 +1,201 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKasaFormaPlatnEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKasaFormaPlatn", + typeof(SklepKasaFormaPlatn), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKasaFormaPlatn).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepFormaId = runtimeEntityType.AddProperty( + "SklepFormaId", + typeof(decimal), + propertyInfo: typeof(SklepKasaFormaPlatn).GetProperty("SklepFormaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepFormaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepFormaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepFormaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKasaId = runtimeEntityType.AddProperty( + "SklepKasaId", + typeof(decimal), + propertyInfo: typeof(SklepKasaFormaPlatn).GetProperty("SklepKasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepKasaFormaPlatn).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepFormaId, sklepKasaId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKasaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepFormaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepFormaId") }), + principalEntityType, + required: true); + + var sklepFormaPlatnPos7 = declaringEntityType.AddNavigation("SklepFormaPlatnPos7", + runtimeForeignKey, + onDependent: true, + typeof(SklepFormaPlatnPos7), + propertyInfo: typeof(SklepKasaFormaPlatn).GetProperty("SklepFormaPlatnPos7", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKasaFormaPlatn = principalEntityType.AddNavigation("SklepKasaFormaPlatn", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepFormaPlatnPos7).GetProperty("SklepKasaFormaPlatn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepFormaPlatnPos7).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKKASAFORMAPLATN_SKFPP7"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKasaId") }), + principalEntityType, + required: true); + + var sklepKasa = declaringEntityType.AddNavigation("SklepKasa", + runtimeForeignKey, + onDependent: true, + typeof(SklepKasa), + propertyInfo: typeof(SklepKasaFormaPlatn).GetProperty("SklepKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasaFormaPlatn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKasaFormaPlatn = principalEntityType.AddNavigation("SklepKasaFormaPlatn", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKasa).GetProperty("SklepKasaFormaPlatn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKKASAFORMAPLATN_SKKASA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKasaFormaPlatn"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoBankoweEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoBankoweEntityType.cs new file mode 100644 index 0000000..3b6b32e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoBankoweEntityType.cs @@ -0,0 +1,475 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKontoBankoweEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankowe", + typeof(SklepKontoBankowe), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKBId = runtimeEntityType.AddProperty( + "SklepKBId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepKBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywne = runtimeEntityType.AddProperty( + "Aktywne", + typeof(short), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("Aktywne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslne = runtimeEntityType.AddProperty( + "Domyslne", + typeof(short), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("Domyslne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kBId = runtimeEntityType.AddProperty( + "KBId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("KBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(string), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + numer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var powSklepKBId = runtimeEntityType.AddProperty( + "PowSklepKBId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("PowSklepKBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + powSklepKBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powSklepKBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powSklepKBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepBankId = runtimeEntityType.AddProperty( + "SklepBankId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepBankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepBankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepBankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepBankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKBIdOplat = runtimeEntityType.AddProperty( + "SklepKBIdOplat", + typeof(decimal?), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepKBIdOplat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKBIdOplat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKBIdOplat.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKBIdOplat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sufix = runtimeEntityType.AddProperty( + "Sufix", + typeof(string), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("Sufix", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + sufix.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + sufix.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKBId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepBankId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepWalId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepBankId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepBankId") }), + principalEntityType, + required: true); + + var sklepBank = declaringEntityType.AddNavigation("SklepBank", + runtimeForeignKey, + onDependent: true, + typeof(SklepBank), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepBank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoBankowe = principalEntityType.AddNavigation("SklepKontoBankowe", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepBank).GetProperty("SklepKontoBankowe", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKONTOBANK_SKLEPBANK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepWalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepWalId") }), + principalEntityType, + required: true); + + var sklepWaluta = declaringEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: true, + typeof(SklepWaluta), + propertyInfo: typeof(SklepKontoBankowe).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankowe).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoBankowe = principalEntityType.AddNavigation("SklepKontoBankowe", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepKontoBankowe", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKONTOBANK_SKLEPWALUTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKontoBankowe"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoBankoweKontrEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoBankoweKontrEntityType.cs new file mode 100644 index 0000000..bcb7f5d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoBankoweKontrEntityType.cs @@ -0,0 +1,447 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKontoBankoweKontrEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoBankoweKontr", + typeof(SklepKontoBankoweKontr), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKBKId = runtimeEntityType.AddProperty( + "SklepKBKId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepKBKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKBKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKBKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKBKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywne = runtimeEntityType.AddProperty( + "Aktywne", + typeof(short), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("Aktywne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslne = runtimeEntityType.AddProperty( + "Domyslne", + typeof(short), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("Domyslne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kBKId = runtimeEntityType.AddProperty( + "KBKId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("KBKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kBKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kBKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kBKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(string), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + numer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var powSklepKBKId = runtimeEntityType.AddProperty( + "PowSklepKBKId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("PowSklepKBKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + powSklepKBKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powSklepKBKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powSklepKBKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepBankId = runtimeEntityType.AddProperty( + "SklepBankId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepBankId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepBankId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepBankId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepBankId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wykazVat = runtimeEntityType.AddProperty( + "WykazVat", + typeof(short), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("WykazVat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + wykazVat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + wykazVat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKBKId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepBankId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontrId }); + + var index1 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepWalId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepBankId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepBankId") }), + principalEntityType); + + var sklepBank = declaringEntityType.AddNavigation("SklepBank", + runtimeForeignKey, + onDependent: true, + typeof(SklepBank), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepBank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoBankoweKontr = principalEntityType.AddNavigation("SklepKontoBankoweKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepBank).GetProperty("SklepKontoBankoweKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepBank).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKONTOBANKKONTR_SKLEPBANK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoBankoweKontr = principalEntityType.AddNavigation("SklepKontoBankoweKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepKontoBankoweKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKONTOBANKKONTR_SKLEPKONTR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepWalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepWalId") }), + principalEntityType, + required: true); + + var sklepWaluta = declaringEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: true, + typeof(SklepWaluta), + propertyInfo: typeof(SklepKontoBankoweKontr).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoBankoweKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoBankoweKontr = principalEntityType.AddNavigation("SklepKontoBankoweKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepKontoBankoweKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKONTOBANKKONTR_SKLEPWALUTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKontoBankoweKontr"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoLojEntityType.cs new file mode 100644 index 0000000..96cf694 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontoLojEntityType.cs @@ -0,0 +1,443 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKontoLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontoLoj", + typeof(SklepKontoLoj), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKontoLoj).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontoId = runtimeEntityType.AddProperty( + "SklepKontoId", + typeof(decimal), + propertyInfo: typeof(SklepKontoLoj).GetProperty("SklepKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywne = runtimeEntityType.AddProperty( + "Aktywne", + typeof(short), + propertyInfo: typeof(SklepKontoLoj).GetProperty("Aktywne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywne.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrKontoId = runtimeEntityType.AddProperty( + "CentrKontoId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoLoj).GetProperty("CentrKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal?), + propertyInfo: typeof(SklepKontoLoj).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepKontoLoj).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepKontoLoj).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stan = runtimeEntityType.AddProperty( + "Stan", + typeof(decimal), + propertyInfo: typeof(SklepKontoLoj).GetProperty("Stan", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stan.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stan.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stan.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanPocz = runtimeEntityType.AddProperty( + "StanPocz", + typeof(decimal), + propertyInfo: typeof(SklepKontoLoj).GetProperty("StanPocz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanPocz.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanPocz.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanPocz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKonta = runtimeEntityType.AddProperty( + "TypKonta", + typeof(short), + propertyInfo: typeof(SklepKontoLoj).GetProperty("TypKonta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typKonta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typKonta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepKontoLoj).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaStanu = runtimeEntityType.AddProperty( + "ZmianaStanu", + typeof(DateTime), + propertyInfo: typeof(SklepKontoLoj).GetProperty("ZmianaStanu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmianaStanu.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaStanu.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaStanu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontoId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPKONTOLOJ"); + + var idx_SCentrKontoId = runtimeEntityType.AddIndex( + new[] { centrKontoId }, + name: "idx_SCentrKontoId"); + + var idx_SKLoj_KLoj = runtimeEntityType.AddIndex( + new[] { kontoId }, + name: "idx_SKLoj_KLoj"); + + var idx_SKLoj_SKontrId = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontrId }, + name: "idx_SKLoj_SKontrId"); + + var idx_SKLoj_ZmStanu = runtimeEntityType.AddIndex( + new[] { zmianaStanu }, + name: "idx_SKLoj_ZmStanu"); + + var idx_SKLoj_Zmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SKLoj_Zmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType); + + var konto = declaringEntityType.AddNavigation("Konto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(SklepKontoLoj).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoLoj = principalEntityType.AddNavigation("SklepKontoLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("SklepKontoLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SKLoj_KLoj"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepKontoLoj).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoLoj = principalEntityType.AddNavigation("SklepKontoLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepKontoLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SKntLoj_Sklep"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepKontoLoj).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontoLoj = principalEntityType.AddNavigation("SklepKontoLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepKontoLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SKLoj_SKth"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKontoLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrEntityType.cs new file mode 100644 index 0000000..b66c48a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrEntityType.cs @@ -0,0 +1,1289 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKontrEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontr", + typeof(SklepKontr), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKontr).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepKontr).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var akwizytor = runtimeEntityType.AddProperty( + "Akwizytor", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Akwizytor", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + akwizytor.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + akwizytor.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bank = runtimeEntityType.AddProperty( + "Bank", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Bank", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + bank.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + bank.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrKontrId = runtimeEntityType.AddProperty( + "CentrKontrId", + typeof(decimal?), + propertyInfo: typeof(SklepKontr).GetProperty("CentrKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czasRealZam = runtimeEntityType.AddProperty( + "CzasRealZam", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("CzasRealZam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + czasRealZam.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + czasRealZam.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dostawca = runtimeEntityType.AddProperty( + "Dostawca", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("Dostawca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dostawca.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dostawca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var eMail = runtimeEntityType.AddProperty( + "EMail", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("EMail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + eMail.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + eMail.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var fax = runtimeEntityType.AddProperty( + "Fax", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Fax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + fax.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + fax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaPlatDost = runtimeEntityType.AddProperty( + "FormaPlatDost", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("FormaPlatDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + formaPlatDost.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + formaPlatDost.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaPlatOdb = runtimeEntityType.AddProperty( + "FormaPlatOdb", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("FormaPlatOdb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + formaPlatOdb.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + formaPlatOdb.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeksCentr = runtimeEntityType.AddProperty( + "IndeksCentr", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("IndeksCentr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + indeksCentr.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeksCentr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kartaAktywna = runtimeEntityType.AddProperty( + "KartaAktywna", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("KartaAktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kartaAktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kartaAktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKarty = runtimeEntityType.AddProperty( + "KodKarty", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("KodKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kodKarty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKontr = runtimeEntityType.AddProperty( + "KodKontr", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("KodKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kodKontr.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKontr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKraju = runtimeEntityType.AddProperty( + "KodKraju", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("KodKraju", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + kodKraju.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kodKraju.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var konto = runtimeEntityType.AddProperty( + "Konto", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + konto.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + konto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal?), + propertyInfo: typeof(SklepKontr).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var maxKredyt = runtimeEntityType.AddProperty( + "MaxKredyt", + typeof(decimal), + propertyInfo: typeof(SklepKontr).GetProperty("MaxKredyt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + maxKredyt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + maxKredyt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + maxKredyt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var maxPoTermPlat = runtimeEntityType.AddProperty( + "MaxPoTermPlat", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("MaxPoTermPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + maxPoTermPlat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + maxPoTermPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var miasto = runtimeEntityType.AddProperty( + "Miasto", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Miasto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + miasto.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + miasto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nIP = runtimeEntityType.AddProperty( + "NIP", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("NIP", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nIP.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nIP.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var naPrzelewie1 = runtimeEntityType.AddProperty( + "NaPrzelewie1", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("NaPrzelewie1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + naPrzelewie1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + naPrzelewie1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var naPrzelewie2 = runtimeEntityType.AddProperty( + "NaPrzelewie2", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("NaPrzelewie2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + naPrzelewie2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + naPrzelewie2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrAnalityki = runtimeEntityType.AddProperty( + "NrAnalityki", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("NrAnalityki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + nrAnalityki.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + nrAnalityki.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDomu = runtimeEntityType.AddProperty( + "NrDomu", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("NrDomu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 9, + unicode: false); + nrDomu.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(9)", + size: 9)); + nrDomu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrLokalu = runtimeEntityType.AddProperty( + "NrLokalu", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("NrLokalu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 9, + unicode: false); + nrLokalu.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(9)", + size: 9)); + nrLokalu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odbiorca = runtimeEntityType.AddProperty( + "Odbiorca", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("Odbiorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + odbiorca.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + odbiorca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var osoba = runtimeEntityType.AddProperty( + "Osoba", + typeof(short?), + propertyInfo: typeof(SklepKontr).GetProperty("Osoba", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + osoba.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + osoba.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poczta = runtimeEntityType.AddProperty( + "Poczta", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Poczta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + poczta.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + poczta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomRabatu = runtimeEntityType.AddProperty( + "PoziomRabatu", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("PoziomRabatu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomRabatu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomRabatu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var producent = runtimeEntityType.AddProperty( + "Producent", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("Producent", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + producent.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + producent.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prowizja = runtimeEntityType.AddProperty( + "Prowizja", + typeof(decimal?), + propertyInfo: typeof(SklepKontr).GetProperty("Prowizja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + prowizja.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + prowizja.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + prowizja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatDost = runtimeEntityType.AddProperty( + "RabatDost", + typeof(decimal), + propertyInfo: typeof(SklepKontr).GetProperty("RabatDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatDost.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatDost.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatDost.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatOdb = runtimeEntityType.AddProperty( + "RabatOdb", + typeof(decimal), + propertyInfo: typeof(SklepKontr).GetProperty("RabatOdb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatOdb.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatOdb.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatOdb.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa1 = runtimeEntityType.AddProperty( + "Rezerwa1", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Rezerwa1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 80, + unicode: false); + rezerwa1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(80)", + size: 80)); + rezerwa1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa2 = runtimeEntityType.AddProperty( + "Rezerwa2", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Rezerwa2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + rezerwa2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + rezerwa2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var staly = runtimeEntityType.AddProperty( + "Staly", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("Staly", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + staly.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + staly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var telefon = runtimeEntityType.AddProperty( + "Telefon", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Telefon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + telefon.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + telefon.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termPlatDost = runtimeEntityType.AddProperty( + "TermPlatDost", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("TermPlatDost", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + termPlatDost.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + termPlatDost.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termPlatOdb = runtimeEntityType.AddProperty( + "TermPlatOdb", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("TermPlatOdb", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + termPlatOdb.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + termPlatOdb.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termWaznKarty = runtimeEntityType.AddProperty( + "TermWaznKarty", + typeof(DateTime), + propertyInfo: typeof(SklepKontr).GetProperty("TermWaznKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + termWaznKarty.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + termWaznKarty.AddAnnotation("Relational:ColumnType", "datetime"); + termWaznKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ulica = runtimeEntityType.AddProperty( + "Ulica", + typeof(string), + propertyInfo: typeof(SklepKontr).GetProperty("Ulica", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + ulica.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + ulica.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zakPracChron = runtimeEntityType.AddProperty( + "ZakPracChron", + typeof(short), + propertyInfo: typeof(SklepKontr).GetProperty("ZakPracChron", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + zakPracChron.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + zakPracChron.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepKontr).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPKONTR"); + + var idx_SklepKthKth = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "idx_SklepKthKth"); + + var idx_SklepKthSkKth = runtimeEntityType.AddIndex( + new[] { sklepId, kontrId }, + name: "idx_SklepKthSkKth"); + + var idx_SklepKthZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SklepKthZmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(SklepKontr).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontr = principalEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKON_REF_KTHSK_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepKontr).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontr = principalEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKON_REF_SKLEP_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKontr"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrOpisEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrOpisEntityType.cs new file mode 100644 index 0000000..53022cd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrOpisEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKontrOpisEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontrOpis", + typeof(SklepKontrOpis), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKontrOpis).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepKontrOpis).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepKontrOpis).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepKontrOpis).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPKONTROPIS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepKontrOpis).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontrOpis = principalEntityType.AddNavigation("SklepKontrOpis", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepKontrOpis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKON_REF_SKKTH_SKLEPKON"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKontrOpis"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrSklepEntityType.cs new file mode 100644 index 0000000..e6afdd2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKontrSklepEntityType.cs @@ -0,0 +1,437 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKontrSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKontrSklep", + typeof(SklepKontrSklep), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKontrSklep).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepKontrSklep).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataBO = runtimeEntityType.AddProperty( + "DataBO", + typeof(DateTime?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("DataBO", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataBO.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataBO.AddAnnotation("Relational:ColumnType", "datetime"); + dataBO.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKraju = runtimeEntityType.AddProperty( + "KodKraju", + typeof(string), + propertyInfo: typeof(SklepKontrSklep).GetProperty("KodKraju", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + kodKraju.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kodKraju.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnyWDniuBO = runtimeEntityType.AddProperty( + "KolejnyWDniuBO", + typeof(int?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("KolejnyWDniuBO", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kolejnyWDniuBO.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + kolejnyWDniuBO.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrSeryjny = runtimeEntityType.AddProperty( + "NrSeryjny", + typeof(string), + propertyInfo: typeof(SklepKontrSklep).GetProperty("NrSeryjny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nrSeryjny.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nrSeryjny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrSklepu = runtimeEntityType.AddProperty( + "NrSklepu", + typeof(short), + propertyInfo: typeof(SklepKontrSklep).GetProperty("NrSklepu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + nrSklepu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + nrSklepu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var okrZamkniety = runtimeEntityType.AddProperty( + "OkrZamkniety", + typeof(DateTime?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("OkrZamkniety", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + okrZamkniety.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + okrZamkniety.AddAnnotation("Relational:ColumnType", "datetime"); + okrZamkniety.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ostEksport = runtimeEntityType.AddProperty( + "OstEksport", + typeof(DateTime?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("OstEksport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ostEksport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + ostEksport.AddAnnotation("Relational:ColumnType", "datetime"); + ostEksport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ostImport = runtimeEntityType.AddProperty( + "OstImport", + typeof(DateTime?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("OstImport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ostImport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + ostImport.AddAnnotation("Relational:ColumnType", "datetime"); + ostImport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pelnyImport = runtimeEntityType.AddProperty( + "PelnyImport", + typeof(short?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("PelnyImport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + pelnyImport.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + pelnyImport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var potwEksport = runtimeEntityType.AddProperty( + "PotwEksport", + typeof(DateTime?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("PotwEksport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + potwEksport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + potwEksport.AddAnnotation("Relational:ColumnType", "datetime"); + potwEksport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rola = runtimeEntityType.AddProperty( + "Rola", + typeof(short?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("Rola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rola.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rola.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wymImport = runtimeEntityType.AddProperty( + "WymImport", + typeof(DateTime?), + propertyInfo: typeof(SklepKontrSklep).GetProperty("WymImport", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wymImport.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + wymImport.AddAnnotation("Relational:ColumnType", "datetime"); + wymImport.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLKONTRSKL"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(SklepKontrSklep).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontrSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKontrSklep = principalEntityType.AddNavigation("SklepKontrSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("SklepKontrSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklKontrSklKontr"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKontrSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKthPrzydzialEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKthPrzydzialEntityType.cs new file mode 100644 index 0000000..c919cad --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKthPrzydzialEntityType.cs @@ -0,0 +1,124 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKthPrzydzialEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "SklepKthPrzydzial", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kPWId = runtimeEntityType.AddProperty( + "KPWId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kPWId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kPWId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kPWId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, kPWId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPKTHPRZYDZIAL"); + + var index = runtimeEntityType.AddIndex( + new[] { kPWId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KPWId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KPWId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKTH_REF_SKKTH_KTHPARWA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPKTH_REF_SKKTH_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKthPrzydzial"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKthTypOsEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKthTypOsEntityType.cs new file mode 100644 index 0000000..8bdb147 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepKthTypOsEntityType.cs @@ -0,0 +1,182 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepKthTypOsEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepKthTypOs", + typeof(SklepKthTypOs), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepKthTypOs).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKthTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepKthTypOs).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKthTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTypOsId = runtimeEntityType.AddProperty( + "SklepTypOsId", + typeof(decimal), + propertyInfo: typeof(SklepKthTypOs).GetProperty("SklepTypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKthTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTypOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTypOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTypOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId, sklepTypOsId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPKTHTYPOS"); + + var idx_SKKTHTYPOS_SKTYPOS = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTypOsId }, + name: "idx_SKKTHTYPOS_SKTYPOS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepKthTypOs).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKthTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKthTypOs = principalEntityType.AddNavigation("SklepKthTypOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepKthTypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKKTHTYPOS_SKKTH"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTypOsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTypOsId") }), + principalEntityType, + required: true); + + var sklepTypOs = declaringEntityType.AddNavigation("SklepTypOs", + runtimeForeignKey, + onDependent: true, + typeof(SklepTypOs), + propertyInfo: typeof(SklepKthTypOs).GetProperty("SklepTypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKthTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepKthTypOs = principalEntityType.AddNavigation("SklepKthTypOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTypOs).GetProperty("SklepKthTypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKKTHTYPOS_SKTYPOS"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepKthTypOs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepMagazynEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepMagazynEntityType.cs new file mode 100644 index 0000000..c3c2cfb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepMagazynEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepMagazynEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepMagazyn", + typeof(SklepMagazyn), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepMagazyn).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal), + propertyInfo: typeof(SklepMagazyn).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepMagazyn).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(short), + propertyInfo: typeof(SklepMagazyn).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + numer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepMagId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPMAGAZYN"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepMagazyn).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepMagazyn = principalEntityType.AddNavigation("SklepMagazyn", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepMagazyn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPMAG_REF_SKMAG_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepMagazyn"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNarzDostEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNarzDostEntityType.cs new file mode 100644 index 0000000..76fcb87 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNarzDostEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepNarzDostEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "SklepNarzDost", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, towId, kontrId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPNARZDOST"); + + var idx_SklepNarzDostKth = runtimeEntityType.AddIndex( + new[] { kontrId }, + name: "idx_SklepNarzDostKth"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPNAR_REF_SKLEP_KONTRAHE"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPNAR_REF_SKLEP_SKLEPFLA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepNarzDost"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNotatkiEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNotatkiEntityType.cs new file mode 100644 index 0000000..794b449 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNotatkiEntityType.cs @@ -0,0 +1,194 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepNotatkiEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepNotatki", + typeof(SklepNotatki), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepNotatki).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNotatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepNotatki).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNotatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepNotatki).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNotatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var koniecLinii = runtimeEntityType.AddProperty( + "KoniecLinii", + typeof(short), + propertyInfo: typeof(SklepNotatki).GetProperty("KoniecLinii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNotatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + koniecLinii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + koniecLinii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepNotatki).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNotatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPNOTATKI"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepNotatki).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNotatki).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepNotatki = principalEntityType.AddNavigation("SklepNotatki", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepNotatki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPNOT_REF_SKNOT_SKLEPTOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepNotatki"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNrRejEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNrRejEntityType.cs new file mode 100644 index 0000000..8f05599 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNrRejEntityType.cs @@ -0,0 +1,202 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepNrRejEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRej", + typeof(SklepNrRej), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepNrRej).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepNrRej).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrFormat = runtimeEntityType.AddProperty( + "NrFormat", + typeof(string), + propertyInfo: typeof(SklepNrRej).GetProperty("NrFormat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 60, + unicode: false); + nrFormat.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrFormat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrWpisany = runtimeEntityType.AddProperty( + "NrWpisany", + typeof(string), + propertyInfo: typeof(SklepNrRej).GetProperty("NrWpisany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nrWpisany.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrWpisany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wyborKart = runtimeEntityType.AddProperty( + "WyborKart", + typeof(short), + propertyInfo: typeof(SklepNrRej).GetProperty("WyborKart", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + wyborKart.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + wyborKart.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId, nrFormat }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPNRREJ"); + + var idx_SkNumerRej = runtimeEntityType.AddIndex( + new[] { nrFormat, sklepId, sklepKontrId }, + name: "idx_SkNumerRej"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepNrRej).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepNrRej = principalEntityType.AddNavigation("SklepNrRej", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepNrRej", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkNrRejKth"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepNrRej"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNrRejKartaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNrRejKartaEntityType.cs new file mode 100644 index 0000000..b9f9f48 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepNrRejKartaEntityType.cs @@ -0,0 +1,208 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepNrRejKartaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepNrRejKarta", + typeof(SklepNrRejKarta), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepNrRejKarta).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRejKarta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepNrRejKarta).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRejKarta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrFormat = runtimeEntityType.AddProperty( + "NrFormat", + typeof(string), + propertyInfo: typeof(SklepNrRejKarta).GetProperty("NrFormat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRejKarta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 60, + unicode: false); + nrFormat.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrFormat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKartaId = runtimeEntityType.AddProperty( + "SklepKartaId", + typeof(decimal), + propertyInfo: typeof(SklepNrRejKarta).GetProperty("SklepKartaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRejKarta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKartaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKartaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKartaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId, nrFormat, sklepKartaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPNRREJKARTA"); + + var idx_SkNrRejKartaId = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKartaId, sklepKontrId, nrFormat }, + name: "idx_SkNrRejKartaId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKartaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKartaId") }), + principalEntityType, + required: true); + + var sklepKartaLoj = declaringEntityType.AddNavigation("SklepKartaLoj", + runtimeForeignKey, + onDependent: true, + typeof(SklepKartaLoj), + propertyInfo: typeof(SklepNrRejKarta).GetProperty("SklepKartaLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRejKarta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepNrRejKarta = principalEntityType.AddNavigation("SklepNrRejKarta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKartaLoj).GetProperty("SklepNrRejKarta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkKartaNrRej"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId"), declaringEntityType.FindProperty("NrFormat") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId"), principalEntityType.FindProperty("NrFormat") }), + principalEntityType, + required: true); + + var sklepNrRej = declaringEntityType.AddNavigation("SklepNrRej", + runtimeForeignKey, + onDependent: true, + typeof(SklepNrRej), + propertyInfo: typeof(SklepNrRejKarta).GetProperty("SklepNrRej", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRejKarta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepNrRejKarta = principalEntityType.AddNavigation("SklepNrRejKarta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepNrRej).GetProperty("SklepNrRejKarta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepNrRej).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkNrRejKarta"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepNrRejKarta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepOplataEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepOplataEntityType.cs new file mode 100644 index 0000000..493c076 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepOplataEntityType.cs @@ -0,0 +1,418 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepOplataEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepOplata", + typeof(SklepOplata), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepOplata).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepOplataId = runtimeEntityType.AddProperty( + "SklepOplataId", + typeof(decimal), + propertyInfo: typeof(SklepOplata).GetProperty("SklepOplataId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepOplataId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepOplataId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepOplataId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepOplata).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDo = runtimeEntityType.AddProperty( + "DataDo", + typeof(DateTime?), + propertyInfo: typeof(SklepOplata).GetProperty("DataDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDo.AddAnnotation("Relational:ColumnType", "datetime"); + dataDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataOd = runtimeEntityType.AddProperty( + "DataOd", + typeof(DateTime?), + propertyInfo: typeof(SklepOplata).GetProperty("DataOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataOd.AddAnnotation("Relational:ColumnType", "datetime"); + dataOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var komentarz = runtimeEntityType.AddProperty( + "Komentarz", + typeof(string), + propertyInfo: typeof(SklepOplata).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + komentarz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + komentarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal?), + propertyInfo: typeof(SklepOplata).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepOplata).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var oplataId = runtimeEntityType.AddProperty( + "OplataId", + typeof(decimal?), + propertyInfo: typeof(SklepOplata).GetProperty("OplataId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + oplataId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + oplataId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + oplataId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SklepOplata).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKBId = runtimeEntityType.AddProperty( + "SklepKBId", + typeof(decimal?), + propertyInfo: typeof(SklepOplata).GetProperty("SklepKBId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKBId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKBId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKBId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawkaProc = runtimeEntityType.AddProperty( + "StawkaProc", + typeof(decimal?), + propertyInfo: typeof(SklepOplata).GetProperty("StawkaProc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawkaProc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stawkaProc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stawkaProc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepOplata).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepOplata).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepOplataId }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepOplata).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepOplata).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepOplata = principalEntityType.AddNavigation("SklepOplata", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepOplata", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKOPLATA_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepOplata"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPanelEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPanelEntityType.cs new file mode 100644 index 0000000..c91dcfd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPanelEntityType.cs @@ -0,0 +1,427 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPanelEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanel", + typeof(SklepPanel), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPanel).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepPanelId = runtimeEntityType.AddProperty( + "SklepPanelId", + typeof(decimal), + propertyInfo: typeof(SklepPanel).GetProperty("SklepPanelId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepPanelId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepPanelId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepPanelId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepPanel).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var h = runtimeEntityType.AddProperty( + "H", + typeof(short?), + propertyInfo: typeof(SklepPanel).GetProperty("H", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + h.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + h.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var l = runtimeEntityType.AddProperty( + "L", + typeof(short?), + propertyInfo: typeof(SklepPanel).GetProperty("L", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + l.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + l.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepPanel).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var panelId = runtimeEntityType.AddProperty( + "PanelId", + typeof(decimal?), + propertyInfo: typeof(SklepPanel).GetProperty("PanelId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + panelId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + panelId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + panelId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int?), + propertyInfo: typeof(SklepPanel).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SklepPanel).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal?), + propertyInfo: typeof(SklepPanel).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var t = runtimeEntityType.AddProperty( + "T", + typeof(short?), + propertyInfo: typeof(SklepPanel).GetProperty("T", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + t.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + t.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typAplikacji = runtimeEntityType.AddProperty( + "TypAplikacji", + typeof(short), + propertyInfo: typeof(SklepPanel).GetProperty("TypAplikacji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + sentinel: (short)0); + typAplikacji.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typAplikacji.AddAnnotation("Relational:DefaultValue", (short)3); + typAplikacji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var w = runtimeEntityType.AddProperty( + "W", + typeof(short?), + propertyInfo: typeof(SklepPanel).GetProperty("W", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + w.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + w.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepPanel).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepPanelId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEP_PANEL"); + + var index = runtimeEntityType.AddIndex( + new[] { panelId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepUzId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PanelId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("PanelId") }), + principalEntityType); + + var panel = declaringEntityType.AddNavigation("Panel", + runtimeForeignKey, + onDependent: true, + typeof(Panel), + propertyInfo: typeof(SklepPanel).GetProperty("Panel", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPanel = principalEntityType.AddNavigation("SklepPanel", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Panel).GetProperty("SklepPanel", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Panel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPANEL_REFERENCE_PANEL"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepPanel).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPanel = principalEntityType.AddNavigation("SklepPanel", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepPanel", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPanel"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPanelParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPanelParamEntityType.cs new file mode 100644 index 0000000..27c9ab8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPanelParamEntityType.cs @@ -0,0 +1,177 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPanelParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPanelParam", + typeof(SklepPanelParam), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPanelParam).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepPanelId = runtimeEntityType.AddProperty( + "SklepPanelId", + typeof(decimal), + propertyInfo: typeof(SklepPanelParam).GetProperty("SklepPanelId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepPanelId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepPanelId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepPanelId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(SklepPanelParam).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parWartosc = runtimeEntityType.AddProperty( + "ParWartosc", + typeof(string), + propertyInfo: typeof(SklepPanelParam).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + parWartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parWartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepPanelId, parNazwa }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEP_PANEL_PARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepPanelId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepPanelId") }), + principalEntityType, + required: true); + + var sklepPanel = declaringEntityType.AddNavigation("SklepPanel", + runtimeForeignKey, + onDependent: true, + typeof(SklepPanel), + propertyInfo: typeof(SklepPanelParam).GetProperty("SklepPanel", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanelParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPanelParam = principalEntityType.AddNavigation("SklepPanelParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPanel).GetProperty("SklepPanelParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPanel).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPanelParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParBonEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParBonEntityType.cs new file mode 100644 index 0000000..d97b267 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParBonEntityType.cs @@ -0,0 +1,224 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepParBonEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepParBon", + typeof(SklepParBon), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepParBon).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepParBon).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepParBon).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal), + propertyInfo: typeof(SklepParBon).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(string), + propertyInfo: typeof(SklepParBon).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + numer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(string), + propertyInfo: typeof(SklepParBon).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + typ.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPARBON"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId") }), + principalEntityType, + required: true); + + var sklepParagon = declaringEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: true, + typeof(SklepParagon), + propertyInfo: typeof(SklepParBon).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParBon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepParBon = principalEntityType.AddNavigation("SklepParBon", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepParagon).GetProperty("SklepParBon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKPB_SKLEPPAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepParBon"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParPunktyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParPunktyEntityType.cs new file mode 100644 index 0000000..dde79be --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParPunktyEntityType.cs @@ -0,0 +1,221 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepParPunktyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepParPunkty", + typeof(SklepParPunkty), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepParPunkty).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepParPunkty).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepParPunkty).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var gdzie = runtimeEntityType.AddProperty( + "Gdzie", + typeof(short), + propertyInfo: typeof(SklepParPunkty).GetProperty("Gdzie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + gdzie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + gdzie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(DateTime), + propertyInfo: typeof(SklepParPunkty).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + kiedy.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + kiedy.AddAnnotation("Relational:ColumnType", "datetime"); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal), + propertyInfo: typeof(SklepParPunkty).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, typ, gdzie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPARPUNKTY"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId") }), + principalEntityType, + required: true); + + var sklepParagon = declaringEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: true, + typeof(SklepParagon), + propertyInfo: typeof(SklepParPunkty).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParPunkty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepParPunkty = principalEntityType.AddNavigation("SklepParPunkty", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepParagon).GetProperty("SklepParPunkty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKPAR_SKLEPPAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepParPunkty"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParWalutaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParWalutaEntityType.cs new file mode 100644 index 0000000..78e88de --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParWalutaEntityType.cs @@ -0,0 +1,260 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepParWalutaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepParWaluta", + typeof(SklepParWaluta), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepParWaluta).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepParWaluta).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal), + propertyInfo: typeof(SklepParWaluta).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal), + propertyInfo: typeof(SklepParWaluta).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parKwota = runtimeEntityType.AddProperty( + "ParKwota", + typeof(decimal), + propertyInfo: typeof(SklepParWaluta).GetProperty("ParKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + parKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + parKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + parKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walKwota = runtimeEntityType.AddProperty( + "WalKwota", + typeof(decimal), + propertyInfo: typeof(SklepParWaluta).GetProperty("WalKwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + walKwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + walKwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + walKwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, sklepWalId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPARWALUTA"); + + var idx_SkWalPar = runtimeEntityType.AddIndex( + new[] { sklepId, sklepWalId }, + name: "idx_SkWalPar"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId") }), + principalEntityType, + required: true); + + var sklepParagon = declaringEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: true, + typeof(SklepParagon), + propertyInfo: typeof(SklepParWaluta).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepParWaluta = principalEntityType.AddNavigation("SklepParWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepParagon).GetProperty("SklepParWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKPWZ_SKLEPPAR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepWalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepWalId") }), + principalEntityType, + required: true); + + var sklepWaluta = declaringEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: true, + typeof(SklepWaluta), + propertyInfo: typeof(SklepParWaluta).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepParWaluta = principalEntityType.AddNavigation("SklepParWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepParWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKWAL_SKLEPWAL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepParWaluta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParagonEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParagonEntityType.cs new file mode 100644 index 0000000..96913d1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepParagonEntityType.cs @@ -0,0 +1,888 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepParagonEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepParagon", + typeof(SklepParagon), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepParagon).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var bony = runtimeEntityType.AddProperty( + "Bony", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("Bony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + bony.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + bony.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + bony.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var brutto = runtimeEntityType.AddProperty( + "Brutto", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("Brutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + brutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + brutto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + brutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cechyPar = runtimeEntityType.AddProperty( + "CechyPar", + typeof(string), + propertyInfo: typeof(SklepParagon).GetProperty("CechyPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + cechyPar.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + cechyPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrEksportFK = runtimeEntityType.AddProperty( + "CentrEksportFK", + typeof(short?), + propertyInfo: typeof(SklepParagon).GetProperty("CentrEksportFK", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrEksportFK.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + centrEksportFK.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czek = runtimeEntityType.AddProperty( + "Czek", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("Czek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + czek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + czek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + czek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzas = runtimeEntityType.AddProperty( + "DataCzas", + typeof(DateTime), + propertyInfo: typeof(SklepParagon).GetProperty("DataCzas", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataCzas.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzas.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzas.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodFPlat = runtimeEntityType.AddProperty( + "DodFPlat", + typeof(decimal?), + propertyInfo: typeof(SklepParagon).GetProperty("DodFPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dodFPlat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + dodFPlat.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + dodFPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var eksportFK = runtimeEntityType.AddProperty( + "EksportFK", + typeof(short?), + propertyInfo: typeof(SklepParagon).GetProperty("EksportFK", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + eksportFK.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + eksportFK.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var gotowka = runtimeEntityType.AddProperty( + "Gotowka", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("Gotowka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + gotowka.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + gotowka.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + gotowka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupyGTU = runtimeEntityType.AddProperty( + "GrupyGTU", + typeof(string), + propertyInfo: typeof(SklepParagon).GetProperty("GrupyGTU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + grupyGTU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + grupyGTU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscPoz = runtimeEntityType.AddProperty( + "IloscPoz", + typeof(int), + propertyInfo: typeof(SklepParagon).GetProperty("IloscPoz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + iloscPoz.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + iloscPoz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var inneFPlat = runtimeEntityType.AddProperty( + "InneFPlat", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("InneFPlat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + inneFPlat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + inneFPlat.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + inneFPlat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var karta = runtimeEntityType.AddProperty( + "Karta", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("Karta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + karta.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + karta.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + karta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kasjer = runtimeEntityType.AddProperty( + "Kasjer", + typeof(string), + propertyInfo: typeof(SklepParagon).GetProperty("Kasjer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + kasjer.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kasjer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKarty = runtimeEntityType.AddProperty( + "KodKarty", + typeof(string), + propertyInfo: typeof(SklepParagon).GetProperty("KodKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kodKarty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal?), + propertyInfo: typeof(SklepParagon).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nIP = runtimeEntityType.AddProperty( + "NIP", + typeof(string), + propertyInfo: typeof(SklepParagon).GetProperty("NIP", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + nIP.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nIP.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opakWyd = runtimeEntityType.AddProperty( + "OpakWyd", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("OpakWyd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + opakWyd.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + opakWyd.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + opakWyd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opakZwr = runtimeEntityType.AddProperty( + "OpakZwr", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("OpakZwr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + opakZwr.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + opakZwr.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + opakZwr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podmiotPowiazany = runtimeEntityType.AddProperty( + "PodmiotPowiazany", + typeof(short?), + propertyInfo: typeof(SklepParagon).GetProperty("PodmiotPowiazany", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + podmiotPowiazany.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + podmiotPowiazany.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przelew = runtimeEntityType.AddProperty( + "Przelew", + typeof(decimal?), + propertyInfo: typeof(SklepParagon).GetProperty("Przelew", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + przelew.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + przelew.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + przelew.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabat = runtimeEntityType.AddProperty( + "Rabat", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("Rabat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rabat.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rabat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKasaId = runtimeEntityType.AddProperty( + "SklepKasaId", + typeof(decimal), + propertyInfo: typeof(SklepParagon).GetProperty("SklepKasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepKasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal?), + propertyInfo: typeof(SklepParagon).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPar = runtimeEntityType.AddProperty( + "TypPar", + typeof(short), + propertyInfo: typeof(SklepParagon).GetProperty("TypPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPar.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waluty = runtimeEntityType.AddProperty( + "Waluty", + typeof(decimal?), + propertyInfo: typeof(SklepParagon).GetProperty("Waluty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + waluty.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + waluty.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + waluty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepParagon).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPARAGON"); + + var idx_SkParKasa = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKasaId }, + name: "idx_SkParKasa"); + + var idx_SkParKasjer = runtimeEntityType.AddIndex( + new[] { sklepId, kasjer }, + name: "idx_SkParKasjer"); + + var idx_SkParWal = runtimeEntityType.AddIndex( + new[] { sklepId, sklepWalId }, + name: "idx_SkParWal"); + + var idx_SkParZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SkParZmiana"); + + var idx_SklepParDataCzas = runtimeEntityType.AddIndex( + new[] { sklepId, dataCzas }, + name: "idx_SklepParDataCzas"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepParagon).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepParagon = principalEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKLEP_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKasaId") }), + principalEntityType, + required: true); + + var sklepKasa = declaringEntityType.AddNavigation("SklepKasa", + runtimeForeignKey, + onDependent: true, + typeof(SklepKasa), + propertyInfo: typeof(SklepParagon).GetProperty("SklepKasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepParagon = principalEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKasa).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKPAR_SKLEPKAS"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepWalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepWalId") }), + principalEntityType); + + var sklepWaluta = declaringEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: true, + typeof(SklepWaluta), + propertyInfo: typeof(SklepParagon).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepParagon = principalEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKPAR_SKLEPWAL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepParagon"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPartiaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPartiaEntityType.cs new file mode 100644 index 0000000..11b8e69 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPartiaEntityType.cs @@ -0,0 +1,331 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPartiaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPartia", + typeof(SklepPartia), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPartia).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepPartia).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepPartia).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cecha1 = runtimeEntityType.AddProperty( + "Cecha1", + typeof(string), + propertyInfo: typeof(SklepPartia).GetProperty("Cecha1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + cecha1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + cecha1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cecha2 = runtimeEntityType.AddProperty( + "Cecha2", + typeof(string), + propertyInfo: typeof(SklepPartia).GetProperty("Cecha2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + cecha2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + cecha2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataWazn = runtimeEntityType.AddProperty( + "DataWazn", + typeof(DateTime?), + propertyInfo: typeof(SklepPartia).GetProperty("DataWazn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataWazn.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataWazn.AddAnnotation("Relational:ColumnType", "datetime"); + dataWazn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pozostalo = runtimeEntityType.AddProperty( + "Pozostalo", + typeof(decimal), + propertyInfo: typeof(SklepPartia).GetProperty("Pozostalo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + pozostalo.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + pozostalo.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + pozostalo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepPartia).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPartii = runtimeEntityType.AddProperty( + "TypPartii", + typeof(short), + propertyInfo: typeof(SklepPartia).GetProperty("TypPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPartii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPARTIA"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowId }); + + var idx_SkPrtTypTowIle = runtimeEntityType.AddIndex( + new[] { typPartii, sklepId, sklepTowId, pozostalo }, + name: "idx_SkPrtTypTowIle"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepPartia).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPartia = principalEntityType.AddNavigation("SklepPartia", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepPartia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKPRT_SKLEPTOW"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + unique: true, + required: true); + + var sklepPozDok = declaringEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozDok), + propertyInfo: typeof(SklepPartia).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPartia = principalEntityType.AddNavigation("SklepPartia", + runtimeForeignKey, + onDependent: false, + typeof(SklepPartia), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepPartia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPAR_REF_SKPRT_SKLEPPOZ"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPartia"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowKontLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowKontLojEntityType.cs new file mode 100644 index 0000000..02d6c56 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowKontLojEntityType.cs @@ -0,0 +1,206 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPowKontLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowKontLoj", + typeof(SklepPowKontLoj), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPowKontLoj).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepNoweKontoId = runtimeEntityType.AddProperty( + "SklepNoweKontoId", + typeof(decimal), + propertyInfo: typeof(SklepPowKontLoj).GetProperty("SklepNoweKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepNoweKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepNoweKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepNoweKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzajPow = runtimeEntityType.AddProperty( + "RodzajPow", + typeof(short), + propertyInfo: typeof(SklepPowKontLoj).GetProperty("RodzajPow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzajPow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzajPow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepStareKontoId = runtimeEntityType.AddProperty( + "SklepStareKontoId", + typeof(decimal), + propertyInfo: typeof(SklepPowKontLoj).GetProperty("SklepStareKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepStareKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepStareKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepStareKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepNoweKontoId, rodzajPow }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPOWKONTLOJ"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepStareKontoId }); + + var idx_PowStareSKLoj = runtimeEntityType.AddIndex( + new[] { sklepStareKontoId }, + name: "idx_PowStareSKLoj"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepNoweKontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontoId") }), + principalEntityType, + required: true); + + var sklepKontoLoj = declaringEntityType.AddNavigation("SklepKontoLoj", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontoLoj), + propertyInfo: typeof(SklepPowKontLoj).GetProperty("SklepKontoLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPowKontLojSklepKontoLoj = principalEntityType.AddNavigation("SklepPowKontLojSklepKontoLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontoLoj).GetProperty("SklepPowKontLojSklepKontoLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SklepNoweKonto"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepStareKontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontoId") }), + principalEntityType, + required: true); + + var sklepKontoLojNavigation = declaringEntityType.AddNavigation("SklepKontoLojNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontoLoj), + propertyInfo: typeof(SklepPowKontLoj).GetProperty("SklepKontoLojNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowKontLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPowKontLojSklepKontoLojNavigation = principalEntityType.AddNavigation("SklepPowKontLojSklepKontoLojNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontoLoj).GetProperty("SklepPowKontLojSklepKontoLojNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SklepStareKonto"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPowKontLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowiazaniePromEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowiazaniePromEntityType.cs new file mode 100644 index 0000000..71a37d6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowiazaniePromEntityType.cs @@ -0,0 +1,178 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPowiazaniePromEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieProm", + typeof(SklepPowiazanieProm), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPowiazanieProm).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepPromId = runtimeEntityType.AddProperty( + "SklepPromId", + typeof(decimal), + propertyInfo: typeof(SklepPowiazanieProm).GetProperty("SklepPromId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepPromId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepPromId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepPromId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepGrupaId = runtimeEntityType.AddProperty( + "SklepGrupaId", + typeof(decimal), + propertyInfo: typeof(SklepPowiazanieProm).GetProperty("SklepGrupaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepGrupaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepGrupaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepGrupaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SklepPowiazanieProm).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepPromId, sklepGrupaId, rodzaj }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SklPowiazanieProm"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepGrupaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepGrupaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepGrupaId") }), + principalEntityType, + required: true); + + var sklepGrupaPromocji = declaringEntityType.AddNavigation("SklepGrupaPromocji", + runtimeForeignKey, + onDependent: true, + typeof(SklepGrupaPromocji), + propertyInfo: typeof(SklepPowiazanieProm).GetProperty("SklepGrupaPromocji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieProm).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPowiazanieProm = principalEntityType.AddNavigation("SklepPowiazanieProm", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepGrupaPromocji).GetProperty("SklepPowiazanieProm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaPromocji).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklPowProm_SklGrupaPromocji"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPowiazanieProm"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowiazanieUzEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowiazanieUzEntityType.cs new file mode 100644 index 0000000..d9fa13f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPowiazanieUzEntityType.cs @@ -0,0 +1,175 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPowiazanieUzEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPowiazanieUz", + typeof(SklepPowiazanieUz), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPowiazanieUz).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal), + propertyInfo: typeof(SklepPowiazanieUz).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzajPow = runtimeEntityType.AddProperty( + "RodzajPow", + typeof(short), + propertyInfo: typeof(SklepPowiazanieUz).GetProperty("RodzajPow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzajPow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzajPow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal), + propertyInfo: typeof(SklepPowiazanieUz).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepUzId, rodzajPow, id }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SK_POW_UZ"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType, + required: true); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepPowiazanieUz).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPowiazanieUz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPowiazanieUz = principalEntityType.AddNavigation("SklepPowiazanieUz", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepPowiazanieUz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPOW_REF_SKPOW_SKLEPUZY"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPowiazanieUz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozAkcyzaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozAkcyzaEntityType.cs new file mode 100644 index 0000000..d71e966 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozAkcyzaEntityType.cs @@ -0,0 +1,230 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPozAkcyzaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozAkcyza", + typeof(SklepPozAkcyza), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPozAkcyza).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepPozAkcyza).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepPozAkcyza).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepGrAkcId = runtimeEntityType.AddProperty( + "SklepGrAkcId", + typeof(decimal), + propertyInfo: typeof(SklepPozAkcyza).GetProperty("SklepGrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepGrAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepGrAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepGrAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal), + propertyInfo: typeof(SklepPozAkcyza).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, kolejnosc, sklepGrAkcId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPOZAKCYZA"); + + var idx_SkPozAkcGr = runtimeEntityType.AddIndex( + new[] { sklepId, sklepGrAkcId }, + name: "idx_SkPozAkcGr"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepGrAkcId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepGrAkcId") }), + principalEntityType, + required: true); + + var sklepGrupaAkcyzowa = declaringEntityType.AddNavigation("SklepGrupaAkcyzowa", + runtimeForeignKey, + onDependent: true, + typeof(SklepGrupaAkcyzowa), + propertyInfo: typeof(SklepPozAkcyza).GetProperty("SklepGrupaAkcyzowa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPozAkcyza = principalEntityType.AddNavigation("SklepPozAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepGrupaAkcyzowa).GetProperty("SklepPozAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkAkcPoz"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozDok = declaringEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozDok), + propertyInfo: typeof(SklepPozAkcyza).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPozAkcyza = principalEntityType.AddNavigation("SklepPozAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepPozAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkPozAkc"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPozAkcyza"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozDokEntityType.cs new file mode 100644 index 0000000..705654e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozDokEntityType.cs @@ -0,0 +1,666 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPozDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozDok", + typeof(SklepPozDok), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepPozDok).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDet = runtimeEntityType.AddProperty( + "CenaDet", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("CenaDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDomyslna = runtimeEntityType.AddProperty( + "CenaDomyslna", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("CenaDomyslna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDomyslna.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDomyslna.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDomyslna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaMag = runtimeEntityType.AddProperty( + "CenaMag", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("CenaMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaPoRab = runtimeEntityType.AddProperty( + "CenaPoRab", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("CenaPoRab", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaPoRab.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaPoRab.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaPoRab.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaPrzedRab = runtimeEntityType.AddProperty( + "CenaPrzedRab", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("CenaPrzedRab", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaPrzedRab.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaPrzedRab.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaPrzedRab.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWZgrzewce = runtimeEntityType.AddProperty( + "IleWZgrzewce", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("IleWZgrzewce", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ileWZgrzewce.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWZgrzewce.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWZgrzewce.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscMinus = runtimeEntityType.AddProperty( + "IloscMinus", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("IloscMinus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + iloscMinus.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscMinus.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscMinus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscPlus = runtimeEntityType.AddProperty( + "IloscPlus", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("IloscPlus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + iloscPlus.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscPlus.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscPlus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var metoda = runtimeEntityType.AddProperty( + "Metoda", + typeof(short), + propertyInfo: typeof(SklepPozDok).GetProperty("Metoda", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + metoda.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + metoda.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal?), + propertyInfo: typeof(SklepPozDok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrPozycji = runtimeEntityType.AddProperty( + "NrPozycji", + typeof(int), + propertyInfo: typeof(SklepPozDok).GetProperty("NrPozycji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + nrPozycji.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + nrPozycji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal?), + propertyInfo: typeof(SklepPozDok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short), + propertyInfo: typeof(SklepPozDok).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatProc = runtimeEntityType.AddProperty( + "RabatProc", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("RabatProc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rabatProc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + rabatProc.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + rabatProc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(SklepPozDok).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawkaDod = runtimeEntityType.AddProperty( + "StawkaDod", + typeof(short?), + propertyInfo: typeof(SklepPozDok).GetProperty("StawkaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawkaDod.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + stawkaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPoz = runtimeEntityType.AddProperty( + "TypPoz", + typeof(short), + propertyInfo: typeof(SklepPozDok).GetProperty("TypPoz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typPoz.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typPoz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typTowaru = runtimeEntityType.AddProperty( + "TypTowaru", + typeof(short), + propertyInfo: typeof(SklepPozDok).GetProperty("TypTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typTowaru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal), + propertyInfo: typeof(SklepPozDok).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPOZDOK"); + + var idx_SklepPozDokNrPoz = runtimeEntityType.AddIndex( + new[] { sklepId, sklepDokId, nrPozycji }, + name: "idx_SklepPozDokNrPoz"); + + var idx_SklepPozDokTowId = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowId }, + name: "idx_SklepPozDokTowId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPozDok = principalEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPozDok = principalEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPozDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozParEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozParEntityType.cs new file mode 100644 index 0000000..727126b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozParEntityType.cs @@ -0,0 +1,374 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPozParEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozPar", + typeof(SklepPozPar), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepPozPar).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupaGTU = runtimeEntityType.AddProperty( + "GrupaGTU", + typeof(string), + propertyInfo: typeof(SklepPozPar).GetProperty("GrupaGTU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 4, + unicode: false); + grupaGTU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(4)", + size: 4)); + grupaGTU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal?), + propertyInfo: typeof(SklepPozPar).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(SklepPozPar).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rabatKwot = runtimeEntityType.AddProperty( + "RabatKwot", + typeof(decimal?), + propertyInfo: typeof(SklepPozPar).GetProperty("RabatKwot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rabatKwot.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rabatKwot.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rabatKwot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal?), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short?), + propertyInfo: typeof(SklepPozPar).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typPozPar = runtimeEntityType.AddProperty( + "TypPozPar", + typeof(short?), + propertyInfo: typeof(SklepPozPar).GetProperty("TypPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typPozPar.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typPozPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartoscBrutto = runtimeEntityType.AddProperty( + "WartoscBrutto", + typeof(decimal?), + propertyInfo: typeof(SklepPozPar).GetProperty("WartoscBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartoscBrutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartoscBrutto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartoscBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPOZPAR"); + + var idx_SkPozParTow = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowId }, + name: "idx_SkPozParTow"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId") }), + principalEntityType, + required: true); + + var sklepParagon = declaringEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: true, + typeof(SklepParagon), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPozPar = principalEntityType.AddNavigation("SklepPozPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepParagon).GetProperty("SklepPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPozPar = principalEntityType.AddNavigation("SklepPozPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPOZ_REF_SKTOW_SKLEPTOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPozPar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozParSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozParSzczegEntityType.cs new file mode 100644 index 0000000..39ec78f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPozParSzczegEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPozParSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPozParSzczeg", + typeof(SklepPozParSzczeg), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPozParSzczeg).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepPozParSzczeg).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepPozParSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodInfo = runtimeEntityType.AddProperty( + "DodInfo", + typeof(string), + propertyInfo: typeof(SklepPozParSzczeg).GetProperty("DodInfo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + dodInfo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + dodInfo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPOZPARSZCZEG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + unique: true, + required: true); + + var sklepPozPar = declaringEntityType.AddNavigation("SklepPozPar", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozPar), + propertyInfo: typeof(SklepPozParSzczeg).GetProperty("SklepPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPozParSzczeg = principalEntityType.AddNavigation("SklepPozParSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(SklepPozParSzczeg), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepPozParSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPozParSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepProfilEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepProfilEntityType.cs new file mode 100644 index 0000000..fca9f15 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepProfilEntityType.cs @@ -0,0 +1,296 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepProfilEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfil", + typeof(SklepProfil), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepProfil).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepProfilId = runtimeEntityType.AddProperty( + "SklepProfilId", + typeof(decimal), + propertyInfo: typeof(SklepProfil).GetProperty("SklepProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepProfilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepProfilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepProfilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short?), + propertyInfo: typeof(SklepProfil).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepProfil).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var profilId = runtimeEntityType.AddProperty( + "ProfilId", + typeof(decimal?), + propertyInfo: typeof(SklepProfil).GetProperty("ProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + profilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + profilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + profilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepProfil).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzony = runtimeEntityType.AddProperty( + "Utworzony", + typeof(DateTime?), + propertyInfo: typeof(SklepProfil).GetProperty("Utworzony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + utworzony.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzony.AddAnnotation("Relational:ColumnType", "datetime"); + utworzony.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(SklepProfil).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepProfilId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPROFIL"); + + var index = runtimeEntityType.AddIndex( + new[] { profilId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ProfilId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ProfilId") }), + principalEntityType); + + var profil = declaringEntityType.AddNavigation("Profil", + runtimeForeignKey, + onDependent: true, + typeof(Profil), + propertyInfo: typeof(SklepProfil).GetProperty("Profil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepProfil = principalEntityType.AddNavigation("SklepProfil", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Profil).GetProperty("SklepProfil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPROFIL_REFERENCE_PROFIL"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepProfil).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepProfil = principalEntityType.AddNavigation("SklepProfil", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepProfil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPROFIL_REFERENCE_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepProfil"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepProfilKonfigEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepProfilKonfigEntityType.cs new file mode 100644 index 0000000..599fe04 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepProfilKonfigEntityType.cs @@ -0,0 +1,276 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepProfilKonfigEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepProfilKonfig", + typeof(SklepProfilKonfig), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepProfilId = runtimeEntityType.AddProperty( + "SklepProfilId", + typeof(decimal), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("SklepProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepProfilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepProfilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepProfilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parGrupa = runtimeEntityType.AddProperty( + "ParGrupa", + typeof(string), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("ParGrupa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 255, + unicode: false); + parGrupa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parGrupa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 255, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejny = runtimeEntityType.AddProperty( + "Kolejny", + typeof(short), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("Kolejny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzony = runtimeEntityType.AddProperty( + "Utworzony", + typeof(DateTime?), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("Utworzony", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + utworzony.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzony.AddAnnotation("Relational:ColumnType", "datetime"); + utworzony.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(string), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + wartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepProfilId, parGrupa, parNazwa, kolejny }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPROFIL_KONFIG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepProfilId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepProfilId") }), + principalEntityType, + required: true); + + var sklepProfil = declaringEntityType.AddNavigation("SklepProfil", + runtimeForeignKey, + onDependent: true, + typeof(SklepProfil), + propertyInfo: typeof(SklepProfilKonfig).GetProperty("SklepProfil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfilKonfig).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepProfilKonfig = principalEntityType.AddNavigation("SklepProfilKonfig", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepProfil).GetProperty("SklepProfilKonfig", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepProfilKonfig"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPrtMagEntityType.cs new file mode 100644 index 0000000..41934f4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPrtMagEntityType.cs @@ -0,0 +1,586 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepPrtMag", + typeof(SklepPrtMag), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(SklepPrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaSpDet = runtimeEntityType.AddProperty( + "CenaSpDet", + typeof(decimal?), + propertyInfo: typeof(SklepPrtMag).GetProperty("CenaSpDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaSpDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaSpDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaSpDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZak = runtimeEntityType.AddProperty( + "CenaZak", + typeof(decimal), + propertyInfo: typeof(SklepPrtMag).GetProperty("CenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime?), + propertyInfo: typeof(SklepPrtMag).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataWazn = runtimeEntityType.AddProperty( + "DataWazn", + typeof(DateTime?), + propertyInfo: typeof(SklepPrtMag).GetProperty("DataWazn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataWazn.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataWazn.AddAnnotation("Relational:ColumnType", "datetime"); + dataWazn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dostarczono = runtimeEntityType.AddProperty( + "Dostarczono", + typeof(decimal?), + propertyInfo: typeof(SklepPrtMag).GetProperty("Dostarczono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dostarczono.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + dostarczono.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + dostarczono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnyWDniu = runtimeEntityType.AddProperty( + "KolejnyWDniu", + typeof(int?), + propertyInfo: typeof(SklepPrtMag).GetProperty("KolejnyWDniu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kolejnyWDniu.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + kolejnyWDniu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDostawy = runtimeEntityType.AddProperty( + "NrDostawy", + typeof(string), + propertyInfo: typeof(SklepPrtMag).GetProperty("NrDostawy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrDostawy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrDostawy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrPartii = runtimeEntityType.AddProperty( + "NrPartii", + typeof(string), + propertyInfo: typeof(SklepPrtMag).GetProperty("NrPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrPartii.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrPozycji = runtimeEntityType.AddProperty( + "NrPozycji", + typeof(int?), + propertyInfo: typeof(SklepPrtMag).GetProperty("NrPozycji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrPozycji.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + nrPozycji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pozostalo = runtimeEntityType.AddProperty( + "Pozostalo", + typeof(decimal), + propertyInfo: typeof(SklepPrtMag).GetProperty("Pozostalo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + pozostalo.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + pozostalo.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + pozostalo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwacja = runtimeEntityType.AddProperty( + "Rezerwacja", + typeof(decimal?), + propertyInfo: typeof(SklepPrtMag).GetProperty("Rezerwacja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rezerwacja.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rezerwacja.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rezerwacja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal?), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(SklepPrtMag).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(SklepPrtMag).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepPrtMag).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, pMId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPRTMAG"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepMagId }); + + var idx_SkPrtMagFifo = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowId, sklepMagId, data, kolejnyWDniu, pMId }, + name: "idx_SkPrtMagFifo"); + + var idx_SkPrtMagNrPrt = runtimeEntityType.AddIndex( + new[] { nrPartii, sklepId, sklepTowId, pMId }, + name: "idx_SkPrtMagNrPrt"); + + var idx_SkPrtMagZmn = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SkPrtMagZmn"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepMagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepMagId") }), + principalEntityType, + required: true); + + var sklepMagazyn = declaringEntityType.AddNavigation("SklepMagazyn", + runtimeForeignKey, + onDependent: true, + typeof(SklepMagazyn), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepMagazyn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPrtMag = principalEntityType.AddNavigation("SklepPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepMagazyn).GetProperty("SklepPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkPrtMagMagazyn"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepPrtMag = principalEntityType.AddNavigation("SklepPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkPrtMagTowar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPrzydzialEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPrzydzialEntityType.cs new file mode 100644 index 0000000..ce0c2fc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepPrzydzialEntityType.cs @@ -0,0 +1,124 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepPrzydzialEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "SklepPrzydzial", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var asId = runtimeEntityType.AddProperty( + "AsId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + asId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + asId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + asId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, asId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPPRZYDZIAL"); + + var index = runtimeEntityType.AddIndex( + new[] { asId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("AsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("AsId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPRZ_REF_SKLEP_ASORT"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPPRZ_REF_SKLEP_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepPrzydzial"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRapWartPoczDaneEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRapWartPoczDaneEntityType.cs new file mode 100644 index 0000000..cfb09e4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRapWartPoczDaneEntityType.cs @@ -0,0 +1,256 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRapWartPoczDaneEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPoczDane", + typeof(SklepRapWartPoczDane), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRWPId = runtimeEntityType.AddProperty( + "SklepRWPId", + typeof(decimal), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("SklepRWPId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRWPId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRWPId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRWPId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepMagId = runtimeEntityType.AddProperty( + "SklepMagId", + typeof(decimal), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("SklepMagId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepMagId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepMagId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepMagId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(decimal), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + typ.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typ.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var numer = runtimeEntityType.AddProperty( + "Numer", + typeof(short), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("Numer", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + numer.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + numer.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRWPId, sklepMagId, typ, numer }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPRAPWARTPOCZDANE"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepMagId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepMagId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepMagId") }), + principalEntityType, + required: true); + + var sklepMagazyn = declaringEntityType.AddNavigation("SklepMagazyn", + runtimeForeignKey, + onDependent: true, + typeof(SklepMagazyn), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("SklepMagazyn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRapWartPoczDane = principalEntityType.AddNavigation("SklepRapWartPoczDane", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepMagazyn).GetProperty("SklepRapWartPoczDane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepMagazyn).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRWPId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepRWPId") }), + principalEntityType, + required: true); + + var sklepRapWartPocz = declaringEntityType.AddNavigation("SklepRapWartPocz", + runtimeForeignKey, + onDependent: true, + typeof(SklepRapWartPocz), + propertyInfo: typeof(SklepRapWartPoczDane).GetProperty("SklepRapWartPocz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPoczDane).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRapWartPoczDane = principalEntityType.AddNavigation("SklepRapWartPoczDane", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("SklepRapWartPoczDane", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRapWartPoczDane"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRapWartPoczEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRapWartPoczEntityType.cs new file mode 100644 index 0000000..4c94a38 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRapWartPoczEntityType.cs @@ -0,0 +1,357 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRapWartPoczEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRapWartPocz", + typeof(SklepRapWartPocz), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRWPId = runtimeEntityType.AddProperty( + "SklepRWPId", + typeof(decimal), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("SklepRWPId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRWPId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRWPId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRWPId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var data = runtimeEntityType.AddProperty( + "Data", + typeof(DateTime), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Data", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + data.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + data.AddAnnotation("Relational:ColumnType", "datetime"); + data.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(short?), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(short?), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(short?), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param3.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var paramTxt = runtimeEntityType.AddProperty( + "ParamTxt", + typeof(string), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("ParamTxt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + paramTxt.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + paramTxt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typRap = runtimeEntityType.AddProperty( + "TypRap", + typeof(short), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("TypRap", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typRap.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typRap.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(short?), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wersja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wykonano = runtimeEntityType.AddProperty( + "Wykonano", + typeof(DateTime), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Wykonano", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + wykonano.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + wykonano.AddAnnotation("Relational:ColumnType", "datetime"); + wykonano.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRWPId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPRAPWARTPOCZ"); + + var idx_SRWP_TypRapData = runtimeEntityType.AddIndex( + new[] { sklepId, typRap, data }, + name: "idx_SRWP_TypRapData"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepRapWartPocz).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRapWartPocz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRapWartPocz = principalEntityType.AddNavigation("SklepRapWartPocz", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepRapWartPocz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRapWartPocz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaAsortEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaAsortEntityType.cs new file mode 100644 index 0000000..dc037c3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaAsortEntityType.cs @@ -0,0 +1,200 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaAsortEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaAsort", + typeof(SklepRegulaAsort), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaAsort).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaAsort).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepAsId = runtimeEntityType.AddProperty( + "SklepAsId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaAsort).GetProperty("SklepAsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepAsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepAsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepAsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRegulaAsort).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepAsNazwa = runtimeEntityType.AddProperty( + "SklepAsNazwa", + typeof(string), + propertyInfo: typeof(SklepRegulaAsort).GetProperty("SklepAsNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + sklepAsNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + sklepAsNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRegulaId, sklepAsId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULAASORT"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepRegulaId") }), + principalEntityType, + required: true); + + var sklepRegula = declaringEntityType.AddNavigation("SklepRegula", + runtimeForeignKey, + onDependent: true, + typeof(SklepRegula), + propertyInfo: typeof(SklepRegulaAsort).GetProperty("SklepRegula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaAsort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaAsort = principalEntityType.AddNavigation("SklepRegulaAsort", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRegula).GetProperty("SklepRegulaAsort", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaAsort"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaDokEntityType.cs new file mode 100644 index 0000000..d08c664 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaDokEntityType.cs @@ -0,0 +1,447 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDok", + typeof(SklepRegulaDok), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaDok).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaDok).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja = runtimeEntityType.AddProperty( + "Opcja", + typeof(short?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Opcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontoId = runtimeEntityType.AddProperty( + "SklepKontoId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("SklepKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typReguly = runtimeEntityType.AddProperty( + "TypReguly", + typeof(short?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("TypReguly", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typReguly.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typReguly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, sklepRegulaId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULADOK"); + + var index = runtimeEntityType.AddIndex( + new[] { kontoId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType); + + var konto = declaringEntityType.AddNavigation("Konto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(SklepRegulaDok).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaDok = principalEntityType.AddNavigation("SklepRegulaDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("SklepRegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegDokKonto"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepRegulaDok).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaDok = principalEntityType.AddNavigation("SklepRegulaDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepRegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegDokDok"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaDokSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaDokSzczegEntityType.cs new file mode 100644 index 0000000..cbd36b0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaDokSzczegEntityType.cs @@ -0,0 +1,269 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaDokSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaDokSzczeg", + typeof(SklepRegulaDokSzczeg), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(decimal), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + param2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + param2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(string), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + param3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, sklepRegulaId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLREGULADOKSZCZEG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId"), declaringEntityType.FindProperty("SklepRegulaId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("SklepRegulaId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepRegulaDok = declaringEntityType.AddNavigation("SklepRegulaDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepRegulaDok), + propertyInfo: typeof(SklepRegulaDokSzczeg).GetProperty("SklepRegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaDokSzczeg = principalEntityType.AddNavigation("SklepRegulaDokSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRegulaDok).GetProperty("SklepRegulaDokSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklRgDokSzczegSklRgDok"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaDokSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaEntityType.cs new file mode 100644 index 0000000..dd319c2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaEntityType.cs @@ -0,0 +1,627 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegula", + typeof(SklepRegula), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegula).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegula).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepRegula).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(SklepRegula).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzasDo = runtimeEntityType.AddProperty( + "DataCzasDo", + typeof(DateTime?), + propertyInfo: typeof(SklepRegula).GetProperty("DataCzasDo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataCzasDo.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzasDo.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzasDo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzasOd = runtimeEntityType.AddProperty( + "DataCzasOd", + typeof(DateTime?), + propertyInfo: typeof(SklepRegula).GetProperty("DataCzasOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataCzasOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzasOd.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzasOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int1 = runtimeEntityType.AddProperty( + "Int1", + typeof(int?), + propertyInfo: typeof(SklepRegula).GetProperty("Int1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int2 = runtimeEntityType.AddProperty( + "Int2", + typeof(int?), + propertyInfo: typeof(SklepRegula).GetProperty("Int2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int2.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int3 = runtimeEntityType.AddProperty( + "Int3", + typeof(int?), + propertyInfo: typeof(SklepRegula).GetProperty("Int3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int3.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var int4 = runtimeEntityType.AddProperty( + "Int4", + typeof(int?), + propertyInfo: typeof(SklepRegula).GetProperty("Int4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + int4.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + int4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepRegula).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number1 = runtimeEntityType.AddProperty( + "Number1", + typeof(decimal?), + propertyInfo: typeof(SklepRegula).GetProperty("Number1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number1.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number2 = runtimeEntityType.AddProperty( + "Number2", + typeof(decimal?), + propertyInfo: typeof(SklepRegula).GetProperty("Number2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number2.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number3 = runtimeEntityType.AddProperty( + "Number3", + typeof(decimal?), + propertyInfo: typeof(SklepRegula).GetProperty("Number3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number3.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var number4 = runtimeEntityType.AddProperty( + "Number4", + typeof(decimal?), + propertyInfo: typeof(SklepRegula).GetProperty("Number4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + number4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + number4.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + number4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var priorytet = runtimeEntityType.AddProperty( + "Priorytet", + typeof(short), + propertyInfo: typeof(SklepRegula).GetProperty("Priorytet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + priorytet.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + priorytet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var str1 = runtimeEntityType.AddProperty( + "Str1", + typeof(string), + propertyInfo: typeof(SklepRegula).GetProperty("Str1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 128, + unicode: false); + str1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(128)", + size: 128)); + str1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var str2 = runtimeEntityType.AddProperty( + "Str2", + typeof(string), + propertyInfo: typeof(SklepRegula).GetProperty("Str2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 128, + unicode: false); + str2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(128)", + size: 128)); + str2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepRegula).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKarty = runtimeEntityType.AddProperty( + "TypKarty", + typeof(short?), + propertyInfo: typeof(SklepRegula).GetProperty("TypKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typKarty.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var usunieto = runtimeEntityType.AddProperty( + "Usunieto", + typeof(DateTime?), + propertyInfo: typeof(SklepRegula).GetProperty("Usunieto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + usunieto.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + usunieto.AddAnnotation("Relational:ColumnType", "datetime"); + usunieto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzono = runtimeEntityType.AddProperty( + "Utworzono", + typeof(DateTime?), + propertyInfo: typeof(SklepRegula).GetProperty("Utworzono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + utworzono.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzono.AddAnnotation("Relational:ColumnType", "datetime"); + utworzono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepRegula).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRegulaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepRegula).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegula = principalEntityType.AddNavigation("SklepRegula", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepRegula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPREGULA_REFERENCE_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegula"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaKodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaKodEntityType.cs new file mode 100644 index 0000000..aeb81d7 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaKodEntityType.cs @@ -0,0 +1,298 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaKodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaKod", + typeof(SklepRegulaKod), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaKod).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaKod).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(SklepRegulaKod).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRegulaKod).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaKod).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaKod).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var informacja = runtimeEntityType.AddProperty( + "Informacja", + typeof(string), + propertyInfo: typeof(SklepRegulaKod).GetProperty("Informacja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + informacja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + informacja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwaTowaru = runtimeEntityType.AddProperty( + "NazwaTowaru", + typeof(string), + propertyInfo: typeof(SklepRegulaKod).GetProperty("NazwaTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + nazwaTowaru.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwaTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parametr = runtimeEntityType.AddProperty( + "Parametr", + typeof(int?), + propertyInfo: typeof(SklepRegulaKod).GetProperty("Parametr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + parametr.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + parametr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRegulaId, kod, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepRegulaId") }), + principalEntityType, + required: true); + + var sklepRegula = declaringEntityType.AddNavigation("SklepRegula", + runtimeForeignKey, + onDependent: true, + typeof(SklepRegula), + propertyInfo: typeof(SklepRegulaKod).GetProperty("SklepRegula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaKod = principalEntityType.AddNavigation("SklepRegulaKod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRegula).GetProperty("SklepRegulaKod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKL_REGULAKOD_REGULA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaKod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParEntityType.cs new file mode 100644 index 0000000..d99fff2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParEntityType.cs @@ -0,0 +1,447 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaParEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPar", + typeof(SklepRegulaPar), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPar).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPar).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPar).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja = runtimeEntityType.AddProperty( + "Opcja", + typeof(short?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Opcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontoId = runtimeEntityType.AddProperty( + "SklepKontoId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("SklepKontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepKontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typReguly = runtimeEntityType.AddProperty( + "TypReguly", + typeof(short?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("TypReguly", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typReguly.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typReguly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, sklepRegulaId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULAPAR"); + + var index = runtimeEntityType.AddIndex( + new[] { kontoId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType); + + var konto = declaringEntityType.AddNavigation("Konto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(SklepRegulaPar).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaPar = principalEntityType.AddNavigation("SklepRegulaPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("SklepRegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegParKonto"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId") }), + principalEntityType, + required: true); + + var sklepParagon = declaringEntityType.AddNavigation("SklepParagon", + runtimeForeignKey, + onDependent: true, + typeof(SklepParagon), + propertyInfo: typeof(SklepRegulaPar).GetProperty("SklepParagon", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaPar = principalEntityType.AddNavigation("SklepRegulaPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepParagon).GetProperty("SklepRegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepParagon).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegParPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaPar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParSzczegEntityType.cs new file mode 100644 index 0000000..857acaf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParSzczegEntityType.cs @@ -0,0 +1,269 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaParSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParSzczeg", + typeof(SklepRegulaParSzczeg), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(decimal), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + param2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + param2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param3 = runtimeEntityType.AddProperty( + "Param3", + typeof(string), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("Param3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + param3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, sklepRegulaId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLREGULAPARSZCZEG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId"), declaringEntityType.FindProperty("SklepRegulaId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId"), principalEntityType.FindProperty("SklepRegulaId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepRegulaPar = declaringEntityType.AddNavigation("SklepRegulaPar", + runtimeForeignKey, + onDependent: true, + typeof(SklepRegulaPar), + propertyInfo: typeof(SklepRegulaParSzczeg).GetProperty("SklepRegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaParSzczeg = principalEntityType.AddNavigation("SklepRegulaParSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRegulaPar).GetProperty("SklepRegulaParSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklRgParSzczegSklRPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaParSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParamEntityType.cs new file mode 100644 index 0000000..abc6f2d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaParamEntityType.cs @@ -0,0 +1,220 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaParam", + typeof(SklepRegulaParam), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaParam).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaParam).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRegulaParam).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(int?), + propertyInfo: typeof(SklepRegulaParam).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(string), + propertyInfo: typeof(SklepRegulaParam).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + param2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRegulaId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULAPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepRegulaParam).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaParam = principalEntityType.AddNavigation("SklepRegulaParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepRegulaParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPREGULAPA_REFERENCE_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepRegulaId") }), + principalEntityType, + required: true); + + var sklepRegula = declaringEntityType.AddNavigation("SklepRegula", + runtimeForeignKey, + onDependent: true, + typeof(SklepRegula), + propertyInfo: typeof(SklepRegulaParam).GetProperty("SklepRegula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaParam = principalEntityType.AddNavigation("SklepRegulaParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRegula).GetProperty("SklepRegulaParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozDokEntityType.cs new file mode 100644 index 0000000..37c0062 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozDokEntityType.cs @@ -0,0 +1,275 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaPozDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDok", + typeof(SklepRegulaPozDok), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, kolejnosc, sklepRegulaId, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULAPOZDOK"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozDok = declaringEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozDok), + propertyInfo: typeof(SklepRegulaPozDok).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaPozDok = principalEntityType.AddNavigation("SklepRegulaPozDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepRegulaPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegPozPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaPozDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozDokSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozDokSzczegEntityType.cs new file mode 100644 index 0000000..55cb763 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozDokSzczegEntityType.cs @@ -0,0 +1,417 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaPozDokSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozDokSzczeg", + typeof(SklepRegulaPozDokSzczeg), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnoscRegulaDok = runtimeEntityType.AddProperty( + "KolejnoscRegulaDok", + typeof(int), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("KolejnoscRegulaDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnoscRegulaDok.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnoscRegulaDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja1 = runtimeEntityType.AddProperty( + "Opcja1", + typeof(short?), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Opcja1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc1 = runtimeEntityType.AddProperty( + "Wartosc1", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Wartosc1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc4 = runtimeEntityType.AddProperty( + "Wartosc4", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("Wartosc4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc4.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, kolejnosc, sklepRegulaId, typ, kolejnoscRegulaDok }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLREGPOZDOKSZ"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozDok = declaringEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozDok), + propertyInfo: typeof(SklepRegulaPozDokSzczeg).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozDokSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaPozDokSzczeg = principalEntityType.AddNavigation("SklepRegulaPozDokSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepRegulaPozDokSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegPozSzPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaPozDokSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozParEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozParEntityType.cs new file mode 100644 index 0000000..8260387 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozParEntityType.cs @@ -0,0 +1,275 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaPozParEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozPar", + typeof(SklepRegulaPozPar), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, kolejnosc, sklepRegulaId, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULAPOZPAR"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozPar = declaringEntityType.AddNavigation("SklepPozPar", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozPar), + propertyInfo: typeof(SklepRegulaPozPar).GetProperty("SklepPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaPozPar = principalEntityType.AddNavigation("SklepRegulaPozPar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepRegulaPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegPozPar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaPozPar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozParSzczegEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozParSzczegEntityType.cs new file mode 100644 index 0000000..2286315 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaPozParSzczegEntityType.cs @@ -0,0 +1,417 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaPozParSzczegEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaPozParSzczeg", + typeof(SklepRegulaPozParSzczeg), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepParId = runtimeEntityType.AddProperty( + "SklepParId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("SklepParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepParId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepParId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepParId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnoscRegulaPar = runtimeEntityType.AddProperty( + "KolejnoscRegulaPar", + typeof(int), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("KolejnoscRegulaPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnoscRegulaPar.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnoscRegulaPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRegulaId = runtimeEntityType.AddProperty( + "CentrRegulaId", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("CentrRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja1 = runtimeEntityType.AddProperty( + "Opcja1", + typeof(short?), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Opcja1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcja2 = runtimeEntityType.AddProperty( + "Opcja2", + typeof(short?), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Opcja2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opcja2.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opcja2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc1 = runtimeEntityType.AddProperty( + "Wartosc1", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Wartosc1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc1.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc2 = runtimeEntityType.AddProperty( + "Wartosc2", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Wartosc2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc2.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc3 = runtimeEntityType.AddProperty( + "Wartosc3", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Wartosc3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc3.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc3.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc4 = runtimeEntityType.AddProperty( + "Wartosc4", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("Wartosc4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartosc4.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + wartosc4.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + wartosc4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepParId, kolejnosc, sklepRegulaId, typ, kolejnoscRegulaPar }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLREGPOZPARSZ"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepParId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepParId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozPar = declaringEntityType.AddNavigation("SklepPozPar", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozPar), + propertyInfo: typeof(SklepRegulaPozParSzczeg).GetProperty("SklepPozPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaPozParSzczeg).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaPozParSzczeg = principalEntityType.AddNavigation("SklepRegulaPozParSzczeg", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozPar).GetProperty("SklepRegulaPozParSzczeg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozPar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRegPozPSzPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaPozParSzczeg"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaTekstEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaTekstEntityType.cs new file mode 100644 index 0000000..8c7fa66 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaTekstEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaTekstEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTekst", + typeof(SklepRegulaTekst), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaTekst).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaTekst).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRegulaTekst).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepRegulaTekst).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRegulaId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepRegulaId") }), + principalEntityType, + required: true); + + var sklepRegula = declaringEntityType.AddNavigation("SklepRegula", + runtimeForeignKey, + onDependent: true, + typeof(SklepRegula), + propertyInfo: typeof(SklepRegulaTekst).GetProperty("SklepRegula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaTekst = principalEntityType.AddNavigation("SklepRegulaTekst", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRegula).GetProperty("SklepRegulaTekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SkRegulaTekst_SkRegula"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaTekst"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaTowarEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaTowarEntityType.cs new file mode 100644 index 0000000..87dab72 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRegulaTowarEntityType.cs @@ -0,0 +1,276 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRegulaTowarEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRegulaTowar", + typeof(SklepRegulaTowar), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRegulaId = runtimeEntityType.AddProperty( + "SklepRegulaId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("SklepRegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepRegulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepRegulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepRegulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal?), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(16,4)", + precision: 16, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "numeric(16, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parametr = runtimeEntityType.AddProperty( + "Parametr", + typeof(int?), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("Parametr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + parametr.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + parametr.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRegulaId, sklepTowId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPREGULATOWAR"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRegulaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepRegulaId") }), + principalEntityType, + required: true); + + var sklepRegula = declaringEntityType.AddNavigation("SklepRegula", + runtimeForeignKey, + onDependent: true, + typeof(SklepRegula), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("SklepRegula", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaTowar = principalEntityType.AddNavigation("SklepRegulaTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRegula).GetProperty("SklepRegulaTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegula).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPREGULATO_REFERENCE_SKLEPREGULA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepRegulaTowar).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRegulaTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRegulaTowar = principalEntityType.AddNavigation("SklepRegulaTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepRegulaTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRegulaTowar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRolaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRolaEntityType.cs new file mode 100644 index 0000000..1ae6e9f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRolaEntityType.cs @@ -0,0 +1,324 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRolaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRola", + typeof(SklepRola), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRola).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRolaId = runtimeEntityType.AddProperty( + "SklepRolaId", + typeof(short), + propertyInfo: typeof(SklepRola).GetProperty("SklepRolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + sklepRolaId.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + sklepRolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywna = runtimeEntityType.AddProperty( + "Aktywna", + typeof(short), + propertyInfo: typeof(SklepRola).GetProperty("Aktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrRolaId = runtimeEntityType.AddProperty( + "CentrRolaId", + typeof(short?), + propertyInfo: typeof(SklepRola).GetProperty("CentrRolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrRolaId.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + centrRolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslna = runtimeEntityType.AddProperty( + "Domyslna", + typeof(short?), + propertyInfo: typeof(SklepRola).GetProperty("Domyslna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + domyslna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + domyslna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepRola).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var priorytet = runtimeEntityType.AddProperty( + "Priorytet", + typeof(short?), + propertyInfo: typeof(SklepRola).GetProperty("Priorytet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + priorytet.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + priorytet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(SklepRola).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uprawnieniaZRoli = runtimeEntityType.AddProperty( + "UprawnieniaZRoli", + typeof(short?), + propertyInfo: typeof(SklepRola).GetProperty("UprawnieniaZRoli", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uprawnieniaZRoli.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + uprawnieniaZRoli.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepRola).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRolaId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPROLA"); + + var index = runtimeEntityType.AddIndex( + new[] { centrRolaId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("CentrRolaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("RolaId") }), + principalEntityType); + + var centrRola = declaringEntityType.AddNavigation("CentrRola", + runtimeForeignKey, + onDependent: true, + typeof(Rola), + propertyInfo: typeof(SklepRola).GetProperty("CentrRola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRola = principalEntityType.AddNavigation("SklepRola", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Rola).GetProperty("SklepRola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Rola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SklepRolaRola"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepRola).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRola = principalEntityType.AddNavigation("SklepRola", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepRola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SklepRolaSklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRola"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRolaUprawnienieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRolaUprawnienieEntityType.cs new file mode 100644 index 0000000..8759e86 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRolaUprawnienieEntityType.cs @@ -0,0 +1,164 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRolaUprawnienieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRolaUprawnienie", + typeof(SklepRolaUprawnienie), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRolaUprawnienie).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepRolaId = runtimeEntityType.AddProperty( + "SklepRolaId", + typeof(short), + propertyInfo: typeof(SklepRolaUprawnienie).GetProperty("SklepRolaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + sklepRolaId.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + sklepRolaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SklepRolaUprawnienie).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jest = runtimeEntityType.AddProperty( + "Jest", + typeof(short?), + propertyInfo: typeof(SklepRolaUprawnienie).GetProperty("Jest", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + jest.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + jest.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepRolaId, rodzaj }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLROLAUPR"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepRolaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepRolaId") }), + principalEntityType, + required: true); + + var sklepRola = declaringEntityType.AddNavigation("SklepRola", + runtimeForeignKey, + onDependent: true, + typeof(SklepRola), + propertyInfo: typeof(SklepRolaUprawnienie).GetProperty("SklepRola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRolaUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRolaUprawnienie = principalEntityType.AddNavigation("SklepRolaUprawnienie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepRola).GetProperty("SklepRolaUprawnienie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRola).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklRolaUprSklRola"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRolaUprawnienie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozPrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozPrtMagEntityType.cs new file mode 100644 index 0000000..fd8d844 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozPrtMagEntityType.cs @@ -0,0 +1,304 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRozPrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozPrtMag", + typeof(SklepRozPrtMag), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime?), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var iloscPrt = runtimeEntityType.AddProperty( + "IloscPrt", + typeof(decimal?), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("IloscPrt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + iloscPrt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + iloscPrt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + iloscPrt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, pMId, znaczenie, sklepDokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPROZPRTMAG"); + + var idx_SkRozPrtMagPoz = runtimeEntityType.AddIndex( + new[] { sklepId, sklepDokId, kolejnosc, znaczenie, pMId }, + name: "idx_SkRozPrtMagPoz"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozDok = declaringEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozDok), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozPrtMag = principalEntityType.AddNavigation("SklepRozPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepRozPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRozPrtMagPoz"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId"), declaringEntityType.FindProperty("PMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId"), principalEntityType.FindProperty("PMId") }), + principalEntityType, + required: true); + + var sklepPrtMag = declaringEntityType.AddNavigation("SklepPrtMag", + runtimeForeignKey, + onDependent: true, + typeof(SklepPrtMag), + propertyInfo: typeof(SklepRozPrtMag).GetProperty("SklepPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozPrtMag = principalEntityType.AddNavigation("SklepRozPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepRozPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkRozPrtMagPrt"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRozPrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozbicieDodDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozbicieDodDokEntityType.cs new file mode 100644 index 0000000..b62a927 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozbicieDodDokEntityType.cs @@ -0,0 +1,326 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRozbicieDodDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDodDok", + typeof(SklepRozbicieDodDok), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDet = runtimeEntityType.AddProperty( + "NettoDet", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("NettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMag = runtimeEntityType.AddProperty( + "NettoMag", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("NettoMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDet = runtimeEntityType.AddProperty( + "PodatekDet", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("PodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMag = runtimeEntityType.AddProperty( + "PodatekMag", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("PodatekMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, znaczenie, stawka }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLROZBDODDOK"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepRozbicieDodDok).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDodDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozbicieDodDok = principalEntityType.AddNavigation("SklepRozbicieDodDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepRozbicieDodDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepRozbDodDokDok"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRozbicieDodDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozbicieDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozbicieDokEntityType.cs new file mode 100644 index 0000000..6d4cf97 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozbicieDokEntityType.cs @@ -0,0 +1,304 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRozbicieDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozbicieDok", + typeof(SklepRozbicieDok), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var netto = runtimeEntityType.AddProperty( + "Netto", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("Netto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + netto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + netto.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + netto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoDet = runtimeEntityType.AddProperty( + "NettoDet", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("NettoDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nettoDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nettoMag = runtimeEntityType.AddProperty( + "NettoMag", + typeof(decimal?), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("NettoMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nettoMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + nettoMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + nettoMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatek = runtimeEntityType.AddProperty( + "Podatek", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("Podatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatek.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatek.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekDet = runtimeEntityType.AddProperty( + "PodatekDet", + typeof(decimal), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("PodatekDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + podatekDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var podatekMag = runtimeEntityType.AddProperty( + "PodatekMag", + typeof(decimal?), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("PodatekMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + podatekMag.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + podatekMag.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + podatekMag.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, stawka }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPROZBICIEDOK"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepRozbicieDok).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozbicieDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozbicieDok = principalEntityType.AddNavigation("SklepRozbicieDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepRozbicieDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPROZ_REF_SKLEP_SKLEPDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRozbicieDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozlPartiiEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozlPartiiEntityType.cs new file mode 100644 index 0000000..38d75c7 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozlPartiiEntityType.cs @@ -0,0 +1,252 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRozlPartiiEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlPartii", + typeof(SklepRozlPartii), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRozlPartii).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozSklepDokId = runtimeEntityType.AddProperty( + "RozSklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRozlPartii).GetProperty("RozSklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + rozSklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rozSklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rozSklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozKolejnosc = runtimeEntityType.AddProperty( + "RozKolejnosc", + typeof(int), + propertyInfo: typeof(SklepRozlPartii).GetProperty("RozKolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + rozKolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + rozKolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prtSklepDokId = runtimeEntityType.AddProperty( + "PrtSklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRozlPartii).GetProperty("PrtSklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + prtSklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + prtSklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + prtSklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prtKolejnosc = runtimeEntityType.AddProperty( + "PrtKolejnosc", + typeof(int), + propertyInfo: typeof(SklepRozlPartii).GetProperty("PrtKolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + prtKolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + prtKolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczenie = runtimeEntityType.AddProperty( + "Rozliczenie", + typeof(decimal), + propertyInfo: typeof(SklepRozlPartii).GetProperty("Rozliczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rozliczenie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rozliczenie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rozliczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, rozSklepDokId, rozKolejnosc, prtSklepDokId, prtKolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPROZLPARTII"); + + var idx_SkRozPrt = runtimeEntityType.AddIndex( + new[] { sklepId, prtSklepDokId, prtKolejnosc }, + name: "idx_SkRozPrt"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("PrtSklepDokId"), declaringEntityType.FindProperty("PrtKolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPartia = declaringEntityType.AddNavigation("SklepPartia", + runtimeForeignKey, + onDependent: true, + typeof(SklepPartia), + propertyInfo: typeof(SklepRozlPartii).GetProperty("SklepPartia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozlPartii = principalEntityType.AddNavigation("SklepRozlPartii", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPartia).GetProperty("SklepRozlPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPartia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPROZ_REF_SKPRT_SKLEPPAR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("RozSklepDokId"), declaringEntityType.FindProperty("RozKolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozDok = declaringEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozDok), + propertyInfo: typeof(SklepRozlPartii).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlPartii).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozlPartii = principalEntityType.AddNavigation("SklepRozlPartii", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepRozlPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPROZ_REF_SKROZ_SKLEPPOZ"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRozlPartii"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozliczaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozliczaEntityType.cs new file mode 100644 index 0000000..69af2bb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepRozliczaEntityType.cs @@ -0,0 +1,281 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepRozliczaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepRozlicza", + typeof(SklepRozlicza), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepRozlicza).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRozlicza).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepRozlicza).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczanySklepDokId = runtimeEntityType.AddProperty( + "RozliczanySklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepRozlicza).GetProperty("RozliczanySklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rozliczanySklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rozliczanySklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rozliczanySklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczanySklepId = runtimeEntityType.AddProperty( + "RozliczanySklepId", + typeof(decimal), + propertyInfo: typeof(SklepRozlicza).GetProperty("RozliczanySklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rozliczanySklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + rozliczanySklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + rozliczanySklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczenie = runtimeEntityType.AddProperty( + "Rozliczenie", + typeof(decimal), + propertyInfo: typeof(SklepRozlicza).GetProperty("Rozliczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + rozliczenie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rozliczenie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rozliczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozliczeniePodatku = runtimeEntityType.AddProperty( + "RozliczeniePodatku", + typeof(decimal?), + propertyInfo: typeof(SklepRozlicza).GetProperty("RozliczeniePodatku", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rozliczeniePodatku.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + rozliczeniePodatku.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + rozliczeniePodatku.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPROZLICZA"); + + var idx_SkRozliczany = runtimeEntityType.AddIndex( + new[] { rozliczanySklepId, rozliczanySklepDokId }, + name: "idx_SkRozliczany"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("RozliczanySklepId"), declaringEntityType.FindProperty("RozliczanySklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepRozlicza).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozliczaSklepDok = principalEntityType.AddNavigation("SklepRozliczaSklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepRozliczaSklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPROZ_REF_SKKOG_SKLEPDOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDokNavigation = declaringEntityType.AddNavigation("SklepDokNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepRozlicza).GetProperty("SklepDokNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepRozlicza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepRozliczaSklepDokNavigation = principalEntityType.AddNavigation("SklepRozliczaSklepDokNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepRozliczaSklepDokNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPROZ_REF_SKKTO_SKLEPDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepRozlicza"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSkladnikDefinicjiKoduEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSkladnikDefinicjiKoduEntityType.cs new file mode 100644 index 0000000..0bb89de --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSkladnikDefinicjiKoduEntityType.cs @@ -0,0 +1,216 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepSkladnikDefinicjiKoduEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikDefinicjiKodu", + typeof(SklepSkladnikDefinicjiKodu), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepSkladnikDefinicjiKodu).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDKId = runtimeEntityType.AddProperty( + "SklepDKId", + typeof(decimal), + propertyInfo: typeof(SklepSkladnikDefinicjiKodu).GetProperty("SklepDKId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDKId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDKId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDKId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepSkladnikDefinicjiKodu).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dlugosc = runtimeEntityType.AddProperty( + "Dlugosc", + typeof(short), + propertyInfo: typeof(SklepSkladnikDefinicjiKodu).GetProperty("Dlugosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + dlugosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + dlugosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SklepSkladnikDefinicjiKodu).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepSkladnikDefinicjiKodu).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDKId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKSKLDEFKODU"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDKId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDKId") }), + principalEntityType, + required: true); + + var sklepDefinicjaKodu = declaringEntityType.AddNavigation("SklepDefinicjaKodu", + runtimeForeignKey, + onDependent: true, + typeof(SklepDefinicjaKodu), + propertyInfo: typeof(SklepSkladnikDefinicjiKodu).GetProperty("SklepDefinicjaKodu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikDefinicjiKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepSkladnikDefinicjiKodu = principalEntityType.AddNavigation("SklepSkladnikDefinicjiKodu", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDefinicjaKodu).GetProperty("SklepSkladnikDefinicjiKodu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDefinicjaKodu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKSKLDEFKODUDEFDOKU"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepSkladnikDefinicjiKodu"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSkladnikWzorcaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSkladnikWzorcaEntityType.cs new file mode 100644 index 0000000..79f9623 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSkladnikWzorcaEntityType.cs @@ -0,0 +1,433 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepSkladnikWzorcaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepSkladnikWzorca", + typeof(SklepSkladnikWzorca), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepSkWzId = runtimeEntityType.AddProperty( + "SklepSkWzId", + typeof(decimal), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("SklepSkWzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepSkWzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepSkWzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepSkWzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czyDodatek = runtimeEntityType.AddProperty( + "CzyDodatek", + typeof(short?), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("CzyDodatek", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + czyDodatek.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + czyDodatek.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var obowiazkowy = runtimeEntityType.AddProperty( + "Obowiazkowy", + typeof(short), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("Obowiazkowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + obowiazkowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + obowiazkowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rozneCeny = runtimeEntityType.AddProperty( + "RozneCeny", + typeof(short?), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("RozneCeny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rozneCeny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rozneCeny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skWzId = runtimeEntityType.AddProperty( + "SkWzId", + typeof(decimal?), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("SkWzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + skWzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + skWzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + skWzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowIdWzorca = runtimeEntityType.AddProperty( + "SklepTowIdWzorca", + typeof(decimal?), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("SklepTowIdWzorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTowIdWzorca.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowIdWzorca.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowIdWzorca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wyborWielu = runtimeEntityType.AddProperty( + "WyborWielu", + typeof(short?), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("WyborWielu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wyborWielu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wyborWielu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wyliczenieCeny = runtimeEntityType.AddProperty( + "WyliczenieCeny", + typeof(short?), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("WyliczenieCeny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wyliczenieCeny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wyliczenieCeny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepSkWzId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPSKLADNIKWZORCA"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowIdWzorca }); + + var idx_SkSkladnikWzorca_SkTowIdWzorca = runtimeEntityType.AddIndex( + new[] { sklepTowIdWzorca, kolejnosc }, + name: "idx_SkSkladnikWzorca_SkTowIdWzorca"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowIdWzorca") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepSkladnikWzorca = principalEntityType.AddNavigation("SklepSkladnikWzorca", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepSkladnikWzorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepSkladnikWzorca"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSklepEntityType.cs new file mode 100644 index 0000000..cf885d6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSklepEntityType.cs @@ -0,0 +1,124 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "SklepSklep", + typeof(Dictionary), + baseEntityType, + sharedClrType: true, + indexerPropertyInfo: RuntimeEntityType.FindIndexerProperty(typeof(Dictionary)), + propertyBag: true); + + var centralaId = runtimeEntityType.AddProperty( + "CentralaId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + centralaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centralaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centralaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), + afterSaveBehavior: PropertySaveBehavior.Throw); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { centralaId, sklepId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPSKLEP"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("CentralaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPSKL_REF_SKCEN_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPSKL_REF_SKSKL_SKLEP"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepStanPrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepStanPrtMagEntityType.cs new file mode 100644 index 0000000..d5a9d47 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepStanPrtMagEntityType.cs @@ -0,0 +1,234 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepStanPrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepStanPrtMag", + typeof(SklepStanPrtMag), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepStanPrtMag).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepStanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime), + propertyInfo: typeof(SklepStanPrtMag).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepStanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepStanPrtMag).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepStanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(SklepStanPrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepStanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanPrt = runtimeEntityType.AddProperty( + "StanPrt", + typeof(decimal), + propertyInfo: typeof(SklepStanPrtMag).GetProperty("StanPrt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepStanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanPrt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanPrt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanPrt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, dzien, sklepTowId, pMId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPSTANPRTMAG"); + + var idx_SkStanPrt = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowId, pMId, dzien }, + name: "idx_SkStanPrt"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("Dzien") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("Dzien") }), + principalEntityType, + required: true); + + var sklepDzienRozl = declaringEntityType.AddNavigation("SklepDzienRozl", + runtimeForeignKey, + onDependent: true, + typeof(SklepDzienRozl), + propertyInfo: typeof(SklepStanPrtMag).GetProperty("SklepDzienRozl", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepStanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepStanPrtMag = principalEntityType.AddNavigation("SklepStanPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDzienRozl).GetProperty("SklepStanPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkStanPrtDzien"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId"), declaringEntityType.FindProperty("PMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId"), principalEntityType.FindProperty("PMId") }), + principalEntityType, + required: true); + + var sklepPrtMag = declaringEntityType.AddNavigation("SklepPrtMag", + runtimeForeignKey, + onDependent: true, + typeof(SklepPrtMag), + propertyInfo: typeof(SklepStanPrtMag).GetProperty("SklepPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepStanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepStanPrtMag = principalEntityType.AddNavigation("SklepStanPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepStanPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkStanPrtMag"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepStanPrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSzczegPrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSzczegPrtMagEntityType.cs new file mode 100644 index 0000000..dab104a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepSzczegPrtMagEntityType.cs @@ -0,0 +1,200 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepSzczegPrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepSzczegPrtMag", + typeof(SklepSzczegPrtMag), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepSzczegPrtMag).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepSzczegPrtMag).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(SklepSzczegPrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typDanych = runtimeEntityType.AddProperty( + "TypDanych", + typeof(short), + propertyInfo: typeof(SklepSzczegPrtMag).GetProperty("TypDanych", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typDanych.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typDanych.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepSzczegPrtMag).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, pMId, typDanych }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPSZCZEGPRTMAG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId"), declaringEntityType.FindProperty("PMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId"), principalEntityType.FindProperty("PMId") }), + principalEntityType, + required: true); + + var sklepPrtMag = declaringEntityType.AddNavigation("SklepPrtMag", + runtimeForeignKey, + onDependent: true, + typeof(SklepPrtMag), + propertyInfo: typeof(SklepSzczegPrtMag).GetProperty("SklepPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepSzczegPrtMag = principalEntityType.AddNavigation("SklepSzczegPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPrtMag).GetProperty("SklepSzczegPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SklepSzczegPrtMag"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepSzczegPrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstDokEntityType.cs new file mode 100644 index 0000000..0e1312e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstDokEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTekstDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstDok", + typeof(SklepTekstDok), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTekstDok).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepTekstDok).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepTekstDok).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepTekstDok).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTEKSTDOK"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepTekstDok).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTekstDok = principalEntityType.AddNavigation("SklepTekstDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepTekstDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPTEK_REF_SKLEP_SKLEPDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTekstDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstPozEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstPozEntityType.cs new file mode 100644 index 0000000..f640b58 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstPozEntityType.cs @@ -0,0 +1,195 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTekstPozEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstPoz", + typeof(SklepTekstPoz), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTekstPoz).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepTekstPoz).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepTekstPoz).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepTekstPoz).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepTekstPoz).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTEKSTPOZ"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var sklepPozDok = declaringEntityType.AddNavigation("SklepPozDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepPozDok), + propertyInfo: typeof(SklepTekstPoz).GetProperty("SklepPozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTekstPoz = principalEntityType.AddNavigation("SklepTekstPoz", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepPozDok).GetProperty("SklepTekstPoz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepPozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SklepTekstPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTekstPoz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstZgodyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstZgodyEntityType.cs new file mode 100644 index 0000000..295c2e1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTekstZgodyEntityType.cs @@ -0,0 +1,199 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTekstZgodyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTekstZgody", + typeof(SklepTekstZgody), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTekstZgody).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZgId = runtimeEntityType.AddProperty( + "SklepZgId", + typeof(decimal), + propertyInfo: typeof(SklepTekstZgody).GetProperty("SklepZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepZgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(SklepTekstZgody).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(SklepTekstZgody).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepTekstZgody).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepZgId, wersja, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTEKSTZGODY"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepZgId") }), + principalEntityType, + required: true); + + var sklepZgoda = declaringEntityType.AddNavigation("SklepZgoda", + runtimeForeignKey, + onDependent: true, + typeof(SklepZgoda), + propertyInfo: typeof(SklepTekstZgody).GetProperty("SklepZgoda", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTekstZgody = principalEntityType.AddNavigation("SklepTekstZgody", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepZgoda).GetProperty("SklepTekstZgody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKTXTZG_SKZGODA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTekstZgody"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowAkcyzaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowAkcyzaEntityType.cs new file mode 100644 index 0000000..8a368e3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowAkcyzaEntityType.cs @@ -0,0 +1,307 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowAkcyzaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowAkcyza", + typeof(SklepTowAkcyza), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaMax = runtimeEntityType.AddProperty( + "CenaMax", + typeof(decimal?), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("CenaMax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaMax.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaMax.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaMax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileAkcJM = runtimeEntityType.AddProperty( + "IleAkcJM", + typeof(decimal?), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("IleAkcJM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileAkcJM.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileAkcJM.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileAkcJM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodCN = runtimeEntityType.AddProperty( + "KodCN", + typeof(string), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("KodCN", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodCN.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodCN.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklad = runtimeEntityType.AddProperty( + "Sklad", + typeof(decimal?), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("Sklad", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklad.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + sklad.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + sklad.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepGrAkcId = runtimeEntityType.AddProperty( + "SklepGrAkcId", + typeof(decimal), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("SklepGrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepGrAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepGrAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepGrAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWAKCYZA"); + + var idx_SkTowAkcGr = runtimeEntityType.AddIndex( + new[] { sklepId, sklepGrAkcId }, + name: "idx_SkTowAkcGr"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepGrAkcId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepGrAkcId") }), + principalEntityType, + required: true); + + var sklepGrupaAkcyzowa = declaringEntityType.AddNavigation("SklepGrupaAkcyzowa", + runtimeForeignKey, + onDependent: true, + typeof(SklepGrupaAkcyzowa), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("SklepGrupaAkcyzowa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowAkcyza = principalEntityType.AddNavigation("SklepTowAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepGrupaAkcyzowa).GetProperty("SklepTowAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepGrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkAkcTow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowAkcyza).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowAkcyza = principalEntityType.AddNavigation("SklepTowAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkTowAkc"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowAkcyza"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowDodatekEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowDodatekEntityType.cs new file mode 100644 index 0000000..9578f66 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowDodatekEntityType.cs @@ -0,0 +1,317 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowDodatekEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowDodatek", + typeof(SklepTowDodatek), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowDodatek).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowDodatek).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepTowDodatek).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal), + propertyInfo: typeof(SklepTowDodatek).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodSklepTowId = runtimeEntityType.AddProperty( + "DodSklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowDodatek).GetProperty("DodSklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + dodSklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dodSklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dodSklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslny = runtimeEntityType.AddProperty( + "Domyslny", + typeof(short), + propertyInfo: typeof(SklepTowDodatek).GetProperty("Domyslny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal), + propertyInfo: typeof(SklepTowDodatek).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var obowiazkowy = runtimeEntityType.AddProperty( + "Obowiazkowy", + typeof(short), + propertyInfo: typeof(SklepTowDodatek).GetProperty("Obowiazkowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + obowiazkowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + obowiazkowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(short?), + propertyInfo: typeof(SklepTowDodatek).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWDODATEK"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, dodSklepTowId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("DodSklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowDodatek).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowDodatekSklepTowar = principalEntityType.AddNavigation("SklepTowDodatekSklepTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowDodatekSklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkDodTow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowarNavigation = declaringEntityType.AddNavigation("SklepTowarNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowDodatek).GetProperty("SklepTowarNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowDodatekSklepTowarNavigation = principalEntityType.AddNavigation("SklepTowDodatekSklepTowarNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowDodatekSklepTowarNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkTowDod"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowDodatek"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowIntParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowIntParamEntityType.cs new file mode 100644 index 0000000..c5dc538 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowIntParamEntityType.cs @@ -0,0 +1,169 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowIntParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowIntParam", + typeof(SklepTowIntParam), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowIntParam).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowIntParam).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepTowIntParam).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param = runtimeEntityType.AddProperty( + "Param", + typeof(int), + propertyInfo: typeof(SklepTowIntParam).GetProperty("Param", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWINTPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowIntParam).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowIntParam = principalEntityType.AddNavigation("SklepTowIntParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowIntParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SkTowIntParamSkTowar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowIntParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowKodEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowKodEntityType.cs new file mode 100644 index 0000000..bfe5ad4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowKodEntityType.cs @@ -0,0 +1,313 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowKodEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowKod", + typeof(SklepTowKod), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowKod).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowKod).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepTowKod).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWKodzie = runtimeEntityType.AddProperty( + "IleWKodzie", + typeof(decimal?), + propertyInfo: typeof(SklepTowKod).GetProperty("IleWKodzie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileWKodzie.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWKodzie.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWKodzie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(SklepTowKod).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodCentralny = runtimeEntityType.AddProperty( + "KodCentralny", + typeof(short?), + propertyInfo: typeof(SklepTowKod).GetProperty("KodCentralny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kodCentralny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + kodCentralny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short?), + propertyInfo: typeof(SklepTowKod).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prefPLU = runtimeEntityType.AddProperty( + "PrefPLU", + typeof(int?), + propertyInfo: typeof(SklepTowKod).GetProperty("PrefPLU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + prefPLU.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))); + prefPLU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(SklepTowKod).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typKodu = runtimeEntityType.AddProperty( + "TypKodu", + typeof(short), + propertyInfo: typeof(SklepTowKod).GetProperty("TypKodu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typKodu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typKodu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWKOD"); + + var idx_SklepKod = runtimeEntityType.AddIndex( + new[] { kod }, + name: "idx_SklepKod"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowKod).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowKod).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowKod = principalEntityType.AddNavigation("SklepTowKod", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowKod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPTOW_REF_KODSK_SKLEPTOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowKod"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowParWiseBaseEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowParWiseBaseEntityType.cs new file mode 100644 index 0000000..fe331d4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowParWiseBaseEntityType.cs @@ -0,0 +1,233 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowParWiseBaseEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowParWiseBase", + typeof(SklepTowParWiseBase), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowParWiseBase).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowParWiseBase).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(SklepTowParWiseBase).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZasobId = runtimeEntityType.AddProperty( + "SklepZasobId", + typeof(decimal?), + propertyInfo: typeof(SklepTowParWiseBase).GetProperty("SklepZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepZasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepTowParWiseBase).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, parId }); + runtimeEntityType.SetPrimaryKey(key); + + var idx_SklepTowParWB_ParId = runtimeEntityType.AddIndex( + new[] { parId }, + name: "idx_SklepTowParWB_ParId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(ParWiseBase), + propertyInfo: typeof(SklepTowParWiseBase).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowParWiseBase = principalEntityType.AddNavigation("SklepTowParWiseBase", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(ParWiseBase).GetProperty("SklepTowParWiseBase", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepTowParWB_ParId"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowParWiseBase).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowParWiseBase = principalEntityType.AddNavigation("SklepTowParWiseBase", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowParWiseBase", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepTowParWB_SklepTowId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowParWiseBase"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowPowiazanieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowPowiazanieEntityType.cs new file mode 100644 index 0000000..b54f2f2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowPowiazanieEntityType.cs @@ -0,0 +1,202 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowPowiazanieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowPowiazanie", + typeof(SklepTowPowiazanie), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowPowiazanie).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowPowiazanie).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepTowPowiazanie).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var powSklepTowId = runtimeEntityType.AddProperty( + "PowSklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowPowiazanie).GetProperty("PowSklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + powSklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powSklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powSklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWPOWIAZANIE"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, powSklepTowId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("PowSklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowPowiazanie).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowPowiazanieSklepTowar = principalEntityType.AddNavigation("SklepTowPowiazanieSklepTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowPowiazanieSklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkPowTowPow_SkTow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowarNavigation = declaringEntityType.AddNavigation("SklepTowarNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowPowiazanie).GetProperty("SklepTowarNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowPowiazanieSklepTowarNavigation = principalEntityType.AddNavigation("SklepTowPowiazanieSklepTowarNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowPowiazanieSklepTowarNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SkTowPow_SkTow"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowPowiazanie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowStratyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowStratyEntityType.cs new file mode 100644 index 0000000..83591bf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowStratyEntityType.cs @@ -0,0 +1,195 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowStratyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowStraty", + typeof(SklepTowStraty), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowStraty).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowStraty).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var idxRodzStrat = runtimeEntityType.AddProperty( + "IdxRodzStrat", + typeof(short), + propertyInfo: typeof(SklepTowStraty).GetProperty("IdxRodzStrat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + idxRodzStrat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + idxRodzStrat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var normaStrat = runtimeEntityType.AddProperty( + "NormaStrat", + typeof(decimal?), + propertyInfo: typeof(SklepTowStraty).GetProperty("NormaStrat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + normaStrat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + normaStrat.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + normaStrat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odliczanie = runtimeEntityType.AddProperty( + "Odliczanie", + typeof(short?), + propertyInfo: typeof(SklepTowStraty).GetProperty("Odliczanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + odliczanie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + odliczanie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, idxRodzStrat }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWSTRATY"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowStraty).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowStraty = principalEntityType.AddNavigation("SklepTowStraty", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowStraty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKTWSTR_TOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowStraty"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowZamiennikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowZamiennikEntityType.cs new file mode 100644 index 0000000..4242c89 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowZamiennikEntityType.cs @@ -0,0 +1,181 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowZamiennikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZamiennik", + typeof(SklepTowZamiennik), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowZamiennik).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowZamiennik).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZmId = runtimeEntityType.AddProperty( + "SklepZmId", + typeof(decimal), + propertyInfo: typeof(SklepTowZamiennik).GetProperty("SklepZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepZmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWZAMIENNIK"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepZmId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + unique: true, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowZamiennik).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowZamiennik = principalEntityType.AddNavigation("SklepTowZamiennik", + runtimeForeignKey, + onDependent: false, + typeof(SklepTowZamiennik), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowZamiennik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepTowZamiennik_Tow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepZmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepZmId") }), + principalEntityType, + required: true); + + var sklepZamiennik = declaringEntityType.AddNavigation("SklepZamiennik", + runtimeForeignKey, + onDependent: true, + typeof(SklepZamiennik), + propertyInfo: typeof(SklepTowZamiennik).GetProperty("SklepZamiennik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowZamiennik = principalEntityType.AddNavigation("SklepTowZamiennik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepZamiennik).GetProperty("SklepTowZamiennik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepTowZamiennik_Zam"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowZamiennik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowZdjeciaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowZdjeciaEntityType.cs new file mode 100644 index 0000000..decf932 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowZdjeciaEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowZdjeciaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowZdjecia", + typeof(SklepTowZdjecia), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowZdjecia).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowZdjecia).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepTowZdjecia).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZasobId = runtimeEntityType.AddProperty( + "SklepZasobId", + typeof(decimal), + propertyInfo: typeof(SklepTowZdjecia).GetProperty("SklepZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sklepZasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowZdjecia).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowZdjecia = principalEntityType.AddNavigation("SklepTowZdjecia", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowZdjecia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SkTowZdjecia_SkTow"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowZdjecia"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowarEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowarEntityType.cs new file mode 100644 index 0000000..0bc5fb3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowarEntityType.cs @@ -0,0 +1,1774 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowarEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowar", + typeof(SklepTowar), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var akcyzowy = runtimeEntityType.AddProperty( + "Akcyzowy", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("Akcyzowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + akcyzowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + akcyzowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var asortyment = runtimeEntityType.AddProperty( + "Asortyment", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Asortyment", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + asortyment.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + asortyment.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cKU = runtimeEntityType.AddProperty( + "CKU", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("CKU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + cKU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + cKU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena5 = runtimeEntityType.AddProperty( + "Cena5", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("Cena5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena5.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena5.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena6 = runtimeEntityType.AddProperty( + "Cena6", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("Cena6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena6.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena6.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDet = runtimeEntityType.AddProperty( + "CenaDet", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("CenaDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDod = runtimeEntityType.AddProperty( + "CenaDod", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("CenaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDod.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDod.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaEw = runtimeEntityType.AddProperty( + "CenaEw", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("CenaEw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaEw.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaEw.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaEw.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaHurt = runtimeEntityType.AddProperty( + "CenaHurt", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("CenaHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaHurt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaNoc = runtimeEntityType.AddProperty( + "CenaNoc", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("CenaNoc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaNoc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaNoc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaNoc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaOtwarta = runtimeEntityType.AddProperty( + "CenaOtwarta", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("CenaOtwarta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + cenaOtwarta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + cenaOtwarta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrTowId = runtimeEntityType.AddProperty( + "CentrTowId", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("CentrTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var glebokosc = runtimeEntityType.AddProperty( + "Glebokosc", + typeof(int), + propertyInfo: typeof(SklepTowar).GetProperty("Glebokosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + glebokosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + glebokosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupaGTU = runtimeEntityType.AddProperty( + "GrupaGTU", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("GrupaGTU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 3, + unicode: false); + grupaGTU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(3)", + size: 3)); + grupaGTU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var hurtRabat = runtimeEntityType.AddProperty( + "HurtRabat", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("HurtRabat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + hurtRabat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + hurtRabat.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + hurtRabat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWCalosci = runtimeEntityType.AddProperty( + "IleWCalosci", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("IleWCalosci", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ileWCalosci.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWCalosci.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWCalosci.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWOpak = runtimeEntityType.AddProperty( + "IleWOpak", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("IleWOpak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileWOpak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWOpak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWOpak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWZgrzewce = runtimeEntityType.AddProperty( + "IleWZgrzewce", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("IleWZgrzewce", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ileWZgrzewce.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWZgrzewce.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWZgrzewce.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks1 = runtimeEntityType.AddProperty( + "Indeks1", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Indeks1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + indeks1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks2 = runtimeEntityType.AddProperty( + "Indeks2", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Indeks2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + indeks2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jM = runtimeEntityType.AddProperty( + "JM", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("JM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + jM.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + jM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kategoria = runtimeEntityType.AddProperty( + "Kategoria", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Kategoria", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + kategoria.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kategoria.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodCN = runtimeEntityType.AddProperty( + "KodCN", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("KodCN", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodCN.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodCN.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKrajuPochodzenia = runtimeEntityType.AddProperty( + "KodKrajuPochodzenia", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("KodKrajuPochodzenia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + kodKrajuPochodzenia.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kodKrajuPochodzenia.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodSklepu = runtimeEntityType.AddProperty( + "KodSklepu", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("KodSklepu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 30, + unicode: false); + kodSklepu.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(30)", + size: 30)); + kodSklepu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var marza = runtimeEntityType.AddProperty( + "Marza", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("Marza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + marza.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + marza.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + marza.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var maxCenaZak = runtimeEntityType.AddProperty( + "MaxCenaZak", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("MaxCenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + maxCenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + maxCenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + maxCenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minCenaSp = runtimeEntityType.AddProperty( + "MinCenaSp", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("MinCenaSp", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + minCenaSp.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + minCenaSp.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + minCenaSp.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nocNarzut = runtimeEntityType.AddProperty( + "NocNarzut", + typeof(decimal), + propertyInfo: typeof(SklepTowar).GetProperty("NocNarzut", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nocNarzut.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + nocNarzut.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + nocNarzut.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nowoscOd = runtimeEntityType.AddProperty( + "NowoscOd", + typeof(DateTime?), + propertyInfo: typeof(SklepTowar).GetProperty("NowoscOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nowoscOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + nowoscOd.AddAnnotation("Relational:ColumnType", "datetime"); + nowoscOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nowoscPrzez = runtimeEntityType.AddProperty( + "NowoscPrzez", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("NowoscPrzez", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nowoscPrzez.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nowoscPrzez.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDrukarki = runtimeEntityType.AddProperty( + "NrDrukarki", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("NrDrukarki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrDrukarki.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nrDrukarki.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var obslugaPartii = runtimeEntityType.AddProperty( + "ObslugaPartii", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("ObslugaPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + obslugaPartii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + obslugaPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaMarzy = runtimeEntityType.AddProperty( + "OpcjaMarzy", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("OpcjaMarzy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaMarzy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaMarzy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaNarzutu = runtimeEntityType.AddProperty( + "OpcjaNarzutu", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("OpcjaNarzutu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaNarzutu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaNarzutu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaRabatu = runtimeEntityType.AddProperty( + "OpcjaRabatu", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("OpcjaRabatu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaRabatu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaRabatu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis1 = runtimeEntityType.AddProperty( + "Opis1", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Opis1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis2 = runtimeEntityType.AddProperty( + "Opis2", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Opis2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis3 = runtimeEntityType.AddProperty( + "Opis3", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Opis3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis4 = runtimeEntityType.AddProperty( + "Opis4", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Opis4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis4.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var precyzja = runtimeEntityType.AddProperty( + "Precyzja", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("Precyzja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + precyzja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + precyzja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var progPromocji = runtimeEntityType.AddProperty( + "ProgPromocji", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("ProgPromocji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + progPromocji.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + progPromocji.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + progPromocji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przeliczJM = runtimeEntityType.AddProperty( + "PrzeliczJM", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("PrzeliczJM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + przeliczJM.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + przeliczJM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przeznaczenie = runtimeEntityType.AddProperty( + "Przeznaczenie", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("Przeznaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + przeznaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + przeznaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa1 = runtimeEntityType.AddProperty( + "Rezerwa1", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Rezerwa1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + rezerwa1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + rezerwa1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa2 = runtimeEntityType.AddProperty( + "Rezerwa2", + typeof(string), + propertyInfo: typeof(SklepTowar).GetProperty("Rezerwa2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + rezerwa2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + rezerwa2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepArtId = runtimeEntityType.AddProperty( + "SklepArtId", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("SklepArtId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepArtId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepArtId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepArtId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepOpakId = runtimeEntityType.AddProperty( + "SklepOpakId", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("SklepOpakId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepOpakId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepOpakId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepOpakId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepProducent = runtimeEntityType.AddProperty( + "SklepProducent", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("SklepProducent", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepProducent.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepProducent.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepProducent.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sledzPartii = runtimeEntityType.AddProperty( + "SledzPartii", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("SledzPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sledzPartii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + sledzPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var statusZam = runtimeEntityType.AddProperty( + "StatusZam", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("StatusZam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + statusZam.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + statusZam.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var szerokosc = runtimeEntityType.AddProperty( + "Szerokosc", + typeof(int), + propertyInfo: typeof(SklepTowar).GetProperty("Szerokosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + szerokosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + szerokosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tandem = runtimeEntityType.AddProperty( + "Tandem", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("Tandem", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tandem.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + tandem.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termWazn = runtimeEntityType.AddProperty( + "TermWazn", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("TermWazn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + termWazn.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + termWazn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal?), + propertyInfo: typeof(SklepTowar).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typTowaru = runtimeEntityType.AddProperty( + "TypTowaru", + typeof(short), + propertyInfo: typeof(SklepTowar).GetProperty("TypTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typTowaru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ukrycNaKasie = runtimeEntityType.AddProperty( + "UkrycNaKasie", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("UkrycNaKasie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ukrycNaKasie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + ukrycNaKasie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waga = runtimeEntityType.AddProperty( + "Waga", + typeof(int), + propertyInfo: typeof(SklepTowar).GetProperty("Waga", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + waga.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + waga.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wysokosc = runtimeEntityType.AddProperty( + "Wysokosc", + typeof(int), + propertyInfo: typeof(SklepTowar).GetProperty("Wysokosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + wysokosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wysokosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wysylacNaSklepInternetowy = runtimeEntityType.AddProperty( + "WysylacNaSklepInternetowy", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("WysylacNaSklepInternetowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wysylacNaSklepInternetowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wysylacNaSklepInternetowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepTowar).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zywnosc = runtimeEntityType.AddProperty( + "Zywnosc", + typeof(short?), + propertyInfo: typeof(SklepTowar).GetProperty("Zywnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zywnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + zywnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTowId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWAR"); + + var idx_SklepTowArt = runtimeEntityType.AddIndex( + new[] { sklepId, sklepArtId }, + name: "idx_SklepTowArt"); + + var idx_SklepTowProd = runtimeEntityType.AddIndex( + new[] { sklepId, sklepProducent }, + name: "idx_SklepTowProd"); + + var idx_SklepTowSkTow = runtimeEntityType.AddIndex( + new[] { sklepId, towId }, + name: "idx_SklepTowSkTow"); + + var idx_SklepTowTow = runtimeEntityType.AddIndex( + new[] { towId }, + name: "idx_SklepTowTow"); + + var idx_SklepTowZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SklepTowZmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepTowar).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowar = principalEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPTOW_REF_SKLEP_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(SklepTowar).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowar = principalEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPTOW_REF_SKLEP_TOWAR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepArtId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepArtId") }), + principalEntityType); + + var sklepArtykulNavigation = declaringEntityType.AddNavigation("SklepArtykulNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepArtykul), + propertyInfo: typeof(SklepTowar).GetProperty("SklepArtykulNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowarNavigation = principalEntityType.AddNavigation("SklepTowarNavigation", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepArtykul).GetProperty("SklepTowarNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepArtykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPTOW_REF_SKTOW_SKLEPART"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepProducent") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepTowar).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowar = principalEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPTOW_REF_SKLEP_SKLEPKON"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowarSkladnikaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowarSkladnikaEntityType.cs new file mode 100644 index 0000000..e6357ef --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTowarSkladnikaEntityType.cs @@ -0,0 +1,296 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTowarSkladnikaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTowarSkladnika", + typeof(SklepTowarSkladnika), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepSkWzId = runtimeEntityType.AddProperty( + "SklepSkWzId", + typeof(decimal), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("SklepSkWzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepSkWzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepSkWzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepSkWzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowId = runtimeEntityType.AddProperty( + "SklepTowId", + typeof(decimal), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("SklepTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal?), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZKartyTow = runtimeEntityType.AddProperty( + "CenaZKartyTow", + typeof(short?), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("CenaZKartyTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZKartyTow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + cenaZKartyTow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslny = runtimeEntityType.AddProperty( + "Domyslny", + typeof(short?), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("Domyslny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + domyslny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + domyslny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal?), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepSkWzId, sklepTowId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTOWARSKLADNIKA"); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTowId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepSkWzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepSkWzId") }), + principalEntityType, + required: true); + + var sklepSkladnikWzorca = declaringEntityType.AddNavigation("SklepSkladnikWzorca", + runtimeForeignKey, + onDependent: true, + typeof(SklepSkladnikWzorca), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("SklepSkladnikWzorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowarSkladnika = principalEntityType.AddNavigation("SklepTowarSkladnika", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepSkladnikWzorca).GetProperty("SklepTowarSkladnika", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepSkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTowId") }), + principalEntityType, + required: true); + + var sklepTowar = declaringEntityType.AddNavigation("SklepTowar", + runtimeForeignKey, + onDependent: true, + typeof(SklepTowar), + propertyInfo: typeof(SklepTowarSkladnika).GetProperty("SklepTowar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTowarSkladnika = principalEntityType.AddNavigation("SklepTowarSkladnika", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTowar).GetProperty("SklepTowarSkladnika", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTowar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTowarSkladnika"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTrescEmailEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTrescEmailEntityType.cs new file mode 100644 index 0000000..15bab5f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTrescEmailEntityType.cs @@ -0,0 +1,224 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTrescEmailEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmail", + typeof(SklepTrescEmail), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTEId = runtimeEntityType.AddProperty( + "SklepTEId", + typeof(decimal), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepTEId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTEId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTEId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTEId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepTrescEmail).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepTrescEmail).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal?), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepTrescEmail).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTEId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { sklepId, sklepUzId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTrescEmail = principalEntityType.AddNavigation("SklepTrescEmail", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepTrescEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepTrescEmail_Uz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTrescEmail"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTrescEmailTekstEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTrescEmailTekstEntityType.cs new file mode 100644 index 0000000..c6d30a5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTrescEmailTekstEntityType.cs @@ -0,0 +1,194 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTrescEmailTekstEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTrescEmailTekst", + typeof(SklepTrescEmailTekst), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTrescEmailTekst).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTEId = runtimeEntityType.AddProperty( + "SklepTEId", + typeof(decimal), + propertyInfo: typeof(SklepTrescEmailTekst).GetProperty("SklepTEId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTEId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTEId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTEId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(SklepTrescEmailTekst).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepTrescEmailTekst).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tresc = runtimeEntityType.AddProperty( + "Tresc", + typeof(string), + propertyInfo: typeof(SklepTrescEmailTekst).GetProperty("Tresc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tresc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tresc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTEId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTEId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTEId") }), + principalEntityType, + required: true); + + var sklepTrescEmail = declaringEntityType.AddNavigation("SklepTrescEmail", + runtimeForeignKey, + onDependent: true, + typeof(SklepTrescEmail), + propertyInfo: typeof(SklepTrescEmailTekst).GetProperty("SklepTrescEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTrescEmailTekst = principalEntityType.AddNavigation("SklepTrescEmailTekst", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTrescEmail).GetProperty("SklepTrescEmailTekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SklepTrescEmail_Pe"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTrescEmailTekst"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTypOsEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTypOsEntityType.cs new file mode 100644 index 0000000..ffadaba --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepTypOsEntityType.cs @@ -0,0 +1,278 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepTypOsEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepTypOs", + typeof(SklepTypOs), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepTypOs).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTypOsId = runtimeEntityType.AddProperty( + "SklepTypOsId", + typeof(decimal), + propertyInfo: typeof(SklepTypOs).GetProperty("SklepTypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTypOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTypOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTypOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepTypOs).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrTypOsId = runtimeEntityType.AddProperty( + "CentrTypOsId", + typeof(decimal?), + propertyInfo: typeof(SklepTypOs).GetProperty("CentrTypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrTypOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrTypOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrTypOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var komentarz = runtimeEntityType.AddProperty( + "Komentarz", + typeof(string), + propertyInfo: typeof(SklepTypOs).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + komentarz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + komentarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepTypOs).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typOsId = runtimeEntityType.AddProperty( + "TypOsId", + typeof(decimal?), + propertyInfo: typeof(SklepTypOs).GetProperty("TypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepTypOsId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPTYPOS"); + + var idx_SKTYPOS_TYPOS = runtimeEntityType.AddIndex( + new[] { typOsId }, + name: "idx_SKTYPOS_TYPOS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepTypOs).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTypOs = principalEntityType.AddNavigation("SklepTypOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepTypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKTYPOS_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TypOsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TypOsId") }), + principalEntityType); + + var typOs = declaringEntityType.AddNavigation("TypOs", + runtimeForeignKey, + onDependent: true, + typeof(TypOs), + propertyInfo: typeof(SklepTypOs).GetProperty("TypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepTypOs = principalEntityType.AddNavigation("SklepTypOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TypOs).GetProperty("SklepTypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKTYPOS_TYPOS"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepTypOs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepUprawnienieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepUprawnienieEntityType.cs new file mode 100644 index 0000000..4c57583 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepUprawnienieEntityType.cs @@ -0,0 +1,169 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepUprawnienieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepUprawnienie", + typeof(SklepUprawnienie), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepUprawnienie).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal), + propertyInfo: typeof(SklepUprawnienie).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(SklepUprawnienie).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jest = runtimeEntityType.AddProperty( + "Jest", + typeof(short?), + propertyInfo: typeof(SklepUprawnienie).GetProperty("Jest", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + jest.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + jest.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepUzId, rodzaj }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPUPRAWNIENIE"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType, + required: true); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepUprawnienie).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepUprawnienie = principalEntityType.AddNavigation("SklepUprawnienie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepUprawnienie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPUPR_REF_SKUPR_SKLEPUZY"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepUprawnienie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepUzytkownikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepUzytkownikEntityType.cs new file mode 100644 index 0000000..654f486 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepUzytkownikEntityType.cs @@ -0,0 +1,588 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepUzytkownikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepUzytkownik", + typeof(SklepUzytkownik), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var haslo = runtimeEntityType.AddProperty( + "Haslo", + typeof(string), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Haslo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 50, + unicode: false); + haslo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(50)", + size: 50)); + haslo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var hasloPrepaid = runtimeEntityType.AddProperty( + "HasloPrepaid", + typeof(string), + propertyInfo: typeof(SklepUzytkownik).GetProperty("HasloPrepaid", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 100, + unicode: false); + hasloPrepaid.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(100)", + size: 100)); + hasloPrepaid.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var identPrepaid = runtimeEntityType.AddProperty( + "IdentPrepaid", + typeof(string), + propertyInfo: typeof(SklepUzytkownik).GetProperty("IdentPrepaid", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + identPrepaid.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + identPrepaid.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var identyfikator = runtimeEntityType.AddProperty( + "Identyfikator", + typeof(string), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Identyfikator", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + identyfikator.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + identyfikator.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jezyk = runtimeEntityType.AddProperty( + "Jezyk", + typeof(string), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Jezyk", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + jezyk.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + jezyk.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKasjera = runtimeEntityType.AddProperty( + "KodKasjera", + typeof(string), + propertyInfo: typeof(SklepUzytkownik).GetProperty("KodKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodKasjera.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwisko = runtimeEntityType.AddProperty( + "Nazwisko", + typeof(string), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Nazwisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrKasjera = runtimeEntityType.AddProperty( + "NrKasjera", + typeof(short), + propertyInfo: typeof(SklepUzytkownik).GetProperty("NrKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + nrKasjera.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + nrKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrSzuflady = runtimeEntityType.AddProperty( + "NrSzuflady", + typeof(short?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("NrSzuflady", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrSzuflady.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nrSzuflady.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opiekun = runtimeEntityType.AddProperty( + "Opiekun", + typeof(short?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Opiekun", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opiekun.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opiekun.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ostZmianaHasla = runtimeEntityType.AddProperty( + "OstZmianaHasla", + typeof(DateTime?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("OstZmianaHasla", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ostZmianaHasla.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + ostZmianaHasla.AddAnnotation("Relational:ColumnType", "datetime"); + ostZmianaHasla.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rola = runtimeEntityType.AddProperty( + "Rola", + typeof(short?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Rola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rola.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rola.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rolaKasjera = runtimeEntityType.AddProperty( + "RolaKasjera", + typeof(short?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("RolaKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rolaKasjera.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rolaKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepProfilId = runtimeEntityType.AddProperty( + "SklepProfilId", + typeof(decimal?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepProfilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepProfilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepProfilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepUzId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPUZYTKOWNIK"); + + var index = runtimeEntityType.AddIndex( + new[] { uzId }); + + var index0 = runtimeEntityType.AddIndex( + new[] { sklepId, sklepProfilId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepUzytkownik = principalEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPUZY_REF_SKUZ_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(SklepUzytkownik).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepUzytkownik = principalEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepProfilId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepProfilId") }), + principalEntityType); + + var sklepProfil = declaringEntityType.AddNavigation("SklepProfil", + runtimeForeignKey, + onDependent: true, + typeof(SklepProfil), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepProfil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepUzytkownik = principalEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepProfil).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepProfil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepUzytkownik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepWalutaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepWalutaEntityType.cs new file mode 100644 index 0000000..a7c3699 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepWalutaEntityType.cs @@ -0,0 +1,371 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepWalutaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepWaluta", + typeof(SklepWaluta), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepWalId = runtimeEntityType.AddProperty( + "SklepWalId", + typeof(decimal), + propertyInfo: typeof(SklepWaluta).GetProperty("SklepWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(SklepWaluta).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(SklepWaluta).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal), + propertyInfo: typeof(SklepWaluta).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepWaluta).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot1 = runtimeEntityType.AddProperty( + "Skrot1", + typeof(string), + propertyInfo: typeof(SklepWaluta).GetProperty("Skrot1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + skrot1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + skrot1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot100 = runtimeEntityType.AddProperty( + "Skrot100", + typeof(string), + propertyInfo: typeof(SklepWaluta).GetProperty("Skrot100", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + skrot100.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + skrot100.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ukrycNaKasie = runtimeEntityType.AddProperty( + "UkrycNaKasie", + typeof(short?), + propertyInfo: typeof(SklepWaluta).GetProperty("UkrycNaKasie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ukrycNaKasie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + ukrycNaKasie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal?), + propertyInfo: typeof(SklepWaluta).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepWaluta).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepWalId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SK_WALUTA"); + + var idx_SkWal = runtimeEntityType.AddIndex( + new[] { walId }, + name: "idx_SkWal"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepWaluta).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepWaluta = principalEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPWAL_REF_SKWAL_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("WalId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("WalId") }), + principalEntityType); + + var wal = declaringEntityType.AddNavigation("Wal", + runtimeForeignKey, + onDependent: true, + typeof(Waluta), + propertyInfo: typeof(SklepWaluta).GetProperty("Wal", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepWaluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepWaluta = principalEntityType.AddNavigation("SklepWaluta", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Waluta).GetProperty("SklepWaluta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPWAL_REF_SKWAL_WALUTA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepWaluta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZaleznoscEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZaleznoscEntityType.cs new file mode 100644 index 0000000..683de84 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZaleznoscEntityType.cs @@ -0,0 +1,208 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepZaleznoscEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepZaleznosc", + typeof(SklepZaleznosc), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepZaleznosc).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepDokId = runtimeEntityType.AddProperty( + "SklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepZaleznosc).GetProperty("SklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poprzedniSklepDokId = runtimeEntityType.AddProperty( + "PoprzedniSklepDokId", + typeof(decimal), + propertyInfo: typeof(SklepZaleznosc).GetProperty("PoprzedniSklepDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + poprzedniSklepDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + poprzedniSklepDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + poprzedniSklepDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poprzedniSklepId = runtimeEntityType.AddProperty( + "PoprzedniSklepId", + typeof(decimal), + propertyInfo: typeof(SklepZaleznosc).GetProperty("PoprzedniSklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + poprzedniSklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + poprzedniSklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + poprzedniSklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepDokId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPZALEZNOSC"); + + var idx_SklepPoprzedniDokId = runtimeEntityType.AddIndex( + new[] { poprzedniSklepId, poprzedniSklepDokId }, + name: "idx_SklepPoprzedniDokId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PoprzedniSklepId"), declaringEntityType.FindProperty("PoprzedniSklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + required: true); + + var sklepDok = declaringEntityType.AddNavigation("SklepDok", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepZaleznosc).GetProperty("SklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZaleznoscSklepDok = principalEntityType.AddNavigation("SklepZaleznoscSklepDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepDok).GetProperty("SklepZaleznoscSklepDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPZAL_REF_SKDOD_SKLEPDOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepDokId") }), + principalEntityType, + unique: true, + required: true); + + var sklepDokNavigation = declaringEntityType.AddNavigation("SklepDokNavigation", + runtimeForeignKey, + onDependent: true, + typeof(SklepDok), + propertyInfo: typeof(SklepZaleznosc).GetProperty("SklepDokNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZaleznoscSklepDokNavigation = principalEntityType.AddNavigation("SklepZaleznoscSklepDokNavigation", + runtimeForeignKey, + onDependent: false, + typeof(SklepZaleznosc), + propertyInfo: typeof(SklepDok).GetProperty("SklepZaleznoscSklepDokNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKLEPZAL_REF_SKODD_SKLEPDOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepZaleznosc"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZamiennikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZamiennikEntityType.cs new file mode 100644 index 0000000..c773169 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZamiennikEntityType.cs @@ -0,0 +1,151 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepZamiennikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepZamiennik", + typeof(SklepZamiennik), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepZamiennik).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZmId = runtimeEntityType.AddProperty( + "SklepZmId", + typeof(decimal), + propertyInfo: typeof(SklepZamiennik).GetProperty("SklepZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepZmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmId = runtimeEntityType.AddProperty( + "ZmId", + typeof(decimal?), + propertyInfo: typeof(SklepZamiennik).GetProperty("ZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(SklepZamiennik).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepZmId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPZAMIENNIK"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepZamiennik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZasobEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZasobEntityType.cs new file mode 100644 index 0000000..0c89e74 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZasobEntityType.cs @@ -0,0 +1,199 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepZasobEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepZasob", + typeof(SklepZasob), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepZasob).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tabela = runtimeEntityType.AddProperty( + "Tabela", + typeof(short), + propertyInfo: typeof(SklepZasob).GetProperty("Tabela", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + tabela.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tabela.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal), + propertyInfo: typeof(SklepZasob).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(string), + propertyInfo: typeof(SklepZasob).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + typ.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sciezka = runtimeEntityType.AddProperty( + "Sciezka", + typeof(string), + propertyInfo: typeof(SklepZasob).GetProperty("Sciezka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + sciezka.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + sciezka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, tabela, id, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPZASOB"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepZasob).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZasob = principalEntityType.AddNavigation("SklepZasob", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepZasob", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SklepZasobSklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepZasob"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZdarzOsEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZdarzOsEntityType.cs new file mode 100644 index 0000000..62f10d5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZdarzOsEntityType.cs @@ -0,0 +1,462 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepZdarzOsEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOs", + typeof(SklepZdarzOs), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(string), + propertyInfo: typeof(SklepZdarzOs).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 20, + unicode: false); + kiedy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var akcja = runtimeEntityType.AddProperty( + "Akcja", + typeof(short), + propertyInfo: typeof(SklepZdarzOs).GetProperty("Akcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + akcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + akcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDec = runtimeEntityType.AddProperty( + "DataDec", + typeof(DateTime?), + propertyInfo: typeof(SklepZdarzOs).GetProperty("DataDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDec.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDec.AddAnnotation("Relational:ColumnType", "datetime"); + dataDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodPar = runtimeEntityType.AddProperty( + "DodPar", + typeof(string), + propertyInfo: typeof(SklepZdarzOs).GetProperty("DodPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + dodPar.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + dodPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaDec = runtimeEntityType.AddProperty( + "FormaDec", + typeof(short?), + propertyInfo: typeof(SklepZdarzOs).GetProperty("FormaDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + formaDec.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + formaDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nowyStatus = runtimeEntityType.AddProperty( + "NowyStatus", + typeof(short?), + propertyInfo: typeof(SklepZdarzOs).GetProperty("NowyStatus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nowyStatus.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nowyStatus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTypOsId = runtimeEntityType.AddProperty( + "SklepTypOsId", + typeof(decimal?), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepTypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepTypOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTypOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTypOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal?), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZgId = runtimeEntityType.AddProperty( + "SklepZgId", + typeof(decimal?), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepZgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(SklepZdarzOs).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId, kiedy }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPZDARZOS"); + + var idx_SKZDOSUZKIEDY = runtimeEntityType.AddIndex( + new[] { sklepId, sklepUzId, kiedy }, + name: "idx_SKZDOSUZKIEDY"); + + var idx_SKZDOS_OSTDEC = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontrId, sklepZgId, dataDec }, + name: "idx_SKZDOS_OSTDEC"); + + var idx_SKZDOS_OSTZGODA = runtimeEntityType.AddIndex( + new[] { sklepId, sklepKontrId, sklepZgId, kiedy }, + name: "idx_SKZDOS_OSTZGODA"); + + var idx_SKZDOS_SKTPOS = runtimeEntityType.AddIndex( + new[] { sklepId, sklepTypOsId }, + name: "idx_SKZDOS_SKTPOS"); + + var idx_SKZDOS_SKZG = runtimeEntityType.AddIndex( + new[] { sklepId, sklepZgId }, + name: "idx_SKZDOS_SKZG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId") }), + principalEntityType, + required: true); + + var sklepKontr = declaringEntityType.AddNavigation("SklepKontr", + runtimeForeignKey, + onDependent: true, + typeof(SklepKontr), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepKontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZdarzOs = principalEntityType.AddNavigation("SklepZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepKontr).GetProperty("SklepZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepKontr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKZDOS_SKKTH"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepTypOsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepTypOsId") }), + principalEntityType); + + var sklepTypOs = declaringEntityType.AddNavigation("SklepTypOs", + runtimeForeignKey, + onDependent: true, + typeof(SklepTypOs), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepTypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZdarzOs = principalEntityType.AddNavigation("SklepZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepTypOs).GetProperty("SklepZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepTypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKZDOS_SKTPOS"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZdarzOs = principalEntityType.AddNavigation("SklepZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("SklepZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKZDOSUZ"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepZgId") }), + principalEntityType); + + var sklepZgoda = declaringEntityType.AddNavigation("SklepZgoda", + runtimeForeignKey, + onDependent: true, + typeof(SklepZgoda), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepZgoda", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZdarzOs = principalEntityType.AddNavigation("SklepZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepZgoda).GetProperty("SklepZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKZDOS_SKZG"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepZdarzOs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZdarzOsOpisEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZdarzOsOpisEntityType.cs new file mode 100644 index 0000000..51ae2e6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZdarzOsOpisEntityType.cs @@ -0,0 +1,199 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepZdarzOsOpisEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepZdarzOsOpis", + typeof(SklepZdarzOsOpis), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepZdarzOsOpis).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepKontrId = runtimeEntityType.AddProperty( + "SklepKontrId", + typeof(decimal), + propertyInfo: typeof(SklepZdarzOsOpis).GetProperty("SklepKontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepKontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepKontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepKontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(string), + propertyInfo: typeof(SklepZdarzOsOpis).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 20, + unicode: false); + kiedy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(SklepZdarzOsOpis).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SklepZdarzOsOpis).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepKontrId, kiedy, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKZDARZOSOPIS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepKontrId"), declaringEntityType.FindProperty("Kiedy") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepKontrId"), principalEntityType.FindProperty("Kiedy") }), + principalEntityType, + required: true); + + var sklepZdarzOs = declaringEntityType.AddNavigation("SklepZdarzOs", + runtimeForeignKey, + onDependent: true, + typeof(SklepZdarzOs), + propertyInfo: typeof(SklepZdarzOsOpis).GetProperty("SklepZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZdarzOsOpis = principalEntityType.AddNavigation("SklepZdarzOsOpis", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepZdarzOs).GetProperty("SklepZdarzOsOpis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKZDOSOPIS"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepZdarzOsOpis"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZgodaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZgodaEntityType.cs new file mode 100644 index 0000000..4afdeb4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SklepZgodaEntityType.cs @@ -0,0 +1,356 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SklepZgodaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SklepZgoda", + typeof(SklepZgoda), + baseEntityType); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(SklepZgoda).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepZgId = runtimeEntityType.AddProperty( + "SklepZgId", + typeof(decimal), + propertyInfo: typeof(SklepZgoda).GetProperty("SklepZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepZgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepZgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepZgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywna = runtimeEntityType.AddProperty( + "Aktywna", + typeof(short), + propertyInfo: typeof(SklepZgoda).GetProperty("Aktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrZgId = runtimeEntityType.AddProperty( + "CentrZgId", + typeof(decimal?), + propertyInfo: typeof(SklepZgoda).GetProperty("CentrZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrZgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrZgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrZgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var daneOs = runtimeEntityType.AddProperty( + "DaneOs", + typeof(string), + propertyInfo: typeof(SklepZgoda).GetProperty("DaneOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + daneOs.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + daneOs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var komentarz = runtimeEntityType.AddProperty( + "Komentarz", + typeof(string), + propertyInfo: typeof(SklepZgoda).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + komentarz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + komentarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(SklepZgoda).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(SklepZgoda).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zastosowania = runtimeEntityType.AddProperty( + "Zastosowania", + typeof(string), + propertyInfo: typeof(SklepZgoda).GetProperty("Zastosowania", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + zastosowania.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + zastosowania.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zgId = runtimeEntityType.AddProperty( + "ZgId", + typeof(decimal?), + propertyInfo: typeof(SklepZgoda).GetProperty("ZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { sklepId, sklepZgId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SKLEPZGODA"); + + var idx_SKZG_ZGODA = runtimeEntityType.AddIndex( + new[] { zgId }, + name: "idx_SKZG_ZGODA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(SklepZgoda).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZgoda = principalEntityType.AddNavigation("SklepZgoda", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("SklepZgoda", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKZG_SKLEP"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZgId") }), + principalEntityType); + + var zg = declaringEntityType.AddNavigation("Zg", + runtimeForeignKey, + onDependent: true, + typeof(Zgoda), + propertyInfo: typeof(SklepZgoda).GetProperty("Zg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepZgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var sklepZgoda = principalEntityType.AddNavigation("SklepZgoda", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zgoda).GetProperty("SklepZgoda", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SKZG_ZGODA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SklepZgoda"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SprzedazEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SprzedazEntityType.cs new file mode 100644 index 0000000..eb1a304 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SprzedazEntityType.cs @@ -0,0 +1,1400 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SprzedazEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Sprzedaz", + typeof(Sprzedaz), + baseEntityType); + + var towID = runtimeEntityType.AddProperty( + "TowID", + typeof(decimal), + propertyInfo: typeof(Sprzedaz).GetProperty("TowID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towID.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towID.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepID = runtimeEntityType.AddProperty( + "SklepID", + typeof(decimal), + propertyInfo: typeof(Sprzedaz).GetProperty("SklepID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepID.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepID.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czasID = runtimeEntityType.AddProperty( + "CzasID", + typeof(decimal), + propertyInfo: typeof(Sprzedaz).GetProperty("CzasID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + czasID.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + czasID.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + czasID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepTowID = runtimeEntityType.AddProperty( + "SklepTowID", + typeof(decimal), + propertyInfo: typeof(Sprzedaz).GetProperty("SklepTowID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepTowID.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepTowID.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepTowID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaSprzedazyBrutto = runtimeEntityType.AddProperty( + "CenaSprzedazyBrutto", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("CenaSprzedazyBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaSprzedazyBrutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + cenaSprzedazyBrutto.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + cenaSprzedazyBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaSprzedazyNetto = runtimeEntityType.AddProperty( + "CenaSprzedazyNetto", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("CenaSprzedazyNetto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaSprzedazyNetto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + cenaSprzedazyNetto.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + cenaSprzedazyNetto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZakInne = runtimeEntityType.AddProperty( + "CenaZakInne", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("CenaZakInne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZakInne.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + cenaZakInne.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + cenaZakInne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZakPrzes = runtimeEntityType.AddProperty( + "CenaZakPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("CenaZakPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZakPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + cenaZakPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + cenaZakPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZakZakupy = runtimeEntityType.AddProperty( + "CenaZakZakupy", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("CenaZakZakupy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZakZakupy.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + cenaZakZakupy.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + cenaZakZakupy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZakupuNetto = runtimeEntityType.AddProperty( + "CenaZakupuNetto", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("CenaZakupuNetto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZakupuNetto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + cenaZakupuNetto.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + cenaZakupuNetto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilSprzedana = runtimeEntityType.AddProperty( + "IlSprzedana", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlSprzedana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilSprzedana.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilSprzedana.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilSprzedana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilSztTowFakt = runtimeEntityType.AddProperty( + "IlSztTowFakt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlSztTowFakt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilSztTowFakt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilSztTowFakt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilSztTowFakt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilSztTowHurt = runtimeEntityType.AddProperty( + "IlSztTowHurt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlSztTowHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilSztTowHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilSztTowHurt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilSztTowHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilSztTowPar = runtimeEntityType.AddProperty( + "IlSztTowPar", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlSztTowPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilSztTowPar.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilSztTowPar.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilSztTowPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilSztTowPrzes = runtimeEntityType.AddProperty( + "IlSztTowPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlSztTowPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilSztTowPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilSztTowPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilSztTowPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilSztTowRozchody = runtimeEntityType.AddProperty( + "IlSztTowRozchody", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlSztTowRozchody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilSztTowRozchody.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilSztTowRozchody.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilSztTowRozchody.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilTowFakt = runtimeEntityType.AddProperty( + "IlTowFakt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlTowFakt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilTowFakt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilTowFakt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilTowFakt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilTowPar = runtimeEntityType.AddProperty( + "IlTowPar", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlTowPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilTowPar.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilTowPar.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilTowPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilZakInne = runtimeEntityType.AddProperty( + "IlZakInne", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlZakInne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilZakInne.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilZakInne.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilZakInne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilZakPrzes = runtimeEntityType.AddProperty( + "IlZakPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlZakPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilZakPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilZakPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilZakPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilZakZakupy = runtimeEntityType.AddProperty( + "IlZakZakupy", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlZakZakupy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilZakZakupy.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilZakZakupy.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilZakZakupy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilZakupiona = runtimeEntityType.AddProperty( + "IlZakupiona", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("IlZakupiona", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilZakupiona.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + ilZakupiona.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + ilZakupiona.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanTowaru = runtimeEntityType.AddProperty( + "StanTowaru", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("StanTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stanTowaru.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + stanTowaru.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + stanTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var version = runtimeEntityType.AddProperty( + "Version", + typeof(string), + propertyInfo: typeof(Sprzedaz).GetProperty("Version", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + version.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + version.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartNetZapas = runtimeEntityType.AddProperty( + "WartNetZapas", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartNetZapas", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartNetZapas.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartNetZapas.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartNetZapas.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzBrtFakt = runtimeEntityType.AddProperty( + "WartSprzBrtFakt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzBrtFakt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzBrtFakt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzBrtFakt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzBrtFakt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzBrtHurt = runtimeEntityType.AddProperty( + "WartSprzBrtHurt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzBrtHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzBrtHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzBrtHurt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzBrtHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzBrtPar = runtimeEntityType.AddProperty( + "WartSprzBrtPar", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzBrtPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzBrtPar.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzBrtPar.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzBrtPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzBrtPrzes = runtimeEntityType.AddProperty( + "WartSprzBrtPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzBrtPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzBrtPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzBrtPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzBrtPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzBrtRozchody = runtimeEntityType.AddProperty( + "WartSprzBrtRozchody", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzBrtRozchody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzBrtRozchody.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzBrtRozchody.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzBrtRozchody.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzNetFakt = runtimeEntityType.AddProperty( + "WartSprzNetFakt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzNetFakt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzNetFakt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzNetFakt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzNetFakt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzNetHurt = runtimeEntityType.AddProperty( + "WartSprzNetHurt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzNetHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzNetHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzNetHurt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzNetHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzNetPar = runtimeEntityType.AddProperty( + "WartSprzNetPar", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzNetPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzNetPar.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzNetPar.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzNetPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzNetPrzes = runtimeEntityType.AddProperty( + "WartSprzNetPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzNetPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzNetPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzNetPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzNetPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartSprzNetRozchody = runtimeEntityType.AddProperty( + "WartSprzNetRozchody", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartSprzNetRozchody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartSprzNetRozchody.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartSprzNetRozchody.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartSprzNetRozchody.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakBrtFakt = runtimeEntityType.AddProperty( + "WartZakBrtFakt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakBrtFakt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakBrtFakt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakBrtFakt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakBrtFakt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakBrtHurt = runtimeEntityType.AddProperty( + "WartZakBrtHurt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakBrtHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakBrtHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakBrtHurt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakBrtHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakBrtPar = runtimeEntityType.AddProperty( + "WartZakBrtPar", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakBrtPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakBrtPar.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakBrtPar.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakBrtPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakBrtPrzes = runtimeEntityType.AddProperty( + "WartZakBrtPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakBrtPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakBrtPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakBrtPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakBrtPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakBrtRozchody = runtimeEntityType.AddProperty( + "WartZakBrtRozchody", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakBrtRozchody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakBrtRozchody.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakBrtRozchody.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakBrtRozchody.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakInne = runtimeEntityType.AddProperty( + "WartZakInne", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakInne", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakInne.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakInne.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakInne.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakNetFakt = runtimeEntityType.AddProperty( + "WartZakNetFakt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakNetFakt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakNetFakt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakNetFakt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakNetFakt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakNetHurt = runtimeEntityType.AddProperty( + "WartZakNetHurt", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakNetHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakNetHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakNetHurt.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakNetHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakNetPar = runtimeEntityType.AddProperty( + "WartZakNetPar", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakNetPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakNetPar.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakNetPar.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakNetPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakNetPrzes = runtimeEntityType.AddProperty( + "WartZakNetPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakNetPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakNetPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakNetPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakNetPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakNetRozchody = runtimeEntityType.AddProperty( + "WartZakNetRozchody", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakNetRozchody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakNetRozchody.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakNetRozchody.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakNetRozchody.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakPrzes = runtimeEntityType.AddProperty( + "WartZakPrzes", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakPrzes", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakPrzes.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakPrzes.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakPrzes.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartZakZakupy = runtimeEntityType.AddProperty( + "WartZakZakupy", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartZakZakupy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartZakZakupy.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartZakZakupy.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartZakZakupy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartoscSprzedazWCenieZakupu = runtimeEntityType.AddProperty( + "WartoscSprzedazWCenieZakupu", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartoscSprzedazWCenieZakupu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartoscSprzedazWCenieZakupu.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartoscSprzedazWCenieZakupu.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartoscSprzedazWCenieZakupu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartoscSprzedazyBrutto = runtimeEntityType.AddProperty( + "WartoscSprzedazyBrutto", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartoscSprzedazyBrutto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartoscSprzedazyBrutto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartoscSprzedazyBrutto.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartoscSprzedazyBrutto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartoscSprzedazyNetto = runtimeEntityType.AddProperty( + "WartoscSprzedazyNetto", + typeof(decimal?), + propertyInfo: typeof(Sprzedaz).GetProperty("WartoscSprzedazyNetto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sprzedaz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wartoscSprzedazyNetto.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(14,3)", + precision: 14, + scale: 3)); + wartoscSprzedazyNetto.AddAnnotation("Relational:ColumnType", "decimal(14, 3)"); + wartoscSprzedazyNetto.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towID, sklepID, czasID, sklepTowID }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SPRZEDAZ"); + + var sprzedaz_Czas_Sklep_Towar = runtimeEntityType.AddIndex( + new[] { czasID, sklepID, towID }, + name: "Sprzedaz_Czas_Sklep_Towar"); + + var sprzedaz_Czas_Towar_Sklep = runtimeEntityType.AddIndex( + new[] { czasID, towID, sklepID }, + name: "Sprzedaz_Czas_Towar_Sklep"); + + var sprzedaz_Sklep_Towar = runtimeEntityType.AddIndex( + new[] { sklepID, towID }, + name: "Sprzedaz_Sklep_Towar"); + + var sprzedaz_Towar_Sklep = runtimeEntityType.AddIndex( + new[] { towID, sklepID }, + name: "Sprzedaz_Towar_Sklep"); + + var idx_Sprzedaz_SklepId = runtimeEntityType.AddIndex( + new[] { sklepID }, + name: "idx_Sprzedaz_SklepId"); + + var idx_Sprzedaz_TowId = runtimeEntityType.AddIndex( + new[] { towID }, + name: "idx_Sprzedaz_TowId"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Sprzedaz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/StanPrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/StanPrtMagEntityType.cs new file mode 100644 index 0000000..8cc91fb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/StanPrtMagEntityType.cs @@ -0,0 +1,207 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class StanPrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.StanPrtMag", + typeof(StanPrtMag), + baseEntityType); + + var dzien = runtimeEntityType.AddProperty( + "Dzien", + typeof(DateTime), + propertyInfo: typeof(StanPrtMag).GetProperty("Dzien", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dzien.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dzien.AddAnnotation("Relational:ColumnType", "datetime"); + dzien.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(StanPrtMag).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(StanPrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanPrt = runtimeEntityType.AddProperty( + "StanPrt", + typeof(decimal), + propertyInfo: typeof(StanPrtMag).GetProperty("StanPrt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + stanPrt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanPrt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanPrt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dzien, towId, pMId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_STANPRTMAG"); + + var idx_StanPrt = runtimeEntityType.AddIndex( + new[] { towId, pMId, dzien }, + name: "idx_StanPrt"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("Dzien") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("Dzien") }), + principalEntityType, + required: true); + + var dzienNavigation = declaringEntityType.AddNavigation("DzienNavigation", + runtimeForeignKey, + onDependent: true, + typeof(DzienRozl), + propertyInfo: typeof(StanPrtMag).GetProperty("DzienNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var stanPrtMag = principalEntityType.AddNavigation("StanPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(DzienRozl).GetProperty("StanPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(DzienRozl).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_StanPrtDzien"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId"), declaringEntityType.FindProperty("PMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId"), principalEntityType.FindProperty("PMId") }), + principalEntityType, + required: true); + + var prtMag = declaringEntityType.AddNavigation("PrtMag", + runtimeForeignKey, + onDependent: true, + typeof(PrtMag), + propertyInfo: typeof(StanPrtMag).GetProperty("PrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var stanPrtMag = principalEntityType.AddNavigation("StanPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PrtMag).GetProperty("StanPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_StanPrtMag"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "StanPrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/StanZgodyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/StanZgodyEntityType.cs new file mode 100644 index 0000000..70651f3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/StanZgodyEntityType.cs @@ -0,0 +1,302 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class StanZgodyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.StanZgody", + typeof(StanZgody), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(StanZgody).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zgId = runtimeEntityType.AddProperty( + "ZgId", + typeof(decimal), + propertyInfo: typeof(StanZgody).GetProperty("ZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDec = runtimeEntityType.AddProperty( + "DataDec", + typeof(DateTime?), + propertyInfo: typeof(StanZgody).GetProperty("DataDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDec.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDec.AddAnnotation("Relational:ColumnType", "datetime"); + dataDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaDec = runtimeEntityType.AddProperty( + "FormaDec", + typeof(short?), + propertyInfo: typeof(StanZgody).GetProperty("FormaDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + formaDec.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + formaDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(string), + propertyInfo: typeof(StanZgody).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kiedy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(StanZgody).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(StanZgody).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(StanZgody).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, zgId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_STANZGODY"); + + var idx_STZG_ZG = runtimeEntityType.AddIndex( + new[] { zgId }, + name: "idx_STZG_ZG"); + + var idx_STZG_ZMIANA = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_STZG_ZMIANA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(StanZgody).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var stanZgody = principalEntityType.AddNavigation("StanZgody", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("StanZgody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_STZG_KTH"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZgId") }), + principalEntityType, + required: true); + + var zg = declaringEntityType.AddNavigation("Zg", + runtimeForeignKey, + onDependent: true, + typeof(Zgoda), + propertyInfo: typeof(StanZgody).GetProperty("Zg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(StanZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var stanZgody = principalEntityType.AddNavigation("StanZgody", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zgoda).GetProperty("StanZgody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_STZG_ZG"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "StanZgody"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/Struktura_7_3EntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/Struktura_7_3EntityType.cs new file mode 100644 index 0000000..ab2b821 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/Struktura_7_3EntityType.cs @@ -0,0 +1,140 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class Struktura_7_3EntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Struktura_7_3", + typeof(Struktura_7_3), + baseEntityType); + + var modId = runtimeEntityType.AddProperty( + "ModId", + typeof(short), + propertyInfo: typeof(Struktura_7_3).GetProperty("ModId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Struktura_7_3).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + modId.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + modId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(DateTime?), + propertyInfo: typeof(Struktura_7_3).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Struktura_7_3).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kiedy.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + kiedy.AddAnnotation("Relational:ColumnType", "datetime"); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typAplikacji = runtimeEntityType.AddProperty( + "TypAplikacji", + typeof(short?), + propertyInfo: typeof(Struktura_7_3).GetProperty("TypAplikacji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Struktura_7_3).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typAplikacji.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + typAplikacji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(Struktura_7_3).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Struktura_7_3).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { modId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_STRUKTURA_7_3"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Struktura_7_3"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SubsysEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SubsysEntityType.cs new file mode 100644 index 0000000..6934441 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SubsysEntityType.cs @@ -0,0 +1,280 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SubsysEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Subsys", + typeof(Subsys), + baseEntityType); + + var kodSubsys = runtimeEntityType.AddProperty( + "KodSubsys", + typeof(string), + propertyInfo: typeof(Subsys).GetProperty("KodSubsys", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + kodSubsys.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kodSubsys.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDok = runtimeEntityType.AddProperty( + "DataDok", + typeof(DateTime?), + propertyInfo: typeof(Subsys).GetProperty("DataDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDok.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDok.AddAnnotation("Relational:ColumnType", "datetime"); + dataDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslny = runtimeEntityType.AddProperty( + "Domyslny", + typeof(short), + propertyInfo: typeof(Subsys).GetProperty("Domyslny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWZgrzewce = runtimeEntityType.AddProperty( + "IleWZgrzewce", + typeof(decimal?), + propertyInfo: typeof(Subsys).GetProperty("IleWZgrzewce", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileWZgrzewce.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWZgrzewce.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWZgrzewce.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodZgrzewki = runtimeEntityType.AddProperty( + "KodZgrzewki", + typeof(string), + propertyInfo: typeof(Subsys).GetProperty("KodZgrzewki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + kodZgrzewki.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kodZgrzewki.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDok = runtimeEntityType.AddProperty( + "NrDok", + typeof(string), + propertyInfo: typeof(Subsys).GetProperty("NrDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nrDok.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nrDok.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal?), + propertyInfo: typeof(Subsys).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Subsys).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kodSubsys }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SUBSYS"); + + var idx_SubsysTow = runtimeEntityType.AddIndex( + new[] { towId, kodSubsys }, + name: "idx_SubsysTow"); + + var idx_SubsysZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_SubsysZmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(Subsys).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Subsys).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var subsys = principalEntityType.AddNavigation("Subsys", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("Subsys", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_SUBSYS_TOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Subsys"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/SzczegPrtMagEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SzczegPrtMagEntityType.cs new file mode 100644 index 0000000..fb4ba9c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/SzczegPrtMagEntityType.cs @@ -0,0 +1,173 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class SzczegPrtMagEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.SzczegPrtMag", + typeof(SzczegPrtMag), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(SzczegPrtMag).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var pMId = runtimeEntityType.AddProperty( + "PMId", + typeof(decimal), + propertyInfo: typeof(SzczegPrtMag).GetProperty("PMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + pMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + pMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + pMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typDanych = runtimeEntityType.AddProperty( + "TypDanych", + typeof(short), + propertyInfo: typeof(SzczegPrtMag).GetProperty("TypDanych", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + typDanych.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typDanych.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(SzczegPrtMag).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, pMId, typDanych }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_SZCZEGPRTMAG"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId"), declaringEntityType.FindProperty("PMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId"), principalEntityType.FindProperty("PMId") }), + principalEntityType, + required: true); + + var prtMag = declaringEntityType.AddNavigation("PrtMag", + runtimeForeignKey, + onDependent: true, + typeof(PrtMag), + propertyInfo: typeof(SzczegPrtMag).GetProperty("PrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SzczegPrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var szczegPrtMag = principalEntityType.AddNavigation("SzczegPrtMag", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PrtMag).GetProperty("SzczegPrtMag", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PrtMag).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_SzczegPrtMag"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "SzczegPrtMag"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TabelaAkcyzowaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TabelaAkcyzowaEntityType.cs new file mode 100644 index 0000000..54cd550 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TabelaAkcyzowaEntityType.cs @@ -0,0 +1,203 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TabelaAkcyzowaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TabelaAkcyzowa", + typeof(TabelaAkcyzowa), + baseEntityType); + + var grAkcId = runtimeEntityType.AddProperty( + "GrAkcId", + typeof(decimal), + propertyInfo: typeof(TabelaAkcyzowa).GetProperty("GrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TabelaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + grAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odDaty = runtimeEntityType.AddProperty( + "OdDaty", + typeof(DateTime), + propertyInfo: typeof(TabelaAkcyzowa).GetProperty("OdDaty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TabelaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + odDaty.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + odDaty.AddAnnotation("Relational:ColumnType", "datetime"); + odDaty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minStawkaAkc = runtimeEntityType.AddProperty( + "MinStawkaAkc", + typeof(decimal?), + propertyInfo: typeof(TabelaAkcyzowa).GetProperty("MinStawkaAkc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TabelaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + minStawkaAkc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + minStawkaAkc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + minStawkaAkc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var procCenyMax = runtimeEntityType.AddProperty( + "ProcCenyMax", + typeof(decimal?), + propertyInfo: typeof(TabelaAkcyzowa).GetProperty("ProcCenyMax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TabelaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + procCenyMax.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + procCenyMax.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + procCenyMax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawkaAkc = runtimeEntityType.AddProperty( + "StawkaAkc", + typeof(decimal?), + propertyInfo: typeof(TabelaAkcyzowa).GetProperty("StawkaAkc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TabelaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawkaAkc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stawkaAkc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stawkaAkc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { grAkcId, odDaty }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TABELAAKCYZOWA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("GrAkcId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("GrAkcId") }), + principalEntityType, + required: true); + + var grAkc = declaringEntityType.AddNavigation("GrAkc", + runtimeForeignKey, + onDependent: true, + typeof(GrupaAkcyzowa), + propertyInfo: typeof(TabelaAkcyzowa).GetProperty("GrAkc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TabelaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var tabelaAkcyzowa = principalEntityType.AddNavigation("TabelaAkcyzowa", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("TabelaAkcyzowa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_TabAkc"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TabelaAkcyzowa"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstDokEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstDokEntityType.cs new file mode 100644 index 0000000..1a7dd80 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstDokEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TekstDokEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TekstDok", + typeof(TekstDok), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(TekstDok).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(TekstDok).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(TekstDok).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TEKSTDOK"); + + var idx_TekstDokTekstZnaczenie = runtimeEntityType.AddIndex( + new[] { tekst, znaczenie }, + name: "idx_TekstDokTekstZnaczenie"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(TekstDok).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var tekstDok = principalEntityType.AddNavigation("TekstDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("TekstDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TEKSTDOK_REF_TEKST_DOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TekstDok"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstPozEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstPozEntityType.cs new file mode 100644 index 0000000..9ab6136 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstPozEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TekstPozEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TekstPoz", + typeof(TekstPoz), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(TekstPoz).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(TekstPoz).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(TekstPoz).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(TekstPoz).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TEKSTPOZ"); + + var idx_TekstPoz_Znaczenie = runtimeEntityType.AddIndex( + new[] { znaczenie }, + name: "idx_TekstPoz_Znaczenie"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId"), declaringEntityType.FindProperty("Kolejnosc") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId"), principalEntityType.FindProperty("Kolejnosc") }), + principalEntityType, + required: true); + + var pozDok = declaringEntityType.AddNavigation("PozDok", + runtimeForeignKey, + onDependent: true, + typeof(PozDok), + propertyInfo: typeof(TekstPoz).GetProperty("PozDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstPoz).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var tekstPoz = principalEntityType.AddNavigation("TekstPoz", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(PozDok).GetProperty("TekstPoz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(PozDok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_TekstPoz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TekstPoz"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstZgodyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstZgodyEntityType.cs new file mode 100644 index 0000000..c10a4a9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TekstZgodyEntityType.cs @@ -0,0 +1,201 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TekstZgodyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TekstZgody", + typeof(TekstZgody), + baseEntityType); + + var zgId = runtimeEntityType.AddProperty( + "ZgId", + typeof(decimal), + propertyInfo: typeof(TekstZgody).GetProperty("ZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(TekstZgody).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(TekstZgody).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(TekstZgody).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(TekstZgody).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zgId, wersja, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TEKSTZGODY"); + + var idx_TXTZG_ZMIANA = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_TXTZG_ZMIANA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZgId") }), + principalEntityType, + required: true); + + var zg = declaringEntityType.AddNavigation("Zg", + runtimeForeignKey, + onDependent: true, + typeof(Zgoda), + propertyInfo: typeof(TekstZgody).GetProperty("Zg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TekstZgody).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var tekstZgody = principalEntityType.AddNavigation("TekstZgody", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zgoda).GetProperty("TekstZgody", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TXTZG_ZGODA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TekstZgody"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowAkcyzaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowAkcyzaEntityType.cs new file mode 100644 index 0000000..162f7d4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowAkcyzaEntityType.cs @@ -0,0 +1,280 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowAkcyzaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowAkcyza", + typeof(TowAkcyza), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowAkcyza).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(TowAkcyza).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaMax = runtimeEntityType.AddProperty( + "CenaMax", + typeof(decimal?), + propertyInfo: typeof(TowAkcyza).GetProperty("CenaMax", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaMax.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaMax.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaMax.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grAkcId = runtimeEntityType.AddProperty( + "GrAkcId", + typeof(decimal), + propertyInfo: typeof(TowAkcyza).GetProperty("GrAkcId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + grAkcId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + grAkcId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + grAkcId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileAkcJM = runtimeEntityType.AddProperty( + "IleAkcJM", + typeof(decimal?), + propertyInfo: typeof(TowAkcyza).GetProperty("IleAkcJM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ileAkcJM.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileAkcJM.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileAkcJM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodCN = runtimeEntityType.AddProperty( + "KodCN", + typeof(string), + propertyInfo: typeof(TowAkcyza).GetProperty("KodCN", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodCN.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodCN.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklad = runtimeEntityType.AddProperty( + "Sklad", + typeof(decimal?), + propertyInfo: typeof(TowAkcyza).GetProperty("Sklad", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklad.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + sklad.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + sklad.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWAKCYZA"); + + var idx_TowAkcGr = runtimeEntityType.AddIndex( + new[] { grAkcId }, + name: "idx_TowAkcGr"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("GrAkcId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("GrAkcId") }), + principalEntityType, + required: true); + + var grAkc = declaringEntityType.AddNavigation("GrAkc", + runtimeForeignKey, + onDependent: true, + typeof(GrupaAkcyzowa), + propertyInfo: typeof(TowAkcyza).GetProperty("GrAkc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towAkcyza = principalEntityType.AddNavigation("TowAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(GrupaAkcyzowa).GetProperty("TowAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(GrupaAkcyzowa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_AkcTow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowAkcyza).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowAkcyza).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towAkcyza = principalEntityType.AddNavigation("TowAkcyza", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowAkcyza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_TowAkc"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowAkcyza"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowDodatekEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowDodatekEntityType.cs new file mode 100644 index 0000000..2e15fc8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowDodatekEntityType.cs @@ -0,0 +1,290 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowDodatekEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowDodatek", + typeof(TowDodatek), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowDodatek).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(TowDodatek).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal), + propertyInfo: typeof(TowDodatek).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodTowId = runtimeEntityType.AddProperty( + "DodTowId", + typeof(decimal), + propertyInfo: typeof(TowDodatek).GetProperty("DodTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + dodTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dodTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dodTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslny = runtimeEntityType.AddProperty( + "Domyslny", + typeof(short), + propertyInfo: typeof(TowDodatek).GetProperty("Domyslny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + domyslny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + domyslny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal), + propertyInfo: typeof(TowDodatek).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var obowiazkowy = runtimeEntityType.AddProperty( + "Obowiazkowy", + typeof(short), + propertyInfo: typeof(TowDodatek).GetProperty("Obowiazkowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + obowiazkowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + obowiazkowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(short?), + propertyInfo: typeof(TowDodatek).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWDODATEK"); + + var index = runtimeEntityType.AddIndex( + new[] { dodTowId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DodTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var dodTow = declaringEntityType.AddNavigation("DodTow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowDodatek).GetProperty("DodTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towDodatekDodTow = principalEntityType.AddNavigation("TowDodatekDodTow", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowDodatekDodTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_DodTow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowDodatek).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowDodatek).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towDodatekTow = principalEntityType.AddNavigation("TowDodatekTow", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowDodatekTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_TowDod"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowDodatek"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowIntParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowIntParamEntityType.cs new file mode 100644 index 0000000..6c16c46 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowIntParamEntityType.cs @@ -0,0 +1,142 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowIntParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowIntParam", + typeof(TowIntParam), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowIntParam).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(TowIntParam).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param = runtimeEntityType.AddProperty( + "Param", + typeof(int), + propertyInfo: typeof(TowIntParam).GetProperty("Param", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWIntPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowIntParam).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowIntParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towIntParam = principalEntityType.AddNavigation("TowIntParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowIntParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TowIntParamTowar"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowIntParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowKrajEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowKrajEntityType.cs new file mode 100644 index 0000000..81b2ef3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowKrajEntityType.cs @@ -0,0 +1,539 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowKrajEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowKraj", + typeof(TowKraj), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowKraj).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var krajId = runtimeEntityType.AddProperty( + "KrajId", + typeof(decimal), + propertyInfo: typeof(TowKraj).GetProperty("KrajId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + krajId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + krajId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + krajId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDet = runtimeEntityType.AddProperty( + "CenaDet", + typeof(decimal?), + propertyInfo: typeof(TowKraj).GetProperty("CenaDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDod = runtimeEntityType.AddProperty( + "CenaDod", + typeof(decimal?), + propertyInfo: typeof(TowKraj).GetProperty("CenaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaDod.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDod.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaHurt = runtimeEntityType.AddProperty( + "CenaHurt", + typeof(decimal?), + propertyInfo: typeof(TowKraj).GetProperty("CenaHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaHurt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaNoc = runtimeEntityType.AddProperty( + "CenaNoc", + typeof(decimal?), + propertyInfo: typeof(TowKraj).GetProperty("CenaNoc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaNoc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaNoc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaNoc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZak = runtimeEntityType.AddProperty( + "CenaZak", + typeof(decimal?), + propertyInfo: typeof(TowKraj).GetProperty("CenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks1 = runtimeEntityType.AddProperty( + "Indeks1", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Indeks1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + indeks1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks2 = runtimeEntityType.AddProperty( + "Indeks2", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Indeks2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + indeks2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis1 = runtimeEntityType.AddProperty( + "Opis1", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Opis1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis2 = runtimeEntityType.AddProperty( + "Opis2", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Opis2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis3 = runtimeEntityType.AddProperty( + "Opis3", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Opis3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis4 = runtimeEntityType.AddProperty( + "Opis4", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Opis4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + opis4.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(TowKraj).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short?), + propertyInfo: typeof(TowKraj).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(TowKraj).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, krajId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWKRAJ"); + + var idx_KrajTow = runtimeEntityType.AddIndex( + new[] { krajId, towId }, + name: "idx_KrajTow"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KrajId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KrajId") }), + principalEntityType, + required: true); + + var kraj = declaringEntityType.AddNavigation("Kraj", + runtimeForeignKey, + onDependent: true, + typeof(Kraj), + propertyInfo: typeof(TowKraj).GetProperty("Kraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towKraj = principalEntityType.AddNavigation("TowKraj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kraj).GetProperty("TowKraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_KrajTow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowKraj).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowKraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towKraj = principalEntityType.AddNavigation("TowKraj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowKraj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_TowKraj"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowKraj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowParWiseBaseEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowParWiseBaseEntityType.cs new file mode 100644 index 0000000..338913b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowParWiseBaseEntityType.cs @@ -0,0 +1,210 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowParWiseBaseEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowParWiseBase", + typeof(TowParWiseBase), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowParWiseBase).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(TowParWiseBase).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(TowParWiseBase).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zasobId = runtimeEntityType.AddProperty( + "ZasobId", + typeof(decimal?), + propertyInfo: typeof(TowParWiseBase).GetProperty("ZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, parId }); + runtimeEntityType.SetPrimaryKey(key); + + var idx_TowParWB_ParId = runtimeEntityType.AddIndex( + new[] { parId }, + name: "idx_TowParWB_ParId"); + + var idx_TowParWB_ZasobId = runtimeEntityType.AddIndex( + new[] { zasobId }, + name: "idx_TowParWB_ZasobId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(ParWiseBase), + propertyInfo: typeof(TowParWiseBase).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towParWiseBase = principalEntityType.AddNavigation("TowParWiseBase", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(ParWiseBase).GetProperty("TowParWiseBase", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TowParWB_ParId"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowParWiseBase).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowParWiseBase).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towParWiseBase = principalEntityType.AddNavigation("TowParWiseBase", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowParWiseBase", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TowParWB_TowId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowParWiseBase"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowPowiazanieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowPowiazanieEntityType.cs new file mode 100644 index 0000000..b050a24 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowPowiazanieEntityType.cs @@ -0,0 +1,175 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowPowiazanieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowPowiazanie", + typeof(TowPowiazanie), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowPowiazanie).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(TowPowiazanie).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var powTowId = runtimeEntityType.AddProperty( + "PowTowId", + typeof(decimal), + propertyInfo: typeof(TowPowiazanie).GetProperty("PowTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + powTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + powTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + powTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWPOWIAZANIE"); + + var index = runtimeEntityType.AddIndex( + new[] { powTowId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PowTowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var powTow = declaringEntityType.AddNavigation("PowTow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowPowiazanie).GetProperty("PowTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towPowiazaniePowTow = principalEntityType.AddNavigation("TowPowiazaniePowTow", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowPowiazaniePowTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_PowTowPow_Tow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowPowiazanie).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowPowiazanie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towPowiazanieTow = principalEntityType.AddNavigation("TowPowiazanieTow", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowPowiazanieTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_TowPow_Tow"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowPowiazanie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowStratyDlaSklepuEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowStratyDlaSklepuEntityType.cs new file mode 100644 index 0000000..a6837bc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowStratyDlaSklepuEntityType.cs @@ -0,0 +1,203 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowStratyDlaSklepuEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowStratyDlaSklepu", + typeof(TowStratyDlaSklepu), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowStratyDlaSklepu).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStratyDlaSklepu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var idxRodzStrat = runtimeEntityType.AddProperty( + "IdxRodzStrat", + typeof(short), + propertyInfo: typeof(TowStratyDlaSklepu).GetProperty("IdxRodzStrat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStratyDlaSklepu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + idxRodzStrat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + idxRodzStrat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal), + propertyInfo: typeof(TowStratyDlaSklepu).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStratyDlaSklepu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var normaStrat = runtimeEntityType.AddProperty( + "NormaStrat", + typeof(decimal?), + propertyInfo: typeof(TowStratyDlaSklepu).GetProperty("NormaStrat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStratyDlaSklepu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + normaStrat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + normaStrat.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + normaStrat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, idxRodzStrat, sklepId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWSTRATYDLASKLEPU"); + + var idx_TwStrSk = runtimeEntityType.AddIndex( + new[] { sklepId }, + name: "idx_TwStrSk"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType, + required: true); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(TowStratyDlaSklepu).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStratyDlaSklepu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towStratyDlaSklepu = principalEntityType.AddNavigation("TowStratyDlaSklepu", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("TowStratyDlaSklepu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TWSTRSKL_SKL"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId"), declaringEntityType.FindProperty("IdxRodzStrat") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId"), principalEntityType.FindProperty("IdxRodzStrat") }), + principalEntityType, + required: true); + + var towStraty = declaringEntityType.AddNavigation("TowStraty", + runtimeForeignKey, + onDependent: true, + typeof(TowStraty), + propertyInfo: typeof(TowStratyDlaSklepu).GetProperty("TowStraty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStratyDlaSklepu).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towStratyDlaSklepu = principalEntityType.AddNavigation("TowStratyDlaSklepu", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TowStraty).GetProperty("TowStratyDlaSklepu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TWSTRSKL_TWSTR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowStratyDlaSklepu"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowStratyEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowStratyEntityType.cs new file mode 100644 index 0000000..d64498b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowStratyEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowStratyEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowStraty", + typeof(TowStraty), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowStraty).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var idxRodzStrat = runtimeEntityType.AddProperty( + "IdxRodzStrat", + typeof(short), + propertyInfo: typeof(TowStraty).GetProperty("IdxRodzStrat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + idxRodzStrat.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + idxRodzStrat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var normaStrat = runtimeEntityType.AddProperty( + "NormaStrat", + typeof(decimal?), + propertyInfo: typeof(TowStraty).GetProperty("NormaStrat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + normaStrat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + normaStrat.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + normaStrat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var odliczanie = runtimeEntityType.AddProperty( + "Odliczanie", + typeof(short), + propertyInfo: typeof(TowStraty).GetProperty("Odliczanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + odliczanie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + odliczanie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, idxRodzStrat }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWSTRATY"); + + var idx_TwStrRS = runtimeEntityType.AddIndex( + new[] { idxRodzStrat }, + name: "idx_TwStrRS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowStraty).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowStraty).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towStraty = principalEntityType.AddNavigation("TowStraty", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowStraty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TWSTR_TOW"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowStraty"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowWartoscEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowWartoscEntityType.cs new file mode 100644 index 0000000..d1c871a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowWartoscEntityType.cs @@ -0,0 +1,176 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowWartoscEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowWartosc", + typeof(TowWartosc), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowWartosc).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal), + propertyInfo: typeof(TowWartosc).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wartosc = runtimeEntityType.AddProperty( + "Wartosc", + typeof(int), + propertyInfo: typeof(TowWartosc).GetProperty("Wartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + wartosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, parId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWWARTOSC"); + + var idx_TowWartParIdWart = runtimeEntityType.AddIndex( + new[] { parId, wartosc }, + name: "idx_TowWartParIdWart"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ParId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ParId") }), + principalEntityType, + required: true); + + var par = declaringEntityType.AddNavigation("Par", + runtimeForeignKey, + onDependent: true, + typeof(Parametr), + propertyInfo: typeof(TowWartosc).GetProperty("Par", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towWartosc = principalEntityType.AddNavigation("TowWartosc", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Parametr).GetProperty("TowWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Parametr).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWWARTO_REF_PARTO_PARAMETR"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowWartosc).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowWartosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towWartosc = principalEntityType.AddNavigation("TowWartosc", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWWARTO_REF_TOWWA_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowWartosc"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowZamiennikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowZamiennikEntityType.cs new file mode 100644 index 0000000..dc6dae4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowZamiennikEntityType.cs @@ -0,0 +1,154 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowZamiennikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowZamiennik", + typeof(TowZamiennik), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowZamiennik).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmId = runtimeEntityType.AddProperty( + "ZmId", + typeof(decimal), + propertyInfo: typeof(TowZamiennik).GetProperty("ZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + zmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWZAMIENNIK"); + + var index = runtimeEntityType.AddIndex( + new[] { zmId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + unique: true, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowZamiennik).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towZamiennik = principalEntityType.AddNavigation("TowZamiennik", + runtimeForeignKey, + onDependent: false, + typeof(TowZamiennik), + propertyInfo: typeof(Towar).GetProperty("TowZamiennik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TowZamiennik_Tow"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZmId") }), + principalEntityType, + required: true); + + var zm = declaringEntityType.AddNavigation("Zm", + runtimeForeignKey, + onDependent: true, + typeof(Zamiennik), + propertyInfo: typeof(TowZamiennik).GetProperty("Zm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towZamiennik = principalEntityType.AddNavigation("TowZamiennik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zamiennik).GetProperty("TowZamiennik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TowZamiennik_Zam"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowZamiennik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowZdjeciaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowZdjeciaEntityType.cs new file mode 100644 index 0000000..b3d0fb6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowZdjeciaEntityType.cs @@ -0,0 +1,150 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowZdjeciaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowZdjecia", + typeof(TowZdjecia), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowZdjecia).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(TowZdjecia).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zasobId = runtimeEntityType.AddProperty( + "ZasobId", + typeof(decimal), + propertyInfo: typeof(TowZdjecia).GetProperty("ZasobId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + zasobId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zasobId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zasobId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + + var idx_TowZdjecia_ZasobId = runtimeEntityType.AddIndex( + new[] { zasobId }, + name: "idx_TowZdjecia_ZasobId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowZdjecia).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowZdjecia).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towZdjecia = principalEntityType.AddNavigation("TowZdjecia", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowZdjecia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TowZdjecia_TowId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowZdjecia"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowarEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowarEntityType.cs new file mode 100644 index 0000000..1c02c11 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowarEntityType.cs @@ -0,0 +1,2000 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowarEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Towar", + typeof(Towar), + baseEntityType); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var akcyzowy = runtimeEntityType.AddProperty( + "Akcyzowy", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("Akcyzowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + akcyzowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + akcyzowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var artId = runtimeEntityType.AddProperty( + "ArtId", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("ArtId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + artId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + artId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + artId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var asId = runtimeEntityType.AddProperty( + "AsId", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("AsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + asId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + asId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + asId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokCenSp = runtimeEntityType.AddProperty( + "BlokCenSp", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("BlokCenSp", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokCenSp.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokCenSp.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokCenyZak = runtimeEntityType.AddProperty( + "BlokCenyZak", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("BlokCenyZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokCenyZak.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokCenyZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokDostawcow = runtimeEntityType.AddProperty( + "BlokDostawcow", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("BlokDostawcow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokDostawcow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokDostawcow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var blokZmian = runtimeEntityType.AddProperty( + "BlokZmian", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("BlokZmian", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + blokZmian.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + blokZmian.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cKU = runtimeEntityType.AddProperty( + "CKU", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("CKU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + cKU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + cKU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena5 = runtimeEntityType.AddProperty( + "Cena5", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("Cena5", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena5.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena5.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena5.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena6 = runtimeEntityType.AddProperty( + "Cena6", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("Cena6", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena6.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena6.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena6.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDet = runtimeEntityType.AddProperty( + "CenaDet", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("CenaDet", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDet.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDet.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDet.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaDod = runtimeEntityType.AddProperty( + "CenaDod", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("CenaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaDod.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaDod.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaEw = runtimeEntityType.AddProperty( + "CenaEw", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("CenaEw", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaEw.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaEw.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaEw.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaHurt = runtimeEntityType.AddProperty( + "CenaHurt", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("CenaHurt", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaHurt.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaHurt.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaHurt.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaNoc = runtimeEntityType.AddProperty( + "CenaNoc", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("CenaNoc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + cenaNoc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cenaNoc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cenaNoc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaOtwarta = runtimeEntityType.AddProperty( + "CenaOtwarta", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("CenaOtwarta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + cenaOtwarta.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + cenaOtwarta.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrTowId = runtimeEntityType.AddProperty( + "CentrTowId", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("CentrTowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrTowId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrTowId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrTowId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var glebokosc = runtimeEntityType.AddProperty( + "Glebokosc", + typeof(int), + propertyInfo: typeof(Towar).GetProperty("Glebokosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + glebokosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + glebokosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupaGTU = runtimeEntityType.AddProperty( + "GrupaGTU", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("GrupaGTU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 3, + unicode: false); + grupaGTU.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(3)", + size: 3)); + grupaGTU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var hurtRabat = runtimeEntityType.AddProperty( + "HurtRabat", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("HurtRabat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + hurtRabat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + hurtRabat.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + hurtRabat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWCalosci = runtimeEntityType.AddProperty( + "IleWCalosci", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("IleWCalosci", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ileWCalosci.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWCalosci.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWCalosci.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ileWZgrzewce = runtimeEntityType.AddProperty( + "IleWZgrzewce", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("IleWZgrzewce", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + ileWZgrzewce.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ileWZgrzewce.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ileWZgrzewce.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks1 = runtimeEntityType.AddProperty( + "Indeks1", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Indeks1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + indeks1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var indeks2 = runtimeEntityType.AddProperty( + "Indeks2", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Indeks2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + indeks2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + indeks2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jMId = runtimeEntityType.AddProperty( + "JMId", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("JMId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + jMId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + jMId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + jMId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var katId = runtimeEntityType.AddProperty( + "KatId", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("KatId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + katId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + katId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + katId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodCN = runtimeEntityType.AddProperty( + "KodCN", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("KodCN", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodCN.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodCN.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodGlownyCentralny = runtimeEntityType.AddProperty( + "KodGlownyCentralny", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("KodGlownyCentralny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kodGlownyCentralny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + kodGlownyCentralny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodSklepu = runtimeEntityType.AddProperty( + "KodSklepu", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("KodSklepu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 30, + unicode: false); + kodSklepu.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(30)", + size: 30)); + kodSklepu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodZgrzewki = runtimeEntityType.AddProperty( + "KodZgrzewki", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("KodZgrzewki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 20, + unicode: false); + kodZgrzewki.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodZgrzewki.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var krajIdPochodzenia = runtimeEntityType.AddProperty( + "KrajIdPochodzenia", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("KrajIdPochodzenia", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + krajIdPochodzenia.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + krajIdPochodzenia.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + krajIdPochodzenia.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var marza = runtimeEntityType.AddProperty( + "Marza", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("Marza", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + marza.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + marza.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + marza.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var maxCenaZak = runtimeEntityType.AddProperty( + "MaxCenaZak", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("MaxCenaZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + maxCenaZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + maxCenaZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + maxCenaZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var minCenaSp = runtimeEntityType.AddProperty( + "MinCenaSp", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("MinCenaSp", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + minCenaSp.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + minCenaSp.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + minCenaSp.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nocNarzut = runtimeEntityType.AddProperty( + "NocNarzut", + typeof(decimal), + propertyInfo: typeof(Towar).GetProperty("NocNarzut", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + nocNarzut.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + nocNarzut.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + nocNarzut.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nowoscOd = runtimeEntityType.AddProperty( + "NowoscOd", + typeof(DateTime?), + propertyInfo: typeof(Towar).GetProperty("NowoscOd", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nowoscOd.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + nowoscOd.AddAnnotation("Relational:ColumnType", "datetime"); + nowoscOd.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nowoscPrzez = runtimeEntityType.AddProperty( + "NowoscPrzez", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("NowoscPrzez", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nowoscPrzez.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nowoscPrzez.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrDrukarki = runtimeEntityType.AddProperty( + "NrDrukarki", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("NrDrukarki", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrDrukarki.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nrDrukarki.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var obslugaPartii = runtimeEntityType.AddProperty( + "ObslugaPartii", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("ObslugaPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + obslugaPartii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + obslugaPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaMarzy = runtimeEntityType.AddProperty( + "OpcjaMarzy", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("OpcjaMarzy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaMarzy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaMarzy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaNarzutu = runtimeEntityType.AddProperty( + "OpcjaNarzutu", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("OpcjaNarzutu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaNarzutu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaNarzutu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opcjaRabatu = runtimeEntityType.AddProperty( + "OpcjaRabatu", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("OpcjaRabatu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + opcjaRabatu.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + opcjaRabatu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis1 = runtimeEntityType.AddProperty( + "Opis1", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Opis1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis2 = runtimeEntityType.AddProperty( + "Opis2", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Opis2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis3 = runtimeEntityType.AddProperty( + "Opis3", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Opis3", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis3.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis3.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis4 = runtimeEntityType.AddProperty( + "Opis4", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Opis4", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + opis4.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + opis4.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poziomCen = runtimeEntityType.AddProperty( + "PoziomCen", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("PoziomCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + poziomCen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + poziomCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var prefPLU = runtimeEntityType.AddProperty( + "PrefPLU", + typeof(int), + propertyInfo: typeof(Towar).GetProperty("PrefPLU", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + prefPLU.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + prefPLU.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var producent = runtimeEntityType.AddProperty( + "Producent", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("Producent", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + producent.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + producent.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + producent.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var progPromocji = runtimeEntityType.AddProperty( + "ProgPromocji", + typeof(decimal?), + propertyInfo: typeof(Towar).GetProperty("ProgPromocji", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + progPromocji.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + progPromocji.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + progPromocji.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przeliczJM = runtimeEntityType.AddProperty( + "PrzeliczJM", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("PrzeliczJM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + przeliczJM.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + przeliczJM.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var przeznaczenie = runtimeEntityType.AddProperty( + "Przeznaczenie", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("Przeznaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + przeznaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + przeznaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa1 = runtimeEntityType.AddProperty( + "Rezerwa1", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Rezerwa1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + rezerwa1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + rezerwa1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rezerwa2 = runtimeEntityType.AddProperty( + "Rezerwa2", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Rezerwa2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + rezerwa2.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + rezerwa2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot = runtimeEntityType.AddProperty( + "Skrot", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("Skrot", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + skrot.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + skrot.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sledzPartii = runtimeEntityType.AddProperty( + "SledzPartii", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("SledzPartii", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sledzPartii.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + sledzPartii.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var statusZam = runtimeEntityType.AddProperty( + "StatusZam", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("StatusZam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + statusZam.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + statusZam.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var subsysKoduGlownego = runtimeEntityType.AddProperty( + "SubsysKoduGlownego", + typeof(string), + propertyInfo: typeof(Towar).GetProperty("SubsysKoduGlownego", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + subsysKoduGlownego.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + subsysKoduGlownego.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var szerokosc = runtimeEntityType.AddProperty( + "Szerokosc", + typeof(int), + propertyInfo: typeof(Towar).GetProperty("Szerokosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + szerokosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + szerokosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var termWazn = runtimeEntityType.AddProperty( + "TermWazn", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("TermWazn", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + termWazn.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + termWazn.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typTowaru = runtimeEntityType.AddProperty( + "TypTowaru", + typeof(short), + propertyInfo: typeof(Towar).GetProperty("TypTowaru", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typTowaru.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typTowaru.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ukrycNaKasie = runtimeEntityType.AddProperty( + "UkrycNaKasie", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("UkrycNaKasie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ukrycNaKasie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + ukrycNaKasie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var waga = runtimeEntityType.AddProperty( + "Waga", + typeof(int), + propertyInfo: typeof(Towar).GetProperty("Waga", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + waga.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + waga.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wysokosc = runtimeEntityType.AddProperty( + "Wysokosc", + typeof(int), + propertyInfo: typeof(Towar).GetProperty("Wysokosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + wysokosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + wysokosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wysylacNaSklepInternetowy = runtimeEntityType.AddProperty( + "WysylacNaSklepInternetowy", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("WysylacNaSklepInternetowy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wysylacNaSklepInternetowy.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + wysylacNaSklepInternetowy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Towar).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaIstotna = runtimeEntityType.AddProperty( + "ZmianaIstotna", + typeof(DateTime?), + propertyInfo: typeof(Towar).GetProperty("ZmianaIstotna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmianaIstotna.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaIstotna.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaIstotna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmianaTylkoCen = runtimeEntityType.AddProperty( + "ZmianaTylkoCen", + typeof(DateTime?), + propertyInfo: typeof(Towar).GetProperty("ZmianaTylkoCen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmianaTylkoCen.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmianaTylkoCen.AddAnnotation("Relational:ColumnType", "datetime"); + zmianaTylkoCen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zywnosc = runtimeEntityType.AddProperty( + "Zywnosc", + typeof(short?), + propertyInfo: typeof(Towar).GetProperty("Zywnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zywnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + zywnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWAR"); + + var index = runtimeEntityType.AddIndex( + new[] { krajIdPochodzenia }); + + var idx_TowArtId = runtimeEntityType.AddIndex( + new[] { artId }, + name: "idx_TowArtId"); + + var idx_TowAsId = runtimeEntityType.AddIndex( + new[] { asId }, + name: "idx_TowAsId"); + + var idx_TowCKU = runtimeEntityType.AddIndex( + new[] { cKU }, + name: "idx_TowCKU"); + + var idx_TowJMId = runtimeEntityType.AddIndex( + new[] { jMId }, + name: "idx_TowJMId"); + + var idx_TowKatId = runtimeEntityType.AddIndex( + new[] { katId }, + name: "idx_TowKatId"); + + var idx_TowKod = runtimeEntityType.AddIndex( + new[] { kod }, + name: "idx_TowKod"); + + var idx_TowKodZgrzewki = runtimeEntityType.AddIndex( + new[] { kodZgrzewki }, + name: "idx_TowKodZgrzewki"); + + var idx_TowProducent = runtimeEntityType.AddIndex( + new[] { producent }, + name: "idx_TowProducent"); + + var idx_TowSkrot = runtimeEntityType.AddIndex( + new[] { skrot }, + name: "idx_TowSkrot"); + + var idx_TowZmiana = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_TowZmiana"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ArtId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ArtId") }), + principalEntityType); + + var art = declaringEntityType.AddNavigation("Art", + runtimeForeignKey, + onDependent: true, + typeof(Artykul), + propertyInfo: typeof(Towar).GetProperty("Art", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towar = principalEntityType.AddNavigation("Towar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Artykul).GetProperty("Towar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Artykul).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWAR_REF_TOWAR_ARTYKUL"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("AsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("AsId") }), + principalEntityType, + required: true); + + var @as = declaringEntityType.AddNavigation("As", + runtimeForeignKey, + onDependent: true, + typeof(Asort), + propertyInfo: typeof(Towar).GetProperty("As", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towar = principalEntityType.AddNavigation("Towar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Asort).GetProperty("Towar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Asort).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWAR_REF_TOWAS_ASORT"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("JMId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("JMId") }), + principalEntityType, + required: true); + + var jM = declaringEntityType.AddNavigation("JM", + runtimeForeignKey, + onDependent: true, + typeof(JM), + propertyInfo: typeof(Towar).GetProperty("JM", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towar = principalEntityType.AddNavigation("Towar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(JM).GetProperty("Towar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(JM).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWAR_REF_TOWJM_JM"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KatId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KatId") }), + principalEntityType); + + var kat = declaringEntityType.AddNavigation("Kat", + runtimeForeignKey, + onDependent: true, + typeof(Kategoria), + propertyInfo: typeof(Towar).GetProperty("Kat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towar = principalEntityType.AddNavigation("Towar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kategoria).GetProperty("Towar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kategoria).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWAR_REF_TOWKA_KATEGORI"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey5(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KrajIdPochodzenia") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KrajId") }), + principalEntityType); + + var krajIdPochodzeniaNavigation = declaringEntityType.AddNavigation("KrajIdPochodzeniaNavigation", + runtimeForeignKey, + onDependent: true, + typeof(Kraj), + propertyInfo: typeof(Towar).GetProperty("KrajIdPochodzeniaNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towar = principalEntityType.AddNavigation("Towar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kraj).GetProperty("Towar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kraj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ref_TowarKrajPochodzenia"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey6(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("Producent") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType); + + var producentNavigation = declaringEntityType.AddNavigation("ProducentNavigation", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(Towar).GetProperty("ProducentNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towar = principalEntityType.AddNavigation("Towar", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("Towar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWAR_REF_PRODU_KONTRAHE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Towar"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowarSkladnikaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowarSkladnikaEntityType.cs new file mode 100644 index 0000000..013931a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TowarSkladnikaEntityType.cs @@ -0,0 +1,273 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TowarSkladnikaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TowarSkladnika", + typeof(TowarSkladnika), + baseEntityType); + + var skWzId = runtimeEntityType.AddProperty( + "SkWzId", + typeof(decimal), + propertyInfo: typeof(TowarSkladnika).GetProperty("SkWzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + skWzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + skWzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + skWzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var towId = runtimeEntityType.AddProperty( + "TowId", + typeof(decimal), + propertyInfo: typeof(TowarSkladnika).GetProperty("TowId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + towId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + towId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cena = runtimeEntityType.AddProperty( + "Cena", + typeof(decimal?), + propertyInfo: typeof(TowarSkladnika).GetProperty("Cena", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cena.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + cena.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + cena.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var cenaZKartyTow = runtimeEntityType.AddProperty( + "CenaZKartyTow", + typeof(short?), + propertyInfo: typeof(TowarSkladnika).GetProperty("CenaZKartyTow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + cenaZKartyTow.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + cenaZKartyTow.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var domyslny = runtimeEntityType.AddProperty( + "Domyslny", + typeof(short?), + propertyInfo: typeof(TowarSkladnika).GetProperty("Domyslny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + domyslny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + domyslny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ilosc = runtimeEntityType.AddProperty( + "Ilosc", + typeof(decimal?), + propertyInfo: typeof(TowarSkladnika).GetProperty("Ilosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ilosc.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + ilosc.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + ilosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(TowarSkladnika).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { skWzId, towId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TOWARSKLADNIKA"); + + var index = runtimeEntityType.AddIndex( + new[] { towId }); + + var idx_TowarSkladniaka = runtimeEntityType.AddIndex( + new[] { skWzId }, + name: "idx_TowarSkladniaka"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SkWzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SkWzId") }), + principalEntityType, + required: true); + + var skWz = declaringEntityType.AddNavigation("SkWz", + runtimeForeignKey, + onDependent: true, + typeof(SkladnikWzorca), + propertyInfo: typeof(TowarSkladnika).GetProperty("SkWz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towarSkladnika = principalEntityType.AddNavigation("TowarSkladnika", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SkladnikWzorca).GetProperty("TowarSkladnika", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SkladnikWzorca).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TowId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TowId") }), + principalEntityType, + required: true); + + var tow = declaringEntityType.AddNavigation("Tow", + runtimeForeignKey, + onDependent: true, + typeof(Towar), + propertyInfo: typeof(TowarSkladnika).GetProperty("Tow", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TowarSkladnika).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var towarSkladnika = principalEntityType.AddNavigation("TowarSkladnika", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Towar).GetProperty("TowarSkladnika", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Towar).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TOWARSKLADNIKA_REFERENCE_TOWAR"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TowarSkladnika"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TrescEmailEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TrescEmailEntityType.cs new file mode 100644 index 0000000..74c0a2b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TrescEmailEntityType.cs @@ -0,0 +1,198 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TrescEmailEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmail", + typeof(TrescEmail), + baseEntityType); + + var tEId = runtimeEntityType.AddProperty( + "TEId", + typeof(decimal), + propertyInfo: typeof(TrescEmail).GetProperty("TEId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + tEId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tEId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tEId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(TrescEmail).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(TrescEmail).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal?), + propertyInfo: typeof(TrescEmail).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(TrescEmail).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { tEId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { uzId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(TrescEmail).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var trescEmail = principalEntityType.AddNavigation("TrescEmail", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("TrescEmail", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TrescEmail_Uz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TrescEmail"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TrescEmailTekstEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TrescEmailTekstEntityType.cs new file mode 100644 index 0000000..76e7d33 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TrescEmailTekstEntityType.cs @@ -0,0 +1,167 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TrescEmailTekstEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TrescEmailTekst", + typeof(TrescEmailTekst), + baseEntityType); + + var tEId = runtimeEntityType.AddProperty( + "TEId", + typeof(decimal), + propertyInfo: typeof(TrescEmailTekst).GetProperty("TEId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + tEId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tEId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tEId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(short), + propertyInfo: typeof(TrescEmailTekst).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + kolejnosc.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(TrescEmailTekst).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tresc = runtimeEntityType.AddProperty( + "Tresc", + typeof(string), + propertyInfo: typeof(TrescEmailTekst).GetProperty("Tresc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tresc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tresc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { tEId, kolejnosc, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TEId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TEId") }), + principalEntityType, + required: true); + + var tE = declaringEntityType.AddNavigation("TE", + runtimeForeignKey, + onDependent: true, + typeof(TrescEmail), + propertyInfo: typeof(TrescEmailTekst).GetProperty("TE", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmailTekst).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var trescEmailTekst = principalEntityType.AddNavigation("TrescEmailTekst", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TrescEmail).GetProperty("TrescEmailTekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TrescEmail).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_TrescEmail_Pe"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TrescEmailTekst"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/TypOsEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TypOsEntityType.cs new file mode 100644 index 0000000..a3f77b4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/TypOsEntityType.cs @@ -0,0 +1,248 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class TypOsEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.TypOs", + typeof(TypOs), + baseEntityType); + + var typOsId = runtimeEntityType.AddProperty( + "TypOsId", + typeof(decimal), + propertyInfo: typeof(TypOs).GetProperty("TypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + typOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(TypOs).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrTypOsId = runtimeEntityType.AddProperty( + "CentrTypOsId", + typeof(decimal?), + propertyInfo: typeof(TypOs).GetProperty("CentrTypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrTypOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrTypOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrTypOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var komentarz = runtimeEntityType.AddProperty( + "Komentarz", + typeof(string), + propertyInfo: typeof(TypOs).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + komentarz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + komentarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var narzucac = runtimeEntityType.AddProperty( + "Narzucac", + typeof(short?), + propertyInfo: typeof(TypOs).GetProperty("Narzucac", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + narzucac.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + narzucac.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(TypOs).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(TypOs).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { typOsId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_TYPOS"); + + var idx_TYPOS_ZMIANA = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_TYPOS_ZMIANA"); + + return runtimeEntityType; + } + + public static RuntimeSkipNavigation CreateSkipNavigation1(RuntimeEntityType declaringEntityType, RuntimeEntityType targetEntityType, RuntimeEntityType joinEntityType) + { + var skipNavigation = declaringEntityType.AddSkipNavigation( + "Kontr", + targetEntityType, + joinEntityType.FindForeignKey( + new[] { joinEntityType.FindProperty("TypOsId") }, + declaringEntityType.FindKey(new[] { declaringEntityType.FindProperty("TypOsId") }), + declaringEntityType), + true, + false, + typeof(ICollection), + propertyInfo: typeof(TypOs).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var inverse = targetEntityType.FindSkipNavigation("TypOs"); + if (inverse != null) + { + skipNavigation.Inverse = inverse; + inverse.Inverse = skipNavigation; + } + + return skipNavigation; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "TypOs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/UlicaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UlicaEntityType.cs new file mode 100644 index 0000000..f85ef7c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UlicaEntityType.cs @@ -0,0 +1,199 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class UlicaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Ulica", + typeof(Ulica), + baseEntityType); + + var ulId = runtimeEntityType.AddProperty( + "UlId", + typeof(decimal), + propertyInfo: typeof(Ulica).GetProperty("UlId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Ulica).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + ulId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + ulId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + ulId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Ulica).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Ulica).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var mId = runtimeEntityType.AddProperty( + "MId", + typeof(decimal), + propertyInfo: typeof(Ulica).GetProperty("MId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Ulica).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + mId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + mId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + mId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Ulica).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Ulica).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Ulica).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Ulica).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { ulId }); + runtimeEntityType.SetPrimaryKey(key); + + var index = runtimeEntityType.AddIndex( + new[] { mId }); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("MId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("MId") }), + principalEntityType, + required: true); + + var mIdNavigation = declaringEntityType.AddNavigation("MIdNavigation", + runtimeForeignKey, + onDependent: true, + typeof(Miasto), + propertyInfo: typeof(Ulica).GetProperty("MIdNavigation", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Ulica).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var ulica = principalEntityType.AddNavigation("Ulica", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Miasto).GetProperty("Ulica", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Miasto).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_Ulica_MId"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Ulica"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/UprawnienieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UprawnienieEntityType.cs new file mode 100644 index 0000000..68dd0d5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UprawnienieEntityType.cs @@ -0,0 +1,142 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class UprawnienieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Uprawnienie", + typeof(Uprawnienie), + baseEntityType); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal), + propertyInfo: typeof(Uprawnienie).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(Uprawnienie).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jest = runtimeEntityType.AddProperty( + "Jest", + typeof(short?), + propertyInfo: typeof(Uprawnienie).GetProperty("Jest", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + jest.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + jest.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { uzId, rodzaj }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_UPRAWNIENIE"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType, + required: true); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(Uprawnienie).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uprawnienie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var uprawnienie = principalEntityType.AddNavigation("Uprawnienie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("Uprawnienie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_UPRAWNIE_REF_UZUPR_UZYTKOWN"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Uprawnienie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/UprawnienieNaSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UprawnienieNaSklepEntityType.cs new file mode 100644 index 0000000..a5de769 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UprawnienieNaSklepEntityType.cs @@ -0,0 +1,142 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class UprawnienieNaSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.UprawnienieNaSklep", + typeof(UprawnienieNaSklep), + baseEntityType); + + var uzNSId = runtimeEntityType.AddProperty( + "UzNSId", + typeof(decimal), + propertyInfo: typeof(UprawnienieNaSklep).GetProperty("UzNSId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UprawnienieNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + uzNSId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzNSId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzNSId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rodzaj = runtimeEntityType.AddProperty( + "Rodzaj", + typeof(short), + propertyInfo: typeof(UprawnienieNaSklep).GetProperty("Rodzaj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UprawnienieNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + rodzaj.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + rodzaj.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jest = runtimeEntityType.AddProperty( + "Jest", + typeof(short?), + propertyInfo: typeof(UprawnienieNaSklep).GetProperty("Jest", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UprawnienieNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + jest.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + jest.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { uzNSId, rodzaj }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_UPRAWNIENIENASKLEP"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzNSId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzNSId") }), + principalEntityType, + required: true); + + var uzNS = declaringEntityType.AddNavigation("UzNS", + runtimeForeignKey, + onDependent: true, + typeof(UzNaSklep), + propertyInfo: typeof(UprawnienieNaSklep).GetProperty("UzNS", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UprawnienieNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var uprawnienieNaSklep = principalEntityType.AddNavigation("UprawnienieNaSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(UzNaSklep).GetProperty("UprawnienieNaSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_UprNaSklepUzNaSklep"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "UprawnienieNaSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/UzNaSklepEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UzNaSklepEntityType.cs new file mode 100644 index 0000000..9ac6d48 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UzNaSklepEntityType.cs @@ -0,0 +1,517 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class UzNaSklepEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.UzNaSklep", + typeof(UzNaSklep), + baseEntityType); + + var uzNSId = runtimeEntityType.AddProperty( + "UzNSId", + typeof(decimal), + propertyInfo: typeof(UzNaSklep).GetProperty("UzNSId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + uzNSId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzNSId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzNSId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(UzNaSklep).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var haslo = runtimeEntityType.AddProperty( + "Haslo", + typeof(string), + propertyInfo: typeof(UzNaSklep).GetProperty("Haslo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 50, + unicode: false); + haslo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(50)", + size: 50)); + haslo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var hasloPrepaid = runtimeEntityType.AddProperty( + "HasloPrepaid", + typeof(string), + propertyInfo: typeof(UzNaSklep).GetProperty("HasloPrepaid", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 50, + unicode: false); + hasloPrepaid.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(50)", + size: 50)); + hasloPrepaid.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var identPrePaid = runtimeEntityType.AddProperty( + "IdentPrePaid", + typeof(string), + propertyInfo: typeof(UzNaSklep).GetProperty("IdentPrePaid", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + identPrePaid.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + identPrePaid.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var identyfikator = runtimeEntityType.AddProperty( + "Identyfikator", + typeof(string), + propertyInfo: typeof(UzNaSklep).GetProperty("Identyfikator", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + identyfikator.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + identyfikator.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jezyk = runtimeEntityType.AddProperty( + "Jezyk", + typeof(string), + propertyInfo: typeof(UzNaSklep).GetProperty("Jezyk", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + jezyk.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + jezyk.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKasjera = runtimeEntityType.AddProperty( + "KodKasjera", + typeof(string), + propertyInfo: typeof(UzNaSklep).GetProperty("KodKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodKasjera.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwisko = runtimeEntityType.AddProperty( + "Nazwisko", + typeof(string), + propertyInfo: typeof(UzNaSklep).GetProperty("Nazwisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrKasjera = runtimeEntityType.AddProperty( + "NrKasjera", + typeof(short), + propertyInfo: typeof(UzNaSklep).GetProperty("NrKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + nrKasjera.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + nrKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrSzuflady = runtimeEntityType.AddProperty( + "NrSzuflady", + typeof(short?), + propertyInfo: typeof(UzNaSklep).GetProperty("NrSzuflady", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrSzuflady.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nrSzuflady.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rola = runtimeEntityType.AddProperty( + "Rola", + typeof(short?), + propertyInfo: typeof(UzNaSklep).GetProperty("Rola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rola.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rola.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rolaKasjera = runtimeEntityType.AddProperty( + "RolaKasjera", + typeof(short?), + propertyInfo: typeof(UzNaSklep).GetProperty("RolaKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rolaKasjera.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rolaKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal?), + propertyInfo: typeof(UzNaSklep).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepUzId = runtimeEntityType.AddProperty( + "SklepUzId", + typeof(decimal?), + propertyInfo: typeof(UzNaSklep).GetProperty("SklepUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wymusZmianeHasla = runtimeEntityType.AddProperty( + "WymusZmianeHasla", + typeof(DateTime?), + propertyInfo: typeof(UzNaSklep).GetProperty("WymusZmianeHasla", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wymusZmianeHasla.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + wymusZmianeHasla.AddAnnotation("Relational:ColumnType", "datetime"); + wymusZmianeHasla.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(UzNaSklep).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { uzNSId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_UZNASKLEP"); + + var idx_UzNaSklelp_Ident = runtimeEntityType.AddIndex( + new[] { identyfikator }, + name: "idx_UzNaSklelp_Ident"); + + var idx_UzNaSklelp_SIdSUzId = runtimeEntityType.AddIndex( + new[] { sklepId, sklepUzId }, + name: "idx_UzNaSklelp_SIdSUzId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId") }), + principalEntityType); + + var sklep = declaringEntityType.AddNavigation("Sklep", + runtimeForeignKey, + onDependent: true, + typeof(Sklep), + propertyInfo: typeof(UzNaSklep).GetProperty("Sklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var uzNaSklep = principalEntityType.AddNavigation("UzNaSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sklep).GetProperty("UzNaSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_UzNaSklepSklep"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SklepId"), declaringEntityType.FindProperty("SklepUzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SklepId"), principalEntityType.FindProperty("SklepUzId") }), + principalEntityType); + + var sklepUzytkownik = declaringEntityType.AddNavigation("SklepUzytkownik", + runtimeForeignKey, + onDependent: true, + typeof(SklepUzytkownik), + propertyInfo: typeof(UzNaSklep).GetProperty("SklepUzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(UzNaSklep).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var uzNaSklep = principalEntityType.AddNavigation("UzNaSklep", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(SklepUzytkownik).GetProperty("UzNaSklep", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(SklepUzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_UzNaSklepSklepUz"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "UzNaSklep"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/UzytkownikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UzytkownikEntityType.cs new file mode 100644 index 0000000..2712874 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/UzytkownikEntityType.cs @@ -0,0 +1,564 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class UzytkownikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Uzytkownik", + typeof(Uzytkownik), + baseEntityType); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal), + propertyInfo: typeof(Uzytkownik).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Uzytkownik).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrUzId = runtimeEntityType.AddProperty( + "CentrUzId", + typeof(decimal?), + propertyInfo: typeof(Uzytkownik).GetProperty("CentrUzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrUzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrUzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrUzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrUzNSId = runtimeEntityType.AddProperty( + "CentrUzNSId", + typeof(decimal?), + propertyInfo: typeof(Uzytkownik).GetProperty("CentrUzNSId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrUzNSId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrUzNSId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrUzNSId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var haslo = runtimeEntityType.AddProperty( + "Haslo", + typeof(string), + propertyInfo: typeof(Uzytkownik).GetProperty("Haslo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 50, + unicode: false); + haslo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(50)", + size: 50)); + haslo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var hasloPrepaid = runtimeEntityType.AddProperty( + "HasloPrepaid", + typeof(string), + propertyInfo: typeof(Uzytkownik).GetProperty("HasloPrepaid", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 100, + unicode: false); + hasloPrepaid.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(100)", + size: 100)); + hasloPrepaid.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var identPrepaid = runtimeEntityType.AddProperty( + "IdentPrepaid", + typeof(string), + propertyInfo: typeof(Uzytkownik).GetProperty("IdentPrepaid", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + identPrepaid.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + identPrepaid.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var identyfikator = runtimeEntityType.AddProperty( + "Identyfikator", + typeof(string), + propertyInfo: typeof(Uzytkownik).GetProperty("Identyfikator", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + identyfikator.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + identyfikator.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var jezyk = runtimeEntityType.AddProperty( + "Jezyk", + typeof(string), + propertyInfo: typeof(Uzytkownik).GetProperty("Jezyk", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + jezyk.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + jezyk.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKasjera = runtimeEntityType.AddProperty( + "KodKasjera", + typeof(string), + propertyInfo: typeof(Uzytkownik).GetProperty("KodKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + kodKasjera.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kodKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwisko = runtimeEntityType.AddProperty( + "Nazwisko", + typeof(string), + propertyInfo: typeof(Uzytkownik).GetProperty("Nazwisko", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwisko.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwisko.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrKasjera = runtimeEntityType.AddProperty( + "NrKasjera", + typeof(short), + propertyInfo: typeof(Uzytkownik).GetProperty("NrKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + nrKasjera.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + nrKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nrSzuflady = runtimeEntityType.AddProperty( + "NrSzuflady", + typeof(short?), + propertyInfo: typeof(Uzytkownik).GetProperty("NrSzuflady", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nrSzuflady.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nrSzuflady.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opiekun = runtimeEntityType.AddProperty( + "Opiekun", + typeof(short?), + propertyInfo: typeof(Uzytkownik).GetProperty("Opiekun", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + opiekun.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + opiekun.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ostZmianaHasla = runtimeEntityType.AddProperty( + "OstZmianaHasla", + typeof(DateTime?), + propertyInfo: typeof(Uzytkownik).GetProperty("OstZmianaHasla", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ostZmianaHasla.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + ostZmianaHasla.AddAnnotation("Relational:ColumnType", "datetime"); + ostZmianaHasla.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var profilId = runtimeEntityType.AddProperty( + "ProfilId", + typeof(decimal?), + propertyInfo: typeof(Uzytkownik).GetProperty("ProfilId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + profilId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + profilId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + profilId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rola = runtimeEntityType.AddProperty( + "Rola", + typeof(short?), + propertyInfo: typeof(Uzytkownik).GetProperty("Rola", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rola.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rola.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var rolaKasjera = runtimeEntityType.AddProperty( + "RolaKasjera", + typeof(short?), + propertyInfo: typeof(Uzytkownik).GetProperty("RolaKasjera", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + rolaKasjera.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + rolaKasjera.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wymusZmianeHasla = runtimeEntityType.AddProperty( + "WymusZmianeHasla", + typeof(DateTime?), + propertyInfo: typeof(Uzytkownik).GetProperty("WymusZmianeHasla", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + wymusZmianeHasla.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + wymusZmianeHasla.AddAnnotation("Relational:ColumnType", "datetime"); + wymusZmianeHasla.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime?), + propertyInfo: typeof(Uzytkownik).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { uzId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_UZYTKOWNIK"); + + var index = runtimeEntityType.AddIndex( + new[] { profilId }); + + var idx_CentrUzId = runtimeEntityType.AddIndex( + new[] { centrUzId }, + name: "idx_CentrUzId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ProfilId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ProfilId") }), + principalEntityType); + + var profil = declaringEntityType.AddNavigation("Profil", + runtimeForeignKey, + onDependent: true, + typeof(Profil), + propertyInfo: typeof(Uzytkownik).GetProperty("Profil", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var uzytkownik = principalEntityType.AddNavigation("Uzytkownik", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Profil).GetProperty("Uzytkownik", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Profil).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_UZYTKOWINK_REFERENCE_PROFIL"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Uzytkownik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/VatEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/VatEntityType.cs new file mode 100644 index 0000000..dd33905 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/VatEntityType.cs @@ -0,0 +1,67 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class VatEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Vat", + typeof(Vat), + baseEntityType); + + var stawka = runtimeEntityType.AddProperty( + "Stawka", + typeof(short), + propertyInfo: typeof(Vat).GetProperty("Stawka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Vat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + stawka.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + stawka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { stawka }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_VAT"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Vat"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/WalutaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/WalutaEntityType.cs new file mode 100644 index 0000000..f577625 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/WalutaEntityType.cs @@ -0,0 +1,373 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class WalutaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Waluta", + typeof(Waluta), + baseEntityType); + + var walId = runtimeEntityType.AddProperty( + "WalId", + typeof(decimal), + propertyInfo: typeof(Waluta).GetProperty("WalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + walId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + walId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + walId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywny = runtimeEntityType.AddProperty( + "Aktywny", + typeof(short), + propertyInfo: typeof(Waluta).GetProperty("Aktywny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrWalId = runtimeEntityType.AddProperty( + "CentrWalId", + typeof(decimal?), + propertyInfo: typeof(Waluta).GetProperty("CentrWalId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrWalId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrWalId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrWalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kod = runtimeEntityType.AddProperty( + "Kod", + typeof(string), + propertyInfo: typeof(Waluta).GetProperty("Kod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 10, + unicode: false); + kod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + kod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kurs = runtimeEntityType.AddProperty( + "Kurs", + typeof(decimal), + propertyInfo: typeof(Waluta).GetProperty("Kurs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + kurs.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kurs.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kurs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kursZak = runtimeEntityType.AddProperty( + "KursZak", + typeof(decimal?), + propertyInfo: typeof(Waluta).GetProperty("KursZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kursZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kursZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kursZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Waluta).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot1 = runtimeEntityType.AddProperty( + "Skrot1", + typeof(string), + propertyInfo: typeof(Waluta).GetProperty("Skrot1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + skrot1.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + skrot1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var skrot100 = runtimeEntityType.AddProperty( + "Skrot100", + typeof(string), + propertyInfo: typeof(Waluta).GetProperty("Skrot100", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 10, + unicode: false); + skrot100.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(10)", + size: 10)); + skrot100.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var spread = runtimeEntityType.AddProperty( + "Spread", + typeof(decimal?), + propertyInfo: typeof(Waluta).GetProperty("Spread", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + spread.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + spread.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + spread.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var spreadZak = runtimeEntityType.AddProperty( + "SpreadZak", + typeof(decimal?), + propertyInfo: typeof(Waluta).GetProperty("SpreadZak", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + spreadZak.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + spreadZak.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + spreadZak.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var ukrycNaKasie = runtimeEntityType.AddProperty( + "UkrycNaKasie", + typeof(short?), + propertyInfo: typeof(Waluta).GetProperty("UkrycNaKasie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + ukrycNaKasie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + ukrycNaKasie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(Waluta).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Waluta).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { walId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_WALUTA"); + + var idx_CentrWalId = runtimeEntityType.AddIndex( + new[] { centrWalId }, + name: "idx_CentrWalId"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Waluta"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/Wersja_7_2EntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/Wersja_7_2EntityType.cs new file mode 100644 index 0000000..a29d009 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/Wersja_7_2EntityType.cs @@ -0,0 +1,114 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class Wersja_7_2EntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Wersja_7_2", + typeof(Wersja_7_2), + baseEntityType); + + var upgrade = runtimeEntityType.AddProperty( + "Upgrade", + typeof(short), + propertyInfo: typeof(Wersja_7_2).GetProperty("Upgrade", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wersja_7_2).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + upgrade.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + upgrade.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Wersja_7_2).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wersja_7_2).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(Wersja_7_2).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wersja_7_2).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { upgrade }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_WERSJA_7_2"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Wersja_7_2"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/WzorzecEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/WzorzecEntityType.cs new file mode 100644 index 0000000..ced1e38 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/WzorzecEntityType.cs @@ -0,0 +1,270 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class WzorzecEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Wzorzec", + typeof(Wzorzec), + baseEntityType); + + var wzId = runtimeEntityType.AddProperty( + "WzId", + typeof(decimal), + propertyInfo: typeof(Wzorzec).GetProperty("WzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + wzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + wzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + wzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var automatyczny = runtimeEntityType.AddProperty( + "Automatyczny", + typeof(short?), + propertyInfo: typeof(Wzorzec).GetProperty("Automatyczny", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + automatyczny.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + automatyczny.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrWzId = runtimeEntityType.AddProperty( + "CentrWzId", + typeof(decimal?), + propertyInfo: typeof(Wzorzec).GetProperty("CentrWzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrWzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrWzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrWzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var grupGen = runtimeEntityType.AddProperty( + "GrupGen", + typeof(short?), + propertyInfo: typeof(Wzorzec).GetProperty("GrupGen", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + grupGen.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + grupGen.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Wzorzec).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 120, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(Wzorzec).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param1 = runtimeEntityType.AddProperty( + "Param1", + typeof(decimal?), + propertyInfo: typeof(Wzorzec).GetProperty("Param1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param1.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + param1.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + param1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param2 = runtimeEntityType.AddProperty( + "Param2", + typeof(decimal?), + propertyInfo: typeof(Wzorzec).GetProperty("Param2", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + param2.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(10,4)", + precision: 10, + scale: 4)); + param2.AddAnnotation("Relational:ColumnType", "decimal(10, 4)"); + param2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typWzorca = runtimeEntityType.AddProperty( + "TypWzorca", + typeof(short), + propertyInfo: typeof(Wzorzec).GetProperty("TypWzorca", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Wzorzec).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typWzorca.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typWzorca.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { wzId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_WZORZEC"); + + var idx_CentrWzId = runtimeEntityType.AddIndex( + new[] { centrWzId }, + name: "idx_CentrWzId"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Wzorzec"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZaleznoscEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZaleznoscEntityType.cs new file mode 100644 index 0000000..802a473 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZaleznoscEntityType.cs @@ -0,0 +1,155 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZaleznoscEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Zaleznosc", + typeof(Zaleznosc), + baseEntityType); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal), + propertyInfo: typeof(Zaleznosc).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var poprzedniDokId = runtimeEntityType.AddProperty( + "PoprzedniDokId", + typeof(decimal), + propertyInfo: typeof(Zaleznosc).GetProperty("PoprzedniDokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + poprzedniDokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + poprzedniDokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + poprzedniDokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { dokId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZALEZNOSC"); + + var idx_PoprzedniDokId = runtimeEntityType.AddIndex( + new[] { poprzedniDokId }, + name: "idx_PoprzedniDokId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("DokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + unique: true, + required: true); + + var dok = declaringEntityType.AddNavigation("Dok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(Zaleznosc).GetProperty("Dok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zaleznoscDok = principalEntityType.AddNavigation("ZaleznoscDok", + runtimeForeignKey, + onDependent: false, + typeof(Zaleznosc), + propertyInfo: typeof(Dok).GetProperty("ZaleznoscDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZALEZNOS_REF_ODDOK_DOK"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("PoprzedniDokId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("DokId") }), + principalEntityType, + required: true); + + var poprzedniDok = declaringEntityType.AddNavigation("PoprzedniDok", + runtimeForeignKey, + onDependent: true, + typeof(Dok), + propertyInfo: typeof(Zaleznosc).GetProperty("PoprzedniDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zaleznosc).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zaleznoscPoprzedniDok = principalEntityType.AddNavigation("ZaleznoscPoprzedniDok", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Dok).GetProperty("ZaleznoscPoprzedniDok", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Dok).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZALEZNOS_REF_DODOK_DOK"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Zaleznosc"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZamiennikEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZamiennikEntityType.cs new file mode 100644 index 0000000..2967bbb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZamiennikEntityType.cs @@ -0,0 +1,125 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZamiennikEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Zamiennik", + typeof(Zamiennik), + baseEntityType); + + var zmId = runtimeEntityType.AddProperty( + "ZmId", + typeof(decimal), + propertyInfo: typeof(Zamiennik).GetProperty("ZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var centrZmId = runtimeEntityType.AddProperty( + "CentrZmId", + typeof(decimal?), + propertyInfo: typeof(Zamiennik).GetProperty("CentrZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrZmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrZmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrZmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Zamiennik).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zamiennik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zmId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZAMIENNIK"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Zamiennik"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZasobEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZasobEntityType.cs new file mode 100644 index 0000000..eb1da08 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZasobEntityType.cs @@ -0,0 +1,146 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZasobEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Zasob", + typeof(Zasob), + baseEntityType); + + var tabela = runtimeEntityType.AddProperty( + "Tabela", + typeof(short), + propertyInfo: typeof(Zasob).GetProperty("Tabela", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + tabela.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tabela.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal), + propertyInfo: typeof(Zasob).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(string), + propertyInfo: typeof(Zasob).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + typ.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sciezka = runtimeEntityType.AddProperty( + "Sciezka", + typeof(string), + propertyInfo: typeof(Zasob).GetProperty("Sciezka", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zasob).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + sciezka.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + sciezka.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { tabela, id, typ }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZASOB"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Zasob"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzLojEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzLojEntityType.cs new file mode 100644 index 0000000..d115186 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzLojEntityType.cs @@ -0,0 +1,581 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZdarzLojEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzLoj", + typeof(ZdarzLoj), + baseEntityType); + + var zdarzLojId = runtimeEntityType.AddProperty( + "ZdarzLojId", + typeof(decimal), + propertyInfo: typeof(ZdarzLoj).GetProperty("ZdarzLojId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zdarzLojId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zdarzLojId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zdarzLojId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var cecha = runtimeEntityType.AddProperty( + "Cecha", + typeof(string), + propertyInfo: typeof(ZdarzLoj).GetProperty("Cecha", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + cecha.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + cecha.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzas = runtimeEntityType.AddProperty( + "DataCzas", + typeof(DateTime), + propertyInfo: typeof(ZdarzLoj).GetProperty("DataCzas", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataCzas.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzas.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzas.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataCzasZapisu = runtimeEntityType.AddProperty( + "DataCzasZapisu", + typeof(DateTime), + propertyInfo: typeof(ZdarzLoj).GetProperty("DataCzasZapisu", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + dataCzasZapisu.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataCzasZapisu.AddAnnotation("Relational:ColumnType", "datetime"); + dataCzasZapisu.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dokId = runtimeEntityType.AddProperty( + "DokId", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("DokId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dokId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + dokId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + dokId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kartaId = runtimeEntityType.AddProperty( + "KartaId", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("KartaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kartaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kartaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kartaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kodKarty = runtimeEntityType.AddProperty( + "KodKarty", + typeof(string), + propertyInfo: typeof(ZdarzLoj).GetProperty("KodKarty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 40, + unicode: false); + kodKarty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + kodKarty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kontoId = runtimeEntityType.AddProperty( + "KontoId", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("KontoId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kontoId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontoId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontoId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kwota = runtimeEntityType.AddProperty( + "Kwota", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("Kwota", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + kwota.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + kwota.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + kwota.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var opis = runtimeEntityType.AddProperty( + "Opis", + typeof(string), + propertyInfo: typeof(ZdarzLoj).GetProperty("Opis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + opis.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + opis.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var posNo = runtimeEntityType.AddProperty( + "PosNo", + typeof(string), + propertyInfo: typeof(ZdarzLoj).GetProperty("PosNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 32, + unicode: false); + posNo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + posNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var regulaId = runtimeEntityType.AddProperty( + "RegulaId", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("RegulaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + regulaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + regulaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + regulaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var shopNo = runtimeEntityType.AddProperty( + "ShopNo", + typeof(string), + propertyInfo: typeof(ZdarzLoj).GetProperty("ShopNo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 32, + unicode: false); + shopNo.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(32)", + size: 32)); + shopNo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanPo = runtimeEntityType.AddProperty( + "StanPo", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("StanPo", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stanPo.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanPo.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanPo.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var stanPrzed = runtimeEntityType.AddProperty( + "StanPrzed", + typeof(decimal?), + propertyInfo: typeof(ZdarzLoj).GetProperty("StanPrzed", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + stanPrzed.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "decimal(15,4)", + precision: 15, + scale: 4)); + stanPrzed.AddAnnotation("Relational:ColumnType", "decimal(15, 4)"); + stanPrzed.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var transUUID = runtimeEntityType.AddProperty( + "TransUUID", + typeof(string), + propertyInfo: typeof(ZdarzLoj).GetProperty("TransUUID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 64, + unicode: false); + transUUID.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(64)", + size: 64)); + transUUID.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typZdarz = runtimeEntityType.AddProperty( + "TypZdarz", + typeof(short), + propertyInfo: typeof(ZdarzLoj).GetProperty("TypZdarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typZdarz.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typZdarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zdarzLojId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZDARZLOJ"); + + var index = runtimeEntityType.AddIndex( + new[] { kartaId }); + + var ixZdarzLoj_Cecha = runtimeEntityType.AddIndex( + new[] { cecha }, + name: "IxZdarzLoj_Cecha"); + + var ixZdarzLoj_DataCzas = runtimeEntityType.AddIndex( + new[] { dataCzas }, + name: "IxZdarzLoj_DataCzas"); + + var ixZdarzLoj_KodKarty = runtimeEntityType.AddIndex( + new[] { kodKarty }, + name: "IxZdarzLoj_KodKarty"); + + var ixZdarzLoj_KontoId = runtimeEntityType.AddIndex( + new[] { kontoId }, + name: "IxZdarzLoj_KontoId"); + + var ixZdarzLoj_TransUUID = runtimeEntityType.AddIndex( + new[] { transUUID }, + name: "IxZdarzLoj_TransUUID"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KartaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KartaId") }), + principalEntityType); + + var karta = declaringEntityType.AddNavigation("Karta", + runtimeForeignKey, + onDependent: true, + typeof(KartaLoj), + propertyInfo: typeof(ZdarzLoj).GetProperty("Karta", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zdarzLoj = principalEntityType.AddNavigation("ZdarzLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KartaLoj).GetProperty("ZdarzLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KartaLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_ZdarzKarta"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontoId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontoId") }), + principalEntityType); + + var konto = declaringEntityType.AddNavigation("Konto", + runtimeForeignKey, + onDependent: true, + typeof(KontoLoj), + propertyInfo: typeof(ZdarzLoj).GetProperty("Konto", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zdarzLoj = principalEntityType.AddNavigation("ZdarzLoj", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(KontoLoj).GetProperty("ZdarzLoj", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(KontoLoj).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "Ref_ZdarzKonto"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ZdarzLoj"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzOsEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzOsEntityType.cs new file mode 100644 index 0000000..4cf03d1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzOsEntityType.cs @@ -0,0 +1,464 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZdarzOsEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOs", + typeof(ZdarzOs), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(ZdarzOs).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(string), + propertyInfo: typeof(ZdarzOs).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 20, + unicode: false); + kiedy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var akcja = runtimeEntityType.AddProperty( + "Akcja", + typeof(short), + propertyInfo: typeof(ZdarzOs).GetProperty("Akcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + akcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + akcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dataDec = runtimeEntityType.AddProperty( + "DataDec", + typeof(DateTime?), + propertyInfo: typeof(ZdarzOs).GetProperty("DataDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + dataDec.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + dataDec.AddAnnotation("Relational:ColumnType", "datetime"); + dataDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var dodPar = runtimeEntityType.AddProperty( + "DodPar", + typeof(string), + propertyInfo: typeof(ZdarzOs).GetProperty("DodPar", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + dodPar.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + dodPar.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var formaDec = runtimeEntityType.AddProperty( + "FormaDec", + typeof(short?), + propertyInfo: typeof(ZdarzOs).GetProperty("FormaDec", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + formaDec.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + formaDec.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nowyStatus = runtimeEntityType.AddProperty( + "NowyStatus", + typeof(short?), + propertyInfo: typeof(ZdarzOs).GetProperty("NowyStatus", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + nowyStatus.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(short)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))); + nowyStatus.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typOsId = runtimeEntityType.AddProperty( + "TypOsId", + typeof(decimal?), + propertyInfo: typeof(ZdarzOs).GetProperty("TypOsId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + typOsId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + typOsId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + typOsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var uzId = runtimeEntityType.AddProperty( + "UzId", + typeof(decimal?), + propertyInfo: typeof(ZdarzOs).GetProperty("UzId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + uzId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + uzId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + uzId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(ZdarzOs).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zgId = runtimeEntityType.AddProperty( + "ZgId", + typeof(decimal?), + propertyInfo: typeof(ZdarzOs).GetProperty("ZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + zgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(ZdarzOs).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, kiedy }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZDARZOS"); + + var idx_ZDOSUZKIEDY = runtimeEntityType.AddIndex( + new[] { uzId, kiedy }, + name: "idx_ZDOSUZKIEDY"); + + var idx_ZDOS_OSTDEC = runtimeEntityType.AddIndex( + new[] { kontrId, zgId, dataDec }, + name: "idx_ZDOS_OSTDEC"); + + var idx_ZDOS_OSTZGODA = runtimeEntityType.AddIndex( + new[] { kontrId, zgId, kiedy }, + name: "idx_ZDOS_OSTZGODA"); + + var idx_ZDOS_TPOS = runtimeEntityType.AddIndex( + new[] { typOsId }, + name: "idx_ZDOS_TPOS"); + + var idx_ZDOS_ZG = runtimeEntityType.AddIndex( + new[] { zgId }, + name: "idx_ZDOS_ZG"); + + var idx_ZDOS_ZMIANA = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_ZDOS_ZMIANA"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId") }), + principalEntityType, + required: true); + + var kontr = declaringEntityType.AddNavigation("Kontr", + runtimeForeignKey, + onDependent: true, + typeof(Kontrahent), + propertyInfo: typeof(ZdarzOs).GetProperty("Kontr", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zdarzOs = principalEntityType.AddNavigation("ZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kontrahent).GetProperty("ZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kontrahent).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZDOS_KTH"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey2(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("TypOsId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("TypOsId") }), + principalEntityType); + + var typOs = declaringEntityType.AddNavigation("TypOs", + runtimeForeignKey, + onDependent: true, + typeof(TypOs), + propertyInfo: typeof(ZdarzOs).GetProperty("TypOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zdarzOs = principalEntityType.AddNavigation("ZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(TypOs).GetProperty("ZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(TypOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZDOS_TPOS"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey3(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("UzId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("UzId") }), + principalEntityType); + + var uz = declaringEntityType.AddNavigation("Uz", + runtimeForeignKey, + onDependent: true, + typeof(Uzytkownik), + propertyInfo: typeof(ZdarzOs).GetProperty("Uz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zdarzOs = principalEntityType.AddNavigation("ZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Uzytkownik).GetProperty("ZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Uzytkownik).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZDOSUZ"); + return runtimeForeignKey; + } + + public static RuntimeForeignKey CreateForeignKey4(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZgId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZgId") }), + principalEntityType); + + var zg = declaringEntityType.AddNavigation("Zg", + runtimeForeignKey, + onDependent: true, + typeof(Zgoda), + propertyInfo: typeof(ZdarzOs).GetProperty("Zg", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zdarzOs = principalEntityType.AddNavigation("ZdarzOs", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zgoda).GetProperty("ZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZDOS_ZG"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ZdarzOs"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzOsOpisEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzOsOpisEntityType.cs new file mode 100644 index 0000000..a50d04b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZdarzOsOpisEntityType.cs @@ -0,0 +1,172 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZdarzOsOpisEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ZdarzOsOpis", + typeof(ZdarzOsOpis), + baseEntityType); + + var kontrId = runtimeEntityType.AddProperty( + "KontrId", + typeof(decimal), + propertyInfo: typeof(ZdarzOsOpis).GetProperty("KontrId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kontrId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kontrId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kontrId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kiedy = runtimeEntityType.AddProperty( + "Kiedy", + typeof(string), + propertyInfo: typeof(ZdarzOsOpis).GetProperty("Kiedy", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 20, + unicode: false); + kiedy.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + kiedy.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(ZdarzOsOpis).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(ZdarzOsOpis).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kontrId, kiedy, znaczenie }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZDARZOSOPIS"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KontrId"), declaringEntityType.FindProperty("Kiedy") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KontrId"), principalEntityType.FindProperty("Kiedy") }), + principalEntityType, + required: true); + + var zdarzOs = declaringEntityType.AddNavigation("ZdarzOs", + runtimeForeignKey, + onDependent: true, + typeof(ZdarzOs), + propertyInfo: typeof(ZdarzOsOpis).GetProperty("ZdarzOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOsOpis).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zdarzOsOpis = principalEntityType.AddNavigation("ZdarzOsOpis", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(ZdarzOs).GetProperty("ZdarzOsOpis", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZdarzOs).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZDOSOPIS"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ZdarzOsOpis"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZgodaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZgodaEntityType.cs new file mode 100644 index 0000000..49d95c4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZgodaEntityType.cs @@ -0,0 +1,279 @@ +// +using System; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZgodaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Zgoda", + typeof(Zgoda), + baseEntityType); + + var zgId = runtimeEntityType.AddProperty( + "ZgId", + typeof(decimal), + propertyInfo: typeof(Zgoda).GetProperty("ZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var aktywna = runtimeEntityType.AddProperty( + "Aktywna", + typeof(short), + propertyInfo: typeof(Zgoda).GetProperty("Aktywna", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + aktywna.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + aktywna.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var centrZgId = runtimeEntityType.AddProperty( + "CentrZgId", + typeof(decimal?), + propertyInfo: typeof(Zgoda).GetProperty("CentrZgId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + centrZgId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + centrZgId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + centrZgId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var daneOs = runtimeEntityType.AddProperty( + "DaneOs", + typeof(string), + propertyInfo: typeof(Zgoda).GetProperty("DaneOs", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + daneOs.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + daneOs.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var komentarz = runtimeEntityType.AddProperty( + "Komentarz", + typeof(string), + propertyInfo: typeof(Zgoda).GetProperty("Komentarz", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + komentarz.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + komentarz.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwa = runtimeEntityType.AddProperty( + "Nazwa", + typeof(string), + propertyInfo: typeof(Zgoda).GetProperty("Nazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 60, + unicode: false); + nazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wersja = runtimeEntityType.AddProperty( + "Wersja", + typeof(string), + propertyInfo: typeof(Zgoda).GetProperty("Wersja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 20, + unicode: false); + wersja.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(20)", + size: 20)); + wersja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zastosowania = runtimeEntityType.AddProperty( + "Zastosowania", + typeof(string), + propertyInfo: typeof(Zgoda).GetProperty("Zastosowania", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 120, + unicode: false); + zastosowania.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(120)", + size: 120)); + zastosowania.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Zgoda).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zgoda).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zgId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZGODA"); + + var idx_ZG_ZMIANA = runtimeEntityType.AddIndex( + new[] { zmiana }, + name: "idx_ZG_ZMIANA"); + + return runtimeEntityType; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Zgoda"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecKomunikatEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecKomunikatEntityType.cs new file mode 100644 index 0000000..35cbf14 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecKomunikatEntityType.cs @@ -0,0 +1,194 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZlecKomunikatEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ZlecKomunikat", + typeof(ZlecKomunikat), + baseEntityType); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(ZlecKomunikat).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecKomunikat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zlecId = runtimeEntityType.AddProperty( + "ZlecId", + typeof(decimal), + propertyInfo: typeof(ZlecKomunikat).GetProperty("ZlecId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecKomunikat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zlecId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zlecId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zlecId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var kolejnosc = runtimeEntityType.AddProperty( + "Kolejnosc", + typeof(int), + propertyInfo: typeof(ZlecKomunikat).GetProperty("Kolejnosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecKomunikat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0); + kolejnosc.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + kolejnosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(ZlecKomunikat).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecKomunikat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var znaczenie = runtimeEntityType.AddProperty( + "Znaczenie", + typeof(short), + propertyInfo: typeof(ZlecKomunikat).GetProperty("Znaczenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecKomunikat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + znaczenie.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + znaczenie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId, zlecId, kolejnosc }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZLECKOMUNIKAT"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId"), declaringEntityType.FindProperty("ZlecId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId"), principalEntityType.FindProperty("ZlecId") }), + principalEntityType, + required: true); + + var zlecenie = declaringEntityType.AddNavigation("Zlecenie", + runtimeForeignKey, + onDependent: true, + typeof(Zlecenie), + propertyInfo: typeof(ZlecKomunikat).GetProperty("Zlecenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecKomunikat).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zlecKomunikat = principalEntityType.AddNavigation("ZlecKomunikat", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zlecenie).GetProperty("ZlecKomunikat", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZLECKOMU_REF_ZLECK_ZLECENIE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ZlecKomunikat"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecParamEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecParamEntityType.cs new file mode 100644 index 0000000..77f81e2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecParamEntityType.cs @@ -0,0 +1,177 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZlecParamEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ZlecParam", + typeof(ZlecParam), + baseEntityType); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(ZlecParam).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zlecId = runtimeEntityType.AddProperty( + "ZlecId", + typeof(decimal), + propertyInfo: typeof(ZlecParam).GetProperty("ZlecId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zlecId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zlecId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zlecId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parNazwa = runtimeEntityType.AddProperty( + "ParNazwa", + typeof(string), + propertyInfo: typeof(ZlecParam).GetProperty("ParNazwa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + maxLength: 40, + unicode: false); + parNazwa.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + keyComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + providerValueComparer: new ValueComparer( + (string l, string r) => string.Equals(l, r, StringComparison.OrdinalIgnoreCase), + (string v) => v == null ? 0 : StringComparer.OrdinalIgnoreCase.GetHashCode(v), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + parNazwa.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parWartosc = runtimeEntityType.AddProperty( + "ParWartosc", + typeof(string), + propertyInfo: typeof(ZlecParam).GetProperty("ParWartosc", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 255, + unicode: false); + parWartosc.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + parWartosc.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId, zlecId, parNazwa }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZLECPARAM"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId"), declaringEntityType.FindProperty("ZlecId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId"), principalEntityType.FindProperty("ZlecId") }), + principalEntityType, + required: true); + + var zlecenie = declaringEntityType.AddNavigation("Zlecenie", + runtimeForeignKey, + onDependent: true, + typeof(Zlecenie), + propertyInfo: typeof(ZlecParam).GetProperty("Zlecenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZlecParam).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zlecParam = principalEntityType.AddNavigation("ZlecParam", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zlecenie).GetProperty("ZlecParam", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZLECPARA_REF_ZLECP_ZLECENIE"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ZlecParam"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecenieEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecenieEntityType.cs new file mode 100644 index 0000000..526fd5a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZlecenieEntityType.cs @@ -0,0 +1,359 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZlecenieEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Zlecenie", + typeof(Zlecenie), + baseEntityType); + + var kasaId = runtimeEntityType.AddProperty( + "KasaId", + typeof(decimal), + propertyInfo: typeof(Zlecenie).GetProperty("KasaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + kasaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + kasaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + kasaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zlecId = runtimeEntityType.AddProperty( + "ZlecId", + typeof(decimal), + propertyInfo: typeof(Zlecenie).GetProperty("ZlecId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zlecId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zlecId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zlecId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var alarm = runtimeEntityType.AddProperty( + "Alarm", + typeof(short), + propertyInfo: typeof(Zlecenie).GetProperty("Alarm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + alarm.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + alarm.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nazwaDod = runtimeEntityType.AddProperty( + "NazwaDod", + typeof(string), + propertyInfo: typeof(Zlecenie).GetProperty("NazwaDod", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 60, + unicode: false); + nazwaDod.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(60)", + size: 60)); + nazwaDod.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var nieUsuwac = runtimeEntityType.AddProperty( + "NieUsuwac", + typeof(short), + propertyInfo: typeof(Zlecenie).GetProperty("NieUsuwac", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + nieUsuwac.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + nieUsuwac.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var parId = runtimeEntityType.AddProperty( + "ParId", + typeof(decimal?), + propertyInfo: typeof(Zlecenie).GetProperty("ParId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + parId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + parId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + parId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var param = runtimeEntityType.AddProperty( + "Param", + typeof(int), + propertyInfo: typeof(Zlecenie).GetProperty("Param", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0); + param.TypeMapping = IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)); + param.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var status = runtimeEntityType.AddProperty( + "Status", + typeof(short), + propertyInfo: typeof(Zlecenie).GetProperty("Status", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + status.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + status.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var typ = runtimeEntityType.AddProperty( + "Typ", + typeof(short), + propertyInfo: typeof(Zlecenie).GetProperty("Typ", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + typ.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + typ.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var utworzono = runtimeEntityType.AddProperty( + "Utworzono", + typeof(DateTime), + propertyInfo: typeof(Zlecenie).GetProperty("Utworzono", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + utworzono.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + utworzono.AddAnnotation("Relational:ColumnType", "datetime"); + utworzono.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var wstrzymanie = runtimeEntityType.AddProperty( + "Wstrzymanie", + typeof(string), + propertyInfo: typeof(Zlecenie).GetProperty("Wstrzymanie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true, + maxLength: 255, + unicode: false); + wstrzymanie.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(255)", + size: 255)); + wstrzymanie.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var zmiana = runtimeEntityType.AddProperty( + "Zmiana", + typeof(DateTime), + propertyInfo: typeof(Zlecenie).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + zmiana.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + zmiana.AddAnnotation("Relational:ColumnType", "datetime"); + zmiana.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { kasaId, zlecId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZLECENIE"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("KasaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("KasaId") }), + principalEntityType, + required: true); + + var kasa = declaringEntityType.AddNavigation("Kasa", + runtimeForeignKey, + onDependent: true, + typeof(Kasa), + propertyInfo: typeof(Zlecenie).GetProperty("Kasa", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zlecenie).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zlecenie = principalEntityType.AddNavigation("Zlecenie", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Kasa).GetProperty("Zlecenie", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Kasa).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZLECENIE_REF_ZLECK_KASA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Zlecenie"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZmianaEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZmianaEntityType.cs new file mode 100644 index 0000000..48af60d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZmianaEntityType.cs @@ -0,0 +1,282 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZmianaEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.Zmiana", + typeof(Zmiana), + baseEntityType); + + var zmId = runtimeEntityType.AddProperty( + "ZmId", + typeof(decimal), + propertyInfo: typeof(Zmiana).GetProperty("ZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueGenerated: ValueGenerated.OnAdd, + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + var akcja = runtimeEntityType.AddProperty( + "Akcja", + typeof(short), + propertyInfo: typeof(Zmiana).GetProperty("Akcja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + akcja.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + akcja.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var czas = runtimeEntityType.AddProperty( + "Czas", + typeof(DateTime), + propertyInfo: typeof(Zmiana).GetProperty("Czas", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + czas.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( + comparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + keyComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + providerValueComparer: new ValueComparer( + (DateTime v1, DateTime v2) => v1.Equals(v2), + (DateTime v) => v.GetHashCode(), + (DateTime v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "datetime", + dbType: System.Data.DbType.DateTime)); + czas.AddAnnotation("Relational:ColumnType", "datetime"); + czas.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sesjaId = runtimeEntityType.AddProperty( + "SesjaId", + typeof(decimal), + propertyInfo: typeof(Zmiana).GetProperty("SesjaId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: 0m); + sesjaId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sesjaId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sesjaId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var sklepId = runtimeEntityType.AddProperty( + "SklepId", + typeof(decimal?), + propertyInfo: typeof(Zmiana).GetProperty("SklepId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + sklepId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + sklepId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + sklepId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tabId = runtimeEntityType.AddProperty( + "TabId", + typeof(decimal?), + propertyInfo: typeof(Zmiana).GetProperty("TabId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + nullable: true); + tabId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + keyComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + providerValueComparer: new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + tabId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + tabId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tabela = runtimeEntityType.AddProperty( + "Tabela", + typeof(short), + propertyInfo: typeof(Zmiana).GetProperty("Tabela", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + sentinel: (short)0); + tabela.TypeMapping = SqlServerShortTypeMapping.Default.Clone( + comparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + keyComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v), + providerValueComparer: new ValueComparer( + (short v1, short v2) => v1 == v2, + (short v) => (int)v, + (short v) => v)); + tabela.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var tekst = runtimeEntityType.AddProperty( + "Tekst", + typeof(string), + propertyInfo: typeof(Zmiana).GetProperty("Tekst", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + maxLength: 40, + unicode: false); + tekst.TypeMapping = SqlServerStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + keyComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => v.GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "varchar(40)", + size: 40)); + tekst.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zmId }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZMIANA"); + + var idx_ZmSkTabIdCzas = runtimeEntityType.AddIndex( + new[] { sklepId, tabId, czas }, + name: "idx_ZmSkTabIdCzas"); + + var idx_ZmTabIdCzas = runtimeEntityType.AddIndex( + new[] { tabId, czas }, + name: "idx_ZmTabIdCzas"); + + var idx_ZmianaSesjaId = runtimeEntityType.AddIndex( + new[] { sesjaId }, + name: "idx_ZmianaSesjaId"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("SesjaId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("SesjaId") }), + principalEntityType, + required: true); + + var sesja = declaringEntityType.AddNavigation("Sesja", + runtimeForeignKey, + onDependent: true, + typeof(Sesja), + propertyInfo: typeof(Zmiana).GetProperty("Sesja", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zmiana = principalEntityType.AddNavigation("Zmiana", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Sesja).GetProperty("Zmiana", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Sesja).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZMIANA_REF_SESJA_SESJA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "Zmiana"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZmianaTabeliEntityType.cs b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZmianaTabeliEntityType.cs new file mode 100644 index 0000000..bd1e311 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/CompiledEntities/ZmianaTabeliEntityType.cs @@ -0,0 +1,126 @@ +// +using System; +using System.Collections.Generic; +using System.Reflection; +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; +using Microsoft.EntityFrameworkCore.Storage; + +#pragma warning disable 219, 612, 618 +#nullable disable + +namespace Blink.Backoffice.Services.PcmDb.CompiledEntities +{ + internal partial class ZmianaTabeliEntityType + { + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) + { + var runtimeEntityType = model.AddEntityType( + "Blink.Backoffice.Services.PcmDb.Entities.ZmianaTabeli", + typeof(ZmianaTabeli), + baseEntityType); + + var zmId = runtimeEntityType.AddProperty( + "ZmId", + typeof(decimal), + propertyInfo: typeof(ZmianaTabeli).GetProperty("ZmId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZmianaTabeli).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + zmId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + zmId.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + zmId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var id = runtimeEntityType.AddProperty( + "Id", + typeof(decimal), + propertyInfo: typeof(ZmianaTabeli).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZmianaTabeli).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + afterSaveBehavior: PropertySaveBehavior.Throw, + sentinel: 0m); + id.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( + comparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + keyComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + providerValueComparer: new ValueComparer( + (decimal v1, decimal v2) => v1 == v2, + (decimal v) => v.GetHashCode(), + (decimal v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "numeric(9,0)", + precision: 9, + scale: 0)); + id.AddAnnotation("Relational:ColumnType", "numeric(9, 0)"); + id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + + var key = runtimeEntityType.AddKey( + new[] { zmId, id }); + runtimeEntityType.SetPrimaryKey(key); + key.AddAnnotation("Relational:Name", "PK_ZMIANATABELI"); + + return runtimeEntityType; + } + + public static RuntimeForeignKey CreateForeignKey1(RuntimeEntityType declaringEntityType, RuntimeEntityType principalEntityType) + { + var runtimeForeignKey = declaringEntityType.AddForeignKey(new[] { declaringEntityType.FindProperty("ZmId") }, + principalEntityType.FindKey(new[] { principalEntityType.FindProperty("ZmId") }), + principalEntityType, + required: true); + + var zm = declaringEntityType.AddNavigation("Zm", + runtimeForeignKey, + onDependent: true, + typeof(Zmiana), + propertyInfo: typeof(ZmianaTabeli).GetProperty("Zm", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(ZmianaTabeli).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + var zmianaTabeli = principalEntityType.AddNavigation("ZmianaTabeli", + runtimeForeignKey, + onDependent: false, + typeof(ICollection), + propertyInfo: typeof(Zmiana).GetProperty("ZmianaTabeli", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(Zmiana).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + + runtimeForeignKey.AddAnnotation("Relational:Name", "FK_ZMIANATA_REF_ZMTAB_ZMIANA"); + return runtimeForeignKey; + } + + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) + { + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); + runtimeEntityType.AddAnnotation("Relational:Schema", null); + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); + runtimeEntityType.AddAnnotation("Relational:TableName", "ZmianaTabeli"); + runtimeEntityType.AddAnnotation("Relational:ViewName", null); + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); + + Customize(runtimeEntityType); + } + + static partial void Customize(RuntimeEntityType runtimeEntityType); + } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Akwizytor.cs b/Blink.Backoffice.Services.PcmDb/Entities/Akwizytor.cs new file mode 100644 index 0000000..030b71c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Akwizytor.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Akwizytor +{ + public decimal AkwId { get; set; } + + public string Nazwisko { get; set; } = null!; + + public string Opis { get; set; } = null!; + + public decimal Prowizja { get; set; } + + public virtual ICollection Kontrahent { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Artykul.cs b/Blink.Backoffice.Services.PcmDb/Entities/Artykul.cs new file mode 100644 index 0000000..bb4599a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Artykul.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Artykul +{ + public decimal ArtId { get; set; } + + public string ArtNazwa { get; set; } = null!; + + public decimal? CentrArtId { get; set; } + + public decimal? GlownyTowId { get; set; } + + public virtual Towar? GlownyTow { get; set; } + + public virtual ICollection Towar { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Asort.cs b/Blink.Backoffice.Services.PcmDb/Entities/Asort.cs new file mode 100644 index 0000000..f4183fe --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Asort.cs @@ -0,0 +1,42 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Asort +{ + public decimal AsId { get; set; } + + public string Nazwa { get; set; } = null!; + + public decimal Marza { get; set; } + + public short OpcjaMarzy { get; set; } + + public decimal HurtRabat { get; set; } + + public short OpcjaRabatu { get; set; } + + public decimal NocNarzut { get; set; } + + public short OpcjaNarzutu { get; set; } + + public decimal? CentrAsId { get; set; } + + public short? UkrytyNaPanelach { get; set; } + + public short? UkrytyNaBonowniku { get; set; } + + public short? BezAutoEtykiet { get; set; } + + public decimal? Param1 { get; set; } + + public short? Autoryzacja { get; set; } + + public virtual ICollection Marzownik { get; set; } = new List(); + + public virtual ICollection RegulaAsort { get; set; } = new List(); + + public virtual ICollection Towar { get; set; } = new List(); + + public virtual ICollection Kasa { get; set; } = new List(); + + public virtual ICollection Sklep { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Bank.cs b/Blink.Backoffice.Services.PcmDb/Entities/Bank.cs new file mode 100644 index 0000000..a1c9fa3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Bank.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Bank +{ + public decimal BankId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Adres { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? CentrBankId { get; set; } + + public string? NrRozliBank { get; set; } + + public string? SWIFT { get; set; } + + public virtual ICollection KontoBankowe { get; set; } = new List(); + + public virtual ICollection KontoBankoweKontr { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Blokada.cs b/Blink.Backoffice.Services.PcmDb/Entities/Blokada.cs new file mode 100644 index 0000000..38c4a6d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Blokada.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Blokada +{ + public decimal SesjaId { get; set; } + + public decimal TowId { get; set; } + + public decimal MagId { get; set; } + + public decimal Ilosc { get; set; } + + public virtual Istw Istw { get; set; } = null!; + + public virtual SesjaAktywna Sesja { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/CentrStanZgody.cs b/Blink.Backoffice.Services.PcmDb/Entities/CentrStanZgody.cs new file mode 100644 index 0000000..c360b4a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/CentrStanZgody.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class CentrStanZgody +{ + public decimal KontrId { get; set; } + + public decimal ZgId { get; set; } + + public short Status { get; set; } + + public string Kiedy { get; set; } = null!; + + public string? Wersja { get; set; } + + public short? FormaDec { get; set; } + + public DateTime? DataDec { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual Zgoda Zg { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Czas.cs b/Blink.Backoffice.Services.PcmDb/Entities/Czas.cs new file mode 100644 index 0000000..79d31f1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Czas.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Czas +{ + public decimal CzasID { get; set; } + + public decimal? DzienTygodnia { get; set; } + + public decimal? DzienMiesiaca { get; set; } + + public decimal? Dzien { get; set; } + + public decimal? TydzienRoku { get; set; } + + public decimal? Tydzien { get; set; } + + public decimal? MiesiacRoku { get; set; } + + public decimal? Miesiac { get; set; } + + public decimal? Weekend { get; set; } + + public decimal? Rok { get; set; } + + public DateTime? Data { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DefinicjaKodu.cs b/Blink.Backoffice.Services.PcmDb/Entities/DefinicjaKodu.cs new file mode 100644 index 0000000..24bde94 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DefinicjaKodu.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DefinicjaKodu +{ + public decimal DKId { get; set; } + + public short Typ { get; set; } + + public string Nazwa { get; set; } = null!; + + public DateTime? DataOd { get; set; } + + public DateTime? DataDo { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? CentrDKId { get; set; } + + public virtual ICollection SkladnikDefinicjiKodu { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasob.cs b/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasob.cs new file mode 100644 index 0000000..4a15fa2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasob.cs @@ -0,0 +1,42 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DlugiZasob +{ + public decimal ZasobId { get; set; } + + public string Zastosowanie { get; set; } = null!; + + public string Opcje { get; set; } = null!; + + public string Nazwa { get; set; } = null!; + + public string Sciezka { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public string TypDanych { get; set; } = null!; + + public string? Skrot1 { get; set; } + + public string? Skrot2 { get; set; } + + public string? Skrot3 { get; set; } + + public string? Skrot4 { get; set; } + + public string Wersja { get; set; } = null!; + + public decimal? CentrZasobId { get; set; } + + public string? CentrWersja { get; set; } + + public string? GUID { get; set; } + + public virtual ICollection DlugiZasobBin { get; set; } = new List(); + + public virtual ICollection DlugiZasobTxt { get; set; } = new List(); + + public virtual ICollection SklepDlugiZasob { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasobBin.cs b/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasobBin.cs new file mode 100644 index 0000000..41474dd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasobBin.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DlugiZasobBin +{ + public decimal ZasobId { get; set; } + + public short Porcja { get; set; } + + public byte[] Dane { get; set; } = null!; + + public virtual DlugiZasob Zasob { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasobTxt.cs b/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasobTxt.cs new file mode 100644 index 0000000..a9d810a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DlugiZasobTxt.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DlugiZasobTxt +{ + public decimal ZasobId { get; set; } + + public short Porcja { get; set; } + + public string Dane { get; set; } = null!; + + public virtual DlugiZasob Zasob { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Dok.cs b/Blink.Backoffice.Services.PcmDb/Entities/Dok.cs new file mode 100644 index 0000000..57c0119 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Dok.cs @@ -0,0 +1,186 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Dok +{ + public decimal DokId { get; set; } + + public decimal UzId { get; set; } + + public decimal MagId { get; set; } + + public DateTime Data { get; set; } + + public int KolejnyWDniu { get; set; } + + public DateTime DataDod { get; set; } + + public DateTime DataPom { get; set; } + + public string NrDok { get; set; } = null!; + + public short TypDok { get; set; } + + public short Aktywny { get; set; } + + public short Opcja1 { get; set; } + + public short Opcja2 { get; set; } + + public short Opcja3 { get; set; } + + public short Opcja4 { get; set; } + + public short CenyZakBrutto { get; set; } + + public short CenySpBrutto { get; set; } + + public short FormaPlat { get; set; } + + public short TerminPlat { get; set; } + + public short PoziomCen { get; set; } + + public decimal RabatProc { get; set; } + + public decimal Netto { get; set; } + + public decimal Podatek { get; set; } + + public decimal NettoUslugi { get; set; } + + public decimal PodatekUslugi { get; set; } + + public decimal NettoDet { get; set; } + + public decimal PodatekDet { get; set; } + + public decimal NettoDetUslugi { get; set; } + + public decimal PodatekDetUslugi { get; set; } + + public decimal NettoMag { get; set; } + + public decimal PodatekMag { get; set; } + + public decimal NettoMagUslugi { get; set; } + + public decimal PodatekMagUslugi { get; set; } + + public decimal Razem { get; set; } + + public decimal DoZaplaty { get; set; } + + public decimal Zaplacono { get; set; } + + public decimal Kwota1 { get; set; } + + public decimal Kwota2 { get; set; } + + public decimal Kwota3 { get; set; } + + public decimal Kwota4 { get; set; } + + public decimal Kwota5 { get; set; } + + public decimal Kwota6 { get; set; } + + public decimal Kwota7 { get; set; } + + public decimal Kwota8 { get; set; } + + public decimal Kwota9 { get; set; } + + public decimal Kwota10 { get; set; } + + public int Param1 { get; set; } + + public int Param2 { get; set; } + + public int Param3 { get; set; } + + public int Param4 { get; set; } + + public short EksportFK { get; set; } + + public DateTime Zmiana { get; set; } + + public int? NrKolejny { get; set; } + + public int? NrKolejnyMag { get; set; } + + public int? Param5 { get; set; } + + public int? Param6 { get; set; } + + public decimal? Kwota11 { get; set; } + + public decimal? Kwota12 { get; set; } + + public decimal? WalId { get; set; } + + public decimal? Kurs { get; set; } + + public decimal? CentrDokId { get; set; } + + public short? Opcja5 { get; set; } + + public short? Opcja6 { get; set; } + + public short? Opcja7 { get; set; } + + public short? Opcja8 { get; set; } + + public DateTime? ZmianaPkt { get; set; } + + public decimal? ZaplaconoPodatek { get; set; } + + public decimal? ZaplaconoWKasie { get; set; } + + public decimal? WalIdPlatnosci { get; set; } + + public virtual ICollection DokDodKth { get; set; } = new List(); + + public virtual DokKasa? DokKasa { get; set; } + + public virtual DokKontr? DokKontr { get; set; } + + public virtual ICollection DokKurs { get; set; } = new List(); + + public virtual ICollection DokPunkty { get; set; } = new List(); + + public virtual ICollection DokWBufPowiazanie { get; set; } = new List(); + + public virtual ICollection DokWaluta { get; set; } = new List(); + + public virtual Magazyn Mag { get; set; } = null!; + + public virtual ICollection PHRozliczenie { get; set; } = new List(); + + public virtual ICollection PozDok { get; set; } = new List(); + + public virtual ICollection RegulaDok { get; set; } = new List(); + + public virtual ICollection RozbicieDodDok { get; set; } = new List(); + + public virtual ICollection RozbicieDok { get; set; } = new List(); + + public virtual ICollection RozliczaDok { get; set; } = new List(); + + public virtual ICollection RozliczaRozliczanyDok { get; set; } = new List(); + + public virtual ICollection SklepDok { get; set; } = new List(); + + public virtual ICollection TekstDok { get; set; } = new List(); + + public virtual Uzytkownik Uz { get; set; } = null!; + + public virtual Waluta? Wal { get; set; } + + public virtual Waluta? WalIdPlatnosciNavigation { get; set; } + + public virtual Zaleznosc? ZaleznoscDok { get; set; } + + public virtual ICollection ZaleznoscPoprzedniDok { get; set; } = new List(); + + public virtual ICollection KB { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DokDodKth.cs b/Blink.Backoffice.Services.PcmDb/Entities/DokDodKth.cs new file mode 100644 index 0000000..e96ccb7 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DokDodKth.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DokDodKth +{ + public decimal DokId { get; set; } + + public short Znaczenie { get; set; } + + public decimal KontrId { get; set; } + + public decimal? Kwota { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Kontrahent Kontr { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DokKasa.cs b/Blink.Backoffice.Services.PcmDb/Entities/DokKasa.cs new file mode 100644 index 0000000..51f2bdc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DokKasa.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DokKasa +{ + public decimal DokId { get; set; } + + public decimal KasaId { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Kasa Kasa { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DokKontr.cs b/Blink.Backoffice.Services.PcmDb/Entities/DokKontr.cs new file mode 100644 index 0000000..0516ef4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DokKontr.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DokKontr +{ + public decimal DokId { get; set; } + + public decimal KontrId { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Kontrahent Kontr { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DokKurs.cs b/Blink.Backoffice.Services.PcmDb/Entities/DokKurs.cs new file mode 100644 index 0000000..1f40336 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DokKurs.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DokKurs +{ + public decimal DokId { get; set; } + + public short Znaczenie { get; set; } + + public decimal WalId { get; set; } + + public decimal? Kurs { get; set; } + + public DateTime? Data { get; set; } + + public string? NrTabeli { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Waluta Wal { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DokPunkty.cs b/Blink.Backoffice.Services.PcmDb/Entities/DokPunkty.cs new file mode 100644 index 0000000..e58684e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DokPunkty.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DokPunkty +{ + public decimal DokId { get; set; } + + public short Typ { get; set; } + + public DateTime Kiedy { get; set; } + + public decimal Kwota { get; set; } + + public virtual Dok Dok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DokWBufPowiazanie.cs b/Blink.Backoffice.Services.PcmDb/Entities/DokWBufPowiazanie.cs new file mode 100644 index 0000000..65dc987 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DokWBufPowiazanie.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DokWBufPowiazanie +{ + public decimal DokId { get; set; } + + public short JakiePow { get; set; } + + public short KtorePow { get; set; } + + public decimal? Id { get; set; } + + public string? Param { get; set; } + + public virtual Dok Dok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DokWaluta.cs b/Blink.Backoffice.Services.PcmDb/Entities/DokWaluta.cs new file mode 100644 index 0000000..c8ce178 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DokWaluta.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DokWaluta +{ + public decimal DokId { get; set; } + + public decimal WalId { get; set; } + + public decimal WalKwota { get; set; } + + public decimal Kurs { get; set; } + + public decimal DokKwota { get; set; } + + public decimal? WalNetto { get; set; } + + public decimal? WalPodatek { get; set; } + + public decimal? WalNettoDet { get; set; } + + public decimal? WalPodatekDet { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Waluta Wal { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DostProd.cs b/Blink.Backoffice.Services.PcmDb/Entities/DostProd.cs new file mode 100644 index 0000000..d9a4b47 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DostProd.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DostProd +{ + public decimal DostId { get; set; } + + public decimal ProdId { get; set; } + + public decimal RabatProd { get; set; } + + public virtual Kontrahent Dost { get; set; } = null!; + + public virtual Kontrahent Prod { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Dostawca.cs b/Blink.Backoffice.Services.PcmDb/Entities/Dostawca.cs new file mode 100644 index 0000000..14fc336 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Dostawca.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Dostawca +{ + public decimal KontrId { get; set; } + + public decimal TowId { get; set; } + + public decimal CenaZak { get; set; } + + public decimal RabatOdWart { get; set; } + + public short? Narzucany { get; set; } + + public string? Kod { get; set; } + + public decimal? IleWZgrzewce { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DzienRozl.cs b/Blink.Backoffice.Services.PcmDb/Entities/DzienRozl.cs new file mode 100644 index 0000000..66ef138 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DzienRozl.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DzienRozl +{ + public DateTime Dzien { get; set; } + + public short Status { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection DzienRozlParam { get; set; } = new List(); + + public virtual ICollection StanPrtMag { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/DzienRozlParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/DzienRozlParam.cs new file mode 100644 index 0000000..5b0747b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/DzienRozlParam.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class DzienRozlParam +{ + public DateTime Dzien { get; set; } + + public short Znaczenie { get; set; } + + public string Wartosc { get; set; } = null!; + + public virtual DzienRozl DzienNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Email.cs b/Blink.Backoffice.Services.PcmDb/Entities/Email.cs new file mode 100644 index 0000000..b4c38cf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Email.cs @@ -0,0 +1,52 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Email +{ + public decimal EmId { get; set; } + + public decimal? UzId { get; set; } + + public decimal? TEDId { get; set; } + + public decimal? TERId { get; set; } + + public decimal? TEWId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Login { get; set; } = null!; + + public string Haslo { get; set; } = null!; + + public string Host { get; set; } = null!; + + public string Port { get; set; } = null!; + + public short Auth { get; set; } + + public short TLS { get; set; } + + public short TLSVer { get; set; } + + public string Nadawca { get; set; } = null!; + + public short Kopia { get; set; } + + public string? KopiaEmail { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? TEZIId { get; set; } + + public decimal? TEHRId { get; set; } + + public virtual TrescEmail? TED { get; set; } + + public virtual TrescEmail? TER { get; set; } + + public virtual TrescEmail? TEW { get; set; } + + public virtual Uzytkownik? Uz { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/FormZgod.cs b/Blink.Backoffice.Services.PcmDb/Entities/FormZgod.cs new file mode 100644 index 0000000..1fcaf7d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/FormZgod.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class FormZgod +{ + public decimal TypOsId { get; set; } + + public decimal ZgId { get; set; } + + public short Kolejnosc { get; set; } + + public short? Wymagana { get; set; } + + public virtual TypOs TypOs { get; set; } = null!; + + public virtual Zgoda Zg { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/FormaPlatnPos7.cs b/Blink.Backoffice.Services.PcmDb/Entities/FormaPlatnPos7.cs new file mode 100644 index 0000000..990c053 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/FormaPlatnPos7.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class FormaPlatnPos7 +{ + public decimal FormaId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Typ { get; set; } + + public short Reszta { get; set; } + + public short? Autoryzacja { get; set; } + + public string? SerwisPlatniczy { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? CentrFormaId { get; set; } + + public decimal? Kolejnosc { get; set; } + + public virtual ICollection KasaFormaPlatn { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/FormaPlatnosci.cs b/Blink.Backoffice.Services.PcmDb/Entities/FormaPlatnosci.cs new file mode 100644 index 0000000..833ff89 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/FormaPlatnosci.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class FormaPlatnosci +{ + public short FormaPlat { get; set; } + + public string Tekst { get; set; } = null!; + + public short MinTermPlat { get; set; } + + public short MaxTermPlat { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/GrWartosc.cs b/Blink.Backoffice.Services.PcmDb/Entities/GrWartosc.cs new file mode 100644 index 0000000..3473461 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/GrWartosc.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class GrWartosc +{ + public decimal GrId { get; set; } + + public decimal ParId { get; set; } + + public int Wartosc { get; set; } + + public virtual GrupaTow Gr { get; set; } = null!; + + public virtual Parametr Par { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/GrupaAkcyzowa.cs b/Blink.Backoffice.Services.PcmDb/Entities/GrupaAkcyzowa.cs new file mode 100644 index 0000000..fae432c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/GrupaAkcyzowa.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class GrupaAkcyzowa +{ + public decimal GrAkcId { get; set; } + + public string Kod { get; set; } = null!; + + public string Nazwa { get; set; } = null!; + + public string AkcJM { get; set; } = null!; + + public string OpcjeWzoru { get; set; } = null!; + + public string? PrefiksyCN { get; set; } + + public string? Opis { get; set; } + + public decimal? CentrGrAkcId { get; set; } + + public DateTime Zmiana { get; set; } + + public string? DodJM { get; set; } + + public decimal? IleDodJMWAkcJM { get; set; } + + public virtual ICollection PozAkcyza { get; set; } = new List(); + + public virtual ICollection TabelaAkcyzowa { get; set; } = new List(); + + public virtual ICollection TowAkcyza { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/GrupaPromocji.cs b/Blink.Backoffice.Services.PcmDb/Entities/GrupaPromocji.cs new file mode 100644 index 0000000..ca73a62 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/GrupaPromocji.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class GrupaPromocji +{ + public decimal GrupaId { get; set; } + + public short Typ { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Opis { get; set; } = null!; + + public short Aktywna { get; set; } + + public decimal? CentrGrupaId { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection PowiazanieProm { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/GrupaTow.cs b/Blink.Backoffice.Services.PcmDb/Entities/GrupaTow.cs new file mode 100644 index 0000000..f746506 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/GrupaTow.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class GrupaTow +{ + public decimal GrId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Opis { get; set; } = null!; + + public virtual ICollection GrWartosc { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/GrupaUz.cs b/Blink.Backoffice.Services.PcmDb/Entities/GrupaUz.cs new file mode 100644 index 0000000..c0aaf58 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/GrupaUz.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class GrupaUz +{ + public decimal UzId { get; set; } + + public decimal RolaId { get; set; } + + public virtual Uzytkownik Rola { get; set; } = null!; + + public virtual Uzytkownik Uz { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmCeny.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmCeny.cs new file mode 100644 index 0000000..2944d6d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmCeny.cs @@ -0,0 +1,36 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmCeny +{ + public decimal HarmId { get; set; } + + public decimal TowId { get; set; } + + public decimal? CenaDet { get; set; } + + public decimal? CenaHurt { get; set; } + + public decimal? CenaDod { get; set; } + + public decimal? CenaNoc { get; set; } + + public decimal? Cena5 { get; set; } + + public decimal? Cena6 { get; set; } + + public decimal? ProgPromocji { get; set; } + + public short? CenaOtwarta { get; set; } + + public string? Inne { get; set; } + + public short? Stawka { get; set; } + + public decimal? Cena7 { get; set; } + + public decimal? Cena8 { get; set; } + + public virtual HarmWpis Harm { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmCykl.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmCykl.cs new file mode 100644 index 0000000..d08cef3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmCykl.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmCykl +{ + public decimal HarmId { get; set; } + + public short OdDnia { get; set; } + + public short OdGodz { get; set; } + + public short OdMin { get; set; } + + public short? DoDnia { get; set; } + + public short? DoGodz { get; set; } + + public short? DoMin { get; set; } + + public virtual HarmWpis Harm { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmHarm.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmHarm.cs new file mode 100644 index 0000000..e8d2cbb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmHarm.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmHarm +{ + public decimal HarmId { get; set; } + + public short Znaczenie { get; set; } + + public decimal PoprzHarmId { get; set; } + + public virtual HarmWpis Harm { get; set; } = null!; + + public virtual HarmWpis PoprzHarm { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmRap.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmRap.cs new file mode 100644 index 0000000..02c7e4c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmRap.cs @@ -0,0 +1,30 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmRap +{ + public decimal HRId { get; set; } + + public string Nazwa { get; set; } = null!; + + public DateTime DataOd { get; set; } + + public DateTime? DataDo { get; set; } + + public short Typ { get; set; } + + public short RodzajCyklicznosci { get; set; } + + public short? RodzajEksportu { get; set; } + + public short? WysylajEmail { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection HarmRapCykl { get; set; } = new List(); + + public virtual ICollection HarmRapParam { get; set; } = new List(); + + public virtual ICollection HarmRapZlecenie { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmRapCykl.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmRapCykl.cs new file mode 100644 index 0000000..1f0a884 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmRapCykl.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmRapCykl +{ + public decimal HRId { get; set; } + + public short Dzien { get; set; } + + public short Godzina { get; set; } + + public short Minuta { get; set; } + + public virtual HarmRap HR { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmRapParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmRapParam.cs new file mode 100644 index 0000000..c8b9318 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmRapParam.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmRapParam +{ + public decimal HRId { get; set; } + + public string ParNazwa { get; set; } = null!; + + public string ParWartosc { get; set; } = null!; + + public virtual HarmRap HR { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmRapZlecenie.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmRapZlecenie.cs new file mode 100644 index 0000000..dcb747d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmRapZlecenie.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmRapZlecenie +{ + public decimal HRId { get; set; } + + public DateTime DataCzas { get; set; } + + public short Status { get; set; } + + public string? Komentarz { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual HarmRap HR { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/HarmWpis.cs b/Blink.Backoffice.Services.PcmDb/Entities/HarmWpis.cs new file mode 100644 index 0000000..fa031c3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/HarmWpis.cs @@ -0,0 +1,42 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class HarmWpis +{ + public decimal HarmId { get; set; } + + public short HarmTyp { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Opcje { get; set; } = null!; + + public short Aktywny { get; set; } + + public short Uwzgledniony { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? PolId { get; set; } + + public decimal? CentrHarmId { get; set; } + + public DateTime? WaznyOd { get; set; } + + public DateTime? WaznyDo { get; set; } + + public decimal? KrajId { get; set; } + + public short? CenyBrutto { get; set; } + + public virtual ICollection HarmCeny { get; set; } = new List(); + + public virtual ICollection HarmCykl { get; set; } = new List(); + + public virtual ICollection HarmHarmHarm { get; set; } = new List(); + + public virtual ICollection HarmHarmPoprzHarm { get; set; } = new List(); + + public virtual Kraj? Kraj { get; set; } + + public virtual Polityka? Pol { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Istw.cs b/Blink.Backoffice.Services.PcmDb/Entities/Istw.cs new file mode 100644 index 0000000..89ddafa --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Istw.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Istw +{ + public decimal TowId { get; set; } + + public decimal MagId { get; set; } + + public decimal StanMag { get; set; } + + public decimal BlokadaMag { get; set; } + + public decimal CenaMag { get; set; } + + public decimal StanMin { get; set; } + + public decimal StanMax { get; set; } + + public decimal? RezerwacjaMag { get; set; } + + public virtual ICollection Blokada { get; set; } = new List(); + + public virtual Magazyn Mag { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/JM.cs b/Blink.Backoffice.Services.PcmDb/Entities/JM.cs new file mode 100644 index 0000000..13d6d63 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/JM.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class JM +{ + public decimal JMId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Precyzja { get; set; } + + public decimal? CentrJMId { get; set; } + + public virtual ICollection KodWazony { get; set; } = new List(); + + public virtual ICollection Towar { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KartaLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/KartaLoj.cs new file mode 100644 index 0000000..85de370 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KartaLoj.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KartaLoj +{ + public decimal KartaId { get; set; } + + public decimal KontoId { get; set; } + + public short TypKarty { get; set; } + + public string? KodKarty { get; set; } + + public DateTime? WaznaOd { get; set; } + + public DateTime? WaznaDo { get; set; } + + public DateTime? Uniewazniono { get; set; } + + public string? Posiadacz { get; set; } + + public string? Opis1 { get; set; } + + public string? Opis2 { get; set; } + + public decimal? CentrKartaId { get; set; } + + public virtual KontoLoj Konto { get; set; } = null!; + + public virtual ICollection ZdarzLoj { get; set; } = new List(); + + public virtual ICollection NrRej { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KasKod.cs b/Blink.Backoffice.Services.PcmDb/Entities/KasKod.cs new file mode 100644 index 0000000..95ad4d1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KasKod.cs @@ -0,0 +1,48 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KasKod +{ + public decimal KasaId { get; set; } + + public decimal TowId { get; set; } + + public short Kolejnosc { get; set; } + + public string Kod { get; set; } = null!; + + public short Status { get; set; } + + public short ZmianyCen { get; set; } + + public short ZmianyInne { get; set; } + + public short BylyZmianyCen { get; set; } + + public short BylyZmianyInne { get; set; } + + public int? KasPrefPLU { get; set; } + + public int? PLU { get; set; } + + public short? DodIndeks { get; set; } + + public short? Stawka { get; set; } + + public short? TypTowaru { get; set; } + + public decimal? IleWKodzie { get; set; } + + public short? PoziomCen { get; set; } + + public string? Skrot { get; set; } + + public string? KodOpak { get; set; } + + public int? PLUOpak { get; set; } + + public string? Rezerwa { get; set; } + + public virtual Kasa Kasa { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KasPar.cs b/Blink.Backoffice.Services.PcmDb/Entities/KasPar.cs new file mode 100644 index 0000000..b8a25dd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KasPar.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KasPar +{ + public decimal KasaId { get; set; } + + public string ParNazwa { get; set; } = null!; + + public string ParWartosc { get; set; } = null!; + + public virtual Kasa Kasa { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KasTow.cs b/Blink.Backoffice.Services.PcmDb/Entities/KasTow.cs new file mode 100644 index 0000000..066076b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KasTow.cs @@ -0,0 +1,28 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KasTow +{ + public decimal KasaId { get; set; } + + public string KodWyslany { get; set; } = null!; + + public decimal TowId { get; set; } + + public short TypTowaru { get; set; } + + public short Dodatkowy { get; set; } + + public int Plu { get; set; } + + public short DodIndeks { get; set; } + + public short ZmianyCen { get; set; } + + public short ZmianyInne { get; set; } + + public short FlagaExp { get; set; } + + public virtual Kasa Kasa { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Kasa.cs b/Blink.Backoffice.Services.PcmDb/Entities/Kasa.cs new file mode 100644 index 0000000..8a037dd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Kasa.cs @@ -0,0 +1,42 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Kasa +{ + public decimal KasaId { get; set; } + + public decimal MagId { get; set; } + + public short Numer { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Rodzaj { get; set; } + + public string Typ { get; set; } = null!; + + public short Aktywny { get; set; } + + public string Stanowisko { get; set; } = null!; + + public string? NrUnikatowy { get; set; } + + public virtual ICollection DokKasa { get; set; } = new List(); + + public virtual ICollection KasKod { get; set; } = new List(); + + public virtual ICollection KasPar { get; set; } = new List(); + + public virtual ICollection KasTow { get; set; } = new List(); + + public virtual ICollection KasaFormaPlatn { get; set; } = new List(); + + public virtual Magazyn Mag { get; set; } = null!; + + public virtual ICollection Paragon { get; set; } = new List(); + + public virtual ICollection ProfilKasa { get; set; } = new List(); + + public virtual ICollection Zlecenie { get; set; } = new List(); + + public virtual ICollection As { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KasaFormaPlatn.cs b/Blink.Backoffice.Services.PcmDb/Entities/KasaFormaPlatn.cs new file mode 100644 index 0000000..41b2c97 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KasaFormaPlatn.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KasaFormaPlatn +{ + public decimal FormaId { get; set; } + + public decimal KasaId { get; set; } + + public short Aktywny { get; set; } + + public virtual FormaPlatnPos7 Forma { get; set; } = null!; + + public virtual Kasa Kasa { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KatParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/KatParam.cs new file mode 100644 index 0000000..18ca34a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KatParam.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KatParam +{ + public decimal KatId { get; set; } + + public decimal ParId { get; set; } + + public short Kolejnosc { get; set; } + + public int WartDom { get; set; } + + public virtual Kategoria Kat { get; set; } = null!; + + public virtual Parametr Par { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Kategoria.cs b/Blink.Backoffice.Services.PcmDb/Entities/Kategoria.cs new file mode 100644 index 0000000..a24772c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Kategoria.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Kategoria +{ + public decimal KatId { get; set; } + + public string Nazwa { get; set; } = null!; + + public decimal? CentrKatId { get; set; } + + public virtual ICollection KatParam { get; set; } = new List(); + + public virtual ICollection Towar { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KodDod.cs b/Blink.Backoffice.Services.PcmDb/Entities/KodDod.cs new file mode 100644 index 0000000..08aec0a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KodDod.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KodDod +{ + public decimal TowId { get; set; } + + public short Kolejnosc { get; set; } + + public string Skrot { get; set; } = null!; + + public string Kod { get; set; } = null!; + + public short PoziomCen { get; set; } + + public int PrefPLU { get; set; } + + public decimal? IleWKodzie { get; set; } + + public short? TypKodu { get; set; } + + public string? SubsysKoduDod { get; set; } + + public short? KodCentralny { get; set; } + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KodWazony.cs b/Blink.Backoffice.Services.PcmDb/Entities/KodWazony.cs new file mode 100644 index 0000000..a4317df --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KodWazony.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KodWazony +{ + public decimal KWId { get; set; } + + public short Prefix { get; set; } + + public string Nazwa { get; set; } = null!; + + public short CzescStala { get; set; } + + public short WartoscWKodzie { get; set; } + + public short DodKontrola { get; set; } + + public short PrecyzjaWKodzie { get; set; } + + public decimal? CentrKWId { get; set; } + + public decimal? JMId { get; set; } + + public virtual JM? JM { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Komentarz.cs b/Blink.Backoffice.Services.PcmDb/Entities/Komentarz.cs new file mode 100644 index 0000000..4be6147 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Komentarz.cs @@ -0,0 +1,10 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Komentarz +{ + public decimal ZmId { get; set; } + + public string Opis { get; set; } = null!; + + public virtual Zmiana Zm { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Konfig.cs b/Blink.Backoffice.Services.PcmDb/Entities/Konfig.cs new file mode 100644 index 0000000..5c81a07 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Konfig.cs @@ -0,0 +1,10 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Konfig +{ + public string ParGrupa { get; set; } = null!; + + public string ParNazwa { get; set; } = null!; + + public string ParWartosc { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KontoBankowe.cs b/Blink.Backoffice.Services.PcmDb/Entities/KontoBankowe.cs new file mode 100644 index 0000000..7331dfb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KontoBankowe.cs @@ -0,0 +1,42 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KontoBankowe +{ + public decimal KBId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Numer { get; set; } = null!; + + public short Domyslne { get; set; } + + public short Typ { get; set; } + + public string Sufix { get; set; } = null!; + + public decimal BankId { get; set; } + + public decimal WalId { get; set; } + + public decimal? PowKBId { get; set; } + + public decimal? MagId { get; set; } + + public short Aktywne { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? CentrKBId { get; set; } + + public decimal? KBIdOplat { get; set; } + + public virtual Bank Bank { get; set; } = null!; + + public virtual Magazyn? Mag { get; set; } + + public virtual ICollection Oplata { get; set; } = new List(); + + public virtual Waluta Wal { get; set; } = null!; + + public virtual ICollection Dok { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KontoBankoweKontr.cs b/Blink.Backoffice.Services.PcmDb/Entities/KontoBankoweKontr.cs new file mode 100644 index 0000000..535ede0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KontoBankoweKontr.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KontoBankoweKontr +{ + public decimal KBKId { get; set; } + + public string Numer { get; set; } = null!; + + public decimal KontrId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Typ { get; set; } + + public short Domyslne { get; set; } + + public short Aktywne { get; set; } + + public short WykazVat { get; set; } + + public decimal? PowKBKId { get; set; } + + public decimal? BankId { get; set; } + + public decimal WalId { get; set; } + + public decimal? CentrKBKId { get; set; } + + public virtual Bank? Bank { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual Waluta Wal { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KontoLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/KontoLoj.cs new file mode 100644 index 0000000..0c31bb0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KontoLoj.cs @@ -0,0 +1,44 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KontoLoj +{ + public decimal KontoId { get; set; } + + public decimal KontrId { get; set; } + + public short TypKonta { get; set; } + + public short Aktywne { get; set; } + + public string? Nazwa { get; set; } + + public decimal StanPocz { get; set; } + + public decimal Stan { get; set; } + + public DateTime ZmianaStanu { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? CentrKontoId { get; set; } + + public virtual ICollection KartaLoj { get; set; } = new List(); + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual ICollection PowKontLojNoweKonto { get; set; } = new List(); + + public virtual ICollection PowKontLojStareKonto { get; set; } = new List(); + + public virtual ICollection RegulaDok { get; set; } = new List(); + + public virtual ICollection RegulaPar { get; set; } = new List(); + + public virtual ICollection SklepKontoLoj { get; set; } = new List(); + + public virtual ICollection SklepRegulaDok { get; set; } = new List(); + + public virtual ICollection SklepRegulaPar { get; set; } = new List(); + + public virtual ICollection ZdarzLoj { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KontrOpis.cs b/Blink.Backoffice.Services.PcmDb/Entities/KontrOpis.cs new file mode 100644 index 0000000..aa039a5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KontrOpis.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KontrOpis +{ + public decimal KontrId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual Kontrahent Kontr { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Kontrahent.cs b/Blink.Backoffice.Services.PcmDb/Entities/Kontrahent.cs new file mode 100644 index 0000000..cd20219 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Kontrahent.cs @@ -0,0 +1,162 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Kontrahent +{ + public decimal KontrId { get; set; } + + public decimal? AkwId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string NaPrzelewie1 { get; set; } = null!; + + public string NaPrzelewie2 { get; set; } = null!; + + public string Skrot { get; set; } = null!; + + public string Ulica { get; set; } = null!; + + public string Kod { get; set; } = null!; + + public string Miasto { get; set; } = null!; + + public string Telefon { get; set; } = null!; + + public string Fax { get; set; } = null!; + + public string EMail { get; set; } = null!; + + public string Bank { get; set; } = null!; + + public string Konto { get; set; } = null!; + + public string NIP { get; set; } = null!; + + public short Staly { get; set; } + + public short Dostawca { get; set; } + + public decimal RabatDost { get; set; } + + public short FormaPlatDost { get; set; } + + public short TermPlatDost { get; set; } + + public short CzasRealZam { get; set; } + + public short Producent { get; set; } + + public short Odbiorca { get; set; } + + public decimal RabatOdb { get; set; } + + public short FormaPlatOdb { get; set; } + + public short TermPlatOdb { get; set; } + + public decimal MaxKredyt { get; set; } + + public short MaxPoTermPlat { get; set; } + + public string KodKarty { get; set; } = null!; + + public short KartaAktywna { get; set; } + + public DateTime TermWaznKarty { get; set; } + + public short PoziomRabatu { get; set; } + + public string NrAnalityki { get; set; } = null!; + + public string KodKontr { get; set; } = null!; + + public short ZakPracChron { get; set; } + + public short Aktywny { get; set; } + + public string Rezerwa1 { get; set; } = null!; + + public string Rezerwa2 { get; set; } = null!; + + public decimal? CentrKontrId { get; set; } + + public DateTime Zmiana { get; set; } + + public string? IndeksCentr { get; set; } + + public decimal? KontrKrajId { get; set; } + + public string? Poczta { get; set; } + + public string? NrDomu { get; set; } + + public string? NrLokalu { get; set; } + + public short? Osoba { get; set; } + + public virtual Akwizytor? Akw { get; set; } + + public virtual ICollection CentrStanZgody { get; set; } = new List(); + + public virtual ICollection DokDodKth { get; set; } = new List(); + + public virtual ICollection DokKontr { get; set; } = new List(); + + public virtual ICollection DostProdDost { get; set; } = new List(); + + public virtual ICollection DostProdProd { get; set; } = new List(); + + public virtual ICollection DostawcaNavigation { get; set; } = new List(); + + public virtual ICollection KontoBankoweKontr { get; set; } = new List(); + + public virtual ICollection KontoLoj { get; set; } = new List(); + + public virtual Kraj? KontrKraj { get; set; } + + public virtual ICollection KontrOpis { get; set; } = new List(); + + public virtual ICollection NrRej { get; set; } = new List(); + + public virtual ICollection OdbProdOdb { get; set; } = new List(); + + public virtual ICollection OdbProdProd { get; set; } = new List(); + + public virtual ICollection OdbiorcaNavigation { get; set; } = new List(); + + public virtual ICollection OfSlownik { get; set; } = new List(); + + public virtual ICollection Oferta { get; set; } = new List(); + + public virtual ICollection OsobaNavigation { get; set; } = new List(); + + public virtual ICollection PH { get; set; } = new List(); + + public virtual ICollection PHOdbiorca { get; set; } = new List(); + + public virtual ICollection PcfUserPcfCustomer { get; set; } = new List(); + + public virtual ICollection PcfUserPcfLoyaltyCustomer { get; set; } = new List(); + + public virtual ICollection PcfUserPcfPStation { get; set; } = new List(); + + public virtual ICollection PcpReceipt { get; set; } = new List(); + + public virtual Sklep? Sklep { get; set; } + + public virtual ICollection SklepKontr { get; set; } = new List(); + + public virtual ICollection SklepKontrSklep { get; set; } = new List(); + + public virtual ICollection StanZgody { get; set; } = new List(); + + public virtual ICollection Towar { get; set; } = new List(); + + public virtual ICollection ZdarzOs { get; set; } = new List(); + + public virtual ICollection KPW { get; set; } = new List(); + + public virtual ICollection SklepFlagi { get; set; } = new List(); + + public virtual ICollection TypOs { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Kraj.cs b/Blink.Backoffice.Services.PcmDb/Entities/Kraj.cs new file mode 100644 index 0000000..162a503 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Kraj.cs @@ -0,0 +1,30 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Kraj +{ + public decimal KrajId { get; set; } + + public decimal WalId { get; set; } + + public string Kod { get; set; } = null!; + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public string? ZdjecieFlagi { get; set; } + + public virtual ICollection HarmWpis { get; set; } = new List(); + + public virtual ICollection Kontrahent { get; set; } = new List(); + + public virtual ICollection KrajStawka { get; set; } = new List(); + + public virtual ICollection Sklep { get; set; } = new List(); + + public virtual ICollection TowKraj { get; set; } = new List(); + + public virtual ICollection Towar { get; set; } = new List(); + + public virtual Waluta Wal { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KrajStawka.cs b/Blink.Backoffice.Services.PcmDb/Entities/KrajStawka.cs new file mode 100644 index 0000000..a8a412f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KrajStawka.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KrajStawka +{ + public decimal KrajId { get; set; } + + public short Stawka { get; set; } + + public short? Podstawowa { get; set; } + + public virtual Kraj Kraj { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KthParWartosc.cs b/Blink.Backoffice.Services.PcmDb/Entities/KthParWartosc.cs new file mode 100644 index 0000000..52126d5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KthParWartosc.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KthParWartosc +{ + public decimal KPWId { get; set; } + + public decimal KthParId { get; set; } + + public short Kolejnosc { get; set; } + + public string Tekst { get; set; } = null!; + + public decimal? CentrKPWId { get; set; } + + public virtual KthParam KthPar { get; set; } = null!; + + public virtual ICollection KthParam { get; set; } = new List(); + + public virtual ICollection Kontr { get; set; } = new List(); + + public virtual ICollection Sklep { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KthParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/KthParam.cs new file mode 100644 index 0000000..5c9b6e8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KthParam.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KthParam +{ + public decimal KthParId { get; set; } + + public short Kolejnosc { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Wymagany { get; set; } + + public decimal? KPWDomyslnaId { get; set; } + + public decimal? CentrKthParId { get; set; } + + public virtual KthParWartosc? KPWDomyslna { get; set; } + + public virtual ICollection KthParWartosc { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/KursWaluty.cs b/Blink.Backoffice.Services.PcmDb/Entities/KursWaluty.cs new file mode 100644 index 0000000..5281ec2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/KursWaluty.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class KursWaluty +{ + public decimal WalId { get; set; } + + public DateTime Data { get; set; } + + public decimal? KursZr { get; set; } + + public decimal? Spread { get; set; } + + public decimal? Kurs { get; set; } + + public decimal? KursZakZr { get; set; } + + public decimal? SpreadZak { get; set; } + + public decimal? KursZak { get; set; } + + public string? NrTabeli { get; set; } + + public string? NrTabeliZak { get; set; } + + public virtual Waluta Wal { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/LiniaLotnicza.cs b/Blink.Backoffice.Services.PcmDb/Entities/LiniaLotnicza.cs new file mode 100644 index 0000000..944243d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/LiniaLotnicza.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class LiniaLotnicza +{ + public decimal LiniaId { get; set; } + + public string Kod { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public string? Nazwa { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/LogOperation.cs b/Blink.Backoffice.Services.PcmDb/Entities/LogOperation.cs new file mode 100644 index 0000000..10c176b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/LogOperation.cs @@ -0,0 +1,30 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class LogOperation +{ + public decimal OperationId { get; set; } + + public decimal PosId { get; set; } + + public decimal? OperatorId { get; set; } + + public decimal AppTypeId { get; set; } + + public decimal ModuleTypeId { get; set; } + + public decimal OperationTypeId { get; set; } + + public DateTime OperationTime { get; set; } + + public string? AdditionalDesc { get; set; } + + public string? ModItemId { get; set; } + + public decimal? ModTableTypeId { get; set; } + + public DateTime? LastUpdate { get; set; } + + public virtual ICollection LogValChangeNum { get; set; } = new List(); + + public virtual ICollection LogValChangeTxt { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/LogTypeDef.cs b/Blink.Backoffice.Services.PcmDb/Entities/LogTypeDef.cs new file mode 100644 index 0000000..81df395 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/LogTypeDef.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class LogTypeDef +{ + public decimal TypeId { get; set; } + + public string? TypeCategory { get; set; } + + public int Type { get; set; } + + public string TypeValue { get; set; } = null!; + + public DateTime? LastUpdate { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/LogValChangeNum.cs b/Blink.Backoffice.Services.PcmDb/Entities/LogValChangeNum.cs new file mode 100644 index 0000000..42f6714 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/LogValChangeNum.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class LogValChangeNum +{ + public decimal ValChangeId { get; set; } + + public decimal OperationId { get; set; } + + public decimal ValChangeTypeId { get; set; } + + public decimal ValueBefore { get; set; } + + public decimal ValueAfter { get; set; } + + public DateTime? LastUpdate { get; set; } + + public virtual LogOperation Operation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/LogValChangeTxt.cs b/Blink.Backoffice.Services.PcmDb/Entities/LogValChangeTxt.cs new file mode 100644 index 0000000..7759a45 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/LogValChangeTxt.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class LogValChangeTxt +{ + public decimal ValChangeId { get; set; } + + public decimal OperationId { get; set; } + + public decimal ValChangeTypeId { get; set; } + + public string ValueBefore { get; set; } = null!; + + public string ValueAfter { get; set; } = null!; + + public DateTime? LastUpdate { get; set; } + + public virtual LogOperation Operation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Lotnisko.cs b/Blink.Backoffice.Services.PcmDb/Entities/Lotnisko.cs new file mode 100644 index 0000000..22a6fd3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Lotnisko.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Lotnisko +{ + public decimal LotnId { get; set; } + + public string Kod { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public short DutyFree { get; set; } + + public string? Nazwa { get; set; } + + public string? Kraj { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Magazyn.cs b/Blink.Backoffice.Services.PcmDb/Entities/Magazyn.cs new file mode 100644 index 0000000..2019885 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Magazyn.cs @@ -0,0 +1,30 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Magazyn +{ + public decimal MagId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short? Numer { get; set; } + + public virtual ICollection Dok { get; set; } = new List(); + + public virtual ICollection Istw { get; set; } = new List(); + + public virtual ICollection Kasa { get; set; } = new List(); + + public virtual ICollection KontoBankowe { get; set; } = new List(); + + public virtual ICollection Marzownik { get; set; } = new List(); + + public virtual ICollection NumMag { get; set; } = new List(); + + public virtual ICollection PrtMag { get; set; } = new List(); + + public virtual ICollection RapWartPoczDane { get; set; } = new List(); + + public virtual ICollection Sklep { get; set; } = new List(); + + public virtual ICollection Pol { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/MarZakres.cs b/Blink.Backoffice.Services.PcmDb/Entities/MarZakres.cs new file mode 100644 index 0000000..afd8f91 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/MarZakres.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class MarZakres +{ + public decimal MarId { get; set; } + + public decimal OdCeny { get; set; } + + public short Zaokraglanie { get; set; } + + public string Koncowki { get; set; } = null!; + + public virtual Marzownik Mar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Marzownik.cs b/Blink.Backoffice.Services.PcmDb/Entities/Marzownik.cs new file mode 100644 index 0000000..9c237d3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Marzownik.cs @@ -0,0 +1,36 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Marzownik +{ + public decimal MarId { get; set; } + + public short PoziomCen { get; set; } + + public decimal? AsId { get; set; } + + public decimal? MagId { get; set; } + + public decimal? TowId { get; set; } + + public short? ModZnaczenie { get; set; } + + public decimal? ModOd100 { get; set; } + + public decimal? ModW100 { get; set; } + + public short? MinMarzaJest { get; set; } + + public decimal? MinMarzaOd100 { get; set; } + + public decimal? MinMarzaW100 { get; set; } + + public short Zakresy { get; set; } + + public virtual Asort? As { get; set; } + + public virtual Magazyn? Mag { get; set; } + + public virtual ICollection MarZakres { get; set; } = new List(); + + public virtual Towar? Tow { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Miasto.cs b/Blink.Backoffice.Services.PcmDb/Entities/Miasto.cs new file mode 100644 index 0000000..bff734d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Miasto.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Miasto +{ + public decimal MId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Domyslne { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection Ulica { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Notatki.cs b/Blink.Backoffice.Services.PcmDb/Entities/Notatki.cs new file mode 100644 index 0000000..92122cb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Notatki.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Notatki +{ + public decimal TowId { get; set; } + + public short Kolejnosc { get; set; } + + public string Tekst { get; set; } = null!; + + public short KoniecLinii { get; set; } + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/NrRej.cs b/Blink.Backoffice.Services.PcmDb/Entities/NrRej.cs new file mode 100644 index 0000000..0f85247 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/NrRej.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class NrRej +{ + public decimal KontrId { get; set; } + + public string NrFormat { get; set; } = null!; + + public string NrWpisany { get; set; } = null!; + + public short WyborKart { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual ICollection Karta { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/NumDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/NumDok.cs new file mode 100644 index 0000000..6359642 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/NumDok.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class NumDok +{ + public short TypNumeru { get; set; } + + public int Licznik { get; set; } + + public string Format { get; set; } = null!; + + public virtual ICollection NumMag { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/NumMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/NumMag.cs new file mode 100644 index 0000000..68fb5bb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/NumMag.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class NumMag +{ + public short TypNumeru { get; set; } + + public decimal MagId { get; set; } + + public int Licznik { get; set; } + + public string Format { get; set; } = null!; + + public virtual Magazyn Mag { get; set; } = null!; + + public virtual NumDok TypNumeruNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/OdbProd.cs b/Blink.Backoffice.Services.PcmDb/Entities/OdbProd.cs new file mode 100644 index 0000000..edb36fe --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/OdbProd.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class OdbProd +{ + public decimal OdbId { get; set; } + + public decimal ProdId { get; set; } + + public decimal RabatProd { get; set; } + + public virtual Kontrahent Odb { get; set; } = null!; + + public virtual Kontrahent Prod { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Odbiorca.cs b/Blink.Backoffice.Services.PcmDb/Entities/Odbiorca.cs new file mode 100644 index 0000000..3c5f3f0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Odbiorca.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Odbiorca +{ + public decimal KontrId { get; set; } + + public decimal TowId { get; set; } + + public decimal Zamowil { get; set; } + + public decimal? RabatTow { get; set; } + + public decimal? StalaCena { get; set; } + + public string? Nazwa { get; set; } + + public string? Indeks { get; set; } + + public short? NaWylacznosc { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/OfKod.cs b/Blink.Backoffice.Services.PcmDb/Entities/OfKod.cs new file mode 100644 index 0000000..18dfd6d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/OfKod.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class OfKod +{ + public decimal KontrId { get; set; } + + public decimal OfId { get; set; } + + public short Kolejnosc { get; set; } + + public short TypKodu { get; set; } + + public string Kod { get; set; } = null!; + + public virtual Oferta Oferta { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/OfSlownik.cs b/Blink.Backoffice.Services.PcmDb/Entities/OfSlownik.cs new file mode 100644 index 0000000..e43cb1a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/OfSlownik.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class OfSlownik +{ + public decimal KontrId { get; set; } + + public short Typ { get; set; } + + public string Opis { get; set; } = null!; + + public decimal? Id { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Oferta.cs b/Blink.Backoffice.Services.PcmDb/Entities/Oferta.cs new file mode 100644 index 0000000..92a0e1a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Oferta.cs @@ -0,0 +1,48 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Oferta +{ + public decimal KontrId { get; set; } + + public decimal OfId { get; set; } + + public decimal? TowId { get; set; } + + public decimal? Przelicznik { get; set; } + + public string? Nazwa { get; set; } + + public string? Skrot { get; set; } + + public string? Indeks1 { get; set; } + + public string? Indeks2 { get; set; } + + public string? Opis1 { get; set; } + + public string? Opis2 { get; set; } + + public string? Opis3 { get; set; } + + public string? Opis4 { get; set; } + + public string? CKU { get; set; } + + public short? TermWazn { get; set; } + + public short? Stawka { get; set; } + + public decimal? Cena { get; set; } + + public string? Asortyment { get; set; } + + public string? Kategoria { get; set; } + + public string? JM { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual ICollection OfKod { get; set; } = new List(); + + public virtual Towar? Tow { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/OpisZdarzLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/OpisZdarzLoj.cs new file mode 100644 index 0000000..0e0a1ca --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/OpisZdarzLoj.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class OpisZdarzLoj +{ + public decimal ZdarzLojId { get; set; } + + public short Znaczenie { get; set; } + + public int Kolejnosc { get; set; } + + public int? ParamI1 { get; set; } + + public int? ParamI2 { get; set; } + + public decimal? ParamN1 { get; set; } + + public decimal? ParamN2 { get; set; } + + public string? ParamS1 { get; set; } + + public virtual ZdarzLoj ZdarzLoj { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Oplata.cs b/Blink.Backoffice.Services.PcmDb/Entities/Oplata.cs new file mode 100644 index 0000000..7b0e81b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Oplata.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Oplata +{ + public decimal OplataId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Typ { get; set; } + + public short Rodzaj { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? KBId { get; set; } + + public decimal? CentrOplataId { get; set; } + + public DateTime? DataOd { get; set; } + + public DateTime? DataDo { get; set; } + + public decimal? StawkaProc { get; set; } + + public decimal? Kwota { get; set; } + + public string? Komentarz { get; set; } + + public virtual KontoBankowe? KB { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Osoba.cs b/Blink.Backoffice.Services.PcmDb/Entities/Osoba.cs new file mode 100644 index 0000000..5e690bc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Osoba.cs @@ -0,0 +1,10 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Osoba +{ + public decimal KontrId { get; set; } + + public string Nazwisko { get; set; } = null!; + + public virtual Kontrahent Kontr { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PH.cs b/Blink.Backoffice.Services.PcmDb/Entities/PH.cs new file mode 100644 index 0000000..26e9d91 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PH.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PH +{ + public decimal PHId { get; set; } + + public decimal? KontrId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual Kontrahent? Kontr { get; set; } + + public virtual ICollection PHDane { get; set; } = new List(); + + public virtual ICollection PHOdbiorca { get; set; } = new List(); + + public virtual ICollection PHRozliczenie { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PHDane.cs b/Blink.Backoffice.Services.PcmDb/Entities/PHDane.cs new file mode 100644 index 0000000..8ea30a5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PHDane.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PHDane +{ + public decimal PHId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual PH PH { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PHOdbDane.cs b/Blink.Backoffice.Services.PcmDb/Entities/PHOdbDane.cs new file mode 100644 index 0000000..05eb2d8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PHOdbDane.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PHOdbDane +{ + public decimal PHId { get; set; } + + public decimal KontrId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual PHOdbiorca PHOdbiorca { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PHOdbiorca.cs b/Blink.Backoffice.Services.PcmDb/Entities/PHOdbiorca.cs new file mode 100644 index 0000000..c0220d5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PHOdbiorca.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PHOdbiorca +{ + public decimal PHId { get; set; } + + public decimal KontrId { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual PH PH { get; set; } = null!; + + public virtual ICollection PHOdbDane { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PHRozliczenie.cs b/Blink.Backoffice.Services.PcmDb/Entities/PHRozliczenie.cs new file mode 100644 index 0000000..fad034e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PHRozliczenie.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PHRozliczenie +{ + public decimal DokId { get; set; } + + public decimal PHId { get; set; } + + public decimal Kwota { get; set; } + + public DateTime? Rozliczono { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual PH PH { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Panel.cs b/Blink.Backoffice.Services.PcmDb/Entities/Panel.cs new file mode 100644 index 0000000..f297346 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Panel.cs @@ -0,0 +1,40 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Panel +{ + public decimal PanelId { get; set; } + + public short Aktywny { get; set; } + + public short Rodzaj { get; set; } + + public decimal? UzId { get; set; } + + public decimal? UzNSId { get; set; } + + public int? Param1 { get; set; } + + public string Nazwa { get; set; } = null!; + + public short? T { get; set; } + + public short? L { get; set; } + + public short? H { get; set; } + + public short? W { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? CentrPanelId { get; set; } + + public short TypAplikacji { get; set; } + + public virtual ICollection PanelParam { get; set; } = new List(); + + public virtual ICollection SklepPanel { get; set; } = new List(); + + public virtual Uzytkownik? Uz { get; set; } + + public virtual UzNaSklep? UzNS { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PanelParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/PanelParam.cs new file mode 100644 index 0000000..450678b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PanelParam.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PanelParam +{ + public decimal PanelId { get; set; } + + public string ParNazwa { get; set; } = null!; + + public string ParWartosc { get; set; } = null!; + + public virtual Panel Panel { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ParBon.cs b/Blink.Backoffice.Services.PcmDb/Entities/ParBon.cs new file mode 100644 index 0000000..d896135 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ParBon.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ParBon +{ + public decimal ParId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal Kwota { get; set; } + + public string Typ { get; set; } = null!; + + public string Numer { get; set; } = null!; + + public virtual Paragon Par { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ParPunkty.cs b/Blink.Backoffice.Services.PcmDb/Entities/ParPunkty.cs new file mode 100644 index 0000000..19088be --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ParPunkty.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ParPunkty +{ + public decimal ParId { get; set; } + + public short Typ { get; set; } + + public DateTime Kiedy { get; set; } + + public decimal Kwota { get; set; } + + public virtual Paragon Par { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ParWaluta.cs b/Blink.Backoffice.Services.PcmDb/Entities/ParWaluta.cs new file mode 100644 index 0000000..7fac7c5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ParWaluta.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ParWaluta +{ + public decimal ParId { get; set; } + + public decimal WalId { get; set; } + + public decimal WalKwota { get; set; } + + public decimal Kurs { get; set; } + + public decimal ParKwota { get; set; } + + public virtual Paragon Par { get; set; } = null!; + + public virtual Waluta Wal { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ParWartosc.cs b/Blink.Backoffice.Services.PcmDb/Entities/ParWartosc.cs new file mode 100644 index 0000000..41bdb85 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ParWartosc.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ParWartosc +{ + public decimal ParId { get; set; } + + public int Wartosc { get; set; } + + public int KolejnoscListy { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual Parametr Par { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ParWiseBase.cs b/Blink.Backoffice.Services.PcmDb/Entities/ParWiseBase.cs new file mode 100644 index 0000000..d065ffb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ParWiseBase.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ParWiseBase +{ + public decimal ParId { get; set; } + + public string KodGrupy { get; set; } = null!; + + public string Nazwa { get; set; } = null!; + + public string Opcje { get; set; } = null!; + + public short? KolWGrupie { get; set; } + + public virtual ICollection SklepTowParWiseBase { get; set; } = new List(); + + public virtual ICollection TowParWiseBase { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Paragon.cs b/Blink.Backoffice.Services.PcmDb/Entities/Paragon.cs new file mode 100644 index 0000000..10a0dda --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Paragon.cs @@ -0,0 +1,76 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Paragon +{ + public decimal ParId { get; set; } + + public decimal KasaId { get; set; } + + public DateTime DataCzas { get; set; } + + public short TypPar { get; set; } + + public DateTime Zmiana { get; set; } + + public string Kasjer { get; set; } = null!; + + public string CechyPar { get; set; } = null!; + + public string KodKarty { get; set; } = null!; + + public short Aktywny { get; set; } + + public int IloscPoz { get; set; } + + public decimal Brutto { get; set; } + + public decimal OpakZwr { get; set; } + + public decimal OpakWyd { get; set; } + + public decimal Rabat { get; set; } + + public decimal Gotowka { get; set; } + + public decimal Bony { get; set; } + + public decimal Czek { get; set; } + + public decimal Karta { get; set; } + + public decimal InneFPlat { get; set; } + + public decimal? Waluty { get; set; } + + public decimal? Przelew { get; set; } + + public decimal? DodFPlat { get; set; } + + public short? EksportFK { get; set; } + + public decimal? WalId { get; set; } + + public decimal? Kurs { get; set; } + + public DateTime? ZmianaPkt { get; set; } + + public string? NIP { get; set; } + + public string? GrupyGTU { get; set; } + + public short? PodmiotPowiazany { get; set; } + + public virtual Kasa Kasa { get; set; } = null!; + + public virtual ICollection ParBon { get; set; } = new List(); + + public virtual ICollection ParPunkty { get; set; } = new List(); + + public virtual ICollection ParWaluta { get; set; } = new List(); + + public virtual ICollection PozPar { get; set; } = new List(); + + public virtual ICollection RegulaPar { get; set; } = new List(); + + public virtual Waluta? Wal { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Parametr.cs b/Blink.Backoffice.Services.PcmDb/Entities/Parametr.cs new file mode 100644 index 0000000..b3ab1fd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Parametr.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Parametr +{ + public decimal ParId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short TypPar { get; set; } + + public int WartMin { get; set; } + + public int WartMax { get; set; } + + public decimal? CentrParId { get; set; } + + public virtual ICollection GrWartosc { get; set; } = new List(); + + public virtual ICollection KatParam { get; set; } = new List(); + + public virtual ICollection ParWartosc { get; set; } = new List(); + + public virtual ICollection TowWartosc { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Partia.cs b/Blink.Backoffice.Services.PcmDb/Entities/Partia.cs new file mode 100644 index 0000000..1305b08 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Partia.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Partia +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public short TypPartii { get; set; } + + public decimal TowId { get; set; } + + public decimal Pozostalo { get; set; } + + public string? Cecha1 { get; set; } + + public string? Cecha2 { get; set; } + + public DateTime? DataWazn { get; set; } + + public virtual PozDok PozDok { get; set; } = null!; + + public virtual ICollection RozliczeniePartii { get; set; } = new List(); + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcfUser.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcfUser.cs new file mode 100644 index 0000000..60ee2c1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcfUser.cs @@ -0,0 +1,44 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcfUser +{ + public int PcfUserId { get; set; } + + public decimal? PcfPStationId { get; set; } + + public decimal? PcfCustomerId { get; set; } + + public decimal? PcfLoyaltyCustomerId { get; set; } + + public string Ident { get; set; } = null!; + + public string? PasswordHash { get; set; } + + public string? FirstName { get; set; } + + public string? LastName { get; set; } + + public int AccessProfile { get; set; } + + public DateTime? ValidFrom { get; set; } + + public DateTime? ValidTo { get; set; } + + public string? EMail { get; set; } + + public short Blocked { get; set; } + + public short Active { get; set; } + + public string? Flags { get; set; } + + public virtual Kontrahent? PcfCustomer { get; set; } + + public virtual Kontrahent? PcfLoyaltyCustomer { get; set; } + + public virtual Kontrahent? PcfPStation { get; set; } + + public virtual ICollection PcfUserSklep { get; set; } = new List(); + + public virtual ICollection RegulaSklepAuth { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcfUserSklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcfUserSklep.cs new file mode 100644 index 0000000..3af7373 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcfUserSklep.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcfUserSklep +{ + public int PcfUserId { get; set; } + + public decimal SklepId { get; set; } + + public short Znaczenie { get; set; } + + public string? Parametr { get; set; } + + public virtual PcfUser PcfUser { get; set; } = null!; + + public virtual Sklep Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcpPos.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcpPos.cs new file mode 100644 index 0000000..30c3887 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcpPos.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcpPos +{ + public int PcpPosId { get; set; } + + public int PcpShopId { get; set; } + + public string? PosCode { get; set; } + + public short PosNo { get; set; } + + public string? PosName { get; set; } + + public string? FiscalUniqueNoDfl { get; set; } + + public short Active { get; set; } + + public DateTime Created { get; set; } + + public DateTime Updated { get; set; } + + public virtual ICollection PcpReceipt { get; set; } = new List(); + + public virtual PcpShop PcpShop { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcpReceipt.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceipt.cs new file mode 100644 index 0000000..6d2b49b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceipt.cs @@ -0,0 +1,54 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcpReceipt +{ + public decimal PcpReceiptId { get; set; } + + public decimal? KontrId { get; set; } + + public string? CustomerCode { get; set; } + + public string? CustomerNip { get; set; } + + public int PcpPosId { get; set; } + + public string? PosCode { get; set; } + + public short? ShopNo { get; set; } + + public short? PosNo { get; set; } + + public string? TransUUID { get; set; } + + public string? FiscalUniqueNo { get; set; } + + public string ReceiptSysNo { get; set; } = null!; + + public int? PrinterNumber { get; set; } + + public string? DocNo { get; set; } + + public string? Cashier { get; set; } + + public DateTime OperationDateTime { get; set; } + + public decimal TotalBrutto { get; set; } + + public decimal? TotalNetto { get; set; } + + public decimal? TotalDiscount { get; set; } + + public DateTime Created { get; set; } + + public DateTime Updated { get; set; } + + public virtual Kontrahent? Kontr { get; set; } + + public virtual PcpPos PcpPos { get; set; } = null!; + + public virtual ICollection PcpReceiptItem { get; set; } = new List(); + + public virtual ICollection PcpReceiptPayment { get; set; } = new List(); + + public virtual ICollection PcpReceiptVat { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptItem.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptItem.cs new file mode 100644 index 0000000..15a2562 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptItem.cs @@ -0,0 +1,36 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcpReceiptItem +{ + public decimal PcpReceiptItemId { get; set; } + + public decimal PcpReceiptId { get; set; } + + public string? Barcode { get; set; } + + public string ProductName { get; set; } = null!; + + public short ProductType { get; set; } + + public short IsReturn { get; set; } + + public decimal Price { get; set; } + + public decimal Quantity { get; set; } + + public decimal TotalBrutto { get; set; } + + public decimal? TotalNetto { get; set; } + + public decimal? VatRate { get; set; } + + public string? VatChar { get; set; } + + public short DiscountType { get; set; } + + public decimal DiscountValue { get; set; } + + public decimal TotalDiscount { get; set; } + + public virtual PcpReceipt PcpReceipt { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptPayment.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptPayment.cs new file mode 100644 index 0000000..4491ab8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptPayment.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcpReceiptPayment +{ + public decimal PcpReceiptPaymentId { get; set; } + + public decimal PcpReceiptId { get; set; } + + public short PaymentForm { get; set; } + + public string Currency { get; set; } = null!; + + public decimal ValueRef { get; set; } + + public decimal ValueInCurrency { get; set; } + + public decimal ChangeRef { get; set; } + + public decimal ChangeInCurrency { get; set; } + + public virtual PcpReceipt PcpReceipt { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptVat.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptVat.cs new file mode 100644 index 0000000..054d8f9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcpReceiptVat.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcpReceiptVat +{ + public decimal PcpReceiptVatId { get; set; } + + public decimal PcpReceiptId { get; set; } + + public decimal VatRate { get; set; } + + public string VatChar { get; set; } = null!; + + public decimal TotalBrutto { get; set; } + + public decimal TotalVat { get; set; } + + public virtual PcpReceipt PcpReceipt { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PcpShop.cs b/Blink.Backoffice.Services.PcmDb/Entities/PcpShop.cs new file mode 100644 index 0000000..2263214 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PcpShop.cs @@ -0,0 +1,42 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PcpShop +{ + public int PcpShopId { get; set; } + + public short? ShopNo { get; set; } + + public string ShopName { get; set; } = null!; + + public string ShopNameOnReceipt0 { get; set; } = null!; + + public string? ShopNameOnReceipt1 { get; set; } + + public string? ShopNameOnReceipt2 { get; set; } + + public string? ShopNameOnReceipt3 { get; set; } + + public string ShopAddrOnReceipt0 { get; set; } = null!; + + public string? ShopAddrOnReceipt1 { get; set; } + + public string? ShopAddrOnReceipt2 { get; set; } + + public string? ShopAddrOnReceipt3 { get; set; } + + public string ShopNip { get; set; } = null!; + + public string? ShopLicenseKey { get; set; } + + public DateTime? ShopLicenseValidFrom { get; set; } + + public DateTime? ShopLicenseValidTo { get; set; } + + public short Active { get; set; } + + public DateTime Created { get; set; } + + public DateTime Updated { get; set; } + + public virtual ICollection PcpPos { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PolParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/PolParam.cs new file mode 100644 index 0000000..6415396 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PolParam.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PolParam +{ + public decimal PolId { get; set; } + + public string ParGrupa { get; set; } = null!; + + public string ParNazwa { get; set; } = null!; + + public string ParWartosc { get; set; } = null!; + + public virtual Polityka Pol { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Polityka.cs b/Blink.Backoffice.Services.PcmDb/Entities/Polityka.cs new file mode 100644 index 0000000..bea208a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Polityka.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Polityka +{ + public decimal PolId { get; set; } + + public short Zastosowanie { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public decimal? CentrPolId { get; set; } + + public virtual ICollection HarmWpis { get; set; } = new List(); + + public virtual ICollection PolParam { get; set; } = new List(); + + public virtual ICollection Mag { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PowKontLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/PowKontLoj.cs new file mode 100644 index 0000000..40cb246 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PowKontLoj.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PowKontLoj +{ + public decimal NoweKontoId { get; set; } + + public short RodzajPow { get; set; } + + public decimal StareKontoId { get; set; } + + public virtual KontoLoj NoweKonto { get; set; } = null!; + + public virtual KontoLoj StareKonto { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Powiadomienie.cs b/Blink.Backoffice.Services.PcmDb/Entities/Powiadomienie.cs new file mode 100644 index 0000000..491141c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Powiadomienie.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Powiadomienie +{ + public decimal PowiadomienieId { get; set; } + + public string? ShopNo { get; set; } + + public string? PosNo { get; set; } + + public string? Adresat { get; set; } + + public string? Nadawca { get; set; } + + public string? Naglowek { get; set; } + + public string? Tresc { get; set; } + + public short Typ { get; set; } + + public short Status { get; set; } + + public short Kategoria { get; set; } + + public DateTime Utworzono { get; set; } + + public DateTime Zmiana { get; set; } + + public short Aktywny { get; set; } + + public virtual ICollection PowiadomienieParam { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PowiadomienieParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/PowiadomienieParam.cs new file mode 100644 index 0000000..fc3ba6d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PowiadomienieParam.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PowiadomienieParam +{ + public decimal PowiadomienieId { get; set; } + + public short Znaczenie { get; set; } + + public int Kolejnosc { get; set; } + + public int? Param1 { get; set; } + + public string? Param2 { get; set; } + + public virtual Powiadomienie Powiadomienie { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Powiazanie.cs b/Blink.Backoffice.Services.PcmDb/Entities/Powiazanie.cs new file mode 100644 index 0000000..ea336b4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Powiazanie.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Powiazanie +{ + public decimal TowId { get; set; } + + public decimal OpakId { get; set; } + + public decimal IleWOpak { get; set; } + + public short Tandem { get; set; } + + public virtual Towar Opak { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieProm.cs b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieProm.cs new file mode 100644 index 0000000..f4e1696 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieProm.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PowiazanieProm +{ + public decimal PromId { get; set; } + + public decimal GrupaId { get; set; } + + public short Rodzaj { get; set; } + + public virtual GrupaPromocji Grupa { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieSklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieSklep.cs new file mode 100644 index 0000000..7f304f1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieSklep.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PowiazanieSklep +{ + public decimal SklepId { get; set; } + + public decimal Id { get; set; } + + public short Typ { get; set; } + + public short? Aktywny { get; set; } + + public DateTime? Zmiana { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieUz.cs b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieUz.cs new file mode 100644 index 0000000..bb2108b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieUz.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PowiazanieUz +{ + public decimal UzId { get; set; } + + public short RodzajPow { get; set; } + + public decimal Id { get; set; } + + public virtual Uzytkownik Uz { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieUzNaSklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieUzNaSklep.cs new file mode 100644 index 0000000..9c7903e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PowiazanieUzNaSklep.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PowiazanieUzNaSklep +{ + public decimal UzNSId { get; set; } + + public short RodzajPow { get; set; } + + public decimal Id { get; set; } + + public virtual UzNaSklep UzNS { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PozAkcyza.cs b/Blink.Backoffice.Services.PcmDb/Entities/PozAkcyza.cs new file mode 100644 index 0000000..2f14fd3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PozAkcyza.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PozAkcyza +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal GrAkcId { get; set; } + + public decimal Wartosc { get; set; } + + public virtual GrupaAkcyzowa GrAkc { get; set; } = null!; + + public virtual PozDok PozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PozCennikDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/PozCennikDok.cs new file mode 100644 index 0000000..a9cbeeb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PozCennikDok.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PozCennikDok +{ + public decimal DokId { get; set; } + + public decimal TowId { get; set; } + + public decimal SklepId { get; set; } + + public short? Przydzial { get; set; } + + public short? Rodzaj { get; set; } + + public short? StatusZam { get; set; } + + public DateTime? DoKiedyPrzyjecie { get; set; } + + public short? ZmPrzydzial { get; set; } + + public short? ZmStatusZam { get; set; } + + public short? ZmDoKiedyPrzyjecie { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PozDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/PozDok.cs new file mode 100644 index 0000000..375a995 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PozDok.cs @@ -0,0 +1,68 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PozDok +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public int NrPozycji { get; set; } + + public decimal TowId { get; set; } + + public short TypPoz { get; set; } + + public decimal IloscPlus { get; set; } + + public decimal IloscMinus { get; set; } + + public short PoziomCen { get; set; } + + public short Metoda { get; set; } + + public decimal CenaDomyslna { get; set; } + + public decimal CenaPrzedRab { get; set; } + + public decimal RabatProc { get; set; } + + public decimal CenaPoRab { get; set; } + + public decimal Wartosc { get; set; } + + public decimal CenaDet { get; set; } + + public decimal CenaMag { get; set; } + + public short Stawka { get; set; } + + public short TypTowaru { get; set; } + + public decimal IleWZgrzewce { get; set; } + + public short? StawkaDod { get; set; } + + public decimal? Netto { get; set; } + + public decimal? Podatek { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Partia? Partia { get; set; } + + public virtual ICollection PozAkcyza { get; set; } = new List(); + + public virtual ICollection PozDokWBufPowiazanie { get; set; } = new List(); + + public virtual ICollection RegulaPozDok { get; set; } = new List(); + + public virtual ICollection RegulaPozDokSzczeg { get; set; } = new List(); + + public virtual ICollection RozPrtMag { get; set; } = new List(); + + public virtual ICollection RozliczeniePartii { get; set; } = new List(); + + public virtual ICollection TekstPoz { get; set; } = new List(); + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PozDokWBufPowiazanie.cs b/Blink.Backoffice.Services.PcmDb/Entities/PozDokWBufPowiazanie.cs new file mode 100644 index 0000000..964c071 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PozDokWBufPowiazanie.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PozDokWBufPowiazanie +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public short JakiePow { get; set; } + + public short KtorePow { get; set; } + + public decimal? Id { get; set; } + + public string? Param { get; set; } + + public virtual PozDok PozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PozPar.cs b/Blink.Backoffice.Services.PcmDb/Entities/PozPar.cs new file mode 100644 index 0000000..811a725 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PozPar.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PozPar +{ + public decimal ParId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal TowId { get; set; } + + public short TypPozPar { get; set; } + + public short Stawka { get; set; } + + public decimal Ilosc { get; set; } + + public decimal RabatKwot { get; set; } + + public decimal WartoscBrutto { get; set; } + + public string? Kod { get; set; } + + public string? GrupaGTU { get; set; } + + public virtual Paragon Par { get; set; } = null!; + + public virtual PozParSzczeg? PozParSzczeg { get; set; } + + public virtual ICollection RegulaPozPar { get; set; } = new List(); + + public virtual ICollection RegulaPozParSzczeg { get; set; } = new List(); + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PozParSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/PozParSzczeg.cs new file mode 100644 index 0000000..b8cc1eb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PozParSzczeg.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PozParSzczeg +{ + public decimal ParId { get; set; } + + public int Kolejnosc { get; set; } + + public string DodInfo { get; set; } = null!; + + public virtual PozPar PozPar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PozWz.cs b/Blink.Backoffice.Services.PcmDb/Entities/PozWz.cs new file mode 100644 index 0000000..4f00195 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PozWz.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PozWz +{ + public decimal WzId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal TowId { get; set; } + + public decimal IloscPlus { get; set; } + + public decimal IloscMinus { get; set; } + + public virtual Towar Tow { get; set; } = null!; + + public virtual Wzorzec Wz { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Profil.cs b/Blink.Backoffice.Services.PcmDb/Entities/Profil.cs new file mode 100644 index 0000000..4f19a7b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Profil.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Profil +{ + public decimal ProfilId { get; set; } + + public short Typ { get; set; } + + public string Nazwa { get; set; } = null!; + + public short? Aktywny { get; set; } + + public DateTime? Zmiana { get; set; } + + public DateTime? Utworzony { get; set; } + + public virtual ProfilKasa? ProfilKasa { get; set; } + + public virtual ICollection ProfilKonfig { get; set; } = new List(); + + public virtual ICollection SklepProfil { get; set; } = new List(); + + public virtual ICollection Uzytkownik { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ProfilKasa.cs b/Blink.Backoffice.Services.PcmDb/Entities/ProfilKasa.cs new file mode 100644 index 0000000..b7f2564 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ProfilKasa.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ProfilKasa +{ + public decimal ProfilId { get; set; } + + public decimal KasaId { get; set; } + + public virtual Kasa Kasa { get; set; } = null!; + + public virtual Profil Profil { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ProfilKonfig.cs b/Blink.Backoffice.Services.PcmDb/Entities/ProfilKonfig.cs new file mode 100644 index 0000000..523f6cc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ProfilKonfig.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ProfilKonfig +{ + public decimal ProfilId { get; set; } + + public string ParGrupa { get; set; } = null!; + + public string ParNazwa { get; set; } = null!; + + public short Kolejny { get; set; } + + public string? Wartosc { get; set; } + + public DateTime? Zmiana { get; set; } + + public DateTime? Utworzony { get; set; } + + public virtual Profil Profil { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/PrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/PrtMag.cs new file mode 100644 index 0000000..12fba85 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/PrtMag.cs @@ -0,0 +1,52 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class PrtMag +{ + public decimal TowId { get; set; } + + public decimal PMId { get; set; } + + public decimal MagId { get; set; } + + public short Status { get; set; } + + public DateTime? Data { get; set; } + + public int? KolejnyWDniu { get; set; } + + public string? NrDostawy { get; set; } + + public string? NrPartii { get; set; } + + public DateTime? DataWazn { get; set; } + + public decimal CenaZak { get; set; } + + public short Stawka { get; set; } + + public decimal? Dostarczono { get; set; } + + public decimal Pozostalo { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? KontrId { get; set; } + + public int? NrPozycji { get; set; } + + public DateTime? ZmianaIstotna { get; set; } + + public decimal? Rezerwacja { get; set; } + + public decimal? CenaSpDet { get; set; } + + public virtual Magazyn Mag { get; set; } = null!; + + public virtual ICollection RozPrtMag { get; set; } = new List(); + + public virtual ICollection StanPrtMag { get; set; } = new List(); + + public virtual ICollection SzczegPrtMag { get; set; } = new List(); + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RapWartPocz.cs b/Blink.Backoffice.Services.PcmDb/Entities/RapWartPocz.cs new file mode 100644 index 0000000..a02ada2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RapWartPocz.cs @@ -0,0 +1,28 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RapWartPocz +{ + public decimal RWPId { get; set; } + + public short TypRap { get; set; } + + public DateTime Data { get; set; } + + public short Aktywny { get; set; } + + public short? Param1 { get; set; } + + public short? Param2 { get; set; } + + public short? Param3 { get; set; } + + public string? ParamTxt { get; set; } + + public DateTime Wykonano { get; set; } + + public DateTime Zmiana { get; set; } + + public short? Wersja { get; set; } + + public virtual ICollection RapWartPoczDane { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RapWartPoczDane.cs b/Blink.Backoffice.Services.PcmDb/Entities/RapWartPoczDane.cs new file mode 100644 index 0000000..a2b326a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RapWartPoczDane.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RapWartPoczDane +{ + public decimal RWPId { get; set; } + + public decimal MagId { get; set; } + + public decimal Typ { get; set; } + + public short Numer { get; set; } + + public decimal Wartosc { get; set; } + + public virtual Magazyn Mag { get; set; } = null!; + + public virtual RapWartPocz RWP { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Regula.cs b/Blink.Backoffice.Services.PcmDb/Entities/Regula.cs new file mode 100644 index 0000000..5a652c7 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Regula.cs @@ -0,0 +1,76 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Regula +{ + public decimal RegulaId { get; set; } + + public string? Nazwa { get; set; } + + public short Typ { get; set; } + + public short? TypKarty { get; set; } + + public DateTime? DataCzasOd { get; set; } + + public DateTime? DataCzasDo { get; set; } + + public short Priorytet { get; set; } + + public decimal? Number1 { get; set; } + + public decimal? Number2 { get; set; } + + public decimal? Number3 { get; set; } + + public decimal? Number4 { get; set; } + + public int? Int1 { get; set; } + + public int? Int2 { get; set; } + + public int? Int3 { get; set; } + + public int? Int4 { get; set; } + + public string? Str1 { get; set; } + + public string? Str2 { get; set; } + + public DateTime Zmiana { get; set; } + + public short Aktywny { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public DateTime? Utworzono { get; set; } + + public DateTime? Usunieto { get; set; } + + public virtual ICollection RegulaAsort { get; set; } = new List(); + + public virtual ICollection RegulaDok { get; set; } = new List(); + + public virtual ICollection RegulaKod { get; set; } = new List(); + + public virtual ICollection RegulaPar { get; set; } = new List(); + + public virtual ICollection RegulaParam { get; set; } = new List(); + + public virtual ICollection RegulaPozDok { get; set; } = new List(); + + public virtual ICollection RegulaPozDokSzczeg { get; set; } = new List(); + + public virtual ICollection RegulaPozPar { get; set; } = new List(); + + public virtual ICollection RegulaPozParSzczeg { get; set; } = new List(); + + public virtual ICollection RegulaProg { get; set; } = new List(); + + public virtual ICollection RegulaSklep { get; set; } = new List(); + + public virtual ICollection RegulaSklepAuth { get; set; } = new List(); + + public virtual ICollection RegulaTekst { get; set; } = new List(); + + public virtual ICollection RegulaTowar { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaAsort.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaAsort.cs new file mode 100644 index 0000000..dea64fd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaAsort.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaAsort +{ + public decimal RegulaId { get; set; } + + public decimal AsId { get; set; } + + public short Znaczenie { get; set; } + + public virtual Asort As { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaDok.cs new file mode 100644 index 0000000..a183cca --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaDok.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaDok +{ + public decimal DokId { get; set; } + + public decimal RegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public short? TypReguly { get; set; } + + public short? Opcja { get; set; } + + public decimal? KontoId { get; set; } + + public short? Opcja2 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual KontoLoj? Konto { get; set; } + + public virtual Regula Regula { get; set; } = null!; + + public virtual ICollection RegulaDokSzczeg { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaDokSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaDokSzczeg.cs new file mode 100644 index 0000000..0f1e090 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaDokSzczeg.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaDokSzczeg +{ + public decimal DokId { get; set; } + + public decimal RegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public int Param1 { get; set; } + + public decimal Param2 { get; set; } + + public string Param3 { get; set; } = null!; + + public virtual RegulaDok RegulaDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaKod.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaKod.cs new file mode 100644 index 0000000..17507c9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaKod.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaKod +{ + public decimal RegulaId { get; set; } + + public string Kod { get; set; } = null!; + + public short Znaczenie { get; set; } + + public decimal? Ilosc { get; set; } + + public decimal? Cena { get; set; } + + public int? Parametr { get; set; } + + public string? NazwaTowaru { get; set; } + + public string? Informacja { get; set; } + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaPar.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPar.cs new file mode 100644 index 0000000..7a6c12c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPar.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaPar +{ + public decimal ParId { get; set; } + + public decimal RegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public short? TypReguly { get; set; } + + public short? Opcja { get; set; } + + public decimal? KontoId { get; set; } + + public short? Opcja2 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public virtual KontoLoj? Konto { get; set; } + + public virtual Paragon Par { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; + + public virtual ICollection RegulaParSzczeg { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaParSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaParSzczeg.cs new file mode 100644 index 0000000..a5950c6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaParSzczeg.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaParSzczeg +{ + public decimal ParId { get; set; } + + public decimal RegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public int Param1 { get; set; } + + public decimal Param2 { get; set; } + + public string Param3 { get; set; } = null!; + + public virtual RegulaPar RegulaPar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaParam.cs new file mode 100644 index 0000000..afb7047 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaParam.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaParam +{ + public decimal RegulaId { get; set; } + + public short Znaczenie { get; set; } + + public int? Param1 { get; set; } + + public string? Param2 { get; set; } + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozDok.cs new file mode 100644 index 0000000..6d1210f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozDok.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaPozDok +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal RegulaId { get; set; } + + public short Typ { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public virtual PozDok PozDok { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozDokSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozDokSzczeg.cs new file mode 100644 index 0000000..d6ee78e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozDokSzczeg.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaPozDokSzczeg +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal RegulaId { get; set; } + + public short Typ { get; set; } + + public int KolejnoscRegulaDok { get; set; } + + public decimal? Wartosc1 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public decimal? Wartosc4 { get; set; } + + public string? Tekst { get; set; } + + public short? Opcja1 { get; set; } + + public short? Opcja2 { get; set; } + + public virtual PozDok PozDok { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozPar.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozPar.cs new file mode 100644 index 0000000..d85cb93 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozPar.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaPozPar +{ + public decimal ParId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal RegulaId { get; set; } + + public short Typ { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public virtual PozPar PozPar { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozParSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozParSzczeg.cs new file mode 100644 index 0000000..52bff4d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaPozParSzczeg.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaPozParSzczeg +{ + public decimal ParId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal RegulaId { get; set; } + + public short Typ { get; set; } + + public int KolejnoscRegulaPar { get; set; } + + public decimal? Wartosc1 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public decimal? Wartosc4 { get; set; } + + public string? Tekst { get; set; } + + public short? Opcja1 { get; set; } + + public short? Opcja2 { get; set; } + + public virtual PozPar PozPar { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaProg.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaProg.cs new file mode 100644 index 0000000..d2e5051 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaProg.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaProg +{ + public decimal RegulaId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal? ProgOd { get; set; } + + public decimal? ProgDo { get; set; } + + public decimal? Wartosc1 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaSklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaSklep.cs new file mode 100644 index 0000000..326da60 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaSklep.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaSklep +{ + public decimal RegulaId { get; set; } + + public decimal SklepId { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual Regula Regula { get; set; } = null!; + + public virtual Sklep Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaSklepAuth.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaSklepAuth.cs new file mode 100644 index 0000000..6e65454 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaSklepAuth.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaSklepAuth +{ + public decimal RegulaId { get; set; } + + public decimal SklepId { get; set; } + + public DateTime DataCzasAutoryzacji { get; set; } + + public int PcfUserId { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual PcfUser PcfUser { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; + + public virtual Sklep Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaTekst.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaTekst.cs new file mode 100644 index 0000000..ac7fbbe --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaTekst.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaTekst +{ + public decimal RegulaId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual Regula Regula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RegulaTowar.cs b/Blink.Backoffice.Services.PcmDb/Entities/RegulaTowar.cs new file mode 100644 index 0000000..caeadaa --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RegulaTowar.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RegulaTowar +{ + public decimal RegulaId { get; set; } + + public decimal TowId { get; set; } + + public short Znaczenie { get; set; } + + public decimal? Ilosc { get; set; } + + public decimal? Cena { get; set; } + + public int? Parametr { get; set; } + + public virtual Regula Regula { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Rola.cs b/Blink.Backoffice.Services.PcmDb/Entities/Rola.cs new file mode 100644 index 0000000..ab646f3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Rola.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Rola +{ + public short RolaId { get; set; } + + public short Typ { get; set; } + + public short Aktywna { get; set; } + + public string Nazwa { get; set; } = null!; + + public DateTime Zmiana { get; set; } + + public short? Domyslna { get; set; } + + public short? CentrRolaId { get; set; } + + public short? UprawnieniaZRoli { get; set; } + + public short? Priorytet { get; set; } + + public virtual ICollection RolaUprawnienie { get; set; } = new List(); + + public virtual ICollection SklepRola { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RolaUprawnienie.cs b/Blink.Backoffice.Services.PcmDb/Entities/RolaUprawnienie.cs new file mode 100644 index 0000000..4234152 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RolaUprawnienie.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RolaUprawnienie +{ + public short RolaId { get; set; } + + public short Rodzaj { get; set; } + + public short? Jest { get; set; } + + public virtual Rola Rola { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RozPrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/RozPrtMag.cs new file mode 100644 index 0000000..cc5db78 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RozPrtMag.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RozPrtMag +{ + public decimal TowId { get; set; } + + public decimal PMId { get; set; } + + public short Znaczenie { get; set; } + + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal? IloscPrt { get; set; } + + public DateTime? Dzien { get; set; } + + public DateTime? Zmiana { get; set; } + + public virtual PozDok PozDok { get; set; } = null!; + + public virtual PrtMag PrtMag { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RozbicieDodDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/RozbicieDodDok.cs new file mode 100644 index 0000000..e19f529 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RozbicieDodDok.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RozbicieDodDok +{ + public decimal DokId { get; set; } + + public short Znaczenie { get; set; } + + public short Stawka { get; set; } + + public decimal Netto { get; set; } + + public decimal Podatek { get; set; } + + public decimal NettoDet { get; set; } + + public decimal PodatekDet { get; set; } + + public decimal NettoMag { get; set; } + + public decimal PodatekMag { get; set; } + + public virtual Dok Dok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RozbicieDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/RozbicieDok.cs new file mode 100644 index 0000000..9fcfbe5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RozbicieDok.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RozbicieDok +{ + public decimal DokId { get; set; } + + public short Stawka { get; set; } + + public decimal Netto { get; set; } + + public decimal Podatek { get; set; } + + public decimal NettoDet { get; set; } + + public decimal PodatekDet { get; set; } + + public decimal? NettoMag { get; set; } + + public decimal? PodatekMag { get; set; } + + public virtual Dok Dok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Rozlicza.cs b/Blink.Backoffice.Services.PcmDb/Entities/Rozlicza.cs new file mode 100644 index 0000000..e7d79f2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Rozlicza.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Rozlicza +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal RozliczanyDokId { get; set; } + + public decimal Rozliczenie { get; set; } + + public decimal? RozliczeniePodatku { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Dok RozliczanyDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/RozliczeniePartii.cs b/Blink.Backoffice.Services.PcmDb/Entities/RozliczeniePartii.cs new file mode 100644 index 0000000..dbf897e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/RozliczeniePartii.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class RozliczeniePartii +{ + public decimal RozDokId { get; set; } + + public int RozKolejnosc { get; set; } + + public decimal PrtDokId { get; set; } + + public int PrtKolejnosc { get; set; } + + public decimal Rozliczenie { get; set; } + + public virtual Partia Partia { get; set; } = null!; + + public virtual PozDok PozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Sesja.cs b/Blink.Backoffice.Services.PcmDb/Entities/Sesja.cs new file mode 100644 index 0000000..a2c761e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Sesja.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Sesja +{ + public decimal SesjaId { get; set; } + + public decimal UzId { get; set; } + + public string Stanowisko { get; set; } = null!; + + public short TypAplikacji { get; set; } + + public string Wersja { get; set; } = null!; + + public virtual SesjaAktywna? SesjaAktywna { get; set; } + + public virtual Uzytkownik Uz { get; set; } = null!; + + public virtual ICollection Zmiana { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SesjaAktywna.cs b/Blink.Backoffice.Services.PcmDb/Entities/SesjaAktywna.cs new file mode 100644 index 0000000..4bb33fe --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SesjaAktywna.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SesjaAktywna +{ + public decimal SesjaId { get; set; } + + public DateTime Aktywnosc { get; set; } + + public short Wylacznosc { get; set; } + + public string? IdProcesu { get; set; } + + public virtual ICollection Blokada { get; set; } = new List(); + + public virtual Sesja Sesja { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SkladnikDefinicjiKodu.cs b/Blink.Backoffice.Services.PcmDb/Entities/SkladnikDefinicjiKodu.cs new file mode 100644 index 0000000..898e1c2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SkladnikDefinicjiKodu.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SkladnikDefinicjiKodu +{ + public decimal DKId { get; set; } + + public short Kolejnosc { get; set; } + + public short Rodzaj { get; set; } + + public short Dlugosc { get; set; } + + public string? Tekst { get; set; } + + public virtual DefinicjaKodu DK { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SkladnikWzorca.cs b/Blink.Backoffice.Services.PcmDb/Entities/SkladnikWzorca.cs new file mode 100644 index 0000000..e06c543 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SkladnikWzorca.cs @@ -0,0 +1,36 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SkladnikWzorca +{ + public decimal SkWzId { get; set; } + + public decimal? TowIdWzorca { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Kolejnosc { get; set; } + + public decimal Ilosc { get; set; } + + public decimal Cena { get; set; } + + public short Obowiazkowy { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? CentrSkWzId { get; set; } + + public short? WyborWielu { get; set; } + + public short? CzyDodatek { get; set; } + + public short? RozneCeny { get; set; } + + public short? WyliczenieCeny { get; set; } + + public virtual Towar? TowIdWzorcaNavigation { get; set; } + + public virtual ICollection TowarSkladnika { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Sklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/Sklep.cs new file mode 100644 index 0000000..bc8764a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Sklep.cs @@ -0,0 +1,110 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Sklep +{ + public decimal SklepId { get; set; } + + public decimal? MagId { get; set; } + + public short NrSklepu { get; set; } + + public string NrSeryjny { get; set; } = null!; + + public DateTime? OstImport { get; set; } + + public DateTime? WymImport { get; set; } + + public DateTime? DataBO { get; set; } + + public int? KolejnyWDniuBO { get; set; } + + public short? PelnyImport { get; set; } + + public DateTime? OstEksport { get; set; } + + public DateTime? PotwEksport { get; set; } + + public short? Rola { get; set; } + + public decimal? KrajId { get; set; } + + public DateTime? OkrZamkniety { get; set; } + + public virtual Kraj? Kraj { get; set; } + + public virtual Magazyn? Mag { get; set; } + + public virtual ICollection PcfUserSklep { get; set; } = new List(); + + public virtual ICollection PowiazanieSklep { get; set; } = new List(); + + public virtual ICollection PozCennikDok { get; set; } = new List(); + + public virtual ICollection RegulaSklep { get; set; } = new List(); + + public virtual ICollection RegulaSklepAuth { get; set; } = new List(); + + public virtual ICollection SklepArtykul { get; set; } = new List(); + + public virtual ICollection SklepDefinicjaKodu { get; set; } = new List(); + + public virtual ICollection SklepDok { get; set; } = new List(); + + public virtual ICollection SklepDzienRozl { get; set; } = new List(); + + public virtual ICollection SklepFlagi { get; set; } = new List(); + + public virtual ICollection SklepFormaPlatnPos7 { get; set; } = new List(); + + public virtual ICollection SklepGrupaAkcyzowa { get; set; } = new List(); + + public virtual ICollection SklepKartaLoj { get; set; } = new List(); + + public virtual ICollection SklepKasa { get; set; } = new List(); + + public virtual ICollection SklepKontoLoj { get; set; } = new List(); + + public virtual ICollection SklepKontr { get; set; } = new List(); + + public virtual ICollection SklepMagazyn { get; set; } = new List(); + + public virtual Kontrahent SklepNavigation { get; set; } = null!; + + public virtual ICollection SklepOplata { get; set; } = new List(); + + public virtual ICollection SklepParagon { get; set; } = new List(); + + public virtual ICollection SklepProfil { get; set; } = new List(); + + public virtual ICollection SklepRapWartPocz { get; set; } = new List(); + + public virtual ICollection SklepRegula { get; set; } = new List(); + + public virtual ICollection SklepRegulaParam { get; set; } = new List(); + + public virtual ICollection SklepRola { get; set; } = new List(); + + public virtual ICollection SklepTowar { get; set; } = new List(); + + public virtual ICollection SklepTypOs { get; set; } = new List(); + + public virtual ICollection SklepUzytkownik { get; set; } = new List(); + + public virtual ICollection SklepWaluta { get; set; } = new List(); + + public virtual ICollection SklepZasob { get; set; } = new List(); + + public virtual ICollection SklepZgoda { get; set; } = new List(); + + public virtual ICollection TowStratyDlaSklepu { get; set; } = new List(); + + public virtual ICollection UzNaSklep { get; set; } = new List(); + + public virtual ICollection As { get; set; } = new List(); + + public virtual ICollection Centrala { get; set; } = new List(); + + public virtual ICollection KPW { get; set; } = new List(); + + public virtual ICollection Sklep1 { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepArtykul.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepArtykul.cs new file mode 100644 index 0000000..6291949 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepArtykul.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepArtykul +{ + public decimal SklepId { get; set; } + + public decimal SklepArtId { get; set; } + + public string ArtNazwa { get; set; } = null!; + + public decimal? GlownySklepTowId { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual SklepTowar? SklepTowar { get; set; } + + public virtual ICollection SklepTowarNavigation { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepBank.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepBank.cs new file mode 100644 index 0000000..7795fdd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepBank.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepBank +{ + public decimal SklepId { get; set; } + + public decimal SklepBankId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Adres { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? BankId { get; set; } + + public string? NrRozliBank { get; set; } + + public string? SWIFT { get; set; } + + public virtual ICollection SklepKontoBankowe { get; set; } = new List(); + + public virtual ICollection SklepKontoBankoweKontr { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDefinicjaKodu.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDefinicjaKodu.cs new file mode 100644 index 0000000..4942f14 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDefinicjaKodu.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDefinicjaKodu +{ + public decimal SklepId { get; set; } + + public decimal SklepDKId { get; set; } + + public short Typ { get; set; } + + public string Nazwa { get; set; } = null!; + + public DateTime? DataOd { get; set; } + + public DateTime? DataDo { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? DKId { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepSkladnikDefinicjiKodu { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDlugiZasob.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDlugiZasob.cs new file mode 100644 index 0000000..fddc79f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDlugiZasob.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDlugiZasob +{ + public decimal ZasobId { get; set; } + + public decimal SklepId { get; set; } + + public decimal SklepZasobId { get; set; } + + public string SklepWersja { get; set; } = null!; + + public virtual DlugiZasob Zasob { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDok.cs new file mode 100644 index 0000000..c1390df --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDok.cs @@ -0,0 +1,194 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDok +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public decimal? DokId { get; set; } + + public decimal SklepUzId { get; set; } + + public decimal SklepMagId { get; set; } + + public decimal? SklepKontrId { get; set; } + + public decimal? SklepKasaId { get; set; } + + public DateTime Data { get; set; } + + public int KolejnyWDniu { get; set; } + + public DateTime DataDod { get; set; } + + public DateTime DataPom { get; set; } + + public string NrDok { get; set; } = null!; + + public short TypDok { get; set; } + + public short Aktywny { get; set; } + + public short Opcja1 { get; set; } + + public short Opcja2 { get; set; } + + public short Opcja3 { get; set; } + + public short Opcja4 { get; set; } + + public short CenyZakBrutto { get; set; } + + public short CenySpBrutto { get; set; } + + public short FormaPlat { get; set; } + + public short TerminPlat { get; set; } + + public short PoziomCen { get; set; } + + public decimal RabatProc { get; set; } + + public decimal Netto { get; set; } + + public decimal Podatek { get; set; } + + public decimal NettoUslugi { get; set; } + + public decimal PodatekUslugi { get; set; } + + public decimal NettoDet { get; set; } + + public decimal PodatekDet { get; set; } + + public decimal NettoDetUslugi { get; set; } + + public decimal PodatekDetUslugi { get; set; } + + public decimal NettoMag { get; set; } + + public decimal PodatekMag { get; set; } + + public decimal NettoMagUslugi { get; set; } + + public decimal PodatekMagUslugi { get; set; } + + public decimal Razem { get; set; } + + public decimal DoZaplaty { get; set; } + + public decimal Zaplacono { get; set; } + + public decimal Kwota1 { get; set; } + + public decimal Kwota2 { get; set; } + + public decimal Kwota3 { get; set; } + + public decimal Kwota4 { get; set; } + + public decimal Kwota5 { get; set; } + + public decimal Kwota6 { get; set; } + + public decimal Kwota7 { get; set; } + + public decimal Kwota8 { get; set; } + + public decimal Kwota9 { get; set; } + + public decimal Kwota10 { get; set; } + + public int Param1 { get; set; } + + public int Param2 { get; set; } + + public int Param3 { get; set; } + + public int Param4 { get; set; } + + public short EksportFK { get; set; } + + public short CentrEksportFK { get; set; } + + public DateTime Zmiana { get; set; } + + public int? NrKolejny { get; set; } + + public int? NrKolejnyMag { get; set; } + + public int? Param5 { get; set; } + + public int? Param6 { get; set; } + + public decimal? Kwota11 { get; set; } + + public decimal? Kwota12 { get; set; } + + public decimal? SklepWalId { get; set; } + + public decimal? Kurs { get; set; } + + public short? Opcja5 { get; set; } + + public short? Opcja6 { get; set; } + + public short? Opcja7 { get; set; } + + public short? Opcja8 { get; set; } + + public decimal? CentrDokId { get; set; } + + public decimal? SklepPlatnikId { get; set; } + + public decimal? SklepKBId { get; set; } + + public decimal? ZaplaconoPodatek { get; set; } + + public decimal? ZaplaconoWKasie { get; set; } + + public decimal? SklepWalIdPlatnosci { get; set; } + + public virtual Dok? Dok { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepDokDodKth { get; set; } = new List(); + + public virtual ICollection SklepDokKurs { get; set; } = new List(); + + public virtual ICollection SklepDokPunkty { get; set; } = new List(); + + public virtual ICollection SklepDokWaluta { get; set; } = new List(); + + public virtual SklepKasa? SklepKasa { get; set; } + + public virtual SklepKontr? SklepKontr { get; set; } + + public virtual SklepKontr? SklepKontrNavigation { get; set; } + + public virtual SklepMagazyn SklepMagazyn { get; set; } = null!; + + public virtual ICollection SklepPozDok { get; set; } = new List(); + + public virtual ICollection SklepRegulaDok { get; set; } = new List(); + + public virtual ICollection SklepRozbicieDodDok { get; set; } = new List(); + + public virtual ICollection SklepRozbicieDok { get; set; } = new List(); + + public virtual ICollection SklepRozliczaSklepDok { get; set; } = new List(); + + public virtual ICollection SklepRozliczaSklepDokNavigation { get; set; } = new List(); + + public virtual ICollection SklepTekstDok { get; set; } = new List(); + + public virtual SklepUzytkownik SklepUzytkownik { get; set; } = null!; + + public virtual SklepWaluta? SklepWaluta { get; set; } + + public virtual ICollection SklepZaleznoscSklepDok { get; set; } = new List(); + + public virtual SklepZaleznosc? SklepZaleznoscSklepDokNavigation { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDokDodKth.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokDodKth.cs new file mode 100644 index 0000000..7115b36 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokDodKth.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDokDodKth +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public short Znaczenie { get; set; } + + public decimal SklepKontrId { get; set; } + + public decimal? Kwota { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; + + public virtual SklepKontr SklepKontr { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDokKurs.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokKurs.cs new file mode 100644 index 0000000..342fbd1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokKurs.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDokKurs +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public short Znaczenie { get; set; } + + public decimal SklepWalId { get; set; } + + public decimal? Kurs { get; set; } + + public DateTime? Data { get; set; } + + public string? NrTabeli { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; + + public virtual SklepWaluta SklepWaluta { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDokPunkty.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokPunkty.cs new file mode 100644 index 0000000..020117e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokPunkty.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDokPunkty +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public short Typ { get; set; } + + public short Gdzie { get; set; } + + public DateTime Kiedy { get; set; } + + public decimal Kwota { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDokWaluta.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokWaluta.cs new file mode 100644 index 0000000..b0446f3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDokWaluta.cs @@ -0,0 +1,28 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDokWaluta +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public decimal SklepWalId { get; set; } + + public decimal WalKwota { get; set; } + + public decimal Kurs { get; set; } + + public decimal DokKwota { get; set; } + + public decimal? WalNetto { get; set; } + + public decimal? WalPodatek { get; set; } + + public decimal? WalNettoDet { get; set; } + + public decimal? WalPodatekDet { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; + + public virtual SklepWaluta SklepWaluta { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDost.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDost.cs new file mode 100644 index 0000000..a362216 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDost.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDost +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal SklepKontrId { get; set; } + + public decimal? CenaZak { get; set; } + + public decimal? RabatOdWart { get; set; } + + public short? Narzucany { get; set; } + + public string? Kod { get; set; } + + public decimal? IleWZgrzewce { get; set; } + + public virtual SklepKontr SklepKontr { get; set; } = null!; + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDzienRozl.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDzienRozl.cs new file mode 100644 index 0000000..e154dbf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDzienRozl.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDzienRozl +{ + public decimal SklepId { get; set; } + + public DateTime Dzien { get; set; } + + public short Status { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepDzienRozlParam { get; set; } = new List(); + + public virtual ICollection SklepStanPrtMag { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepDzienRozlParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepDzienRozlParam.cs new file mode 100644 index 0000000..d13e056 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepDzienRozlParam.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepDzienRozlParam +{ + public decimal SklepId { get; set; } + + public DateTime Dzien { get; set; } + + public short Znaczenie { get; set; } + + public string Wartosc { get; set; } = null!; + + public virtual SklepDzienRozl SklepDzienRozl { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepEmail.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepEmail.cs new file mode 100644 index 0000000..44899e9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepEmail.cs @@ -0,0 +1,54 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepEmail +{ + public decimal SklepId { get; set; } + + public decimal SklepEmId { get; set; } + + public decimal? SklepUzId { get; set; } + + public decimal? SklepTEDId { get; set; } + + public decimal? SklepTERId { get; set; } + + public decimal? SklepTEWId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Login { get; set; } = null!; + + public string Haslo { get; set; } = null!; + + public string Host { get; set; } = null!; + + public string Port { get; set; } = null!; + + public short Auth { get; set; } + + public short TLS { get; set; } + + public short TLSVer { get; set; } + + public string Nadawca { get; set; } = null!; + + public short Kopia { get; set; } + + public string? KopiaEmail { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? SklepTEZIId { get; set; } + + public decimal? SklepTEHRId { get; set; } + + public virtual SklepTrescEmail? SklepTrescEmail { get; set; } + + public virtual SklepTrescEmail? SklepTrescEmail1 { get; set; } + + public virtual SklepTrescEmail? SklepTrescEmailNavigation { get; set; } + + public virtual SklepUzytkownik? SklepUzytkownik { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepFlagi.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepFlagi.cs new file mode 100644 index 0000000..dc5b9e5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepFlagi.cs @@ -0,0 +1,46 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepFlagi +{ + public decimal SklepId { get; set; } + + public decimal TowId { get; set; } + + public short BlokDostawcow { get; set; } + + public short BlokCenyZak { get; set; } + + public short BlokCenSp { get; set; } + + public short BlokZmian { get; set; } + + public decimal? NarzCenaZak { get; set; } + + public decimal? NarzCenaDet { get; set; } + + public decimal? NarzCenaHurt { get; set; } + + public decimal? NarzCenaNoc { get; set; } + + public decimal? NarzCenaDod { get; set; } + + public short? NarzCenaOtwarta { get; set; } + + public DateTime Zmiana { get; set; } + + public DateTime? ZmianaIstotna { get; set; } + + public DateTime? ZmianaTylkoCen { get; set; } + + public short? Aktywny { get; set; } + + public short? StatusZam { get; set; } + + public DateTime? DoKiedyPrzyjecie { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; + + public virtual ICollection Kontr { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepFormZgod.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepFormZgod.cs new file mode 100644 index 0000000..934ade0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepFormZgod.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepFormZgod +{ + public decimal SklepId { get; set; } + + public decimal SklepTypOsId { get; set; } + + public decimal SklepZgId { get; set; } + + public short Kolejnosc { get; set; } + + public short? Wymagana { get; set; } + + public virtual SklepTypOs SklepTypOs { get; set; } = null!; + + public virtual SklepZgoda SklepZgoda { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepFormaPlatnPos7.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepFormaPlatnPos7.cs new file mode 100644 index 0000000..984b281 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepFormaPlatnPos7.cs @@ -0,0 +1,30 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepFormaPlatnPos7 +{ + public decimal SklepId { get; set; } + + public decimal SklepFormaId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Typ { get; set; } + + public short Reszta { get; set; } + + public short? Autoryzacja { get; set; } + + public string? SerwisPlatniczy { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? FormaId { get; set; } + + public decimal? Kolejnosc { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepKasaFormaPlatn { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaAkcyzowa.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaAkcyzowa.cs new file mode 100644 index 0000000..f03b98d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaAkcyzowa.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepGrupaAkcyzowa +{ + public decimal SklepId { get; set; } + + public decimal SklepGrAkcId { get; set; } + + public string Kod { get; set; } = null!; + + public decimal? CentrGrAkcId { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepPozAkcyza { get; set; } = new List(); + + public virtual ICollection SklepTowAkcyza { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaPromocji.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaPromocji.cs new file mode 100644 index 0000000..0294fe3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaPromocji.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepGrupaPromocji +{ + public decimal SklepId { get; set; } + + public decimal SklepGrupaId { get; set; } + + public short Typ { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Opis { get; set; } = null!; + + public short Aktywna { get; set; } + + public decimal? GrupaId { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection SklepPowiazanieProm { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaUz.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaUz.cs new file mode 100644 index 0000000..d82b4dd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepGrupaUz.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepGrupaUz +{ + public decimal SklepId { get; set; } + + public decimal SklepUzId { get; set; } + + public decimal SklepRolaId { get; set; } + + public virtual SklepUzytkownik SklepUzytkownik { get; set; } = null!; + + public virtual SklepUzytkownik SklepUzytkownikNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepIstw.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepIstw.cs new file mode 100644 index 0000000..dae1cd5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepIstw.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepIstw +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal SklepMagId { get; set; } + + public decimal CenaMag { get; set; } + + public decimal StanMag { get; set; } + + public decimal StanMin { get; set; } + + public decimal StanMax { get; set; } + + public decimal? RezerwacjaMag { get; set; } + + public virtual SklepMagazyn SklepMagazyn { get; set; } = null!; + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKartaLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKartaLoj.cs new file mode 100644 index 0000000..99d7574 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKartaLoj.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKartaLoj +{ + public decimal SklepId { get; set; } + + public decimal SklepKartaId { get; set; } + + public decimal SklepKontoId { get; set; } + + public short TypKarty { get; set; } + + public string? KodKarty { get; set; } + + public DateTime? WaznaOd { get; set; } + + public DateTime? WaznaDo { get; set; } + + public DateTime? Uniewazniono { get; set; } + + public string? Posiadacz { get; set; } + + public string? Opis1 { get; set; } + + public string? Opis2 { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual SklepKontoLoj SklepKontoLoj { get; set; } = null!; + + public virtual ICollection SklepNrRejKarta { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKasa.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKasa.cs new file mode 100644 index 0000000..2786795 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKasa.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKasa +{ + public decimal SklepId { get; set; } + + public decimal SklepKasaId { get; set; } + + public decimal SklepMagId { get; set; } + + public short Numer { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Rodzaj { get; set; } + + public string Typ { get; set; } = null!; + + public short Aktywny { get; set; } + + public string Stanowisko { get; set; } = null!; + + public string? NrUnikatowy { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepDok { get; set; } = new List(); + + public virtual ICollection SklepKasaFormaPlatn { get; set; } = new List(); + + public virtual SklepMagazyn SklepMagazyn { get; set; } = null!; + + public virtual ICollection SklepParagon { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKasaFormaPlatn.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKasaFormaPlatn.cs new file mode 100644 index 0000000..d75b858 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKasaFormaPlatn.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKasaFormaPlatn +{ + public decimal SklepId { get; set; } + + public decimal SklepFormaId { get; set; } + + public decimal SklepKasaId { get; set; } + + public short Aktywny { get; set; } + + public virtual SklepFormaPlatnPos7 SklepFormaPlatnPos7 { get; set; } = null!; + + public virtual SklepKasa SklepKasa { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoBankowe.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoBankowe.cs new file mode 100644 index 0000000..af4edbe --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoBankowe.cs @@ -0,0 +1,38 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKontoBankowe +{ + public decimal SklepId { get; set; } + + public decimal SklepKBId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Numer { get; set; } = null!; + + public short Domyslne { get; set; } + + public short Typ { get; set; } + + public string Sufix { get; set; } = null!; + + public decimal SklepBankId { get; set; } + + public decimal SklepWalId { get; set; } + + public decimal? PowSklepKBId { get; set; } + + public decimal? SklepMagId { get; set; } + + public short Aktywne { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? KBId { get; set; } + + public decimal? SklepKBIdOplat { get; set; } + + public virtual SklepBank SklepBank { get; set; } = null!; + + public virtual SklepWaluta SklepWaluta { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoBankoweKontr.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoBankoweKontr.cs new file mode 100644 index 0000000..11656fc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoBankoweKontr.cs @@ -0,0 +1,36 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKontoBankoweKontr +{ + public decimal SklepId { get; set; } + + public decimal SklepKBKId { get; set; } + + public decimal? KBKId { get; set; } + + public string Numer { get; set; } = null!; + + public decimal SklepKontrId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Typ { get; set; } + + public short Domyslne { get; set; } + + public short Aktywne { get; set; } + + public short WykazVat { get; set; } + + public decimal? PowSklepKBKId { get; set; } + + public decimal? SklepBankId { get; set; } + + public decimal SklepWalId { get; set; } + + public virtual SklepBank? SklepBank { get; set; } + + public virtual SklepKontr SklepKontr { get; set; } = null!; + + public virtual SklepWaluta SklepWaluta { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoLoj.cs new file mode 100644 index 0000000..5b659dd --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontoLoj.cs @@ -0,0 +1,40 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKontoLoj +{ + public decimal SklepId { get; set; } + + public decimal SklepKontoId { get; set; } + + public decimal SklepKontrId { get; set; } + + public short TypKonta { get; set; } + + public short Aktywne { get; set; } + + public string? Nazwa { get; set; } + + public decimal StanPocz { get; set; } + + public decimal Stan { get; set; } + + public DateTime ZmianaStanu { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? KontoId { get; set; } + + public decimal? CentrKontoId { get; set; } + + public virtual KontoLoj? Konto { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepKartaLoj { get; set; } = new List(); + + public virtual SklepKontr SklepKontr { get; set; } = null!; + + public virtual ICollection SklepPowKontLojSklepKontoLoj { get; set; } = new List(); + + public virtual ICollection SklepPowKontLojSklepKontoLojNavigation { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKontr.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontr.cs new file mode 100644 index 0000000..c11b9ca --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontr.cs @@ -0,0 +1,128 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKontr +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public decimal? KontrId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string NaPrzelewie1 { get; set; } = null!; + + public string NaPrzelewie2 { get; set; } = null!; + + public string Skrot { get; set; } = null!; + + public string Ulica { get; set; } = null!; + + public string Kod { get; set; } = null!; + + public string Miasto { get; set; } = null!; + + public string Telefon { get; set; } = null!; + + public string Fax { get; set; } = null!; + + public string EMail { get; set; } = null!; + + public string Bank { get; set; } = null!; + + public string Konto { get; set; } = null!; + + public string NIP { get; set; } = null!; + + public short Staly { get; set; } + + public short Dostawca { get; set; } + + public decimal RabatDost { get; set; } + + public short FormaPlatDost { get; set; } + + public short TermPlatDost { get; set; } + + public short CzasRealZam { get; set; } + + public short Producent { get; set; } + + public short Odbiorca { get; set; } + + public decimal RabatOdb { get; set; } + + public short FormaPlatOdb { get; set; } + + public short TermPlatOdb { get; set; } + + public decimal MaxKredyt { get; set; } + + public short MaxPoTermPlat { get; set; } + + public string KodKarty { get; set; } = null!; + + public short KartaAktywna { get; set; } + + public DateTime TermWaznKarty { get; set; } + + public short PoziomRabatu { get; set; } + + public string NrAnalityki { get; set; } = null!; + + public string KodKontr { get; set; } = null!; + + public short ZakPracChron { get; set; } + + public short Aktywny { get; set; } + + public string Rezerwa1 { get; set; } = null!; + + public string Rezerwa2 { get; set; } = null!; + + public string? Akwizytor { get; set; } + + public decimal? Prowizja { get; set; } + + public decimal? CentrKontrId { get; set; } + + public DateTime Zmiana { get; set; } + + public string? IndeksCentr { get; set; } + + public string? KodKraju { get; set; } + + public string? Poczta { get; set; } + + public string? NrDomu { get; set; } + + public string? NrLokalu { get; set; } + + public short? Osoba { get; set; } + + public virtual Kontrahent? Kontr { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepDokDodKth { get; set; } = new List(); + + public virtual ICollection SklepDokSklepKontr { get; set; } = new List(); + + public virtual ICollection SklepDokSklepKontrNavigation { get; set; } = new List(); + + public virtual ICollection SklepDost { get; set; } = new List(); + + public virtual ICollection SklepKontoBankoweKontr { get; set; } = new List(); + + public virtual ICollection SklepKontoLoj { get; set; } = new List(); + + public virtual ICollection SklepKontrOpis { get; set; } = new List(); + + public virtual ICollection SklepKthTypOs { get; set; } = new List(); + + public virtual ICollection SklepNrRej { get; set; } = new List(); + + public virtual ICollection SklepTowar { get; set; } = new List(); + + public virtual ICollection SklepZdarzOs { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKontrOpis.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontrOpis.cs new file mode 100644 index 0000000..61aba89 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontrOpis.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKontrOpis +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual SklepKontr SklepKontr { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKontrSklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontrSklep.cs new file mode 100644 index 0000000..d481f53 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKontrSklep.cs @@ -0,0 +1,36 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKontrSklep +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public decimal? SklepMagId { get; set; } + + public short NrSklepu { get; set; } + + public string NrSeryjny { get; set; } = null!; + + public DateTime? OstImport { get; set; } + + public DateTime? WymImport { get; set; } + + public DateTime? DataBO { get; set; } + + public int? KolejnyWDniuBO { get; set; } + + public short? PelnyImport { get; set; } + + public DateTime? OstEksport { get; set; } + + public DateTime? PotwEksport { get; set; } + + public string? KodKraju { get; set; } + + public short? Rola { get; set; } + + public DateTime? OkrZamkniety { get; set; } + + public virtual Kontrahent Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepKthTypOs.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepKthTypOs.cs new file mode 100644 index 0000000..a313ffe --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepKthTypOs.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepKthTypOs +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public decimal SklepTypOsId { get; set; } + + public virtual SklepKontr SklepKontr { get; set; } = null!; + + public virtual SklepTypOs SklepTypOs { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepMagazyn.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepMagazyn.cs new file mode 100644 index 0000000..c366049 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepMagazyn.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepMagazyn +{ + public decimal SklepId { get; set; } + + public decimal SklepMagId { get; set; } + + public short Numer { get; set; } + + public string Nazwa { get; set; } = null!; + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepDok { get; set; } = new List(); + + public virtual ICollection SklepIstw { get; set; } = new List(); + + public virtual ICollection SklepKasa { get; set; } = new List(); + + public virtual ICollection SklepPrtMag { get; set; } = new List(); + + public virtual ICollection SklepRapWartPoczDane { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepNotatki.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepNotatki.cs new file mode 100644 index 0000000..d50f59b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepNotatki.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepNotatki +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Kolejnosc { get; set; } + + public string Tekst { get; set; } = null!; + + public short KoniecLinii { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepNrRej.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepNrRej.cs new file mode 100644 index 0000000..e0a3f50 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepNrRej.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepNrRej +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public string NrFormat { get; set; } = null!; + + public string NrWpisany { get; set; } = null!; + + public short WyborKart { get; set; } + + public virtual SklepKontr SklepKontr { get; set; } = null!; + + public virtual ICollection SklepNrRejKarta { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepNrRejKarta.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepNrRejKarta.cs new file mode 100644 index 0000000..6cd71d0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepNrRejKarta.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepNrRejKarta +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public string NrFormat { get; set; } = null!; + + public decimal SklepKartaId { get; set; } + + public virtual SklepKartaLoj SklepKartaLoj { get; set; } = null!; + + public virtual SklepNrRej SklepNrRej { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepOplata.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepOplata.cs new file mode 100644 index 0000000..24a4e58 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepOplata.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepOplata +{ + public decimal SklepId { get; set; } + + public decimal SklepOplataId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Typ { get; set; } + + public short Rodzaj { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public DateTime? DataOd { get; set; } + + public DateTime? DataDo { get; set; } + + public decimal? StawkaProc { get; set; } + + public decimal? Kwota { get; set; } + + public string? Komentarz { get; set; } + + public decimal? SklepKBId { get; set; } + + public decimal? OplataId { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPanel.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPanel.cs new file mode 100644 index 0000000..7ec91ba --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPanel.cs @@ -0,0 +1,38 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPanel +{ + public decimal SklepId { get; set; } + + public decimal SklepPanelId { get; set; } + + public short Aktywny { get; set; } + + public short Rodzaj { get; set; } + + public decimal? SklepUzId { get; set; } + + public int? Param1 { get; set; } + + public string Nazwa { get; set; } = null!; + + public short? T { get; set; } + + public short? L { get; set; } + + public short? H { get; set; } + + public short? W { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? PanelId { get; set; } + + public short TypAplikacji { get; set; } + + public virtual Panel? Panel { get; set; } + + public virtual ICollection SklepPanelParam { get; set; } = new List(); + + public virtual SklepUzytkownik? SklepUzytkownik { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPanelParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPanelParam.cs new file mode 100644 index 0000000..9a2425e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPanelParam.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPanelParam +{ + public decimal SklepId { get; set; } + + public decimal SklepPanelId { get; set; } + + public string ParNazwa { get; set; } = null!; + + public string ParWartosc { get; set; } = null!; + + public virtual SklepPanel SklepPanel { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepParBon.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepParBon.cs new file mode 100644 index 0000000..df59fa4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepParBon.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepParBon +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal Kwota { get; set; } + + public string Typ { get; set; } = null!; + + public string Numer { get; set; } = null!; + + public virtual SklepParagon SklepParagon { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepParPunkty.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepParPunkty.cs new file mode 100644 index 0000000..7a43ea4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepParPunkty.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepParPunkty +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public short Typ { get; set; } + + public short Gdzie { get; set; } + + public DateTime Kiedy { get; set; } + + public decimal Kwota { get; set; } + + public virtual SklepParagon SklepParagon { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepParWaluta.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepParWaluta.cs new file mode 100644 index 0000000..55e7c8e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepParWaluta.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepParWaluta +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public decimal SklepWalId { get; set; } + + public decimal WalKwota { get; set; } + + public decimal Kurs { get; set; } + + public decimal ParKwota { get; set; } + + public virtual SklepParagon SklepParagon { get; set; } = null!; + + public virtual SklepWaluta SklepWaluta { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepParagon.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepParagon.cs new file mode 100644 index 0000000..444b974 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepParagon.cs @@ -0,0 +1,80 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepParagon +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public decimal SklepKasaId { get; set; } + + public DateTime DataCzas { get; set; } + + public short TypPar { get; set; } + + public string Kasjer { get; set; } = null!; + + public string CechyPar { get; set; } = null!; + + public string KodKarty { get; set; } = null!; + + public short Aktywny { get; set; } + + public int IloscPoz { get; set; } + + public decimal Brutto { get; set; } + + public decimal OpakZwr { get; set; } + + public decimal OpakWyd { get; set; } + + public decimal Rabat { get; set; } + + public decimal Gotowka { get; set; } + + public decimal Bony { get; set; } + + public decimal Czek { get; set; } + + public decimal Karta { get; set; } + + public decimal InneFPlat { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? Waluty { get; set; } + + public decimal? Przelew { get; set; } + + public decimal? DodFPlat { get; set; } + + public short? EksportFK { get; set; } + + public short? CentrEksportFK { get; set; } + + public decimal? SklepWalId { get; set; } + + public decimal? Kurs { get; set; } + + public string? NIP { get; set; } + + public string? GrupyGTU { get; set; } + + public short? PodmiotPowiazany { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual SklepKasa SklepKasa { get; set; } = null!; + + public virtual ICollection SklepParBon { get; set; } = new List(); + + public virtual ICollection SklepParPunkty { get; set; } = new List(); + + public virtual ICollection SklepParWaluta { get; set; } = new List(); + + public virtual ICollection SklepPozPar { get; set; } = new List(); + + public virtual ICollection SklepRegulaPar { get; set; } = new List(); + + public virtual SklepWaluta? SklepWaluta { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPartia.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPartia.cs new file mode 100644 index 0000000..11f52da --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPartia.cs @@ -0,0 +1,28 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPartia +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public short TypPartii { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal Pozostalo { get; set; } + + public string? Cecha1 { get; set; } + + public string? Cecha2 { get; set; } + + public DateTime? DataWazn { get; set; } + + public virtual SklepPozDok SklepPozDok { get; set; } = null!; + + public virtual ICollection SklepRozlPartii { get; set; } = new List(); + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPowKontLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPowKontLoj.cs new file mode 100644 index 0000000..e4ac76e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPowKontLoj.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPowKontLoj +{ + public decimal SklepId { get; set; } + + public decimal SklepNoweKontoId { get; set; } + + public short RodzajPow { get; set; } + + public decimal SklepStareKontoId { get; set; } + + public virtual SklepKontoLoj SklepKontoLoj { get; set; } = null!; + + public virtual SklepKontoLoj SklepKontoLojNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPowiazanieProm.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPowiazanieProm.cs new file mode 100644 index 0000000..1ea3c97 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPowiazanieProm.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPowiazanieProm +{ + public decimal SklepId { get; set; } + + public decimal SklepPromId { get; set; } + + public decimal SklepGrupaId { get; set; } + + public short Rodzaj { get; set; } + + public virtual SklepGrupaPromocji SklepGrupaPromocji { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPowiazanieUz.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPowiazanieUz.cs new file mode 100644 index 0000000..8483d0e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPowiazanieUz.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPowiazanieUz +{ + public decimal SklepId { get; set; } + + public decimal SklepUzId { get; set; } + + public short RodzajPow { get; set; } + + public decimal Id { get; set; } + + public virtual SklepUzytkownik SklepUzytkownik { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPozAkcyza.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozAkcyza.cs new file mode 100644 index 0000000..b4d2583 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozAkcyza.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPozAkcyza +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal SklepGrAkcId { get; set; } + + public decimal Wartosc { get; set; } + + public virtual SklepGrupaAkcyzowa SklepGrupaAkcyzowa { get; set; } = null!; + + public virtual SklepPozDok SklepPozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPozDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozDok.cs new file mode 100644 index 0000000..40c3d21 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozDok.cs @@ -0,0 +1,68 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPozDok +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public int NrPozycji { get; set; } + + public decimal SklepTowId { get; set; } + + public short TypPoz { get; set; } + + public decimal IloscPlus { get; set; } + + public decimal IloscMinus { get; set; } + + public short PoziomCen { get; set; } + + public short Metoda { get; set; } + + public decimal CenaDomyslna { get; set; } + + public decimal CenaPrzedRab { get; set; } + + public decimal RabatProc { get; set; } + + public decimal CenaPoRab { get; set; } + + public decimal Wartosc { get; set; } + + public decimal CenaDet { get; set; } + + public decimal CenaMag { get; set; } + + public short Stawka { get; set; } + + public short TypTowaru { get; set; } + + public decimal IleWZgrzewce { get; set; } + + public short? StawkaDod { get; set; } + + public decimal? Netto { get; set; } + + public decimal? Podatek { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; + + public virtual SklepPartia? SklepPartia { get; set; } + + public virtual ICollection SklepPozAkcyza { get; set; } = new List(); + + public virtual ICollection SklepRegulaPozDok { get; set; } = new List(); + + public virtual ICollection SklepRegulaPozDokSzczeg { get; set; } = new List(); + + public virtual ICollection SklepRozPrtMag { get; set; } = new List(); + + public virtual ICollection SklepRozlPartii { get; set; } = new List(); + + public virtual ICollection SklepTekstPoz { get; set; } = new List(); + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPozPar.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozPar.cs new file mode 100644 index 0000000..1dbb092 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozPar.cs @@ -0,0 +1,36 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPozPar +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal? SklepTowId { get; set; } + + public short? TypPozPar { get; set; } + + public short? Stawka { get; set; } + + public decimal? Ilosc { get; set; } + + public decimal? RabatKwot { get; set; } + + public decimal? WartoscBrutto { get; set; } + + public string? Kod { get; set; } + + public string? GrupaGTU { get; set; } + + public virtual SklepParagon SklepParagon { get; set; } = null!; + + public virtual SklepPozParSzczeg? SklepPozParSzczeg { get; set; } + + public virtual ICollection SklepRegulaPozPar { get; set; } = new List(); + + public virtual ICollection SklepRegulaPozParSzczeg { get; set; } = new List(); + + public virtual SklepTowar? SklepTowar { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPozParSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozParSzczeg.cs new file mode 100644 index 0000000..411b11c --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPozParSzczeg.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPozParSzczeg +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public int Kolejnosc { get; set; } + + public string DodInfo { get; set; } = null!; + + public virtual SklepPozPar SklepPozPar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepProfil.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepProfil.cs new file mode 100644 index 0000000..def942d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepProfil.cs @@ -0,0 +1,28 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepProfil +{ + public decimal SklepId { get; set; } + + public decimal SklepProfilId { get; set; } + + public decimal? ProfilId { get; set; } + + public short Typ { get; set; } + + public string Nazwa { get; set; } = null!; + + public short? Aktywny { get; set; } + + public DateTime? Zmiana { get; set; } + + public DateTime? Utworzony { get; set; } + + public virtual Profil? Profil { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepProfilKonfig { get; set; } = new List(); + + public virtual ICollection SklepUzytkownik { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepProfilKonfig.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepProfilKonfig.cs new file mode 100644 index 0000000..950a976 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepProfilKonfig.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepProfilKonfig +{ + public decimal SklepId { get; set; } + + public decimal SklepProfilId { get; set; } + + public string ParGrupa { get; set; } = null!; + + public string ParNazwa { get; set; } = null!; + + public short Kolejny { get; set; } + + public string? Wartosc { get; set; } + + public DateTime? Zmiana { get; set; } + + public DateTime? Utworzony { get; set; } + + public virtual SklepProfil SklepProfil { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepPrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepPrtMag.cs new file mode 100644 index 0000000..3835ca0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepPrtMag.cs @@ -0,0 +1,52 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepPrtMag +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal PMId { get; set; } + + public decimal SklepMagId { get; set; } + + public short Status { get; set; } + + public DateTime? Data { get; set; } + + public int? KolejnyWDniu { get; set; } + + public string? NrDostawy { get; set; } + + public string? NrPartii { get; set; } + + public DateTime? DataWazn { get; set; } + + public decimal CenaZak { get; set; } + + public short Stawka { get; set; } + + public decimal? Dostarczono { get; set; } + + public decimal Pozostalo { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? SklepKontrId { get; set; } + + public int? NrPozycji { get; set; } + + public decimal? Rezerwacja { get; set; } + + public decimal? CenaSpDet { get; set; } + + public virtual SklepMagazyn SklepMagazyn { get; set; } = null!; + + public virtual ICollection SklepRozPrtMag { get; set; } = new List(); + + public virtual ICollection SklepStanPrtMag { get; set; } = new List(); + + public virtual ICollection SklepSzczegPrtMag { get; set; } = new List(); + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRapWartPocz.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRapWartPocz.cs new file mode 100644 index 0000000..01b3a17 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRapWartPocz.cs @@ -0,0 +1,32 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRapWartPocz +{ + public decimal SklepId { get; set; } + + public decimal SklepRWPId { get; set; } + + public short TypRap { get; set; } + + public DateTime Data { get; set; } + + public short Aktywny { get; set; } + + public short? Param1 { get; set; } + + public short? Param2 { get; set; } + + public short? Param3 { get; set; } + + public string? ParamTxt { get; set; } + + public DateTime Wykonano { get; set; } + + public DateTime Zmiana { get; set; } + + public short? Wersja { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepRapWartPoczDane { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRapWartPoczDane.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRapWartPoczDane.cs new file mode 100644 index 0000000..8e15e84 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRapWartPoczDane.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRapWartPoczDane +{ + public decimal SklepId { get; set; } + + public decimal SklepRWPId { get; set; } + + public decimal SklepMagId { get; set; } + + public decimal Typ { get; set; } + + public short Numer { get; set; } + + public decimal Wartosc { get; set; } + + public virtual SklepMagazyn SklepMagazyn { get; set; } = null!; + + public virtual SklepRapWartPocz SklepRapWartPocz { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegula.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegula.cs new file mode 100644 index 0000000..cf7b20f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegula.cs @@ -0,0 +1,62 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegula +{ + public decimal SklepId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public string? Nazwa { get; set; } + + public short Typ { get; set; } + + public short? TypKarty { get; set; } + + public DateTime? DataCzasOd { get; set; } + + public DateTime? DataCzasDo { get; set; } + + public short Priorytet { get; set; } + + public decimal? Number1 { get; set; } + + public decimal? Number2 { get; set; } + + public decimal? Number3 { get; set; } + + public decimal? Number4 { get; set; } + + public int? Int1 { get; set; } + + public int? Int2 { get; set; } + + public int? Int3 { get; set; } + + public int? Int4 { get; set; } + + public string? Str1 { get; set; } + + public string? Str2 { get; set; } + + public DateTime Zmiana { get; set; } + + public short Aktywny { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public DateTime? Utworzono { get; set; } + + public DateTime? Usunieto { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepRegulaAsort { get; set; } = new List(); + + public virtual ICollection SklepRegulaKod { get; set; } = new List(); + + public virtual ICollection SklepRegulaParam { get; set; } = new List(); + + public virtual ICollection SklepRegulaTekst { get; set; } = new List(); + + public virtual ICollection SklepRegulaTowar { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaAsort.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaAsort.cs new file mode 100644 index 0000000..2ed5cd1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaAsort.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaAsort +{ + public decimal SklepId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public decimal SklepAsId { get; set; } + + public short Znaczenie { get; set; } + + public string SklepAsNazwa { get; set; } = null!; + + public virtual SklepRegula SklepRegula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaDok.cs new file mode 100644 index 0000000..330789d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaDok.cs @@ -0,0 +1,38 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaDok +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public short? TypReguly { get; set; } + + public short? Opcja { get; set; } + + public decimal? SklepKontoId { get; set; } + + public decimal? KontoId { get; set; } + + public short? Opcja2 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public virtual KontoLoj? Konto { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; + + public virtual ICollection SklepRegulaDokSzczeg { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaDokSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaDokSzczeg.cs new file mode 100644 index 0000000..fb6001e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaDokSzczeg.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaDokSzczeg +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public int Param1 { get; set; } + + public decimal Param2 { get; set; } + + public string Param3 { get; set; } = null!; + + public virtual SklepRegulaDok SklepRegulaDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaKod.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaKod.cs new file mode 100644 index 0000000..5067b11 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaKod.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaKod +{ + public decimal SklepId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public string Kod { get; set; } = null!; + + public short Znaczenie { get; set; } + + public decimal? Ilosc { get; set; } + + public decimal? Cena { get; set; } + + public int? Parametr { get; set; } + + public string? NazwaTowaru { get; set; } + + public string? Informacja { get; set; } + + public virtual SklepRegula SklepRegula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPar.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPar.cs new file mode 100644 index 0000000..6ee3120 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPar.cs @@ -0,0 +1,38 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaPar +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public short? TypReguly { get; set; } + + public short? Opcja { get; set; } + + public decimal? SklepKontoId { get; set; } + + public decimal? KontoId { get; set; } + + public short? Opcja2 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public virtual KontoLoj? Konto { get; set; } + + public virtual SklepParagon SklepParagon { get; set; } = null!; + + public virtual ICollection SklepRegulaParSzczeg { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaParSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaParSzczeg.cs new file mode 100644 index 0000000..df55cb0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaParSzczeg.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaParSzczeg +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public int Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public int Param1 { get; set; } + + public decimal Param2 { get; set; } + + public string Param3 { get; set; } = null!; + + public virtual SklepRegulaPar SklepRegulaPar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaParam.cs new file mode 100644 index 0000000..ccda73f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaParam.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaParam +{ + public decimal SklepId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public short Znaczenie { get; set; } + + public int? Param1 { get; set; } + + public string? Param2 { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual SklepRegula SklepRegula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozDok.cs new file mode 100644 index 0000000..0ac7ca3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozDok.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaPozDok +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal SklepRegulaId { get; set; } + + public short Typ { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public virtual SklepPozDok SklepPozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozDokSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozDokSzczeg.cs new file mode 100644 index 0000000..8a84f96 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozDokSzczeg.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaPozDokSzczeg +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal SklepRegulaId { get; set; } + + public short Typ { get; set; } + + public int KolejnoscRegulaDok { get; set; } + + public decimal? Wartosc1 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public decimal? Wartosc4 { get; set; } + + public string? Tekst { get; set; } + + public short? Opcja1 { get; set; } + + public short? Opcja2 { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public virtual SklepPozDok SklepPozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozPar.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozPar.cs new file mode 100644 index 0000000..bed0e13 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozPar.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaPozPar +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal SklepRegulaId { get; set; } + + public short Typ { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public decimal? Wartosc { get; set; } + + public string? Tekst { get; set; } + + public virtual SklepPozPar SklepPozPar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozParSzczeg.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozParSzczeg.cs new file mode 100644 index 0000000..25191e4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaPozParSzczeg.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaPozParSzczeg +{ + public decimal SklepId { get; set; } + + public decimal SklepParId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal SklepRegulaId { get; set; } + + public short Typ { get; set; } + + public int KolejnoscRegulaPar { get; set; } + + public decimal? Wartosc1 { get; set; } + + public decimal? Wartosc2 { get; set; } + + public decimal? Wartosc3 { get; set; } + + public decimal? Wartosc4 { get; set; } + + public string? Tekst { get; set; } + + public short? Opcja1 { get; set; } + + public short? Opcja2 { get; set; } + + public decimal? CentrRegulaId { get; set; } + + public virtual SklepPozPar SklepPozPar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaTekst.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaTekst.cs new file mode 100644 index 0000000..cac3177 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaTekst.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaTekst +{ + public decimal SklepId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual SklepRegula SklepRegula { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaTowar.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaTowar.cs new file mode 100644 index 0000000..fb249d8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRegulaTowar.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRegulaTowar +{ + public decimal SklepId { get; set; } + + public decimal SklepRegulaId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Znaczenie { get; set; } + + public decimal? Ilosc { get; set; } + + public decimal? Cena { get; set; } + + public int? Parametr { get; set; } + + public virtual SklepRegula SklepRegula { get; set; } = null!; + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRola.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRola.cs new file mode 100644 index 0000000..29c478b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRola.cs @@ -0,0 +1,30 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRola +{ + public decimal SklepId { get; set; } + + public short SklepRolaId { get; set; } + + public short Typ { get; set; } + + public short Aktywna { get; set; } + + public string Nazwa { get; set; } = null!; + + public short? Domyslna { get; set; } + + public short? CentrRolaId { get; set; } + + public DateTime Zmiana { get; set; } + + public short? UprawnieniaZRoli { get; set; } + + public short? Priorytet { get; set; } + + public virtual Rola? CentrRola { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepRolaUprawnienie { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRolaUprawnienie.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRolaUprawnienie.cs new file mode 100644 index 0000000..284b8e3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRolaUprawnienie.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRolaUprawnienie +{ + public decimal SklepId { get; set; } + + public short SklepRolaId { get; set; } + + public short Rodzaj { get; set; } + + public short? Jest { get; set; } + + public virtual SklepRola SklepRola { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRozPrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozPrtMag.cs new file mode 100644 index 0000000..04b4ec0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozPrtMag.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRozPrtMag +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal PMId { get; set; } + + public short Znaczenie { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal? IloscPrt { get; set; } + + public DateTime? Dzien { get; set; } + + public virtual SklepPozDok SklepPozDok { get; set; } = null!; + + public virtual SklepPrtMag SklepPrtMag { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRozbicieDodDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozbicieDodDok.cs new file mode 100644 index 0000000..2ab8bbb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozbicieDodDok.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRozbicieDodDok +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public short Znaczenie { get; set; } + + public short Stawka { get; set; } + + public decimal Netto { get; set; } + + public decimal Podatek { get; set; } + + public decimal NettoDet { get; set; } + + public decimal PodatekDet { get; set; } + + public decimal NettoMag { get; set; } + + public decimal PodatekMag { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRozbicieDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozbicieDok.cs new file mode 100644 index 0000000..79c9c63 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozbicieDok.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRozbicieDok +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public short Stawka { get; set; } + + public decimal Netto { get; set; } + + public decimal Podatek { get; set; } + + public decimal NettoDet { get; set; } + + public decimal PodatekDet { get; set; } + + public decimal? NettoMag { get; set; } + + public decimal? PodatekMag { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRozlPartii.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozlPartii.cs new file mode 100644 index 0000000..3d49411 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozlPartii.cs @@ -0,0 +1,20 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRozlPartii +{ + public decimal SklepId { get; set; } + + public decimal RozSklepDokId { get; set; } + + public int RozKolejnosc { get; set; } + + public decimal PrtSklepDokId { get; set; } + + public int PrtKolejnosc { get; set; } + + public decimal Rozliczenie { get; set; } + + public virtual SklepPartia SklepPartia { get; set; } = null!; + + public virtual SklepPozDok SklepPozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepRozlicza.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozlicza.cs new file mode 100644 index 0000000..605d4f2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepRozlicza.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepRozlicza +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public decimal RozliczanySklepId { get; set; } + + public decimal RozliczanySklepDokId { get; set; } + + public decimal Rozliczenie { get; set; } + + public decimal? RozliczeniePodatku { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; + + public virtual SklepDok SklepDokNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepSkladnikDefinicjiKodu.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepSkladnikDefinicjiKodu.cs new file mode 100644 index 0000000..39f4aea --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepSkladnikDefinicjiKodu.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepSkladnikDefinicjiKodu +{ + public decimal SklepId { get; set; } + + public decimal SklepDKId { get; set; } + + public short Kolejnosc { get; set; } + + public short Rodzaj { get; set; } + + public short Dlugosc { get; set; } + + public string? Tekst { get; set; } + + public virtual SklepDefinicjaKodu SklepDefinicjaKodu { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepSkladnikWzorca.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepSkladnikWzorca.cs new file mode 100644 index 0000000..4ddd09e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepSkladnikWzorca.cs @@ -0,0 +1,38 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepSkladnikWzorca +{ + public decimal SklepId { get; set; } + + public decimal SklepSkWzId { get; set; } + + public decimal? SklepTowIdWzorca { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Kolejnosc { get; set; } + + public decimal Ilosc { get; set; } + + public decimal Cena { get; set; } + + public short Obowiazkowy { get; set; } + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? SkWzId { get; set; } + + public short? WyborWielu { get; set; } + + public short? CzyDodatek { get; set; } + + public short? RozneCeny { get; set; } + + public short? WyliczenieCeny { get; set; } + + public virtual SklepTowar? SklepTowar { get; set; } + + public virtual ICollection SklepTowarSkladnika { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepStanPrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepStanPrtMag.cs new file mode 100644 index 0000000..fefcd41 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepStanPrtMag.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepStanPrtMag +{ + public decimal SklepId { get; set; } + + public DateTime Dzien { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal PMId { get; set; } + + public decimal StanPrt { get; set; } + + public virtual SklepDzienRozl SklepDzienRozl { get; set; } = null!; + + public virtual SklepPrtMag SklepPrtMag { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepSzczegPrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepSzczegPrtMag.cs new file mode 100644 index 0000000..2a53569 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepSzczegPrtMag.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepSzczegPrtMag +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal PMId { get; set; } + + public short TypDanych { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual SklepPrtMag SklepPrtMag { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstDok.cs new file mode 100644 index 0000000..0563984 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstDok.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTekstDok +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual SklepDok SklepDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstPoz.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstPoz.cs new file mode 100644 index 0000000..e5e12f3 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstPoz.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTekstPoz +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public int Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual SklepPozDok SklepPozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstZgody.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstZgody.cs new file mode 100644 index 0000000..fb039d8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTekstZgody.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTekstZgody +{ + public decimal SklepId { get; set; } + + public decimal SklepZgId { get; set; } + + public string Wersja { get; set; } = null!; + + public int Kolejnosc { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual SklepZgoda SklepZgoda { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowAkcyza.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowAkcyza.cs new file mode 100644 index 0000000..fb83b1b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowAkcyza.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowAkcyza +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal SklepGrAkcId { get; set; } + + public string? KodCN { get; set; } + + public decimal? IleAkcJM { get; set; } + + public decimal? Sklad { get; set; } + + public decimal? CenaMax { get; set; } + + public virtual SklepGrupaAkcyzowa SklepGrupaAkcyzowa { get; set; } = null!; + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowDodatek.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowDodatek.cs new file mode 100644 index 0000000..1e3af93 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowDodatek.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowDodatek +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal DodSklepTowId { get; set; } + + public decimal Ilosc { get; set; } + + public decimal Cena { get; set; } + + public short Domyslny { get; set; } + + public short Obowiazkowy { get; set; } + + public short? Param1 { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; + + public virtual SklepTowar SklepTowarNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowIntParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowIntParam.cs new file mode 100644 index 0000000..d3db24e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowIntParam.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowIntParam +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Znaczenie { get; set; } + + public int Param { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowKod.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowKod.cs new file mode 100644 index 0000000..fd7b612 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowKod.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowKod +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Kolejnosc { get; set; } + + public string Kod { get; set; } = null!; + + public short TypKodu { get; set; } + + public string? Skrot { get; set; } + + public short? PoziomCen { get; set; } + + public int? PrefPLU { get; set; } + + public decimal? IleWKodzie { get; set; } + + public short? KodCentralny { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowParWiseBase.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowParWiseBase.cs new file mode 100644 index 0000000..7130fdf --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowParWiseBase.cs @@ -0,0 +1,18 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowParWiseBase +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal ParId { get; set; } + + public string? Tekst { get; set; } + + public decimal? SklepZasobId { get; set; } + + public virtual ParWiseBase Par { get; set; } = null!; + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowPowiazanie.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowPowiazanie.cs new file mode 100644 index 0000000..1b1a25b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowPowiazanie.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowPowiazanie +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Znaczenie { get; set; } + + public decimal PowSklepTowId { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; + + public virtual SklepTowar SklepTowarNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowStraty.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowStraty.cs new file mode 100644 index 0000000..11867c5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowStraty.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowStraty +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short IdxRodzStrat { get; set; } + + public decimal? NormaStrat { get; set; } + + public short? Odliczanie { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowZamiennik.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowZamiennik.cs new file mode 100644 index 0000000..50573c5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowZamiennik.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowZamiennik +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal SklepZmId { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; + + public virtual SklepZamiennik SklepZamiennik { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowZdjecia.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowZdjecia.cs new file mode 100644 index 0000000..7eaab72 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowZdjecia.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowZdjecia +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal SklepZasobId { get; set; } + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowar.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowar.cs new file mode 100644 index 0000000..ba20fd1 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowar.cs @@ -0,0 +1,190 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowar +{ + public decimal SklepId { get; set; } + + public decimal SklepTowId { get; set; } + + public decimal? TowId { get; set; } + + public short TypTowaru { get; set; } + + public short Aktywny { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Indeks1 { get; set; } = null!; + + public string Indeks2 { get; set; } = null!; + + public short Stawka { get; set; } + + public decimal CenaEw { get; set; } + + public decimal CenaDet { get; set; } + + public decimal CenaHurt { get; set; } + + public decimal CenaNoc { get; set; } + + public decimal CenaDod { get; set; } + + public short CenaOtwarta { get; set; } + + public decimal Marza { get; set; } + + public short OpcjaMarzy { get; set; } + + public decimal HurtRabat { get; set; } + + public short OpcjaRabatu { get; set; } + + public decimal NocNarzut { get; set; } + + public short OpcjaNarzutu { get; set; } + + public string Opis1 { get; set; } = null!; + + public string Opis2 { get; set; } = null!; + + public string Opis3 { get; set; } = null!; + + public string Opis4 { get; set; } = null!; + + public decimal IleWZgrzewce { get; set; } + + public decimal IleWCalosci { get; set; } + + public short TermWazn { get; set; } + + public int Waga { get; set; } + + public int Wysokosc { get; set; } + + public int Szerokosc { get; set; } + + public int Glebokosc { get; set; } + + public decimal? SklepOpakId { get; set; } + + public decimal? IleWOpak { get; set; } + + public short? Tandem { get; set; } + + public string Asortyment { get; set; } = null!; + + public string JM { get; set; } = null!; + + public short Precyzja { get; set; } + + public string? Kategoria { get; set; } + + public string CKU { get; set; } = null!; + + public decimal? SklepProducent { get; set; } + + public string Rezerwa1 { get; set; } = null!; + + public string Rezerwa2 { get; set; } = null!; + + public decimal? CentrTowId { get; set; } + + public DateTime Zmiana { get; set; } + + public decimal? SklepArtId { get; set; } + + public short? Akcyzowy { get; set; } + + public short? SledzPartii { get; set; } + + public decimal? MaxCenaZak { get; set; } + + public string? PrzeliczJM { get; set; } + + public short? NrDrukarki { get; set; } + + public decimal? Cena5 { get; set; } + + public decimal? Cena6 { get; set; } + + public decimal? ProgPromocji { get; set; } + + public short? Przeznaczenie { get; set; } + + public short? ObslugaPartii { get; set; } + + public short? UkrycNaKasie { get; set; } + + public string? KodCN { get; set; } + + public decimal? MinCenaSp { get; set; } + + public short? StatusZam { get; set; } + + public DateTime? NowoscOd { get; set; } + + public short? NowoscPrzez { get; set; } + + public short? WysylacNaSklepInternetowy { get; set; } + + public string? GrupaGTU { get; set; } + + public string? KodKrajuPochodzenia { get; set; } + + public short? Zywnosc { get; set; } + + public string? KodSklepu { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepArtykul { get; set; } = new List(); + + public virtual SklepArtykul? SklepArtykulNavigation { get; set; } + + public virtual ICollection SklepDost { get; set; } = new List(); + + public virtual ICollection SklepIstw { get; set; } = new List(); + + public virtual SklepKontr? SklepKontr { get; set; } + + public virtual ICollection SklepNotatki { get; set; } = new List(); + + public virtual ICollection SklepPartia { get; set; } = new List(); + + public virtual ICollection SklepPozDok { get; set; } = new List(); + + public virtual ICollection SklepPozPar { get; set; } = new List(); + + public virtual ICollection SklepPrtMag { get; set; } = new List(); + + public virtual ICollection SklepRegulaTowar { get; set; } = new List(); + + public virtual ICollection SklepSkladnikWzorca { get; set; } = new List(); + + public virtual ICollection SklepTowAkcyza { get; set; } = new List(); + + public virtual ICollection SklepTowDodatekSklepTowar { get; set; } = new List(); + + public virtual ICollection SklepTowDodatekSklepTowarNavigation { get; set; } = new List(); + + public virtual ICollection SklepTowIntParam { get; set; } = new List(); + + public virtual ICollection SklepTowKod { get; set; } = new List(); + + public virtual ICollection SklepTowParWiseBase { get; set; } = new List(); + + public virtual ICollection SklepTowPowiazanieSklepTowar { get; set; } = new List(); + + public virtual ICollection SklepTowPowiazanieSklepTowarNavigation { get; set; } = new List(); + + public virtual ICollection SklepTowStraty { get; set; } = new List(); + + public virtual SklepTowZamiennik? SklepTowZamiennik { get; set; } + + public virtual ICollection SklepTowZdjecia { get; set; } = new List(); + + public virtual ICollection SklepTowarSkladnika { get; set; } = new List(); + + public virtual Towar? Tow { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTowarSkladnika.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowarSkladnika.cs new file mode 100644 index 0000000..cb72178 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTowarSkladnika.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTowarSkladnika +{ + public decimal SklepId { get; set; } + + public decimal SklepSkWzId { get; set; } + + public decimal SklepTowId { get; set; } + + public short Kolejnosc { get; set; } + + public short? Domyslny { get; set; } + + public decimal? Cena { get; set; } + + public decimal? Ilosc { get; set; } + + public short? CenaZKartyTow { get; set; } + + public virtual SklepSkladnikWzorca SklepSkladnikWzorca { get; set; } = null!; + + public virtual SklepTowar SklepTowar { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTrescEmail.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTrescEmail.cs new file mode 100644 index 0000000..bf160f2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTrescEmail.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTrescEmail +{ + public decimal SklepId { get; set; } + + public decimal SklepTEId { get; set; } + + public decimal? SklepUzId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection SklepEmailSklepTrescEmail { get; set; } = new List(); + + public virtual ICollection SklepEmailSklepTrescEmail1 { get; set; } = new List(); + + public virtual ICollection SklepEmailSklepTrescEmailNavigation { get; set; } = new List(); + + public virtual ICollection SklepTrescEmailTekst { get; set; } = new List(); + + public virtual SklepUzytkownik? SklepUzytkownik { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTrescEmailTekst.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTrescEmailTekst.cs new file mode 100644 index 0000000..2b45f11 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTrescEmailTekst.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTrescEmailTekst +{ + public decimal SklepId { get; set; } + + public decimal SklepTEId { get; set; } + + public short Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public string Tresc { get; set; } = null!; + + public virtual SklepTrescEmail SklepTrescEmail { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepTypOs.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepTypOs.cs new file mode 100644 index 0000000..869a754 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepTypOs.cs @@ -0,0 +1,28 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepTypOs +{ + public decimal SklepId { get; set; } + + public decimal SklepTypOsId { get; set; } + + public decimal? TypOsId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public string? Komentarz { get; set; } + + public decimal? CentrTypOsId { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepFormZgod { get; set; } = new List(); + + public virtual ICollection SklepKthTypOs { get; set; } = new List(); + + public virtual ICollection SklepZdarzOs { get; set; } = new List(); + + public virtual TypOs? TypOs { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepUprawnienie.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepUprawnienie.cs new file mode 100644 index 0000000..4ca8f28 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepUprawnienie.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepUprawnienie +{ + public decimal SklepId { get; set; } + + public decimal SklepUzId { get; set; } + + public short Rodzaj { get; set; } + + public short? Jest { get; set; } + + public virtual SklepUzytkownik SklepUzytkownik { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepUzytkownik.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepUzytkownik.cs new file mode 100644 index 0000000..9568205 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepUzytkownik.cs @@ -0,0 +1,68 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepUzytkownik +{ + public decimal SklepId { get; set; } + + public decimal SklepUzId { get; set; } + + public string Identyfikator { get; set; } = null!; + + public string Nazwisko { get; set; } = null!; + + public short Aktywny { get; set; } + + public short NrKasjera { get; set; } + + public short? Rola { get; set; } + + public string? KodKasjera { get; set; } + + public short? NrSzuflady { get; set; } + + public decimal? SklepProfilId { get; set; } + + public decimal? UzId { get; set; } + + public short? Opiekun { get; set; } + + public DateTime? OstZmianaHasla { get; set; } + + public string? Jezyk { get; set; } + + public string? IdentPrepaid { get; set; } + + public string? HasloPrepaid { get; set; } + + public DateTime? Zmiana { get; set; } + + public short? RolaKasjera { get; set; } + + public string? Haslo { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepDok { get; set; } = new List(); + + public virtual ICollection SklepEmail { get; set; } = new List(); + + public virtual ICollection SklepGrupaUzSklepUzytkownik { get; set; } = new List(); + + public virtual SklepGrupaUz? SklepGrupaUzSklepUzytkownikNavigation { get; set; } + + public virtual ICollection SklepPanel { get; set; } = new List(); + + public virtual ICollection SklepPowiazanieUz { get; set; } = new List(); + + public virtual SklepProfil? SklepProfil { get; set; } + + public virtual ICollection SklepTrescEmail { get; set; } = new List(); + + public virtual ICollection SklepUprawnienie { get; set; } = new List(); + + public virtual ICollection SklepZdarzOs { get; set; } = new List(); + + public virtual Uzytkownik? Uz { get; set; } + + public virtual ICollection UzNaSklep { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepWaluta.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepWaluta.cs new file mode 100644 index 0000000..c5b2d37 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepWaluta.cs @@ -0,0 +1,44 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepWaluta +{ + public decimal SklepId { get; set; } + + public decimal SklepWalId { get; set; } + + public decimal? WalId { get; set; } + + public string Kod { get; set; } = null!; + + public string Nazwa { get; set; } = null!; + + public decimal Kurs { get; set; } + + public short Znaczenie { get; set; } + + public short Aktywny { get; set; } + + public string? Skrot1 { get; set; } + + public string? Skrot100 { get; set; } + + public short? UkrycNaKasie { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepDok { get; set; } = new List(); + + public virtual ICollection SklepDokKurs { get; set; } = new List(); + + public virtual ICollection SklepDokWaluta { get; set; } = new List(); + + public virtual ICollection SklepKontoBankowe { get; set; } = new List(); + + public virtual ICollection SklepKontoBankoweKontr { get; set; } = new List(); + + public virtual ICollection SklepParWaluta { get; set; } = new List(); + + public virtual ICollection SklepParagon { get; set; } = new List(); + + public virtual Waluta? Wal { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepZaleznosc.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepZaleznosc.cs new file mode 100644 index 0000000..88412f8 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepZaleznosc.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepZaleznosc +{ + public decimal SklepId { get; set; } + + public decimal SklepDokId { get; set; } + + public decimal PoprzedniSklepId { get; set; } + + public decimal PoprzedniSklepDokId { get; set; } + + public virtual SklepDok SklepDok { get; set; } = null!; + + public virtual SklepDok SklepDokNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepZamiennik.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepZamiennik.cs new file mode 100644 index 0000000..2a8f891 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepZamiennik.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepZamiennik +{ + public decimal SklepId { get; set; } + + public decimal SklepZmId { get; set; } + + public decimal? ZmId { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection SklepTowZamiennik { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepZasob.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepZasob.cs new file mode 100644 index 0000000..e39538a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepZasob.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepZasob +{ + public decimal SklepId { get; set; } + + public short Tabela { get; set; } + + public decimal Id { get; set; } + + public string Typ { get; set; } = null!; + + public string Sciezka { get; set; } = null!; + + public virtual Sklep Sklep { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepZdarzOs.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepZdarzOs.cs new file mode 100644 index 0000000..a6e2c9a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepZdarzOs.cs @@ -0,0 +1,38 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepZdarzOs +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public string Kiedy { get; set; } = null!; + + public short Akcja { get; set; } + + public decimal? SklepTypOsId { get; set; } + + public decimal? SklepZgId { get; set; } + + public short? NowyStatus { get; set; } + + public string? Wersja { get; set; } + + public string? DodPar { get; set; } + + public decimal? SklepUzId { get; set; } + + public short? FormaDec { get; set; } + + public DateTime? DataDec { get; set; } + + public virtual SklepKontr SklepKontr { get; set; } = null!; + + public virtual SklepTypOs? SklepTypOs { get; set; } + + public virtual SklepUzytkownik? SklepUzytkownik { get; set; } + + public virtual ICollection SklepZdarzOsOpis { get; set; } = new List(); + + public virtual SklepZgoda? SklepZgoda { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepZdarzOsOpis.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepZdarzOsOpis.cs new file mode 100644 index 0000000..8236422 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepZdarzOsOpis.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepZdarzOsOpis +{ + public decimal SklepId { get; set; } + + public decimal SklepKontrId { get; set; } + + public string Kiedy { get; set; } = null!; + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual SklepZdarzOs SklepZdarzOs { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SklepZgoda.cs b/Blink.Backoffice.Services.PcmDb/Entities/SklepZgoda.cs new file mode 100644 index 0000000..cb360ad --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SklepZgoda.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SklepZgoda +{ + public decimal SklepId { get; set; } + + public decimal SklepZgId { get; set; } + + public decimal? ZgId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywna { get; set; } + + public string? Wersja { get; set; } + + public string? Zastosowania { get; set; } + + public string? Komentarz { get; set; } + + public decimal? CentrZgId { get; set; } + + public string? DaneOs { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual ICollection SklepFormZgod { get; set; } = new List(); + + public virtual ICollection SklepTekstZgody { get; set; } = new List(); + + public virtual ICollection SklepZdarzOs { get; set; } = new List(); + + public virtual Zgoda? Zg { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Sprzedaz.cs b/Blink.Backoffice.Services.PcmDb/Entities/Sprzedaz.cs new file mode 100644 index 0000000..6242c65 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Sprzedaz.cs @@ -0,0 +1,106 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Sprzedaz +{ + public decimal TowID { get; set; } + + public decimal SklepID { get; set; } + + public decimal CzasID { get; set; } + + public decimal SklepTowID { get; set; } + + public decimal? CenaZakupuNetto { get; set; } + + public decimal? IlZakupiona { get; set; } + + public decimal? IlSprzedana { get; set; } + + public decimal? WartoscSprzedazyNetto { get; set; } + + public decimal? CenaSprzedazyNetto { get; set; } + + public decimal? CenaSprzedazyBrutto { get; set; } + + public decimal? WartoscSprzedazyBrutto { get; set; } + + public decimal? WartoscSprzedazWCenieZakupu { get; set; } + + public decimal? StanTowaru { get; set; } + + public decimal? IlTowPar { get; set; } + + public decimal? IlTowFakt { get; set; } + + public decimal? IlSztTowPar { get; set; } + + public decimal? IlSztTowFakt { get; set; } + + public decimal? WartZakNetPar { get; set; } + + public decimal? WartZakNetFakt { get; set; } + + public decimal? WartZakBrtPar { get; set; } + + public decimal? WartZakBrtFakt { get; set; } + + public decimal? WartSprzNetPar { get; set; } + + public decimal? WartSprzNetFakt { get; set; } + + public decimal? WartSprzBrtPar { get; set; } + + public decimal? WartSprzBrtFakt { get; set; } + + public decimal? WartNetZapas { get; set; } + + public decimal? IlSztTowHurt { get; set; } + + public decimal? IlSztTowPrzes { get; set; } + + public decimal? IlSztTowRozchody { get; set; } + + public decimal? WartZakNetHurt { get; set; } + + public decimal? WartZakNetPrzes { get; set; } + + public decimal? WartZakNetRozchody { get; set; } + + public decimal? WartZakBrtHurt { get; set; } + + public decimal? WartZakBrtPrzes { get; set; } + + public decimal? WartZakBrtRozchody { get; set; } + + public decimal? WartSprzNetHurt { get; set; } + + public decimal? WartSprzNetPrzes { get; set; } + + public decimal? WartSprzNetRozchody { get; set; } + + public decimal? WartSprzBrtHurt { get; set; } + + public decimal? WartSprzBrtPrzes { get; set; } + + public decimal? WartSprzBrtRozchody { get; set; } + + public decimal? IlZakZakupy { get; set; } + + public decimal? IlZakPrzes { get; set; } + + public decimal? IlZakInne { get; set; } + + public decimal? CenaZakZakupy { get; set; } + + public decimal? CenaZakPrzes { get; set; } + + public decimal? CenaZakInne { get; set; } + + public decimal? WartZakZakupy { get; set; } + + public decimal? WartZakPrzes { get; set; } + + public decimal? WartZakInne { get; set; } + + public string? Version { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/StanPrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/StanPrtMag.cs new file mode 100644 index 0000000..0053a4f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/StanPrtMag.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class StanPrtMag +{ + public DateTime Dzien { get; set; } + + public decimal TowId { get; set; } + + public decimal PMId { get; set; } + + public decimal StanPrt { get; set; } + + public virtual DzienRozl DzienNavigation { get; set; } = null!; + + public virtual PrtMag PrtMag { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/StanZgody.cs b/Blink.Backoffice.Services.PcmDb/Entities/StanZgody.cs new file mode 100644 index 0000000..c8e4175 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/StanZgody.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class StanZgody +{ + public decimal KontrId { get; set; } + + public decimal ZgId { get; set; } + + public short Status { get; set; } + + public string Kiedy { get; set; } = null!; + + public string? Wersja { get; set; } + + public DateTime Zmiana { get; set; } + + public short? FormaDec { get; set; } + + public DateTime? DataDec { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual Zgoda Zg { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Struktura_7_3.cs b/Blink.Backoffice.Services.PcmDb/Entities/Struktura_7_3.cs new file mode 100644 index 0000000..251d80a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Struktura_7_3.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Struktura_7_3 +{ + public short ModId { get; set; } + + public short? TypAplikacji { get; set; } + + public string? Wersja { get; set; } + + public DateTime? Kiedy { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Subsys.cs b/Blink.Backoffice.Services.PcmDb/Entities/Subsys.cs new file mode 100644 index 0000000..d2325ed --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Subsys.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Subsys +{ + public string KodSubsys { get; set; } = null!; + + public decimal? TowId { get; set; } + + public short Domyslny { get; set; } + + public DateTime? DataDok { get; set; } + + public string? NrDok { get; set; } + + public string? KodZgrzewki { get; set; } + + public decimal? IleWZgrzewce { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual Towar? Tow { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/SzczegPrtMag.cs b/Blink.Backoffice.Services.PcmDb/Entities/SzczegPrtMag.cs new file mode 100644 index 0000000..3e8423e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/SzczegPrtMag.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class SzczegPrtMag +{ + public decimal TowId { get; set; } + + public decimal PMId { get; set; } + + public short TypDanych { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual PrtMag PrtMag { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TabelaAkcyzowa.cs b/Blink.Backoffice.Services.PcmDb/Entities/TabelaAkcyzowa.cs new file mode 100644 index 0000000..0db913a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TabelaAkcyzowa.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TabelaAkcyzowa +{ + public decimal GrAkcId { get; set; } + + public DateTime OdDaty { get; set; } + + public decimal? StawkaAkc { get; set; } + + public decimal? ProcCenyMax { get; set; } + + public decimal? MinStawkaAkc { get; set; } + + public virtual GrupaAkcyzowa GrAkc { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TekstDok.cs b/Blink.Backoffice.Services.PcmDb/Entities/TekstDok.cs new file mode 100644 index 0000000..e5cb35d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TekstDok.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TekstDok +{ + public decimal DokId { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual Dok Dok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TekstPoz.cs b/Blink.Backoffice.Services.PcmDb/Entities/TekstPoz.cs new file mode 100644 index 0000000..7e69043 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TekstPoz.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TekstPoz +{ + public decimal DokId { get; set; } + + public int Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual PozDok PozDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TekstZgody.cs b/Blink.Backoffice.Services.PcmDb/Entities/TekstZgody.cs new file mode 100644 index 0000000..96822cc --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TekstZgody.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TekstZgody +{ + public decimal ZgId { get; set; } + + public string Wersja { get; set; } = null!; + + public int Kolejnosc { get; set; } + + public string Tekst { get; set; } = null!; + + public DateTime Zmiana { get; set; } + + public virtual Zgoda Zg { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowAkcyza.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowAkcyza.cs new file mode 100644 index 0000000..20c0e89 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowAkcyza.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowAkcyza +{ + public decimal TowId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal GrAkcId { get; set; } + + public string? KodCN { get; set; } + + public decimal? IleAkcJM { get; set; } + + public decimal? Sklad { get; set; } + + public decimal? CenaMax { get; set; } + + public virtual GrupaAkcyzowa GrAkc { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowDodatek.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowDodatek.cs new file mode 100644 index 0000000..ee84749 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowDodatek.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowDodatek +{ + public decimal TowId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal DodTowId { get; set; } + + public decimal Ilosc { get; set; } + + public decimal Cena { get; set; } + + public short Domyslny { get; set; } + + public short Obowiazkowy { get; set; } + + public short? Param1 { get; set; } + + public virtual Towar DodTow { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowIntParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowIntParam.cs new file mode 100644 index 0000000..ac95f2b --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowIntParam.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowIntParam +{ + public decimal TowId { get; set; } + + public short Znaczenie { get; set; } + + public int Param { get; set; } + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowKraj.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowKraj.cs new file mode 100644 index 0000000..59e1a9f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowKraj.cs @@ -0,0 +1,42 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowKraj +{ + public decimal TowId { get; set; } + + public decimal KrajId { get; set; } + + public DateTime Zmiana { get; set; } + + public short? Stawka { get; set; } + + public decimal? CenaZak { get; set; } + + public decimal? CenaDet { get; set; } + + public decimal? CenaHurt { get; set; } + + public decimal? CenaDod { get; set; } + + public decimal? CenaNoc { get; set; } + + public string? Nazwa { get; set; } + + public string? Skrot { get; set; } + + public string? Indeks1 { get; set; } + + public string? Indeks2 { get; set; } + + public string? Opis1 { get; set; } + + public string? Opis2 { get; set; } + + public string? Opis3 { get; set; } + + public string? Opis4 { get; set; } + + public virtual Kraj Kraj { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowParWiseBase.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowParWiseBase.cs new file mode 100644 index 0000000..50508c5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowParWiseBase.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowParWiseBase +{ + public decimal TowId { get; set; } + + public decimal ParId { get; set; } + + public string? Tekst { get; set; } + + public decimal? ZasobId { get; set; } + + public virtual ParWiseBase Par { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowPowiazanie.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowPowiazanie.cs new file mode 100644 index 0000000..9b42675 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowPowiazanie.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowPowiazanie +{ + public decimal TowId { get; set; } + + public short Znaczenie { get; set; } + + public decimal PowTowId { get; set; } + + public virtual Towar PowTow { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowStraty.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowStraty.cs new file mode 100644 index 0000000..6340bb7 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowStraty.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowStraty +{ + public decimal TowId { get; set; } + + public short IdxRodzStrat { get; set; } + + public short Odliczanie { get; set; } + + public decimal? NormaStrat { get; set; } + + public virtual Towar Tow { get; set; } = null!; + + public virtual ICollection TowStratyDlaSklepu { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowStratyDlaSklepu.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowStratyDlaSklepu.cs new file mode 100644 index 0000000..605ccc5 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowStratyDlaSklepu.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowStratyDlaSklepu +{ + public decimal TowId { get; set; } + + public short IdxRodzStrat { get; set; } + + public decimal SklepId { get; set; } + + public decimal? NormaStrat { get; set; } + + public virtual Sklep Sklep { get; set; } = null!; + + public virtual TowStraty TowStraty { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowWartosc.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowWartosc.cs new file mode 100644 index 0000000..d8493aa --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowWartosc.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowWartosc +{ + public decimal TowId { get; set; } + + public decimal ParId { get; set; } + + public int Wartosc { get; set; } + + public virtual Parametr Par { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowZamiennik.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowZamiennik.cs new file mode 100644 index 0000000..168e141 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowZamiennik.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowZamiennik +{ + public decimal TowId { get; set; } + + public decimal ZmId { get; set; } + + public virtual Towar Tow { get; set; } = null!; + + public virtual Zamiennik Zm { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowZdjecia.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowZdjecia.cs new file mode 100644 index 0000000..a7575eb --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowZdjecia.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowZdjecia +{ + public decimal TowId { get; set; } + + public short Kolejnosc { get; set; } + + public decimal ZasobId { get; set; } + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Towar.cs b/Blink.Backoffice.Services.PcmDb/Entities/Towar.cs new file mode 100644 index 0000000..dfa37be --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Towar.cs @@ -0,0 +1,236 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Towar +{ + public decimal TowId { get; set; } + + public decimal AsId { get; set; } + + public decimal JMId { get; set; } + + public decimal? KatId { get; set; } + + public decimal? Producent { get; set; } + + public decimal? ArtId { get; set; } + + public string Nazwa { get; set; } = null!; + + public string Skrot { get; set; } = null!; + + public string Kod { get; set; } = null!; + + public short TypTowaru { get; set; } + + public string Indeks1 { get; set; } = null!; + + public string Indeks2 { get; set; } = null!; + + public string Opis1 { get; set; } = null!; + + public string Opis2 { get; set; } = null!; + + public string Opis3 { get; set; } = null!; + + public string Opis4 { get; set; } = null!; + + public short TermWazn { get; set; } + + public decimal Marza { get; set; } + + public decimal HurtRabat { get; set; } + + public decimal NocNarzut { get; set; } + + public short OpcjaMarzy { get; set; } + + public short OpcjaRabatu { get; set; } + + public short OpcjaNarzutu { get; set; } + + public decimal CenaEw { get; set; } + + public decimal CenaDet { get; set; } + + public decimal CenaHurt { get; set; } + + public decimal CenaNoc { get; set; } + + public decimal CenaDod { get; set; } + + public short CenaOtwarta { get; set; } + + public short PoziomCen { get; set; } + + public int PrefPLU { get; set; } + + public short Stawka { get; set; } + + public decimal IleWZgrzewce { get; set; } + + public decimal IleWCalosci { get; set; } + + public string KodZgrzewki { get; set; } = null!; + + public short Aktywny { get; set; } + + public int Waga { get; set; } + + public int Szerokosc { get; set; } + + public int Wysokosc { get; set; } + + public int Glebokosc { get; set; } + + public string CKU { get; set; } = null!; + + public short BlokDostawcow { get; set; } + + public short BlokCenyZak { get; set; } + + public short BlokCenSp { get; set; } + + public short BlokZmian { get; set; } + + public string Rezerwa1 { get; set; } = null!; + + public string Rezerwa2 { get; set; } = null!; + + public decimal? CentrTowId { get; set; } + + public DateTime Zmiana { get; set; } + + public short? Akcyzowy { get; set; } + + public short? SledzPartii { get; set; } + + public decimal? MaxCenaZak { get; set; } + + public string? PrzeliczJM { get; set; } + + public short? NrDrukarki { get; set; } + + public decimal? Cena5 { get; set; } + + public decimal? Cena6 { get; set; } + + public decimal? ProgPromocji { get; set; } + + public DateTime? ZmianaIstotna { get; set; } + + public DateTime? ZmianaTylkoCen { get; set; } + + public short? Przeznaczenie { get; set; } + + public short? ObslugaPartii { get; set; } + + public short? UkrycNaKasie { get; set; } + + public string? KodCN { get; set; } + + public decimal? MinCenaSp { get; set; } + + public string? SubsysKoduGlownego { get; set; } + + public short? StatusZam { get; set; } + + public short? KodGlownyCentralny { get; set; } + + public DateTime? NowoscOd { get; set; } + + public short? NowoscPrzez { get; set; } + + public short? WysylacNaSklepInternetowy { get; set; } + + public string? GrupaGTU { get; set; } + + public decimal? KrajIdPochodzenia { get; set; } + + public short? Zywnosc { get; set; } + + public string? KodSklepu { get; set; } + + public virtual Artykul? Art { get; set; } + + public virtual ICollection Artykul { get; set; } = new List(); + + public virtual Asort As { get; set; } = null!; + + public virtual ICollection Dostawca { get; set; } = new List(); + + public virtual ICollection HarmCeny { get; set; } = new List(); + + public virtual ICollection Istw { get; set; } = new List(); + + public virtual JM JM { get; set; } = null!; + + public virtual ICollection KasKod { get; set; } = new List(); + + public virtual ICollection KasTow { get; set; } = new List(); + + public virtual Kategoria? Kat { get; set; } + + public virtual ICollection KodDod { get; set; } = new List(); + + public virtual Kraj? KrajIdPochodzeniaNavigation { get; set; } + + public virtual ICollection Marzownik { get; set; } = new List(); + + public virtual ICollection Notatki { get; set; } = new List(); + + public virtual ICollection Odbiorca { get; set; } = new List(); + + public virtual ICollection Oferta { get; set; } = new List(); + + public virtual ICollection Partia { get; set; } = new List(); + + public virtual ICollection PowiazanieOpak { get; set; } = new List(); + + public virtual Powiazanie? PowiazanieTow { get; set; } + + public virtual ICollection PozDok { get; set; } = new List(); + + public virtual ICollection PozPar { get; set; } = new List(); + + public virtual ICollection PozWz { get; set; } = new List(); + + public virtual Kontrahent? ProducentNavigation { get; set; } + + public virtual ICollection PrtMag { get; set; } = new List(); + + public virtual ICollection RegulaTowar { get; set; } = new List(); + + public virtual ICollection SkladnikWzorca { get; set; } = new List(); + + public virtual ICollection SklepFlagi { get; set; } = new List(); + + public virtual ICollection SklepTowar { get; set; } = new List(); + + public virtual ICollection Subsys { get; set; } = new List(); + + public virtual ICollection TowAkcyza { get; set; } = new List(); + + public virtual ICollection TowDodatekDodTow { get; set; } = new List(); + + public virtual ICollection TowDodatekTow { get; set; } = new List(); + + public virtual ICollection TowIntParam { get; set; } = new List(); + + public virtual ICollection TowKraj { get; set; } = new List(); + + public virtual ICollection TowParWiseBase { get; set; } = new List(); + + public virtual ICollection TowPowiazaniePowTow { get; set; } = new List(); + + public virtual ICollection TowPowiazanieTow { get; set; } = new List(); + + public virtual ICollection TowStraty { get; set; } = new List(); + + public virtual ICollection TowWartosc { get; set; } = new List(); + + public virtual TowZamiennik? TowZamiennik { get; set; } + + public virtual ICollection TowZdjecia { get; set; } = new List(); + + public virtual ICollection TowarSkladnika { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TowarSkladnika.cs b/Blink.Backoffice.Services.PcmDb/Entities/TowarSkladnika.cs new file mode 100644 index 0000000..f9e5f46 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TowarSkladnika.cs @@ -0,0 +1,22 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TowarSkladnika +{ + public decimal SkWzId { get; set; } + + public decimal TowId { get; set; } + + public short Kolejnosc { get; set; } + + public short? Domyslny { get; set; } + + public decimal? Cena { get; set; } + + public decimal? Ilosc { get; set; } + + public short? CenaZKartyTow { get; set; } + + public virtual SkladnikWzorca SkWz { get; set; } = null!; + + public virtual Towar Tow { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TrescEmail.cs b/Blink.Backoffice.Services.PcmDb/Entities/TrescEmail.cs new file mode 100644 index 0000000..98edd9a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TrescEmail.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TrescEmail +{ + public decimal TEId { get; set; } + + public decimal? UzId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection EmailTED { get; set; } = new List(); + + public virtual ICollection EmailTER { get; set; } = new List(); + + public virtual ICollection EmailTEW { get; set; } = new List(); + + public virtual ICollection TrescEmailTekst { get; set; } = new List(); + + public virtual Uzytkownik? Uz { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TrescEmailTekst.cs b/Blink.Backoffice.Services.PcmDb/Entities/TrescEmailTekst.cs new file mode 100644 index 0000000..2fec082 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TrescEmailTekst.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TrescEmailTekst +{ + public decimal TEId { get; set; } + + public short Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public string Tresc { get; set; } = null!; + + public virtual TrescEmail TE { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/TypOs.cs b/Blink.Backoffice.Services.PcmDb/Entities/TypOs.cs new file mode 100644 index 0000000..cde8f7f --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/TypOs.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class TypOs +{ + public decimal TypOsId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public string? Komentarz { get; set; } + + public short? Narzucac { get; set; } + + public decimal? CentrTypOsId { get; set; } + + public virtual ICollection FormZgod { get; set; } = new List(); + + public virtual ICollection SklepTypOs { get; set; } = new List(); + + public virtual ICollection ZdarzOs { get; set; } = new List(); + + public virtual ICollection Kontr { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Ulica.cs b/Blink.Backoffice.Services.PcmDb/Entities/Ulica.cs new file mode 100644 index 0000000..88556ef --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Ulica.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Ulica +{ + public decimal UlId { get; set; } + + public decimal MId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywny { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual Miasto MIdNavigation { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Uprawnienie.cs b/Blink.Backoffice.Services.PcmDb/Entities/Uprawnienie.cs new file mode 100644 index 0000000..14f097d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Uprawnienie.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Uprawnienie +{ + public decimal UzId { get; set; } + + public short Rodzaj { get; set; } + + public short? Jest { get; set; } + + public virtual Uzytkownik Uz { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/UprawnienieNaSklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/UprawnienieNaSklep.cs new file mode 100644 index 0000000..9977924 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/UprawnienieNaSklep.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class UprawnienieNaSklep +{ + public decimal UzNSId { get; set; } + + public short Rodzaj { get; set; } + + public short? Jest { get; set; } + + public virtual UzNaSklep UzNS { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/UzNaSklep.cs b/Blink.Backoffice.Services.PcmDb/Entities/UzNaSklep.cs new file mode 100644 index 0000000..7612ed9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/UzNaSklep.cs @@ -0,0 +1,48 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class UzNaSklep +{ + public decimal UzNSId { get; set; } + + public decimal? SklepId { get; set; } + + public decimal? SklepUzId { get; set; } + + public string Identyfikator { get; set; } = null!; + + public string Haslo { get; set; } = null!; + + public string Nazwisko { get; set; } = null!; + + public short Aktywny { get; set; } + + public short NrKasjera { get; set; } + + public short? Rola { get; set; } + + public string? KodKasjera { get; set; } + + public short? NrSzuflady { get; set; } + + public string? Jezyk { get; set; } + + public string? IdentPrePaid { get; set; } + + public string? HasloPrepaid { get; set; } + + public DateTime? Zmiana { get; set; } + + public DateTime? WymusZmianeHasla { get; set; } + + public short? RolaKasjera { get; set; } + + public virtual ICollection Panel { get; set; } = new List(); + + public virtual ICollection PowiazanieUzNaSklep { get; set; } = new List(); + + public virtual Sklep? Sklep { get; set; } + + public virtual SklepUzytkownik? SklepUzytkownik { get; set; } + + public virtual ICollection UprawnienieNaSklep { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Uzytkownik.cs b/Blink.Backoffice.Services.PcmDb/Entities/Uzytkownik.cs new file mode 100644 index 0000000..6c24a69 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Uzytkownik.cs @@ -0,0 +1,68 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Uzytkownik +{ + public decimal UzId { get; set; } + + public string Identyfikator { get; set; } = null!; + + public string Haslo { get; set; } = null!; + + public string Nazwisko { get; set; } = null!; + + public short Aktywny { get; set; } + + public short NrKasjera { get; set; } + + public short? Rola { get; set; } + + public string? KodKasjera { get; set; } + + public short? NrSzuflady { get; set; } + + public decimal? ProfilId { get; set; } + + public decimal? CentrUzId { get; set; } + + public short? Opiekun { get; set; } + + public DateTime? OstZmianaHasla { get; set; } + + public string? Jezyk { get; set; } + + public string? IdentPrepaid { get; set; } + + public string? HasloPrepaid { get; set; } + + public decimal? CentrUzNSId { get; set; } + + public DateTime? Zmiana { get; set; } + + public DateTime? WymusZmianeHasla { get; set; } + + public short? RolaKasjera { get; set; } + + public virtual ICollection Dok { get; set; } = new List(); + + public virtual ICollection Email { get; set; } = new List(); + + public virtual ICollection GrupaUzRola { get; set; } = new List(); + + public virtual GrupaUz? GrupaUzUz { get; set; } + + public virtual ICollection Panel { get; set; } = new List(); + + public virtual ICollection PowiazanieUz { get; set; } = new List(); + + public virtual Profil? Profil { get; set; } + + public virtual ICollection Sesja { get; set; } = new List(); + + public virtual ICollection SklepUzytkownik { get; set; } = new List(); + + public virtual ICollection TrescEmail { get; set; } = new List(); + + public virtual ICollection Uprawnienie { get; set; } = new List(); + + public virtual ICollection ZdarzOs { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Vat.cs b/Blink.Backoffice.Services.PcmDb/Entities/Vat.cs new file mode 100644 index 0000000..13f46b2 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Vat.cs @@ -0,0 +1,6 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Vat +{ + public short Stawka { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Waluta.cs b/Blink.Backoffice.Services.PcmDb/Entities/Waluta.cs new file mode 100644 index 0000000..194d19e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Waluta.cs @@ -0,0 +1,52 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Waluta +{ + public decimal WalId { get; set; } + + public string Kod { get; set; } = null!; + + public string Nazwa { get; set; } = null!; + + public decimal Kurs { get; set; } + + public short Znaczenie { get; set; } + + public short Aktywny { get; set; } + + public decimal? Spread { get; set; } + + public decimal? SpreadZak { get; set; } + + public decimal? KursZak { get; set; } + + public decimal? CentrWalId { get; set; } + + public string? Skrot1 { get; set; } + + public string? Skrot100 { get; set; } + + public short? UkrycNaKasie { get; set; } + + public virtual ICollection DokKurs { get; set; } = new List(); + + public virtual ICollection DokWal { get; set; } = new List(); + + public virtual ICollection DokWalIdPlatnosciNavigation { get; set; } = new List(); + + public virtual ICollection DokWaluta { get; set; } = new List(); + + public virtual ICollection KontoBankowe { get; set; } = new List(); + + public virtual ICollection KontoBankoweKontr { get; set; } = new List(); + + public virtual ICollection Kraj { get; set; } = new List(); + + public virtual ICollection KursWaluty { get; set; } = new List(); + + public virtual ICollection ParWaluta { get; set; } = new List(); + + public virtual ICollection Paragon { get; set; } = new List(); + + public virtual ICollection SklepWaluta { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Wersja_7_2.cs b/Blink.Backoffice.Services.PcmDb/Entities/Wersja_7_2.cs new file mode 100644 index 0000000..266ec11 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Wersja_7_2.cs @@ -0,0 +1,10 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Wersja_7_2 +{ + public short Upgrade { get; set; } + + public short Status { get; set; } + + public string Nazwa { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Wzorzec.cs b/Blink.Backoffice.Services.PcmDb/Entities/Wzorzec.cs new file mode 100644 index 0000000..d89c378 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Wzorzec.cs @@ -0,0 +1,24 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Wzorzec +{ + public decimal WzId { get; set; } + + public short TypWzorca { get; set; } + + public string Nazwa { get; set; } = null!; + + public decimal? CentrWzId { get; set; } + + public short? Automatyczny { get; set; } + + public decimal? Param1 { get; set; } + + public decimal? Param2 { get; set; } + + public short? GrupGen { get; set; } + + public string? Opis { get; set; } + + public virtual ICollection PozWz { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Zaleznosc.cs b/Blink.Backoffice.Services.PcmDb/Entities/Zaleznosc.cs new file mode 100644 index 0000000..f6ea15a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Zaleznosc.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Zaleznosc +{ + public decimal DokId { get; set; } + + public decimal PoprzedniDokId { get; set; } + + public virtual Dok Dok { get; set; } = null!; + + public virtual Dok PoprzedniDok { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Zamiennik.cs b/Blink.Backoffice.Services.PcmDb/Entities/Zamiennik.cs new file mode 100644 index 0000000..3a4b064 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Zamiennik.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Zamiennik +{ + public decimal ZmId { get; set; } + + public decimal? CentrZmId { get; set; } + + public DateTime Zmiana { get; set; } + + public virtual ICollection TowZamiennik { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Zasob.cs b/Blink.Backoffice.Services.PcmDb/Entities/Zasob.cs new file mode 100644 index 0000000..6f388c9 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Zasob.cs @@ -0,0 +1,12 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Zasob +{ + public short Tabela { get; set; } + + public decimal Id { get; set; } + + public string Typ { get; set; } = null!; + + public string Sciezka { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ZdarzLoj.cs b/Blink.Backoffice.Services.PcmDb/Entities/ZdarzLoj.cs new file mode 100644 index 0000000..257dc90 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ZdarzLoj.cs @@ -0,0 +1,46 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ZdarzLoj +{ + public decimal ZdarzLojId { get; set; } + + public decimal? KontoId { get; set; } + + public decimal? KartaId { get; set; } + + public string? KodKarty { get; set; } + + public DateTime DataCzas { get; set; } + + public DateTime DataCzasZapisu { get; set; } + + public short TypZdarz { get; set; } + + public decimal? RegulaId { get; set; } + + public decimal? StanPrzed { get; set; } + + public decimal? StanPo { get; set; } + + public decimal? Kwota { get; set; } + + public string? Opis { get; set; } + + public string? TransUUID { get; set; } + + public string? ShopNo { get; set; } + + public string? PosNo { get; set; } + + public decimal? SklepId { get; set; } + + public decimal? DokId { get; set; } + + public string? Cecha { get; set; } + + public virtual KartaLoj? Karta { get; set; } + + public virtual KontoLoj? Konto { get; set; } + + public virtual ICollection OpisZdarzLoj { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ZdarzOs.cs b/Blink.Backoffice.Services.PcmDb/Entities/ZdarzOs.cs new file mode 100644 index 0000000..12deeef --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ZdarzOs.cs @@ -0,0 +1,38 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ZdarzOs +{ + public decimal KontrId { get; set; } + + public string Kiedy { get; set; } = null!; + + public short Akcja { get; set; } + + public decimal? TypOsId { get; set; } + + public decimal? ZgId { get; set; } + + public short? NowyStatus { get; set; } + + public string? Wersja { get; set; } + + public DateTime Zmiana { get; set; } + + public string? DodPar { get; set; } + + public decimal? UzId { get; set; } + + public short? FormaDec { get; set; } + + public DateTime? DataDec { get; set; } + + public virtual Kontrahent Kontr { get; set; } = null!; + + public virtual TypOs? TypOs { get; set; } + + public virtual Uzytkownik? Uz { get; set; } + + public virtual ICollection ZdarzOsOpis { get; set; } = new List(); + + public virtual Zgoda? Zg { get; set; } +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ZdarzOsOpis.cs b/Blink.Backoffice.Services.PcmDb/Entities/ZdarzOsOpis.cs new file mode 100644 index 0000000..a790a8e --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ZdarzOsOpis.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ZdarzOsOpis +{ + public decimal KontrId { get; set; } + + public string Kiedy { get; set; } = null!; + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual ZdarzOs ZdarzOs { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Zgoda.cs b/Blink.Backoffice.Services.PcmDb/Entities/Zgoda.cs new file mode 100644 index 0000000..5556e1a --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Zgoda.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Zgoda +{ + public decimal ZgId { get; set; } + + public string Nazwa { get; set; } = null!; + + public short Aktywna { get; set; } + + public DateTime Zmiana { get; set; } + + public string? Wersja { get; set; } + + public string? Zastosowania { get; set; } + + public string? Komentarz { get; set; } + + public decimal? CentrZgId { get; set; } + + public string? DaneOs { get; set; } + + public virtual ICollection CentrStanZgody { get; set; } = new List(); + + public virtual ICollection FormZgod { get; set; } = new List(); + + public virtual ICollection SklepZgoda { get; set; } = new List(); + + public virtual ICollection StanZgody { get; set; } = new List(); + + public virtual ICollection TekstZgody { get; set; } = new List(); + + public virtual ICollection ZdarzOs { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ZlecKomunikat.cs b/Blink.Backoffice.Services.PcmDb/Entities/ZlecKomunikat.cs new file mode 100644 index 0000000..e85f88d --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ZlecKomunikat.cs @@ -0,0 +1,16 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ZlecKomunikat +{ + public decimal KasaId { get; set; } + + public decimal ZlecId { get; set; } + + public int Kolejnosc { get; set; } + + public short Znaczenie { get; set; } + + public string Tekst { get; set; } = null!; + + public virtual Zlecenie Zlecenie { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ZlecParam.cs b/Blink.Backoffice.Services.PcmDb/Entities/ZlecParam.cs new file mode 100644 index 0000000..1780104 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ZlecParam.cs @@ -0,0 +1,14 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ZlecParam +{ + public decimal KasaId { get; set; } + + public decimal ZlecId { get; set; } + + public string ParNazwa { get; set; } = null!; + + public string ParWartosc { get; set; } = null!; + + public virtual Zlecenie Zlecenie { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Zlecenie.cs b/Blink.Backoffice.Services.PcmDb/Entities/Zlecenie.cs new file mode 100644 index 0000000..53a72e6 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Zlecenie.cs @@ -0,0 +1,34 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Zlecenie +{ + public decimal KasaId { get; set; } + + public decimal ZlecId { get; set; } + + public short Typ { get; set; } + + public short Status { get; set; } + + public int Param { get; set; } + + public short Alarm { get; set; } + + public short NieUsuwac { get; set; } + + public DateTime Utworzono { get; set; } + + public DateTime Zmiana { get; set; } + + public string? NazwaDod { get; set; } + + public decimal? ParId { get; set; } + + public string? Wstrzymanie { get; set; } + + public virtual Kasa Kasa { get; set; } = null!; + + public virtual ICollection ZlecKomunikat { get; set; } = new List(); + + public virtual ICollection ZlecParam { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/Zmiana.cs b/Blink.Backoffice.Services.PcmDb/Entities/Zmiana.cs new file mode 100644 index 0000000..7d55c20 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/Zmiana.cs @@ -0,0 +1,26 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class Zmiana +{ + public decimal ZmId { get; set; } + + public decimal SesjaId { get; set; } + + public DateTime Czas { get; set; } + + public short Akcja { get; set; } + + public short Tabela { get; set; } + + public string Tekst { get; set; } = null!; + + public decimal? SklepId { get; set; } + + public decimal? TabId { get; set; } + + public virtual Komentarz? Komentarz { get; set; } + + public virtual Sesja Sesja { get; set; } = null!; + + public virtual ICollection ZmianaTabeli { get; set; } = new List(); +} diff --git a/Blink.Backoffice.Services.PcmDb/Entities/ZmianaTabeli.cs b/Blink.Backoffice.Services.PcmDb/Entities/ZmianaTabeli.cs new file mode 100644 index 0000000..86cc2c4 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/Entities/ZmianaTabeli.cs @@ -0,0 +1,10 @@ +namespace Blink.Backoffice.Services.PcmDb.Entities; + +public partial class ZmianaTabeli +{ + public decimal ZmId { get; set; } + + public decimal Id { get; set; } + + public virtual Zmiana Zm { get; set; } = null!; +} diff --git a/Blink.Backoffice.Services.PcmDb/PcmDbContext.cs b/Blink.Backoffice.Services.PcmDb/PcmDbContext.cs new file mode 100644 index 0000000..88671c0 --- /dev/null +++ b/Blink.Backoffice.Services.PcmDb/PcmDbContext.cs @@ -0,0 +1,8354 @@ +using Blink.Backoffice.Services.PcmDb.Entities; +using Microsoft.EntityFrameworkCore; + +namespace Blink.Backoffice.Services.PcmDb; + +public partial class PcmDbContext : DbContext +{ + public PcmDbContext() + { + } + + public PcmDbContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet Akwizytor { get; set; } + + public virtual DbSet Artykul { get; set; } + + public virtual DbSet Asort { get; set; } + + public virtual DbSet Bank { get; set; } + + public virtual DbSet Blokada { get; set; } + + public virtual DbSet CentrStanZgody { get; set; } + + public virtual DbSet Czas { get; set; } + + public virtual DbSet DefinicjaKodu { get; set; } + + public virtual DbSet DlugiZasob { get; set; } + + public virtual DbSet DlugiZasobBin { get; set; } + + public virtual DbSet DlugiZasobTxt { get; set; } + + public virtual DbSet Dok { get; set; } + + public virtual DbSet DokDodKth { get; set; } + + public virtual DbSet DokKasa { get; set; } + + public virtual DbSet DokKontr { get; set; } + + public virtual DbSet DokKurs { get; set; } + + public virtual DbSet DokPunkty { get; set; } + + public virtual DbSet DokWBufPowiazanie { get; set; } + + public virtual DbSet DokWaluta { get; set; } + + public virtual DbSet DostProd { get; set; } + + public virtual DbSet Dostawca { get; set; } + + public virtual DbSet DzienRozl { get; set; } + + public virtual DbSet DzienRozlParam { get; set; } + + public virtual DbSet Email { get; set; } + + public virtual DbSet FormZgod { get; set; } + + public virtual DbSet FormaPlatnPos7 { get; set; } + + public virtual DbSet FormaPlatnosci { get; set; } + + public virtual DbSet GrWartosc { get; set; } + + public virtual DbSet GrupaAkcyzowa { get; set; } + + public virtual DbSet GrupaPromocji { get; set; } + + public virtual DbSet GrupaTow { get; set; } + + public virtual DbSet GrupaUz { get; set; } + + public virtual DbSet HarmCeny { get; set; } + + public virtual DbSet HarmCykl { get; set; } + + public virtual DbSet HarmHarm { get; set; } + + public virtual DbSet HarmRap { get; set; } + + public virtual DbSet HarmRapCykl { get; set; } + + public virtual DbSet HarmRapParam { get; set; } + + public virtual DbSet HarmRapZlecenie { get; set; } + + public virtual DbSet HarmWpis { get; set; } + + public virtual DbSet Istw { get; set; } + + public virtual DbSet JM { get; set; } + + public virtual DbSet KartaLoj { get; set; } + + public virtual DbSet KasKod { get; set; } + + public virtual DbSet KasPar { get; set; } + + public virtual DbSet KasTow { get; set; } + + public virtual DbSet Kasa { get; set; } + + public virtual DbSet KasaFormaPlatn { get; set; } + + public virtual DbSet KatParam { get; set; } + + public virtual DbSet Kategoria { get; set; } + + public virtual DbSet KodDod { get; set; } + + public virtual DbSet KodWazony { get; set; } + + public virtual DbSet Komentarz { get; set; } + + public virtual DbSet Konfig { get; set; } + + public virtual DbSet KontoBankowe { get; set; } + + public virtual DbSet KontoBankoweKontr { get; set; } + + public virtual DbSet KontoLoj { get; set; } + + public virtual DbSet KontrOpis { get; set; } + + public virtual DbSet Kontrahent { get; set; } + + public virtual DbSet Kraj { get; set; } + + public virtual DbSet KrajStawka { get; set; } + + public virtual DbSet KthParWartosc { get; set; } + + public virtual DbSet KthParam { get; set; } + + public virtual DbSet KursWaluty { get; set; } + + public virtual DbSet LiniaLotnicza { get; set; } + + public virtual DbSet LogOperation { get; set; } + + public virtual DbSet LogTypeDef { get; set; } + + public virtual DbSet LogValChangeNum { get; set; } + + public virtual DbSet LogValChangeTxt { get; set; } + + public virtual DbSet Lotnisko { get; set; } + + public virtual DbSet Magazyn { get; set; } + + public virtual DbSet MarZakres { get; set; } + + public virtual DbSet Marzownik { get; set; } + + public virtual DbSet Miasto { get; set; } + + public virtual DbSet Notatki { get; set; } + + public virtual DbSet NrRej { get; set; } + + public virtual DbSet NumDok { get; set; } + + public virtual DbSet NumMag { get; set; } + + public virtual DbSet OdbProd { get; set; } + + public virtual DbSet Odbiorca { get; set; } + + public virtual DbSet OfKod { get; set; } + + public virtual DbSet OfSlownik { get; set; } + + public virtual DbSet Oferta { get; set; } + + public virtual DbSet OpisZdarzLoj { get; set; } + + public virtual DbSet Oplata { get; set; } + + public virtual DbSet Osoba { get; set; } + + public virtual DbSet PH { get; set; } + + public virtual DbSet PHDane { get; set; } + + public virtual DbSet PHOdbDane { get; set; } + + public virtual DbSet PHOdbiorca { get; set; } + + public virtual DbSet PHRozliczenie { get; set; } + + public virtual DbSet Panel { get; set; } + + public virtual DbSet PanelParam { get; set; } + + public virtual DbSet ParBon { get; set; } + + public virtual DbSet ParPunkty { get; set; } + + public virtual DbSet ParWaluta { get; set; } + + public virtual DbSet ParWartosc { get; set; } + + public virtual DbSet ParWiseBase { get; set; } + + public virtual DbSet Paragon { get; set; } + + public virtual DbSet Parametr { get; set; } + + public virtual DbSet Partia { get; set; } + + public virtual DbSet PcfUser { get; set; } + + public virtual DbSet PcfUserSklep { get; set; } + + public virtual DbSet PcpPos { get; set; } + + public virtual DbSet PcpReceipt { get; set; } + + public virtual DbSet PcpReceiptItem { get; set; } + + public virtual DbSet PcpReceiptPayment { get; set; } + + public virtual DbSet PcpReceiptVat { get; set; } + + public virtual DbSet PcpShop { get; set; } + + public virtual DbSet PolParam { get; set; } + + public virtual DbSet Polityka { get; set; } + + public virtual DbSet PowKontLoj { get; set; } + + public virtual DbSet Powiadomienie { get; set; } + + public virtual DbSet PowiadomienieParam { get; set; } + + public virtual DbSet Powiazanie { get; set; } + + public virtual DbSet PowiazanieProm { get; set; } + + public virtual DbSet PowiazanieSklep { get; set; } + + public virtual DbSet PowiazanieUz { get; set; } + + public virtual DbSet PowiazanieUzNaSklep { get; set; } + + public virtual DbSet PozAkcyza { get; set; } + + public virtual DbSet PozCennikDok { get; set; } + + public virtual DbSet PozDok { get; set; } + + public virtual DbSet PozDokWBufPowiazanie { get; set; } + + public virtual DbSet PozPar { get; set; } + + public virtual DbSet PozParSzczeg { get; set; } + + public virtual DbSet PozWz { get; set; } + + public virtual DbSet Profil { get; set; } + + public virtual DbSet ProfilKasa { get; set; } + + public virtual DbSet ProfilKonfig { get; set; } + + public virtual DbSet PrtMag { get; set; } + + public virtual DbSet RapWartPocz { get; set; } + + public virtual DbSet RapWartPoczDane { get; set; } + + public virtual DbSet Regula { get; set; } + + public virtual DbSet RegulaAsort { get; set; } + + public virtual DbSet RegulaDok { get; set; } + + public virtual DbSet RegulaDokSzczeg { get; set; } + + public virtual DbSet RegulaKod { get; set; } + + public virtual DbSet RegulaPar { get; set; } + + public virtual DbSet RegulaParSzczeg { get; set; } + + public virtual DbSet RegulaParam { get; set; } + + public virtual DbSet RegulaPozDok { get; set; } + + public virtual DbSet RegulaPozDokSzczeg { get; set; } + + public virtual DbSet RegulaPozPar { get; set; } + + public virtual DbSet RegulaPozParSzczeg { get; set; } + + public virtual DbSet RegulaProg { get; set; } + + public virtual DbSet RegulaSklep { get; set; } + + public virtual DbSet RegulaSklepAuth { get; set; } + + public virtual DbSet RegulaTekst { get; set; } + + public virtual DbSet RegulaTowar { get; set; } + + public virtual DbSet Rola { get; set; } + + public virtual DbSet RolaUprawnienie { get; set; } + + public virtual DbSet RozPrtMag { get; set; } + + public virtual DbSet RozbicieDodDok { get; set; } + + public virtual DbSet RozbicieDok { get; set; } + + public virtual DbSet Rozlicza { get; set; } + + public virtual DbSet RozliczeniePartii { get; set; } + + public virtual DbSet Sesja { get; set; } + + public virtual DbSet SesjaAktywna { get; set; } + + public virtual DbSet SkladnikDefinicjiKodu { get; set; } + + public virtual DbSet SkladnikWzorca { get; set; } + + public virtual DbSet Sklep { get; set; } + + public virtual DbSet SklepArtykul { get; set; } + + public virtual DbSet SklepBank { get; set; } + + public virtual DbSet SklepDefinicjaKodu { get; set; } + + public virtual DbSet SklepDlugiZasob { get; set; } + + public virtual DbSet SklepDok { get; set; } + + public virtual DbSet SklepDokDodKth { get; set; } + + public virtual DbSet SklepDokKurs { get; set; } + + public virtual DbSet SklepDokPunkty { get; set; } + + public virtual DbSet SklepDokWaluta { get; set; } + + public virtual DbSet SklepDost { get; set; } + + public virtual DbSet SklepDzienRozl { get; set; } + + public virtual DbSet SklepDzienRozlParam { get; set; } + + public virtual DbSet SklepEmail { get; set; } + + public virtual DbSet SklepFlagi { get; set; } + + public virtual DbSet SklepFormZgod { get; set; } + + public virtual DbSet SklepFormaPlatnPos7 { get; set; } + + public virtual DbSet SklepGrupaAkcyzowa { get; set; } + + public virtual DbSet SklepGrupaPromocji { get; set; } + + public virtual DbSet SklepGrupaUz { get; set; } + + public virtual DbSet SklepIstw { get; set; } + + public virtual DbSet SklepKartaLoj { get; set; } + + public virtual DbSet SklepKasa { get; set; } + + public virtual DbSet SklepKasaFormaPlatn { get; set; } + + public virtual DbSet SklepKontoBankowe { get; set; } + + public virtual DbSet SklepKontoBankoweKontr { get; set; } + + public virtual DbSet SklepKontoLoj { get; set; } + + public virtual DbSet SklepKontr { get; set; } + + public virtual DbSet SklepKontrOpis { get; set; } + + public virtual DbSet SklepKontrSklep { get; set; } + + public virtual DbSet SklepKthTypOs { get; set; } + + public virtual DbSet SklepMagazyn { get; set; } + + public virtual DbSet SklepNotatki { get; set; } + + public virtual DbSet SklepNrRej { get; set; } + + public virtual DbSet SklepNrRejKarta { get; set; } + + public virtual DbSet SklepOplata { get; set; } + + public virtual DbSet SklepPanel { get; set; } + + public virtual DbSet SklepPanelParam { get; set; } + + public virtual DbSet SklepParBon { get; set; } + + public virtual DbSet SklepParPunkty { get; set; } + + public virtual DbSet SklepParWaluta { get; set; } + + public virtual DbSet SklepParagon { get; set; } + + public virtual DbSet SklepPartia { get; set; } + + public virtual DbSet SklepPowKontLoj { get; set; } + + public virtual DbSet SklepPowiazanieProm { get; set; } + + public virtual DbSet SklepPowiazanieUz { get; set; } + + public virtual DbSet SklepPozAkcyza { get; set; } + + public virtual DbSet SklepPozDok { get; set; } + + public virtual DbSet SklepPozPar { get; set; } + + public virtual DbSet SklepPozParSzczeg { get; set; } + + public virtual DbSet SklepProfil { get; set; } + + public virtual DbSet SklepProfilKonfig { get; set; } + + public virtual DbSet SklepPrtMag { get; set; } + + public virtual DbSet SklepRapWartPocz { get; set; } + + public virtual DbSet SklepRapWartPoczDane { get; set; } + + public virtual DbSet SklepRegula { get; set; } + + public virtual DbSet SklepRegulaAsort { get; set; } + + public virtual DbSet SklepRegulaDok { get; set; } + + public virtual DbSet SklepRegulaDokSzczeg { get; set; } + + public virtual DbSet SklepRegulaKod { get; set; } + + public virtual DbSet SklepRegulaPar { get; set; } + + public virtual DbSet SklepRegulaParSzczeg { get; set; } + + public virtual DbSet SklepRegulaParam { get; set; } + + public virtual DbSet SklepRegulaPozDok { get; set; } + + public virtual DbSet SklepRegulaPozDokSzczeg { get; set; } + + public virtual DbSet SklepRegulaPozPar { get; set; } + + public virtual DbSet SklepRegulaPozParSzczeg { get; set; } + + public virtual DbSet SklepRegulaTekst { get; set; } + + public virtual DbSet SklepRegulaTowar { get; set; } + + public virtual DbSet SklepRola { get; set; } + + public virtual DbSet SklepRolaUprawnienie { get; set; } + + public virtual DbSet SklepRozPrtMag { get; set; } + + public virtual DbSet SklepRozbicieDodDok { get; set; } + + public virtual DbSet SklepRozbicieDok { get; set; } + + public virtual DbSet SklepRozlPartii { get; set; } + + public virtual DbSet SklepRozlicza { get; set; } + + public virtual DbSet SklepSkladnikDefinicjiKodu { get; set; } + + public virtual DbSet SklepSkladnikWzorca { get; set; } + + public virtual DbSet SklepStanPrtMag { get; set; } + + public virtual DbSet SklepSzczegPrtMag { get; set; } + + public virtual DbSet SklepTekstDok { get; set; } + + public virtual DbSet SklepTekstPoz { get; set; } + + public virtual DbSet SklepTekstZgody { get; set; } + + public virtual DbSet SklepTowAkcyza { get; set; } + + public virtual DbSet SklepTowDodatek { get; set; } + + public virtual DbSet SklepTowIntParam { get; set; } + + public virtual DbSet SklepTowKod { get; set; } + + public virtual DbSet SklepTowParWiseBase { get; set; } + + public virtual DbSet SklepTowPowiazanie { get; set; } + + public virtual DbSet SklepTowStraty { get; set; } + + public virtual DbSet SklepTowZamiennik { get; set; } + + public virtual DbSet SklepTowZdjecia { get; set; } + + public virtual DbSet SklepTowar { get; set; } + + public virtual DbSet SklepTowarSkladnika { get; set; } + + public virtual DbSet SklepTrescEmail { get; set; } + + public virtual DbSet SklepTrescEmailTekst { get; set; } + + public virtual DbSet SklepTypOs { get; set; } + + public virtual DbSet SklepUprawnienie { get; set; } + + public virtual DbSet SklepUzytkownik { get; set; } + + public virtual DbSet SklepWaluta { get; set; } + + public virtual DbSet SklepZaleznosc { get; set; } + + public virtual DbSet SklepZamiennik { get; set; } + + public virtual DbSet SklepZasob { get; set; } + + public virtual DbSet SklepZdarzOs { get; set; } + + public virtual DbSet SklepZdarzOsOpis { get; set; } + + public virtual DbSet SklepZgoda { get; set; } + + public virtual DbSet Sprzedaz { get; set; } + + public virtual DbSet StanPrtMag { get; set; } + + public virtual DbSet StanZgody { get; set; } + + public virtual DbSet Struktura_7_3 { get; set; } + + public virtual DbSet Subsys { get; set; } + + public virtual DbSet SzczegPrtMag { get; set; } + + public virtual DbSet TabelaAkcyzowa { get; set; } + + public virtual DbSet TekstDok { get; set; } + + public virtual DbSet TekstPoz { get; set; } + + public virtual DbSet TekstZgody { get; set; } + + public virtual DbSet TowAkcyza { get; set; } + + public virtual DbSet TowDodatek { get; set; } + + public virtual DbSet TowIntParam { get; set; } + + public virtual DbSet TowKraj { get; set; } + + public virtual DbSet TowParWiseBase { get; set; } + + public virtual DbSet TowPowiazanie { get; set; } + + public virtual DbSet TowStraty { get; set; } + + public virtual DbSet TowStratyDlaSklepu { get; set; } + + public virtual DbSet TowWartosc { get; set; } + + public virtual DbSet TowZamiennik { get; set; } + + public virtual DbSet TowZdjecia { get; set; } + + public virtual DbSet Towar { get; set; } + + public virtual DbSet TowarSkladnika { get; set; } + + public virtual DbSet TrescEmail { get; set; } + + public virtual DbSet TrescEmailTekst { get; set; } + + public virtual DbSet TypOs { get; set; } + + public virtual DbSet Ulica { get; set; } + + public virtual DbSet Uprawnienie { get; set; } + + public virtual DbSet UprawnienieNaSklep { get; set; } + + public virtual DbSet UzNaSklep { get; set; } + + public virtual DbSet Uzytkownik { get; set; } + + public virtual DbSet Vat { get; set; } + + public virtual DbSet Waluta { get; set; } + + public virtual DbSet Wersja_7_2 { get; set; } + + public virtual DbSet Wzorzec { get; set; } + + public virtual DbSet Zaleznosc { get; set; } + + public virtual DbSet Zamiennik { get; set; } + + public virtual DbSet Zasob { get; set; } + + public virtual DbSet ZdarzLoj { get; set; } + + public virtual DbSet ZdarzOs { get; set; } + + public virtual DbSet ZdarzOsOpis { get; set; } + + public virtual DbSet Zgoda { get; set; } + + public virtual DbSet ZlecKomunikat { get; set; } + + public virtual DbSet ZlecParam { get; set; } + + public virtual DbSet Zlecenie { get; set; } + + public virtual DbSet Zmiana { get; set; } + + public virtual DbSet ZmianaTabeli { get; set; } + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AkwId).HasName("PK_AKWIZYTOR"); + + entity.Property(e => e.AkwId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwisko) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Prowizja).HasColumnType("decimal(10, 4)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ArtId).HasName("PK_ARTYKUL"); + + entity.HasIndex(e => e.CentrArtId, "idx_CentrArtId"); + + entity.Property(e => e.ArtId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ArtNazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.CentrArtId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GlownyTowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.GlownyTow).WithMany(p => p.Artykul) + .HasForeignKey(d => d.GlownyTowId) + .HasConstraintName("FK_ARTGLOWNYTOWID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AsId).HasName("PK_ASORT"); + + entity.HasIndex(e => e.CentrAsId, "idx_CentrAsId"); + + entity.Property(e => e.AsId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrAsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.HurtRabat).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Marza).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NocNarzut).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Param1).HasColumnType("decimal(15, 4)"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BankId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Adres) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.CentrBankId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.NrRozliBank) + .HasMaxLength(8) + .IsUnicode(false); + entity.Property(e => e.SWIFT) + .HasMaxLength(11) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SesjaId, e.TowId, e.MagId }).HasName("PK_BLOKADA"); + + entity.HasIndex(e => new { e.TowId, e.MagId }, "idx_BlokTowMag"); + + entity.Property(e => e.SesjaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Sesja).WithMany(p => p.Blokada) + .HasForeignKey(d => d.SesjaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_BLOKADA_REF_BLOKS_SESJAAKT"); + + entity.HasOne(d => d.Istw).WithMany(p => p.Blokada) + .HasForeignKey(d => new { d.TowId, d.MagId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_BLOKADA_REF_BLOKT_ISTW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.ZgId }).HasName("PK_CENTRSTANZGODY"); + + entity.HasIndex(e => e.ZgId, "idx_CESTZG_ZG"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataDec).HasColumnType("datetime"); + entity.Property(e => e.Kiedy) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + + entity.HasOne(d => d.Kontr).WithMany(p => p.CentrStanZgody) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CESTZG_KTH"); + + entity.HasOne(d => d.Zg).WithMany(p => p.CentrStanZgody) + .HasForeignKey(d => d.ZgId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CESTZG_ZG"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CzasID).HasName("PK_CZAS"); + + entity.Property(e => e.CzasID).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.Dzien).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DzienMiesiaca).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DzienTygodnia).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Miesiac).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MiesiacRoku).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Rok).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tydzien).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TydzienRoku).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Weekend).HasColumnType("numeric(9, 0)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.DKId).HasName("PK_DEFKODU"); + + entity.Property(e => e.DKId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrDKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataDo).HasColumnType("datetime"); + entity.Property(e => e.DataOd).HasColumnType("datetime"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ZasobId); + + entity.HasIndex(e => e.CentrZasobId, "IxDlugiZasob_CentrZasobId"); + + entity.HasIndex(e => e.GUID, "IxDlugiZasob_GUID"); + + entity.HasIndex(e => e.Zmiana, "IxDlugiZasob_Zmiana"); + + entity.Property(e => e.ZasobId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrWersja) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.CentrZasobId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GUID) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Opcje) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Sciezka) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Skrot1) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Skrot2) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Skrot3) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Skrot4) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.TypDanych) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Wersja) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Zastosowanie) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ZasobId, e.Porcja }); + + entity.Property(e => e.ZasobId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Zasob).WithMany(p => p.DlugiZasobBin) + .HasForeignKey(d => d.ZasobId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DlugiZasobBin_ZasobId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ZasobId, e.Porcja }); + + entity.Property(e => e.ZasobId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Dane).IsUnicode(false); + + entity.HasOne(d => d.Zasob).WithMany(p => p.DlugiZasobTxt) + .HasForeignKey(d => d.ZasobId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DlugiZasobTxt_ZasobId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.DokId).HasName("PK_DOK"); + + entity.HasIndex(e => new { e.TypDok, e.Data, e.KolejnyWDniu }, "DokTypDok"); + + entity.HasIndex(e => e.CentrDokId, "idx_DokCentrDokId"); + + entity.HasIndex(e => new { e.Data, e.KolejnyWDniu }, "idx_DokDataKolejnyWDniu"); + + entity.HasIndex(e => e.MagId, "idx_DokMagId"); + + entity.HasIndex(e => e.NrDok, "idx_DokNrDok"); + + entity.HasIndex(e => e.UzId, "idx_DokUzId"); + + entity.HasIndex(e => e.WalId, "idx_DokWal"); + + entity.HasIndex(e => e.Zmiana, "idx_DokZmiana"); + + entity.HasIndex(e => e.ZmianaPkt, "idx_DokZmianaPkt"); + + entity.Property(e => e.DokId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrDokId).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.DataDod).HasColumnType("datetime"); + entity.Property(e => e.DataPom).HasColumnType("datetime"); + entity.Property(e => e.DoZaplaty).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota1).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota10).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota11).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota12).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota3).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota4).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota5).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota6).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota7).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota8).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota9).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDetUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMagUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NrDok) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDetUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMagUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Razem).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WalIdPlatnosci).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zaplacono).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ZaplaconoPodatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ZaplaconoWKasie).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + entity.Property(e => e.ZmianaPkt).HasColumnType("datetime"); + + entity.HasOne(d => d.Mag).WithMany(p => p.Dok) + .HasForeignKey(d => d.MagId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOK_REF_DOKMA_MAGAZYN"); + + entity.HasOne(d => d.Uz).WithMany(p => p.Dok) + .HasForeignKey(d => d.UzId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOK_REF_DOKUZ_UZYTKOWN"); + + entity.HasOne(d => d.Wal).WithMany(p => p.DokWal) + .HasForeignKey(d => d.WalId) + .HasConstraintName("FK_DOK_REF_DOKWA_WALUTA"); + + entity.HasOne(d => d.WalIdPlatnosciNavigation).WithMany(p => p.DokWalIdPlatnosciNavigation) + .HasForeignKey(d => d.WalIdPlatnosci) + .HasConstraintName("FK_Ref_DokWalIdPlatnosci"); + + entity.HasMany(d => d.KB).WithMany(p => p.Dok) + .UsingEntity>( + "DokKontoBankowe", + r => r.HasOne().WithMany() + .HasForeignKey("KBId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKONTOBANK_KONTOBANK"), + l => l.HasOne().WithMany() + .HasForeignKey("DokId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKONTOBANK_DOK"), + j => + { + j.HasKey("DokId", "KBId"); + j.IndexerProperty("DokId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("KBId").HasColumnType("numeric(9, 0)"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Znaczenie }).HasName("PK_DOKDODKTH"); + + entity.HasIndex(e => e.KontrId, "idx_DDKth"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.DokDodKth) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKDODKT_REF_DDK_DOK"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.DokDodKth) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKDODKT_REF_DKD_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.DokId).HasName("PK_DOKKASA"); + + entity.HasIndex(e => e.KasaId, "idx_DokKasaId"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Dok).WithOne(p => p.DokKasa) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKASA_REF_DOKKA_DOK"); + + entity.HasOne(d => d.Kasa).WithMany(p => p.DokKasa) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKASA_REF_KASA_KASA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.DokId).HasName("PK_DOKKONTR"); + + entity.HasIndex(e => e.KontrId, "idx_DokKontrId"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Dok).WithOne(p => p.DokKontr) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKONTR_REF_DOKKO_DOK"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.DokKontr) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKONTR_REF_KONTR_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Znaczenie }).HasName("PK_DOKKURS"); + + entity.HasIndex(e => e.WalId, "idx_DokKursWal"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NrTabeli) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.DokKurs) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKURS_DOK"); + + entity.HasOne(d => d.Wal).WithMany(p => p.DokKurs) + .HasForeignKey(d => d.WalId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKKURS_WAL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Typ }).HasName("PK_DOKPUNKTY"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy).HasColumnType("datetime"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.DokPunkty) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKPUNKT_REF_DOKPK_DOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.JakiePow, e.KtorePow }).HasName("PK_DOKWBUFPOWIAZANIE"); + + entity.HasIndex(e => e.Id, "idx_DokWBufId"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Dok).WithMany(p => p.DokWBufPowiazanie) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DokWBufPow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.WalId }).HasName("PK_DOKWALUTA"); + + entity.HasIndex(e => e.WalId, "idx_WalDok"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DokKwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalNetto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalNettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalPodatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalPodatekDet).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.DokWaluta) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKWALUT_REF_DOKWA_DOK"); + + entity.HasOne(d => d.Wal).WithMany(p => p.DokWaluta) + .HasForeignKey(d => d.WalId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOKWALUT_REF_WALDO_WALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DostId, e.ProdId }).HasName("PK_DOSTPROD"); + + entity.Property(e => e.DostId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ProdId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RabatProd).HasColumnType("decimal(10, 4)"); + + entity.HasOne(d => d.Dost).WithMany(p => p.DostProdDost) + .HasForeignKey(d => d.DostId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_DostPrKth"); + + entity.HasOne(d => d.Prod).WithMany(p => p.DostProdProd) + .HasForeignKey(d => d.ProdId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_PrDostKth"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.TowId }).HasName("PK_DOSTAWCA"); + + entity.HasIndex(e => e.TowId, "idx_DostTowId"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleWZgrzewce).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(30) + .IsUnicode(false); + entity.Property(e => e.RabatOdWart).HasColumnType("decimal(10, 4)"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.DostawcaNavigation) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOSTAWCA_REF_KTHDO_KONTRAHE"); + + entity.HasOne(d => d.Tow).WithMany(p => p.Dostawca) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_DOSTAWCA_REF_TOWDO_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Dzien).HasName("PK_DZIENROZL"); + + entity.HasIndex(e => e.Zmiana, "idx_DzienZmiana"); + + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.Dzien, e.Znaczenie }).HasName("PK_DZIENROZLPARAM"); + + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.Wartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.DzienNavigation).WithMany(p => p.DzienRozlParam) + .HasForeignKey(d => d.Dzien) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_DzienRozlPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.EmId); + + entity.Property(e => e.EmId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Haslo) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Host) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.KopiaEmail) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Login) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Nadawca) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Port) + .HasMaxLength(5) + .IsUnicode(false); + entity.Property(e => e.TEDId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TEHRId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TERId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TEWId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TEZIId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.TED).WithMany(p => p.EmailTED) + .HasForeignKey(d => d.TEDId) + .HasConstraintName("FK_Email_TED"); + + entity.HasOne(d => d.TER).WithMany(p => p.EmailTER) + .HasForeignKey(d => d.TERId) + .HasConstraintName("FK_Email_TER"); + + entity.HasOne(d => d.TEW).WithMany(p => p.EmailTEW) + .HasForeignKey(d => d.TEWId) + .HasConstraintName("FK_Email_TEW"); + + entity.HasOne(d => d.Uz).WithMany(p => p.Email) + .HasForeignKey(d => d.UzId) + .HasConstraintName("FK_Email_Uz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TypOsId, e.ZgId }).HasName("PK_FORMZGOD"); + + entity.HasIndex(e => e.ZgId, "idx_FMZG_ZGODA"); + + entity.Property(e => e.TypOsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.TypOs).WithMany(p => p.FormZgod) + .HasForeignKey(d => d.TypOsId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_FMZG_TYPOS"); + + entity.HasOne(d => d.Zg).WithMany(p => p.FormZgod) + .HasForeignKey(d => d.ZgId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_FMZG_ZGODA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FormaId); + + entity.Property(e => e.FormaId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrFormaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kolejnosc).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.SerwisPlatniczy) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FormaPlat).HasName("PK_FORMAPLATNOSCI"); + + entity.Property(e => e.FormaPlat).ValueGeneratedNever(); + entity.Property(e => e.Tekst) + .HasMaxLength(40) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.GrId, e.ParId, e.Wartosc }).HasName("PK_GRWARTOSC"); + + entity.Property(e => e.GrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Gr).WithMany(p => p.GrWartosc) + .HasForeignKey(d => d.GrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_GRWARTOS_REF_GRWAR_GRUPATOW"); + + entity.HasOne(d => d.Par).WithMany(p => p.GrWartosc) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_GRWARTOS_REF_PARGR_PARAMETR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GrAkcId).HasName("PK_GRUPAAKCYZOWA"); + + entity.Property(e => e.GrAkcId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.AkcJM) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.CentrGrAkcId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DodJM) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.IleDodJMWAkcJM).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.OpcjeWzoru) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Opis) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.PrefiksyCN) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GrupaId); + + entity.Property(e => e.GrupaId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrGrupaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Opis) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GrId).HasName("PK_GRUPATOW"); + + entity.Property(e => e.GrId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Opis) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.UzId).HasName("PK_GRUPAUZ"); + + entity.HasIndex(e => e.RolaId, "idx_Rola"); + + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RolaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Rola).WithMany(p => p.GrupaUzRola) + .HasForeignKey(d => d.RolaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_GRUPAUZ_REF_GRROL_UZYTKOWN"); + + entity.HasOne(d => d.Uz).WithOne(p => p.GrupaUzUz) + .HasForeignKey(d => d.UzId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_GRUPAUZ_REF_GRUZ_UZYTKOWN"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.HarmId, e.TowId }).HasName("PK_HARMCENY"); + + entity.HasIndex(e => e.TowId, "idx_HarmTow"); + + entity.Property(e => e.HarmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena5).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Cena6).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Cena7).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Cena8).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Inne) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ProgPromocji).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Harm).WithMany(p => p.HarmCeny) + .HasForeignKey(d => d.HarmId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HARMCENY_REF_HARMC_HARMWPIS"); + + entity.HasOne(d => d.Tow).WithMany(p => p.HarmCeny) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HARMCENY_REF_HARMT_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.HarmId, e.OdDnia, e.OdGodz, e.OdMin }).HasName("PK_HARMCYKL"); + + entity.Property(e => e.HarmId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Harm).WithMany(p => p.HarmCykl) + .HasForeignKey(d => d.HarmId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HARMCYKL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.HarmId, e.Znaczenie }).HasName("PK_HARMHARM"); + + entity.Property(e => e.HarmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PoprzHarmId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Harm).WithMany(p => p.HarmHarmHarm) + .HasForeignKey(d => d.HarmId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HARMHARM"); + + entity.HasOne(d => d.PoprzHarm).WithMany(p => p.HarmHarmPoprzHarm) + .HasForeignKey(d => d.PoprzHarmId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HARMPOPRZHARM"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HRId); + + entity.Property(e => e.HRId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataDo).HasColumnType("datetime"); + entity.Property(e => e.DataOd).HasColumnType("datetime"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.HRId, e.Dzien, e.Godzina, e.Minuta }); + + entity.Property(e => e.HRId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.HR).WithMany(p => p.HarmRapCykl) + .HasForeignKey(d => d.HRId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HarmRapCykl_HRId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.HRId, e.ParNazwa }); + + entity.Property(e => e.HRId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParNazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParWartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.HR).WithMany(p => p.HarmRapParam) + .HasForeignKey(d => d.HRId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HarmRapParam_HRId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.HRId, e.DataCzas }); + + entity.HasIndex(e => e.DataCzas, "idx_HarmRapZlecenieDataCzas"); + + entity.Property(e => e.HRId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataCzas).HasColumnType("datetime"); + entity.Property(e => e.Komentarz) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.HR).WithMany(p => p.HarmRapZlecenie) + .HasForeignKey(d => d.HRId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_HarmRapZlecenie_HRId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HarmId).HasName("PK_HARMWPIS"); + + entity.HasIndex(e => new { e.KrajId, e.HarmId }, "idx_HarmKraj"); + + entity.HasIndex(e => e.PolId, "idx_HarmPol"); + + entity.Property(e => e.HarmId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrHarmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Opcje) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.PolId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WaznyDo).HasColumnType("datetime"); + entity.Property(e => e.WaznyOd).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Kraj).WithMany(p => p.HarmWpis) + .HasForeignKey(d => d.KrajId) + .HasConstraintName("FK_Ref_HarmKraj"); + + entity.HasOne(d => d.Pol).WithMany(p => p.HarmWpis) + .HasForeignKey(d => d.PolId) + .HasConstraintName("FK_HARMWPIS_REF_HARMP_POLITYKA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.MagId }).HasName("PK_ISTW"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.BlokadaMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RezerwacjaMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanMax).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanMin).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Mag).WithMany(p => p.Istw) + .HasForeignKey(d => d.MagId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ISTW_REF_ISTWM_MAGAZYN"); + + entity.HasOne(d => d.Tow).WithMany(p => p.Istw) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ISTW_REF_TOWIS_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.CentrJMId, "idx_CentrJMId"); + + entity.Property(e => e.JMId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrJMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(10) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KartaId).HasName("PK_KARTALOJ"); + + entity.HasIndex(e => e.CentrKartaId, "idx_CentrKartaId"); + + entity.HasIndex(e => e.KodKarty, "idx_KLoj_KodKarty"); + + entity.HasIndex(e => e.KontoId, "idx_KLoj_Konto"); + + entity.Property(e => e.KartaId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKartaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KodKarty) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Opis1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Opis2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Posiadacz) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Uniewazniono).HasColumnType("datetime"); + entity.Property(e => e.WaznaDo).HasColumnType("datetime"); + entity.Property(e => e.WaznaOd).HasColumnType("datetime"); + + entity.HasOne(d => d.Konto).WithMany(p => p.KartaLoj) + .HasForeignKey(d => d.KontoId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_KartaKonto"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KasaId, e.TowId, e.Kolejnosc }).HasName("PK_KASKOD"); + + entity.HasIndex(e => new { e.TowId, e.Kolejnosc }, "idx_KasKodTow"); + + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.IleWKodzie).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KodOpak) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Rezerwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Skrot) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Kasa).WithMany(p => p.KasKod) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASKOD_REF_KASKO_KASA"); + + entity.HasOne(d => d.Tow).WithMany(p => p.KasKod) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASKOD_REF_KASKO_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KasaId, e.ParNazwa }).HasName("PK_KASPAR"); + + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParNazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.ParWartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Kasa).WithMany(p => p.KasPar) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASPAR_REF_KASPA_KASA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KasaId, e.KodWyslany }).HasName("PK_KASTOW"); + + entity.HasIndex(e => new { e.KasaId, e.Plu, e.DodIndeks }, "idx_KasTowKasaPluDodIndeks"); + + entity.HasIndex(e => e.TowId, "idx_KasTowTowId"); + + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KodWyslany) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Kasa).WithMany(p => p.KasTow) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASTOW_REF_KASKO_KASA"); + + entity.HasOne(d => d.Tow).WithMany(p => p.KasTow) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASTOW_REF_KASTO_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KasaId).HasName("PK_KASA"); + + entity.Property(e => e.KasaId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NrUnikatowy) + .HasMaxLength(30) + .IsUnicode(false); + entity.Property(e => e.Stanowisko) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Typ) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Mag).WithMany(p => p.Kasa) + .HasForeignKey(d => d.MagId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASA_REF_KASAM_MAGAZYN"); + + entity.HasMany(d => d.As).WithMany(p => p.Kasa) + .UsingEntity>( + "Przydzial", + r => r.HasOne().WithMany() + .HasForeignKey("AsId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PRZYDZIA_REF_ASPRZ_ASORT"), + l => l.HasOne().WithMany() + .HasForeignKey("KasaId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PRZYDZIA_REF_KASPR_KASA"), + j => + { + j.HasKey("KasaId", "AsId").HasName("PK_PRZYDZIAL"); + j.IndexerProperty("KasaId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("AsId").HasColumnType("numeric(9, 0)"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.FormaId, e.KasaId }); + + entity.Property(e => e.FormaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Forma).WithMany(p => p.KasaFormaPlatn) + .HasForeignKey(d => d.FormaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASAFORMAPLATN_FPP7"); + + entity.HasOne(d => d.Kasa).WithMany(p => p.KasaFormaPlatn) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KASAFORMAPLATN_KASA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KatId, e.ParId }).HasName("PK_KATPARAM"); + + entity.HasIndex(e => e.KatId, "idx_KatParKat"); + + entity.HasIndex(e => e.ParId, "idx_KatParPar"); + + entity.Property(e => e.KatId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Kat).WithMany(p => p.KatParam) + .HasForeignKey(d => d.KatId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KATPARAM_REF_KATPA_KATEGORI"); + + entity.HasOne(d => d.Par).WithMany(p => p.KatParam) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KATPARAM_REF_PARKA_PARAMETR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KatId).HasName("PK_KATEGORIA"); + + entity.HasIndex(e => e.CentrKatId, "idx_CentrKatId"); + + entity.Property(e => e.KatId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKatId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.Kolejnosc }).HasName("PK_KODDOD"); + + entity.HasIndex(e => e.Kod, "idx_KodDodKod"); + + entity.HasIndex(e => e.Skrot, "idx_KodDodSkrot"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.IleWKodzie).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Skrot) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.SubsysKoduDod) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Tow).WithMany(p => p.KodDod) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KODDOD_REF_KODDO_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KWId).HasName("PK_KODWAZONY"); + + entity.HasIndex(e => e.CentrKWId, "idx_CentrKWId"); + + entity.Property(e => e.KWId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKWId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.JMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.JM).WithMany(p => p.KodWazony) + .HasForeignKey(d => d.JMId) + .HasConstraintName("Ref_KodWazony"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ZmId).HasName("PK_KOMENTARZ"); + + entity.Property(e => e.ZmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Opis) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Zm).WithOne(p => p.Komentarz) + .HasForeignKey(d => d.ZmId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KOMENTAR_REF_ZMKOM_ZMIANA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParGrupa, e.ParNazwa }).HasName("PK_KONFIG"); + + entity.Property(e => e.ParGrupa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParNazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParWartosc) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KBId); + + entity.Property(e => e.KBId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.BankId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KBIdOplat).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Numer) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.PowKBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Sufix) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Bank).WithMany(p => p.KontoBankowe) + .HasForeignKey(d => d.BankId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KONTOBANK_BANK"); + + entity.HasOne(d => d.Mag).WithMany(p => p.KontoBankowe) + .HasForeignKey(d => d.MagId) + .HasConstraintName("FK_KONTOBANK_MAGAZYN"); + + entity.HasOne(d => d.Wal).WithMany(p => p.KontoBankowe) + .HasForeignKey(d => d.WalId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KONTOBANK_WALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KBKId); + + entity.Property(e => e.KBKId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.BankId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKBKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Numer) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.PowKBKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Bank).WithMany(p => p.KontoBankoweKontr) + .HasForeignKey(d => d.BankId) + .HasConstraintName("FK_KONTOBANKKONTR_BANK"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.KontoBankoweKontr) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KONTOBANKKONTR_KONTR"); + + entity.HasOne(d => d.Wal).WithMany(p => p.KontoBankoweKontr) + .HasForeignKey(d => d.WalId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KONTOBANKKONTR_WALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KontoId).HasName("PK_KONTOLOJ"); + + entity.HasIndex(e => e.CentrKontoId, "idx_CentrKontoId"); + + entity.HasIndex(e => e.KontrId, "idx_KLoj_KontrId"); + + entity.HasIndex(e => e.ZmianaStanu, "idx_KLoj_ZmStanu"); + + entity.HasIndex(e => e.Zmiana, "idx_KLoj_Zmiana"); + + entity.Property(e => e.KontoId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Stan).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanPocz).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + entity.Property(e => e.ZmianaStanu).HasColumnType("datetime"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.KontoLoj) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_KontoKth"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.Znaczenie }).HasName("PK_KONTROPIS"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Kontr).WithMany(p => p.KontrOpis) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KONTROPI_REF_KTHOP_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KontrId).HasName("PK_KONTRAHENT"); + + entity.HasIndex(e => e.IndeksCentr, "idx_KontrIndCentr"); + + entity.HasIndex(e => e.NIP, "idx_KontrNIP"); + + entity.HasIndex(e => e.Zmiana, "idx_KontrZmiana"); + + entity.Property(e => e.KontrId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.AkwId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Bank) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.CentrKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.EMail) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Fax) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.IndeksCentr) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Kod) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.KodKarty) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KodKontr) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Konto) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.KontrKrajId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MaxKredyt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Miasto) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NIP) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NaPrzelewie1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NaPrzelewie2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.NrAnalityki) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.NrDomu) + .HasMaxLength(9) + .IsUnicode(false); + entity.Property(e => e.NrLokalu) + .HasMaxLength(9) + .IsUnicode(false); + entity.Property(e => e.Poczta) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.RabatDost).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.RabatOdb).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Rezerwa1) + .HasMaxLength(80) + .IsUnicode(false); + entity.Property(e => e.Rezerwa2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Skrot) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Telefon) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.TermWaznKarty).HasColumnType("datetime"); + entity.Property(e => e.Ulica) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Akw).WithMany(p => p.Kontrahent) + .HasForeignKey(d => d.AkwId) + .HasConstraintName("FK_KONTRAHE_REF_KTHAK_AKWIZYTO"); + + entity.HasOne(d => d.KontrKraj).WithMany(p => p.Kontrahent) + .HasForeignKey(d => d.KontrKrajId) + .HasConstraintName("FK_Ref_KontrahentKraj"); + + entity.HasMany(d => d.KPW).WithMany(p => p.Kontr) + .UsingEntity>( + "KthWartosc", + r => r.HasOne().WithMany() + .HasForeignKey("KPWId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KTHWARTO_REF_KWPAR_KTHPARWA"), + l => l.HasOne().WithMany() + .HasForeignKey("KontrId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KTHWARTO_REF_KTHWA_KONTRAHE"), + j => + { + j.HasKey("KontrId", "KPWId").HasName("PK_KTHWARTOSC"); + j.HasIndex(new[] { "KPWId" }, "idx_KWart"); + j.IndexerProperty("KontrId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("KPWId").HasColumnType("numeric(9, 0)"); + }); + + entity.HasMany(d => d.TypOs).WithMany(p => p.Kontr) + .UsingEntity>( + "KthTypOs", + r => r.HasOne().WithMany() + .HasForeignKey("TypOsId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KTHTYPOS_TYPOS"), + l => l.HasOne().WithMany() + .HasForeignKey("KontrId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KTHTYPOS_KTH"), + j => + { + j.HasKey("KontrId", "TypOsId").HasName("PK_KTHTYPOS"); + j.HasIndex(new[] { "TypOsId" }, "idx_KTHTYPOS_TYPOS"); + j.IndexerProperty("KontrId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("TypOsId").HasColumnType("numeric(9, 0)"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KrajId).HasName("PK_KRAJ"); + + entity.Property(e => e.KrajId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Aktywny).HasDefaultValue((short)1); + entity.Property(e => e.Kod) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZdjecieFlagi) + .HasMaxLength(100) + .IsUnicode(false); + + entity.HasOne(d => d.Wal).WithMany(p => p.Kraj) + .HasForeignKey(d => d.WalId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Ref_KrajWal"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KrajId, e.Stawka }).HasName("PK_KRAJSTAWKA"); + + entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Kraj).WithMany(p => p.KrajStawka) + .HasForeignKey(d => d.KrajId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Ref_KrajVat"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KPWId).HasName("PK_KTHPARWARTOSC"); + + entity.HasIndex(e => e.KthParId, "idx_KPWPar"); + + entity.Property(e => e.KPWId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKPWId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KthParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.KthPar).WithMany(p => p.KthParWartosc) + .HasForeignKey(d => d.KthParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KTHPARWA_REF_KPWAR_KTHPARAM"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KthParId).HasName("PK_KTHPARAM"); + + entity.Property(e => e.KthParId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKthParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KPWDomyslnaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.KPWDomyslna).WithMany(p => p.KthParam) + .HasForeignKey(d => d.KPWDomyslnaId) + .HasConstraintName("FK_KTHPARAM_REF_KPDOM_KTHPARWA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.WalId, e.Data }).HasName("PK_KURSWALUTY"); + + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KursZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KursZakZr).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KursZr).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NrTabeli) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.NrTabeliZak) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Spread).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SpreadZak).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Wal).WithMany(p => p.KursWaluty) + .HasForeignKey(d => d.WalId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_KURSWAL_REFERENCE_WAL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LiniaId).HasName("PK_LINIALOTN"); + + entity.HasIndex(e => e.Kod, "idx_LinLotKod"); + + entity.HasIndex(e => e.Zmiana, "idx_LinLotZmiana"); + + entity.Property(e => e.LiniaId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(16) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.OperationId).HasName("PK_LOGOPERATION"); + + entity.Property(e => e.OperationId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.AdditionalDesc) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.AppTypeId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.LastUpdate).HasColumnType("datetime"); + entity.Property(e => e.ModItemId) + .HasMaxLength(30) + .IsUnicode(false); + entity.Property(e => e.ModTableTypeId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ModuleTypeId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.OperationTime).HasColumnType("datetime"); + entity.Property(e => e.OperationTypeId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.OperatorId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PosId).HasColumnType("numeric(9, 0)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TypeId).HasName("PK_LOGTYPEDEF"); + + entity.Property(e => e.TypeId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.LastUpdate).HasColumnType("datetime"); + entity.Property(e => e.TypeCategory) + .HasMaxLength(50) + .IsUnicode(false); + entity.Property(e => e.TypeValue) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ValChangeId).HasName("PK_LOGVALCHANGENUM"); + + entity.Property(e => e.ValChangeId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.LastUpdate).HasColumnType("datetime"); + entity.Property(e => e.OperationId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ValChangeTypeId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ValueAfter).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ValueBefore).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Operation).WithMany(p => p.LogValChangeNum) + .HasForeignKey(d => d.OperationId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_LOGVALCH_REFERENCE_LOGOPERB"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ValChangeId).HasName("PK_LOGVALCHANGETXT"); + + entity.Property(e => e.ValChangeId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.LastUpdate).HasColumnType("datetime"); + entity.Property(e => e.OperationId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ValChangeTypeId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ValueAfter) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.ValueBefore) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Operation).WithMany(p => p.LogValChangeTxt) + .HasForeignKey(d => d.OperationId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_LOGVALCH_REFERENCE_LOGOPERA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LotnId).HasName("PK_LOTNISKO"); + + entity.HasIndex(e => e.Kod, "idx_LotnKod"); + + entity.HasIndex(e => e.Zmiana, "idx_LotnZmiana"); + + entity.Property(e => e.LotnId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(16) + .IsUnicode(false); + entity.Property(e => e.Kraj) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MagId).HasName("PK_MAGAZYN"); + + entity.Property(e => e.MagId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.MarId, e.OdCeny }).HasName("PK_MARZAKRES"); + + entity.Property(e => e.MarId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.OdCeny).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Koncowki) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Mar).WithMany(p => p.MarZakres) + .HasForeignKey(d => d.MarId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_MARZAKRE_REF_MARZA_MARZOWNI"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MarId).HasName("PK_MARZOWNIK"); + + entity.HasIndex(e => e.AsId, "idxMarAs"); + + entity.HasIndex(e => e.MagId, "idxMarMag"); + + entity.HasIndex(e => e.TowId, "idxMarTow"); + + entity.Property(e => e.MarId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MinMarzaOd100).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.MinMarzaW100).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.ModOd100).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.ModW100).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.As).WithMany(p => p.Marzownik) + .HasForeignKey(d => d.AsId) + .HasConstraintName("FK_MARZOWNI_REF_MARAS_ASORT"); + + entity.HasOne(d => d.Mag).WithMany(p => p.Marzownik) + .HasForeignKey(d => d.MagId) + .HasConstraintName("FK_MARZOWNI_REF_MARMA_MAGAZYN"); + + entity.HasOne(d => d.Tow).WithMany(p => p.Marzownik) + .HasForeignKey(d => d.TowId) + .HasConstraintName("FK_MARZOWNI_REF_MARTO_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MId); + + entity.Property(e => e.MId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.Kolejnosc }).HasName("PK_NOTATKI"); + + entity.ToTable(tb => tb.HasTrigger("SwwDoNotatek")); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Tow).WithMany(p => p.Notatki) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_NOTATKI_REF_TOWNO_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.NrFormat }).HasName("PK_NRREJ"); + + entity.HasIndex(e => new { e.NrFormat, e.KontrId }, "idx_NumerRej"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NrFormat) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.NrWpisany) + .HasMaxLength(60) + .IsUnicode(false); + + entity.HasOne(d => d.Kontr).WithMany(p => p.NrRej) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_NrRejKth"); + + entity.HasMany(d => d.Karta).WithMany(p => p.NrRej) + .UsingEntity>( + "NrRejKarta", + r => r.HasOne().WithMany() + .HasForeignKey("KartaId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_KartaNrRej"), + l => l.HasOne().WithMany() + .HasForeignKey("KontrId", "NrFormat") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_NrRejKarta"), + j => + { + j.HasKey("KontrId", "NrFormat", "KartaId").HasName("PK_NRREJKARTA"); + j.HasIndex(new[] { "KartaId", "KontrId", "NrFormat" }, "idx_NrRejKartaId"); + j.IndexerProperty("KontrId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("NrFormat") + .HasMaxLength(60) + .IsUnicode(false); + j.IndexerProperty("KartaId").HasColumnType("numeric(9, 0)"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TypNumeru).HasName("PK_NUMDOK"); + + entity.Property(e => e.TypNumeru).ValueGeneratedNever(); + entity.Property(e => e.Format) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TypNumeru, e.MagId }).HasName("PK_NUMMAG"); + + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Format) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Mag).WithMany(p => p.NumMag) + .HasForeignKey(d => d.MagId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_NUMMAG_REF_NUMMA_MAGAZYN"); + + entity.HasOne(d => d.TypNumeruNavigation).WithMany(p => p.NumMag) + .HasForeignKey(d => d.TypNumeru) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_NUMMAG_REF_NUMMA_NUMDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.OdbId, e.ProdId }).HasName("PK_ODBPROD"); + + entity.Property(e => e.OdbId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ProdId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RabatProd).HasColumnType("decimal(10, 4)"); + + entity.HasOne(d => d.Odb).WithMany(p => p.OdbProdOdb) + .HasForeignKey(d => d.OdbId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ODBPROD_REF_ODBPR_KONTRAHE"); + + entity.HasOne(d => d.Prod).WithMany(p => p.OdbProdProd) + .HasForeignKey(d => d.ProdId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ODBPROD_REF_PRODO_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.TowId }).HasName("PK_ODBIORCA"); + + entity.HasIndex(e => e.TowId, "idx_OdbTowId"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Indeks) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.RabatTow).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.StalaCena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zamowil).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.OdbiorcaNavigation) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ODBIORCA_REF_KTHOD_KONTRAHE"); + + entity.HasOne(d => d.Tow).WithMany(p => p.Odbiorca) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ODBIORCA_REF_TOWOD_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.OfId, e.Kolejnosc }).HasName("PK_OFKOD"); + + entity.HasIndex(e => new { e.KontrId, e.Kod }, "idx_OfKthKod"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.OfId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + + entity.HasOne(d => d.Oferta).WithMany(p => p.OfKod) + .HasForeignKey(d => new { d.KontrId, d.OfId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OFKOD_REF_OFKOD_OFERTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.Typ, e.Opis }).HasName("PK_OFSLOWNIK"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Opis) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.OfSlownik) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OFSLOWNI_REF_OFSLO_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.OfId }).HasName("PK_OFERTA"); + + entity.HasIndex(e => e.TowId, "idx_OfTow"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.OfId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Asortyment) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.CKU) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Indeks1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Indeks2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.JM) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Kategoria) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Opis1) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis2) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis3) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis4) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Przelicznik).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Skrot) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.Oferta) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OFERTA_REF_OFKON_KONTRAHE"); + + entity.HasOne(d => d.Tow).WithMany(p => p.Oferta) + .HasForeignKey(d => d.TowId) + .HasConstraintName("FK_OFERTA_REF_OFTOW_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ZdarzLojId, e.Znaczenie, e.Kolejnosc }).HasName("PK_OPISZDARZLOJ"); + + entity.Property(e => e.ZdarzLojId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParamN1).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ParamN2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ParamS1) + .HasMaxLength(64) + .IsUnicode(false); + + entity.HasOne(d => d.ZdarzLoj).WithMany(p => p.OpisZdarzLoj) + .HasForeignKey(d => d.ZdarzLojId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_OpisZdarzLojZdarzLoj"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => new { e.DataOd, e.DataDo }, "IxOplata_DataOd"); + + entity.HasIndex(e => e.Zmiana, "IxOplata_Zmiana"); + + entity.Property(e => e.OplataId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrOplataId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataDo).HasColumnType("datetime"); + entity.Property(e => e.DataOd).HasColumnType("datetime"); + entity.Property(e => e.KBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Komentarz) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.StawkaProc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.KB).WithMany(p => p.Oplata) + .HasForeignKey(d => d.KBId) + .HasConstraintName("FK_Oplata_KontoBank"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.Nazwisko }).HasName("PK_OSOBA"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwisko) + .HasMaxLength(60) + .IsUnicode(false); + + entity.HasOne(d => d.Kontr).WithMany(p => p.OsobaNavigation) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OSOBA_REF_OSOBA_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.KontrId, "idx_PHKth"); + + entity.Property(e => e.PHId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.PH) + .HasForeignKey(d => d.KontrId) + .HasConstraintName("FK_PH_REF_PHKON_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PHId, e.Znaczenie }).HasName("PK_PHDANE"); + + entity.Property(e => e.PHId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.PH).WithMany(p => p.PHDane) + .HasForeignKey(d => d.PHId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PHDANE_REF_PHDAN_PH"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PHId, e.KontrId, e.Znaczenie }).HasName("PK_PHODBDANE"); + + entity.Property(e => e.PHId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.PHOdbiorca).WithMany(p => p.PHOdbDane) + .HasForeignKey(d => new { d.PHId, d.KontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PHODBDAN_REF_PHODB_PHODBIOR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PHId, e.KontrId }).HasName("PK_PHODBIORCA"); + + entity.HasIndex(e => e.KontrId, "idx_PHOdbKth"); + + entity.Property(e => e.PHId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.PHOdbiorca) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PHODBIOR_REF_PHODB_KONTRAHE"); + + entity.HasOne(d => d.PH).WithMany(p => p.PHOdbiorca) + .HasForeignKey(d => d.PHId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PHODBIOR_REF_PHODB_PH"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.PHId }).HasName("PK_PHROZLICZENIE"); + + entity.HasIndex(e => e.PHId, "idx_PHRozPH"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PHId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Rozliczono).HasColumnType("datetime"); + + entity.HasOne(d => d.Dok).WithMany(p => p.PHRozliczenie) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PHROZLIC_REF_PHDOK_DOK"); + + entity.HasOne(d => d.PH).WithMany(p => p.PHRozliczenie) + .HasForeignKey(d => d.PHId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PHROZLIC_REF_PHROZ_PH"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PanelId).HasName("PK_PANEL"); + + entity.Property(e => e.PanelId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrPanelId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.TypAplikacji).HasDefaultValue((short)3); + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.UzNSId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Uz).WithMany(p => p.Panel) + .HasForeignKey(d => d.UzId) + .HasConstraintName("FK_PANEL_REFERENCE_UZYTKOWNIK"); + + entity.HasOne(d => d.UzNS).WithMany(p => p.Panel) + .HasForeignKey(d => d.UzNSId) + .HasConstraintName("FK_PANEL_REFERENCE_UZNASKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PanelId, e.ParNazwa }).HasName("PK_PANELPARAM"); + + entity.Property(e => e.PanelId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParNazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParWartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Panel).WithMany(p => p.PanelParam) + .HasForeignKey(d => d.PanelId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PANELPARAM_REFERENCE_PANEL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.Kolejnosc }).HasName("PK_PARBON"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Numer) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Typ) + .HasMaxLength(10) + .IsUnicode(false); + + entity.HasOne(d => d.Par).WithMany(p => p.ParBon) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARBON_REF_PARBO_PARAGON"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.Typ }).HasName("PK_PARPUNKTY"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy).HasColumnType("datetime"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Par).WithMany(p => p.ParPunkty) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARPUNKT_REF_PARPK_PARAGON"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.WalId }).HasName("PK_PARWALUTA"); + + entity.HasIndex(e => e.WalId, "idx_WalPar"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ParKwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Par).WithMany(p => p.ParWaluta) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARWALUT_REF_PARWA_PARAGON"); + + entity.HasOne(d => d.Wal).WithMany(p => p.ParWaluta) + .HasForeignKey(d => d.WalId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARWALUT_REF_WALPA_WALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.Wartosc }).HasName("PK_PARWARTOSC"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Par).WithMany(p => p.ParWartosc) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARWARTO_REF_PARWA_PARAMETR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ParId); + + entity.HasIndex(e => new { e.KodGrupy, e.Nazwa }, "idx_ParWB_GrupaINazwa"); + + entity.Property(e => e.ParId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KodGrupy) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Opcje) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ParId).HasName("PK_PARAGON"); + + entity.HasIndex(e => e.DataCzas, "idx_ParDataCzas"); + + entity.HasIndex(e => e.Kasjer, "idx_ParKasjer"); + + entity.HasIndex(e => e.WalId, "idx_ParWal"); + + entity.HasIndex(e => e.Zmiana, "idx_ParZmiana"); + + entity.HasIndex(e => e.ZmianaPkt, "idx_ParZmianaPkt"); + + entity.Property(e => e.ParId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Bony).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Brutto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CechyPar) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Czek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.DataCzas).HasColumnType("datetime"); + entity.Property(e => e.DodFPlat).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Gotowka).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.GrupyGTU) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.InneFPlat).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Karta).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kasjer) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.KodKarty) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NIP) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.OpakWyd).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.OpakZwr).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Przelew).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Rabat).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Waluty).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + entity.Property(e => e.ZmianaPkt).HasColumnType("datetime"); + + entity.HasOne(d => d.Kasa).WithMany(p => p.Paragon) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARAGON_REF_PARKA_KASA"); + + entity.HasOne(d => d.Wal).WithMany(p => p.Paragon) + .HasForeignKey(d => d.WalId) + .HasConstraintName("FK_PARAGON_REF_PARWA_WALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ParId).HasName("PK_PARAMETR"); + + entity.HasIndex(e => e.CentrParId, "idx_CentrParId"); + + entity.Property(e => e.ParId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc }).HasName("PK_PARTIA"); + + entity.HasIndex(e => new { e.TypPartii, e.TowId, e.Pozostalo }, "idx_PrtTypTowIle"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cecha1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Cecha2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.DataWazn).HasColumnType("datetime"); + entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Tow).WithMany(p => p.Partia) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARTIA_REF_PRTTO_TOWAR"); + + entity.HasOne(d => d.PozDok).WithOne(p => p.Partia) + .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PARTIA_REF_PRTPO_POZDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PcfUserId).HasName("PK_PCFUSER"); + + entity.HasIndex(e => e.Ident, "IxIdent"); + + entity.Property(e => e.EMail) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.FirstName) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.Flags) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.Ident) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.LastName) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.PasswordHash) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.PcfCustomerId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PcfLoyaltyCustomerId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PcfPStationId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ValidFrom).HasColumnType("datetime"); + entity.Property(e => e.ValidTo).HasColumnType("datetime"); + + entity.HasOne(d => d.PcfCustomer).WithMany(p => p.PcfUserPcfCustomer) + .HasForeignKey(d => d.PcfCustomerId) + .HasConstraintName("FK_PCFUSER_REFERENCE_KONTRC"); + + entity.HasOne(d => d.PcfLoyaltyCustomer).WithMany(p => p.PcfUserPcfLoyaltyCustomer) + .HasForeignKey(d => d.PcfLoyaltyCustomerId) + .HasConstraintName("FK_PCFUSER_REFERENCE_KONTRL"); + + entity.HasOne(d => d.PcfPStation).WithMany(p => p.PcfUserPcfPStation) + .HasForeignKey(d => d.PcfPStationId) + .HasConstraintName("FK_PCFUSER_REFERENCE_KONTRS"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PcfUserId, e.SklepId, e.Znaczenie }).HasName("PK_PcfUserSklepZnaczenie"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Parametr) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.PcfUser).WithMany(p => p.PcfUserSklep) + .HasForeignKey(d => d.PcfUserId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PcfUser"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.PcfUserSklep) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Sklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.PcpShopId, "IxPcpPosPcpShopId"); + + entity.Property(e => e.Created).HasColumnType("datetime"); + entity.Property(e => e.FiscalUniqueNoDfl) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.PosCode) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.PosName) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.Updated).HasColumnType("datetime"); + + entity.HasOne(d => d.PcpShop).WithMany(p => p.PcpPos) + .HasForeignKey(d => d.PcpShopId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Pos_Shop"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.CustomerCode, "IxPcpReceiptCustomerCode"); + + entity.HasIndex(e => e.KontrId, "IxPcpReceiptKontrId"); + + entity.HasIndex(e => e.PcpPosId, "IxPcpReceiptPcpPosId"); + + entity.Property(e => e.PcpReceiptId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cashier) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.Created).HasColumnType("datetime"); + entity.Property(e => e.CustomerCode) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.CustomerNip) + .HasMaxLength(16) + .IsUnicode(false); + entity.Property(e => e.DocNo) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.FiscalUniqueNo) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.OperationDateTime).HasColumnType("datetime"); + entity.Property(e => e.PosCode) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ReceiptSysNo) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.TotalBrutto).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.TotalDiscount).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.TotalNetto).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.TransUUID) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.Updated).HasColumnType("datetime"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.PcpReceipt) + .HasForeignKey(d => d.KontrId) + .HasConstraintName("FK_Receipt_Customer"); + + entity.HasOne(d => d.PcpPos).WithMany(p => p.PcpReceipt) + .HasForeignKey(d => d.PcpPosId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Receipt_Pos"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.PcpReceiptId, "IxPcpReceiptItemPcpReceiptId"); + + entity.Property(e => e.PcpReceiptItemId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Barcode) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.DiscountValue).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.PcpReceiptId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Price).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.ProductName) + .HasMaxLength(128) + .IsUnicode(false); + entity.Property(e => e.Quantity).HasColumnType("decimal(14, 4)"); + entity.Property(e => e.TotalBrutto).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.TotalDiscount).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.TotalNetto).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.VatChar) + .HasMaxLength(1) + .IsUnicode(false); + entity.Property(e => e.VatRate).HasColumnType("decimal(6, 2)"); + + entity.HasOne(d => d.PcpReceipt).WithMany(p => p.PcpReceiptItem) + .HasForeignKey(d => d.PcpReceiptId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ReceiptItem_Receipt"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.PcpReceiptId, "IxPcpReceiptPaymentPcpReceiptId"); + + entity.Property(e => e.PcpReceiptPaymentId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ChangeInCurrency).HasColumnType("decimal(14, 4)"); + entity.Property(e => e.ChangeRef).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.Currency) + .HasMaxLength(8) + .IsUnicode(false); + entity.Property(e => e.PcpReceiptId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ValueInCurrency).HasColumnType("decimal(14, 4)"); + entity.Property(e => e.ValueRef).HasColumnType("decimal(14, 2)"); + + entity.HasOne(d => d.PcpReceipt).WithMany(p => p.PcpReceiptPayment) + .HasForeignKey(d => d.PcpReceiptId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ReceiptPayment_Receipt"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PcpReceiptVatId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PcpReceiptId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TotalBrutto).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.TotalVat).HasColumnType("decimal(14, 2)"); + entity.Property(e => e.VatChar) + .HasMaxLength(1) + .IsUnicode(false); + entity.Property(e => e.VatRate).HasColumnType("decimal(6, 2)"); + + entity.HasOne(d => d.PcpReceipt).WithMany(p => p.PcpReceiptVat) + .HasForeignKey(d => d.PcpReceiptId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ReceiptVat_Receipt"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.Created).HasColumnType("datetime"); + entity.Property(e => e.ShopAddrOnReceipt0) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopAddrOnReceipt1) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopAddrOnReceipt2) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopAddrOnReceipt3) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopLicenseKey) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopLicenseValidFrom).HasColumnType("datetime"); + entity.Property(e => e.ShopLicenseValidTo).HasColumnType("datetime"); + entity.Property(e => e.ShopName) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopNameOnReceipt0) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopNameOnReceipt1) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopNameOnReceipt2) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopNameOnReceipt3) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.ShopNip) + .HasMaxLength(16) + .IsUnicode(false); + entity.Property(e => e.Updated).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PolId, e.ParGrupa, e.ParNazwa }).HasName("PK_POLPARAM"); + + entity.Property(e => e.PolId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParGrupa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParNazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParWartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Pol).WithMany(p => p.PolParam) + .HasForeignKey(d => d.PolId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POLPARAM_REF_POLPA_POLITYKA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PolId).HasName("PK_POLITYKA"); + + entity.HasIndex(e => e.CentrPolId, "idx_CentrPolId"); + + entity.Property(e => e.PolId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrPolId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasMany(d => d.Mag).WithMany(p => p.Pol) + .UsingEntity>( + "PolMag", + r => r.HasOne().WithMany() + .HasForeignKey("MagId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POLMAG_REF_MAGPO_MAGAZYN"), + l => l.HasOne().WithMany() + .HasForeignKey("PolId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POLMAG_REF_POLMA_POLITYKA"), + j => + { + j.HasKey("PolId", "MagId").HasName("PK_POLMAG"); + j.HasIndex(new[] { "MagId" }, "idx_MagPol"); + j.IndexerProperty("PolId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("MagId").HasColumnType("numeric(9, 0)"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.NoweKontoId, e.RodzajPow }).HasName("PK_POWKONTLOJ"); + + entity.HasIndex(e => e.StareKontoId, "idx_PowStareKLoj"); + + entity.Property(e => e.NoweKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.StareKontoId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.NoweKonto).WithMany(p => p.PowKontLojNoweKonto) + .HasForeignKey(d => d.NoweKontoId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_NoweKonto"); + + entity.HasOne(d => d.StareKonto).WithMany(p => p.PowKontLojStareKonto) + .HasForeignKey(d => d.StareKontoId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_StareKonto"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PowiadomienieId).HasName("PK_POWIADOMIENIE"); + + entity.HasIndex(e => new { e.ShopNo, e.PosNo }, "IxPowiadomienie_ShopNoPosNo"); + + entity.HasIndex(e => e.Status, "IxPowiadomienie_Status"); + + entity.Property(e => e.PowiadomienieId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Adresat) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.Nadawca) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.Naglowek) + .HasMaxLength(128) + .IsUnicode(false); + entity.Property(e => e.PosNo) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.ShopNo) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.Tresc) + .HasMaxLength(2048) + .IsUnicode(false); + entity.Property(e => e.Utworzono).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PowiadomienieId, e.Znaczenie, e.Kolejnosc }).HasName("PK_POWIADOMIENIEPARAM"); + + entity.Property(e => e.PowiadomienieId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param2) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Powiadomienie).WithMany(p => p.PowiadomienieParam) + .HasForeignKey(d => d.PowiadomienieId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_PowiadomienieParamPowiadomienie"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TowId).HasName("PK_POWIAZANIE"); + + entity.HasIndex(e => e.OpakId, "idx_OpakId"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.IleWOpak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.OpakId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Opak).WithMany(p => p.PowiazanieOpak) + .HasForeignKey(d => d.OpakId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POWIAZAN_REF_OPAK_TOWAR"); + + entity.HasOne(d => d.Tow).WithOne(p => p.PowiazanieTow) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POWIAZAN_REF_TOWAR_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.PromId, e.GrupaId, e.Rodzaj }); + + entity.Property(e => e.PromId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GrupaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Grupa).WithMany(p => p.PowiazanieProm) + .HasForeignKey(d => d.GrupaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PowiazanieProm_GrupaPromocji"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.Id, e.Typ }).HasName("PK_POWIAZANIE_SKLEP"); + + entity.HasIndex(e => e.Typ, "PowiazanieSklepTyp"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.PowiazanieSklep) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POWIAZANIESKLEP_REFERENCE_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.UzId, e.RodzajPow, e.Id }).HasName("PK_POWIAZANIEUZ"); + + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Uz).WithMany(p => p.PowiazanieUz) + .HasForeignKey(d => d.UzId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POWIAZAN_REF_POWUZ_UZYTKOWN"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.UzNSId, e.RodzajPow, e.Id }).HasName("PK_POWIAZANIEUZNASKLEP"); + + entity.Property(e => e.UzNSId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.UzNS).WithMany(p => p.PowiazanieUzNaSklep) + .HasForeignKey(d => d.UzNSId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_PowUzNaSklepUzNaSklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.GrAkcId }).HasName("PK_POZAKCYZA"); + + entity.HasIndex(e => e.GrAkcId, "idx_PozAkcGr"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GrAkcId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.GrAkc).WithMany(p => p.PozAkcyza) + .HasForeignKey(d => d.GrAkcId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_AkcPoz"); + + entity.HasOne(d => d.PozDok).WithMany(p => p.PozAkcyza) + .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_PozAkc"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.TowId, e.SklepId }).HasName("PK_POZCENNIKDOK"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DoKiedyPrzyjecie).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.PozCennikDok) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PozCennikDokSklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc }).HasName("PK_POZDOK"); + + entity.HasIndex(e => new { e.DokId, e.NrPozycji }, "idx_PozDokDokIdNrPozycji"); + + entity.HasIndex(e => e.TowId, "idx_PozDokTowId"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDomyslna).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaPoRab).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaPrzedRab).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleWZgrzewce).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IloscMinus).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IloscPlus).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.PozDok) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POZDOK_REF_POZDO_DOK"); + + entity.HasOne(d => d.Tow).WithMany(p => p.PozDok) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POZDOK_REF_POZTO_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.JakiePow, e.KtorePow }).HasName("PK_POZDOKWBUFPOWIAZANIE"); + + entity.HasIndex(e => e.Id, "idx_PozDokWBufId"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.PozDok).WithMany(p => p.PozDokWBufPowiazanie) + .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PozDokWBufPow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.Kolejnosc }).HasName("PK_POZPAR"); + + entity.HasIndex(e => e.TowId, "idx_PozParTowId"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GrupaGTU) + .HasMaxLength(4) + .IsUnicode(false); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.RabatKwot).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WartoscBrutto).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Par).WithMany(p => p.PozPar) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POZPAR_REF_POZPA_PARAGON"); + + entity.HasOne(d => d.Tow).WithMany(p => p.PozPar) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POZPAR_REF_TOWPA_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.Kolejnosc }).HasName("PK_POZPARSZCZEG"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DodInfo) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.PozPar).WithOne(p => p.PozParSzczeg) + .HasForeignKey(d => new { d.ParId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POZPARSZ_REF_PPSZC_POZPAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.WzId, e.Kolejnosc }).HasName("PK_POZWZ"); + + entity.Property(e => e.WzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.IloscMinus).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IloscPlus).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Tow).WithMany(p => p.PozWz) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POZWZ_REF_TOWWZ_TOWAR"); + + entity.HasOne(d => d.Wz).WithMany(p => p.PozWz) + .HasForeignKey(d => d.WzId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_POZWZ_REF_POZWZ_WZORZEC"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ProfilId).HasName("PK_PROFIL"); + + entity.Property(e => e.ProfilId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Utworzony).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ProfilId).HasName("PK_PROFKAS"); + + entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Kasa).WithMany(p => p.ProfilKasa) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PROFKAS_REFERENCE_KASA"); + + entity.HasOne(d => d.Profil).WithOne(p => p.ProfilKasa) + .HasForeignKey(d => d.ProfilId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PROFKAS_REFERENCE_PROF"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ProfilId, e.ParGrupa, e.ParNazwa, e.Kolejny }).HasName("PK_PROFIL_KONFIG"); + + entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParGrupa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.ParNazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Utworzony).HasColumnType("datetime"); + entity.Property(e => e.Wartosc) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Profil).WithMany(p => p.ProfilKonfig) + .HasForeignKey(d => d.ProfilId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_PROFILKONFIG_REFERENCE_PROFIL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.PMId }).HasName("PK_PRTMAG"); + + entity.HasIndex(e => new { e.TowId, e.MagId, e.Data, e.KolejnyWDniu, e.PMId }, "idx_PrtMagFifo"); + + entity.HasIndex(e => new { e.NrPartii, e.TowId, e.PMId }, "idx_PrtMagNrPrt"); + + entity.HasIndex(e => e.Zmiana, "idx_PrtMagZmn"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaSpDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.DataWazn).HasColumnType("datetime"); + entity.Property(e => e.Dostarczono).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NrDostawy) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.NrPartii) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Rezerwacja).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + entity.Property(e => e.ZmianaIstotna).HasColumnType("datetime"); + + entity.HasOne(d => d.Mag).WithMany(p => p.PrtMag) + .HasForeignKey(d => d.MagId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_PrtMagMagazyn"); + + entity.HasOne(d => d.Tow).WithMany(p => p.PrtMag) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_PrtMagTowar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RWPId).HasName("PK_RAPWARTPOCZ"); + + entity.HasIndex(e => new { e.TypRap, e.Data }, "idx_RWP_TypRapData"); + + entity.Property(e => e.RWPId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.ParamTxt) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Wykonano).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RWPId, e.MagId, e.Typ, e.Numer }).HasName("PK_RAPWARTPOCZDANE"); + + entity.Property(e => e.RWPId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Typ).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Mag).WithMany(p => p.RapWartPoczDane) + .HasForeignKey(d => d.MagId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RAPWARTPOCZDANE_REFERENCE_MAGAZYN"); + + entity.HasOne(d => d.RWP).WithMany(p => p.RapWartPoczDane) + .HasForeignKey(d => d.RWPId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RAPWARTPOCZDANE_REFERENCE_RAPWARTPOCZ"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RegulaId).HasName("PK_REGULA"); + + entity.Property(e => e.RegulaId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataCzasDo).HasColumnType("datetime"); + entity.Property(e => e.DataCzasOd).HasColumnType("datetime"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Number1).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Number2).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Number3).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Number4).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Str1) + .HasMaxLength(128) + .IsUnicode(false); + entity.Property(e => e.Str2) + .HasMaxLength(128) + .IsUnicode(false); + entity.Property(e => e.Usunieto).HasColumnType("datetime"); + entity.Property(e => e.Utworzono).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.AsId, e.Znaczenie }).HasName("PK_REGULAASORT"); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.As).WithMany(p => p.RegulaAsort) + .HasForeignKey(d => d.AsId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_REGULAAS_REFERENCE_ASORT"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaAsort) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_REGULAAS_REFERENCE_REGULA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.RegulaId, e.Kolejnosc }).HasName("PK_REGULADOK"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.RegulaDok) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegDokDok"); + + entity.HasOne(d => d.Konto).WithMany(p => p.RegulaDok) + .HasForeignKey(d => d.KontoId) + .HasConstraintName("Ref_RegDokKonto"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaDok) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegDokReg"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.RegulaId, e.Kolejnosc, e.Znaczenie }).HasName("PK_REGULADOKSZCZEG"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Param3) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.RegulaDok).WithMany(p => p.RegulaDokSzczeg) + .HasForeignKey(d => new { d.DokId, d.RegulaId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RgDokSzczegRgDok"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.Kod, e.Znaczenie }); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Cena).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Ilosc).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Informacja) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NazwaTowaru) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaKod) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_REGULAKOD_REGULA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.RegulaId, e.Kolejnosc }).HasName("PK_REGULAPAR"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Konto).WithMany(p => p.RegulaPar) + .HasForeignKey(d => d.KontoId) + .HasConstraintName("Ref_RegParKonto"); + + entity.HasOne(d => d.Par).WithMany(p => p.RegulaPar) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegParPar"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaPar) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegParReg"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.RegulaId, e.Kolejnosc, e.Znaczenie }).HasName("PK_REGULAPARSZCZEG"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Param3) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.RegulaPar).WithMany(p => p.RegulaParSzczeg) + .HasForeignKey(d => new { d.ParId, d.RegulaId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RgParSzczegRgPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.Znaczenie }).HasName("PK_REGULAPARAM"); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param2) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaParam) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.RegulaId, e.Typ }).HasName("PK_REGULAPOZDOK"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaPozDok) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozReg"); + + entity.HasOne(d => d.PozDok).WithMany(p => p.RegulaPozDok) + .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.RegulaId, e.Typ, e.KolejnoscRegulaDok }).HasName("PK_REGPOZDOKSZ"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaPozDokSzczeg) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozSzReg"); + + entity.HasOne(d => d.PozDok).WithMany(p => p.RegulaPozDokSzczeg) + .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozSzPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.Kolejnosc, e.RegulaId, e.Typ }).HasName("PK_REGULAPOZPAR"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaPozPar) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozParReg"); + + entity.HasOne(d => d.PozPar).WithMany(p => p.RegulaPozPar) + .HasForeignKey(d => new { d.ParId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozParPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ParId, e.Kolejnosc, e.RegulaId, e.Typ, e.KolejnoscRegulaPar }).HasName("PK_REGPOZPARSZ"); + + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaPozParSzczeg) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozPSzReg"); + + entity.HasOne(d => d.PozPar).WithMany(p => p.RegulaPozParSzczeg) + .HasForeignKey(d => new { d.ParId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RegPozPSzPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.Kolejnosc }).HasName("PK_REGULAPROG"); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ProgDo).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.ProgOd).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Wartosc1).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("numeric(16, 4)"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaProg) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_REGULAPROG_REFERENCE_REGULA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.SklepId }).HasName("PK_REGULASKLEP"); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaSklep) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RegulaSklep_Regula"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.RegulaSklep) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RegulaSklep_Sklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.SklepId }); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataCzasAutoryzacji).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.PcfUser).WithMany(p => p.RegulaSklepAuth) + .HasForeignKey(d => d.PcfUserId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RegulaSklepAuth_PcfUser"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaSklepAuth) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RegulaSklepAuth_Regula"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.RegulaSklepAuth) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RegulaSklepAuth_Sklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.Znaczenie }); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaTekst) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RegulaTekst_Regula"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RegulaId, e.TowId, e.Znaczenie }).HasName("PK_REGULATOWAR"); + + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Ilosc).HasColumnType("numeric(16, 4)"); + + entity.HasOne(d => d.Regula).WithMany(p => p.RegulaTowar) + .HasForeignKey(d => d.RegulaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_REGULATO_REFERENCE_REGULA"); + + entity.HasOne(d => d.Tow).WithMany(p => p.RegulaTowar) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_REGULATO_REFERENCE_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RolaId).HasName("PK_ROLA"); + + entity.Property(e => e.RolaId).ValueGeneratedNever(); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RolaId, e.Rodzaj }).HasName("PK_ROLAUPR"); + + entity.HasOne(d => d.Rola).WithMany(p => p.RolaUprawnienie) + .HasForeignKey(d => d.RolaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RolaUprRola"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.PMId, e.Znaczenie, e.DokId, e.Kolejnosc }).HasName("PK_ROZPRTMAG"); + + entity.HasIndex(e => e.Dzien, "idx_RozPrtMagDzien"); + + entity.HasIndex(e => new { e.DokId, e.Kolejnosc, e.Znaczenie, e.PMId }, "idx_RozPrtMagPoz"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.IloscPrt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.PozDok).WithMany(p => p.RozPrtMag) + .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RozPrtMagPoz"); + + entity.HasOne(d => d.PrtMag).WithMany(p => p.RozPrtMag) + .HasForeignKey(d => new { d.TowId, d.PMId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_RozPrtMagPrt"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Znaczenie, e.Stawka }).HasName("PK_ROZBDODDOK"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.RozbicieDodDok) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_RozbDodDokDok"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Stawka }).HasName("PK_ROZBICIEDOK"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.RozbicieDok) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ROZBICIE_REF_SUMAD_DOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc }).HasName("PK_ROZLICZA"); + + entity.HasIndex(e => e.RozliczanyDokId, "idx_RozliczanyDokId"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RozliczanyDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RozliczeniePodatku).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Dok).WithMany(p => p.RozliczaDok) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ROZLICZA_REF_DOKZB_DOK"); + + entity.HasOne(d => d.RozliczanyDok).WithMany(p => p.RozliczaRozliczanyDok) + .HasForeignKey(d => d.RozliczanyDokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ROZLICZA_REF_DOKRO_DOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.RozDokId, e.RozKolejnosc, e.PrtDokId, e.PrtKolejnosc }).HasName("PK_ROZLICZENIEPARTII"); + + entity.HasIndex(e => new { e.PrtDokId, e.PrtKolejnosc }, "idx_RozPrt"); + + entity.Property(e => e.RozDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PrtDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Partia).WithMany(p => p.RozliczeniePartii) + .HasForeignKey(d => new { d.PrtDokId, d.PrtKolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ROZLICZE_REF_PRTRO_PARTIA"); + + entity.HasOne(d => d.PozDok).WithMany(p => p.RozliczeniePartii) + .HasForeignKey(d => new { d.RozDokId, d.RozKolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ROZLICZE_REF_ROZPO_POZDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SesjaId).HasName("PK_SESJA"); + + entity.HasIndex(e => e.UzId, "idx_SesjaUzId"); + + entity.Property(e => e.SesjaId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Stanowisko) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wersja) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Uz).WithMany(p => p.Sesja) + .HasForeignKey(d => d.UzId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SESJA_REF_UZYSE_UZYTKOWN"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SesjaId).HasName("PK_SESJAAKTYWNA"); + + entity.Property(e => e.SesjaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Aktywnosc).HasColumnType("datetime"); + entity.Property(e => e.IdProcesu) + .HasMaxLength(20) + .IsUnicode(false); + + entity.HasOne(d => d.Sesja).WithOne(p => p.SesjaAktywna) + .HasForeignKey(d => d.SesjaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SESJAAKT_REF_SESAK_SESJA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DKId, e.Kolejnosc }).HasName("PK_SKLDEFKODU"); + + entity.Property(e => e.DKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.DK).WithMany(p => p.SkladnikDefinicjiKodu) + .HasForeignKey(d => d.DKId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLDEFKODU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SkWzId).HasName("PK_SKLADNIKWZORCA"); + + entity.HasIndex(e => e.CentrSkWzId, "idx_CentrSkWzId"); + + entity.HasIndex(e => new { e.TowIdWzorca, e.Kolejnosc }, "idx_SkladnikWzorca_TowIdWzorca"); + + entity.Property(e => e.SkWzId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CentrSkWzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.TowIdWzorca).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.TowIdWzorcaNavigation).WithMany(p => p.SkladnikWzorca) + .HasForeignKey(d => d.TowIdWzorca) + .HasConstraintName("FK_SKLADNIKWZORCA_REFERENCE_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SklepId).HasName("PK_SKLEP"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataBO).HasColumnType("datetime"); + entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NrSeryjny) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.OkrZamkniety).HasColumnType("datetime"); + entity.Property(e => e.OstEksport).HasColumnType("datetime"); + entity.Property(e => e.OstImport).HasColumnType("datetime"); + entity.Property(e => e.PotwEksport).HasColumnType("datetime"); + entity.Property(e => e.WymImport).HasColumnType("datetime"); + + entity.HasOne(d => d.Kraj).WithMany(p => p.Sklep) + .HasForeignKey(d => d.KrajId) + .HasConstraintName("FK_Ref_KrajSklep"); + + entity.HasOne(d => d.Mag).WithMany(p => p.Sklep) + .HasForeignKey(d => d.MagId) + .HasConstraintName("FK_SKLEP_REF_SKLEP_MAGAZYN"); + + entity.HasOne(d => d.SklepNavigation).WithOne(p => p.Sklep) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEP_REF_SKLEP_KONTRAHE"); + + entity.HasMany(d => d.As).WithMany(p => p.Sklep) + .UsingEntity>( + "SklepPrzydzial", + r => r.HasOne().WithMany() + .HasForeignKey("AsId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPRZ_REF_SKLEP_ASORT"), + l => l.HasOne().WithMany() + .HasForeignKey("SklepId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPRZ_REF_SKLEP_SKLEP"), + j => + { + j.HasKey("SklepId", "AsId").HasName("PK_SKLEPPRZYDZIAL"); + j.IndexerProperty("SklepId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("AsId").HasColumnType("numeric(9, 0)"); + }); + + entity.HasMany(d => d.Centrala).WithMany(p => p.Sklep1) + .UsingEntity>( + "SklepSklep", + r => r.HasOne().WithMany() + .HasForeignKey("CentralaId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPSKL_REF_SKCEN_SKLEP"), + l => l.HasOne().WithMany() + .HasForeignKey("SklepId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPSKL_REF_SKSKL_SKLEP"), + j => + { + j.HasKey("CentralaId", "SklepId").HasName("PK_SKLEPSKLEP"); + j.IndexerProperty("CentralaId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("SklepId").HasColumnType("numeric(9, 0)"); + }); + + entity.HasMany(d => d.KPW).WithMany(p => p.Sklep) + .UsingEntity>( + "SklepKthPrzydzial", + r => r.HasOne().WithMany() + .HasForeignKey("KPWId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKTH_REF_SKKTH_KTHPARWA"), + l => l.HasOne().WithMany() + .HasForeignKey("SklepId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKTH_REF_SKKTH_SKLEP"), + j => + { + j.HasKey("SklepId", "KPWId").HasName("PK_SKLEPKTHPRZYDZIAL"); + j.IndexerProperty("SklepId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("KPWId").HasColumnType("numeric(9, 0)"); + }); + + entity.HasMany(d => d.Sklep1).WithMany(p => p.Centrala) + .UsingEntity>( + "SklepSklep", + r => r.HasOne().WithMany() + .HasForeignKey("SklepId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPSKL_REF_SKSKL_SKLEP"), + l => l.HasOne().WithMany() + .HasForeignKey("CentralaId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPSKL_REF_SKCEN_SKLEP"), + j => + { + j.HasKey("CentralaId", "SklepId").HasName("PK_SKLEPSKLEP"); + j.IndexerProperty("CentralaId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("SklepId").HasColumnType("numeric(9, 0)"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepArtId }).HasName("PK_SKLEPARTYKUL"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepArtId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ArtNazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.GlownySklepTowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepArtykul) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPART_REF_SKART_SKLEP"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepArtykul) + .HasForeignKey(d => new { d.SklepId, d.GlownySklepTowId }) + .HasConstraintName("FK_SKLARTGLOWNYSKLEPTOWID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepBankId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepBankId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Adres) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.BankId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.NrRozliBank) + .HasMaxLength(8) + .IsUnicode(false); + entity.Property(e => e.SWIFT) + .HasMaxLength(11) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDKId }).HasName("PK_SKDEFKODU"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataDo).HasColumnType("datetime"); + entity.Property(e => e.DataOd).HasColumnType("datetime"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepDefinicjaKodu) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKDEFKODUSKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ZasobId, e.SklepId }); + + entity.HasIndex(e => new { e.SklepId, e.SklepZasobId }, "IxSklepDlugiZasob_SklepIdent"); + + entity.Property(e => e.ZasobId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWersja) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.SklepZasobId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Zasob).WithMany(p => p.SklepDlugiZasob) + .HasForeignKey(d => d.ZasobId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklepDlugiZasob_ZasobId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId }).HasName("PK_SKLEPDOK"); + + entity.HasIndex(e => e.DokId, "idx_SkDokId"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKasaId }, "idx_SkDokKasa"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SkDokKth"); + + entity.HasIndex(e => new { e.SklepId, e.SklepMagId }, "idx_SkDokMag"); + + entity.HasIndex(e => new { e.SklepId, e.SklepPlatnikId }, "idx_SkDokPlatKth"); + + entity.HasIndex(e => new { e.TypDok, e.Data, e.KolejnyWDniu }, "idx_SkDokTypDokDataKolejnyWDniu"); + + entity.HasIndex(e => new { e.SklepId, e.SklepUzId }, "idx_SkDokUz"); + + entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkDokWal"); + + entity.HasIndex(e => e.Zmiana, "idx_SkDokZmiana"); + + entity.HasIndex(e => new { e.SklepId, e.Data, e.KolejnyWDniu }, "idx_SklepDataKolejnyWDniu"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.DataDod).HasColumnType("datetime"); + entity.Property(e => e.DataPom).HasColumnType("datetime"); + entity.Property(e => e.DoZaplaty).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota1).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota10).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota11).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota12).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota3).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota4).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota5).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota6).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota7).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota8).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kwota9).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDetUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMagUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NrDok) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDetUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMagUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekUslugi).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Razem).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SklepKBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepPlatnikId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalIdPlatnosci).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zaplacono).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ZaplaconoPodatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ZaplaconoWKasie).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Dok).WithMany(p => p.SklepDok) + .HasForeignKey(d => d.DokId) + .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_DOK"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepDok) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKLEP_SKLEP"); + + entity.HasOne(d => d.SklepKasa).WithMany(p => p.SklepDok) + .HasForeignKey(d => new { d.SklepId, d.SklepKasaId }) + .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPKAS"); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepDokSklepKontr) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .HasConstraintName("FK_SKLEPDOK_REF_OBROT_SKLEPKON"); + + entity.HasOne(d => d.SklepMagazyn).WithMany(p => p.SklepDok) + .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPMAG"); + + entity.HasOne(d => d.SklepKontrNavigation).WithMany(p => p.SklepDokSklepKontrNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepPlatnikId }) + .HasConstraintName("FK_SKLEPDOK_REF_OBROT_SKLEPPLAT"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepDok) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPUZY"); + + entity.HasOne(d => d.SklepWaluta).WithMany(p => p.SklepDok) + .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) + .HasConstraintName("FK_SKLEPDOK_REF_SKDWP_SKLEPWAL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Znaczenie }).HasName("PK_SKLEPDOKDODKTH"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SkDDKth"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepDokDodKth) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKDDK_SKLEPDOK"); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepDokDodKth) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKDKD_SKLEPKON"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Znaczenie }).HasName("PK_SKLEPDOKKURS"); + + entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SklDokKursWal"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NrTabeli) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepDokKurs) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLDOKKURS_SKLEPDOK"); + + entity.HasOne(d => d.SklepWaluta).WithMany(p => p.SklepDokKurs) + .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLDOKKURS_WAL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Typ, e.Gdzie }).HasName("PK_SKLEPDOKPUNKTY"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy).HasColumnType("datetime"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepDokPunkty) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKDOK_SKLEPDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.SklepWalId }).HasName("PK_SKLEPDOKWALUTA"); + + entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkWalDok"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DokKwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalNetto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalNettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalPodatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalPodatekDet).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepDokWaluta) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKDWZ_SKLEPDOK"); + + entity.HasOne(d => d.SklepWaluta).WithMany(p => p.SklepDokWaluta) + .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOK_REF_SKWD_SKLEPWAL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.SklepKontrId }).HasName("PK_SKLEPDOST"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SkDostKth"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleWZgrzewce).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(30) + .IsUnicode(false); + entity.Property(e => e.RabatOdWart).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepDost) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOS_REF_DOSTS_SKLEPKON"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepDost) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPDOS_REF_SKLEP_SKLEPTOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.Dzien }).HasName("PK_SKLEPDZIENROZL"); + + entity.HasIndex(e => e.Zmiana, "idx_SkDzienZmiana"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepDzienRozl) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkDzienRozl"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.Dzien, e.Znaczenie }).HasName("PK_SKLEPDZIENROZLPARAM"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.Wartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepDzienRozl).WithMany(p => p.SklepDzienRozlParam) + .HasForeignKey(d => new { d.SklepId, d.Dzien }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkDzienRozlPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepEmId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepEmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Haslo) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Host) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.KopiaEmail) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Login) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Nadawca) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Port) + .HasMaxLength(5) + .IsUnicode(false); + entity.Property(e => e.SklepTEDId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTEHRId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTERId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTEWId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTEZIId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.SklepTrescEmail).WithMany(p => p.SklepEmailSklepTrescEmail) + .HasForeignKey(d => new { d.SklepId, d.SklepTEDId }) + .HasConstraintName("FK_SklepEmail_TED"); + + entity.HasOne(d => d.SklepTrescEmailNavigation).WithMany(p => p.SklepEmailSklepTrescEmailNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepTERId }) + .HasConstraintName("FK_SklepEmail_TER"); + + entity.HasOne(d => d.SklepTrescEmail1).WithMany(p => p.SklepEmailSklepTrescEmail1) + .HasForeignKey(d => new { d.SklepId, d.SklepTEWId }) + .HasConstraintName("FK_SklepEmail_TEW"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepEmail) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .HasConstraintName("FK_SklepEmail_Uz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.TowId }).HasName("PK_SKLEPFLAGI"); + + entity.HasIndex(e => new { e.SklepId, e.ZmianaIstotna }, "idx_SFZmianaIstotna"); + + entity.HasIndex(e => new { e.SklepId, e.ZmianaTylkoCen }, "idx_SFZmianaTylkoCen"); + + entity.HasIndex(e => new { e.TowId, e.SklepId }, "idx_SklFlgTowSklep"); + + entity.HasIndex(e => e.Zmiana, "idx_SklepFlagZmiana"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DoKiedyPrzyjecie).HasColumnType("datetime"); + entity.Property(e => e.NarzCenaDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NarzCenaDod).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NarzCenaHurt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NarzCenaNoc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NarzCenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + entity.Property(e => e.ZmianaIstotna).HasColumnType("datetime"); + entity.Property(e => e.ZmianaTylkoCen).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepFlagi) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPFLA_REF_SKLEP_SKLEP"); + + entity.HasOne(d => d.Tow).WithMany(p => p.SklepFlagi) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPFLA_REF_SKLEP_TOWAR"); + + entity.HasMany(d => d.Kontr).WithMany(p => p.SklepFlagi) + .UsingEntity>( + "SklepNarzDost", + r => r.HasOne().WithMany() + .HasForeignKey("KontrId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPNAR_REF_SKLEP_KONTRAHE"), + l => l.HasOne().WithMany() + .HasForeignKey("SklepId", "TowId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPNAR_REF_SKLEP_SKLEPFLA"), + j => + { + j.HasKey("SklepId", "TowId", "KontrId").HasName("PK_SKLEPNARZDOST"); + j.HasIndex(new[] { "KontrId" }, "idx_SklepNarzDostKth"); + j.IndexerProperty("SklepId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("TowId").HasColumnType("numeric(9, 0)"); + j.IndexerProperty("KontrId").HasColumnType("numeric(9, 0)"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTypOsId, e.SklepZgId }).HasName("PK_SKLEPFORMZGOD"); + + entity.HasIndex(e => new { e.SklepId, e.SklepZgId }, "idx_SKFMZG_SKZGODA"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepTypOs).WithMany(p => p.SklepFormZgod) + .HasForeignKey(d => new { d.SklepId, d.SklepTypOsId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKFMZG_SKTYPOS"); + + entity.HasOne(d => d.SklepZgoda).WithMany(p => p.SklepFormZgod) + .HasForeignKey(d => new { d.SklepId, d.SklepZgId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKFMZG_SKZGODA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepFormaId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepFormaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.FormaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kolejnosc).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.SerwisPlatniczy) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepFormaPlatnPos7) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKFPP7_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepGrAkcId }).HasName("PK_SKLEPGRUPAAKCYZOWA"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepGrAkcId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrGrAkcId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepGrupaAkcyzowa) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkGrAkc"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepGrupaId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepGrupaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GrupaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Opis) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepUzId }).HasName("PK_SK_GR_UZ"); + + entity.HasIndex(e => new { e.SklepId, e.SklepRolaId }, "idx_SkRola"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRolaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepGrupaUzSklepUzytkownik) + .HasForeignKey(d => new { d.SklepId, d.SklepRolaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPGRU_REF_SKGRR_SKLEPUZY"); + + entity.HasOne(d => d.SklepUzytkownikNavigation).WithOne(p => p.SklepGrupaUzSklepUzytkownikNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPGRU_REF_SKGRU_SKLEPUZY"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.SklepMagId }).HasName("PK_SKLEPISTW"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RezerwacjaMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanMax).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanMin).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepMagazyn).WithMany(p => p.SklepIstw) + .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPIST_REF_SKMAG_SKLEPMAG"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepIstw) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPIST_REF_SKTOW_SKLEPTOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKartaId }).HasName("PK_SKLEPKARTALOJ"); + + entity.HasIndex(e => e.KodKarty, "idx_SKLoj_KodKarty"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKontoId }, "idx_SKLoj_SKonto"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKartaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KodKarty) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Opis1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Opis2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Posiadacz) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Uniewazniono).HasColumnType("datetime"); + entity.Property(e => e.WaznaDo).HasColumnType("datetime"); + entity.Property(e => e.WaznaOd).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepKartaLoj) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SKrtLoj_Sklep"); + + entity.HasOne(d => d.SklepKontoLoj).WithMany(p => p.SklepKartaLoj) + .HasForeignKey(d => new { d.SklepId, d.SklepKontoId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SKartaKonto"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKasaId }).HasName("PK_SKLEPKASA"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NrUnikatowy) + .HasMaxLength(30) + .IsUnicode(false); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Stanowisko) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Typ) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepKasa) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKAS_REF_SKKAS_SKLEP"); + + entity.HasOne(d => d.SklepMagazyn).WithMany(p => p.SklepKasa) + .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKAS_REF_SKMAG_SKLEPMAG"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepFormaId, e.SklepKasaId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepFormaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepFormaPlatnPos7).WithMany(p => p.SklepKasaFormaPlatn) + .HasForeignKey(d => new { d.SklepId, d.SklepFormaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKKASAFORMAPLATN_SKFPP7"); + + entity.HasOne(d => d.SklepKasa).WithMany(p => p.SklepKasaFormaPlatn) + .HasForeignKey(d => new { d.SklepId, d.SklepKasaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKKASAFORMAPLATN_SKKASA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKBId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Numer) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.PowSklepKBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepBankId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKBIdOplat).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Sufix) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.SklepBank).WithMany(p => p.SklepKontoBankowe) + .HasForeignKey(d => new { d.SklepId, d.SklepBankId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKONTOBANK_SKLEPBANK"); + + entity.HasOne(d => d.SklepWaluta).WithMany(p => p.SklepKontoBankowe) + .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKONTOBANK_SKLEPWALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKBKId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKBKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KBKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Numer) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.PowSklepKBKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepBankId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepBank).WithMany(p => p.SklepKontoBankoweKontr) + .HasForeignKey(d => new { d.SklepId, d.SklepBankId }) + .HasConstraintName("FK_SKLEPKONTOBANKKONTR_SKLEPBANK"); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepKontoBankoweKontr) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKONTOBANKKONTR_SKLEPKONTR"); + + entity.HasOne(d => d.SklepWaluta).WithMany(p => p.SklepKontoBankoweKontr) + .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKONTOBANKKONTR_SKLEPWALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontoId }).HasName("PK_SKLEPKONTOLOJ"); + + entity.HasIndex(e => e.CentrKontoId, "idx_SCentrKontoId"); + + entity.HasIndex(e => e.KontoId, "idx_SKLoj_KLoj"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKontrId }, "idx_SKLoj_SKontrId"); + + entity.HasIndex(e => e.ZmianaStanu, "idx_SKLoj_ZmStanu"); + + entity.HasIndex(e => e.Zmiana, "idx_SKLoj_Zmiana"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Stan).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanPocz).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + entity.Property(e => e.ZmianaStanu).HasColumnType("datetime"); + + entity.HasOne(d => d.Konto).WithMany(p => p.SklepKontoLoj) + .HasForeignKey(d => d.KontoId) + .HasConstraintName("Ref_SKLoj_KLoj"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepKontoLoj) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SKntLoj_Sklep"); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepKontoLoj) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SKLoj_SKth"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId }).HasName("PK_SKLEPKONTR"); + + entity.HasIndex(e => e.KontrId, "idx_SklepKthKth"); + + entity.HasIndex(e => new { e.SklepId, e.KontrId }, "idx_SklepKthSkKth"); + + entity.HasIndex(e => e.Zmiana, "idx_SklepKthZmiana"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Akwizytor) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Bank) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.CentrKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.EMail) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Fax) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.IndeksCentr) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Kod) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.KodKarty) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KodKontr) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KodKraju) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Konto) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MaxKredyt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Miasto) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NIP) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NaPrzelewie1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NaPrzelewie2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.NrAnalityki) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.NrDomu) + .HasMaxLength(9) + .IsUnicode(false); + entity.Property(e => e.NrLokalu) + .HasMaxLength(9) + .IsUnicode(false); + entity.Property(e => e.Poczta) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Prowizja).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.RabatDost).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.RabatOdb).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Rezerwa1) + .HasMaxLength(80) + .IsUnicode(false); + entity.Property(e => e.Rezerwa2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Skrot) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Telefon) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.TermWaznKarty).HasColumnType("datetime"); + entity.Property(e => e.Ulica) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.SklepKontr) + .HasForeignKey(d => d.KontrId) + .HasConstraintName("FK_SKLEPKON_REF_KTHSK_KONTRAHE"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepKontr) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKON_REF_SKLEP_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.Znaczenie }).HasName("PK_SKLEPKONTROPIS"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepKontrOpis) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPKON_REF_SKKTH_SKLEPKON"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId }).HasName("PK_SKLKONTRSKL"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataBO).HasColumnType("datetime"); + entity.Property(e => e.KodKraju) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.NrSeryjny) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.OkrZamkniety).HasColumnType("datetime"); + entity.Property(e => e.OstEksport).HasColumnType("datetime"); + entity.Property(e => e.OstImport).HasColumnType("datetime"); + entity.Property(e => e.PotwEksport).HasColumnType("datetime"); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WymImport).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepKontrSklep) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklKontrSklKontr"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.SklepTypOsId }).HasName("PK_SKLEPKTHTYPOS"); + + entity.HasIndex(e => new { e.SklepId, e.SklepTypOsId }, "idx_SKKTHTYPOS_SKTYPOS"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepKthTypOs) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKKTHTYPOS_SKKTH"); + + entity.HasOne(d => d.SklepTypOs).WithMany(p => p.SklepKthTypOs) + .HasForeignKey(d => new { d.SklepId, d.SklepTypOsId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKKTHTYPOS_SKTYPOS"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepMagId }).HasName("PK_SKLEPMAGAZYN"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepMagazyn) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPMAG_REF_SKMAG_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }).HasName("PK_SKLEPNOTATKI"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepNotatki) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPNOT_REF_SKNOT_SKLEPTOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.NrFormat }).HasName("PK_SKLEPNRREJ"); + + entity.HasIndex(e => new { e.NrFormat, e.SklepId, e.SklepKontrId }, "idx_SkNumerRej"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NrFormat) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.NrWpisany) + .HasMaxLength(60) + .IsUnicode(false); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepNrRej) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkNrRejKth"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.NrFormat, e.SklepKartaId }).HasName("PK_SKLEPNRREJKARTA"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKartaId, e.SklepKontrId, e.NrFormat }, "idx_SkNrRejKartaId"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NrFormat) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.SklepKartaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepKartaLoj).WithMany(p => p.SklepNrRejKarta) + .HasForeignKey(d => new { d.SklepId, d.SklepKartaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkKartaNrRej"); + + entity.HasOne(d => d.SklepNrRej).WithMany(p => p.SklepNrRejKarta) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId, d.NrFormat }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkNrRejKarta"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepOplataId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepOplataId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataDo).HasColumnType("datetime"); + entity.Property(e => e.DataOd).HasColumnType("datetime"); + entity.Property(e => e.Komentarz) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.OplataId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKBId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.StawkaProc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepOplata) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKOPLATA_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepPanelId }).HasName("PK_SKLEP_PANEL"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepPanelId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.PanelId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TypAplikacji).HasDefaultValue((short)3); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Panel).WithMany(p => p.SklepPanel) + .HasForeignKey(d => d.PanelId) + .HasConstraintName("FK_SKLEPPANEL_REFERENCE_PANEL"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepPanel) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .HasConstraintName("FK_SKLEPPANEL_REFERENCE_SKLEPUZYTKOWNIK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepPanelId, e.ParNazwa }).HasName("PK_SKLEP_PANEL_PARAM"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepPanelId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParNazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParWartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepPanel).WithMany(p => p.SklepPanelParam) + .HasForeignKey(d => new { d.SklepId, d.SklepPanelId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPANELPARAM_REFERENCE_SKLEPPANEL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc }).HasName("PK_SKLEPPARBON"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Numer) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Typ) + .HasMaxLength(10) + .IsUnicode(false); + + entity.HasOne(d => d.SklepParagon).WithMany(p => p.SklepParBon) + .HasForeignKey(d => new { d.SklepId, d.SklepParId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKPB_SKLEPPAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Typ, e.Gdzie }).HasName("PK_SKLEPPARPUNKTY"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy).HasColumnType("datetime"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepParagon).WithMany(p => p.SklepParPunkty) + .HasForeignKey(d => new { d.SklepId, d.SklepParId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKPAR_SKLEPPAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.SklepWalId }).HasName("PK_SKLEPPARWALUTA"); + + entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkWalPar"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ParKwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.WalKwota).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepParagon).WithMany(p => p.SklepParWaluta) + .HasForeignKey(d => new { d.SklepId, d.SklepParId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKPWZ_SKLEPPAR"); + + entity.HasOne(d => d.SklepWaluta).WithMany(p => p.SklepParWaluta) + .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKWAL_SKLEPWAL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId }).HasName("PK_SKLEPPARAGON"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKasaId }, "idx_SkParKasa"); + + entity.HasIndex(e => new { e.SklepId, e.Kasjer }, "idx_SkParKasjer"); + + entity.HasIndex(e => new { e.SklepId, e.SklepWalId }, "idx_SkParWal"); + + entity.HasIndex(e => e.Zmiana, "idx_SkParZmiana"); + + entity.HasIndex(e => new { e.SklepId, e.DataCzas }, "idx_SklepParDataCzas"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Bony).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Brutto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CechyPar) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Czek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.DataCzas).HasColumnType("datetime"); + entity.Property(e => e.DodFPlat).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Gotowka).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.GrupyGTU) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.InneFPlat).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Karta).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kasjer) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.KodKarty) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NIP) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.OpakWyd).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.OpakZwr).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Przelew).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Rabat).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SklepKasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Waluty).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepParagon) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKLEP_SKLEP"); + + entity.HasOne(d => d.SklepKasa).WithMany(p => p.SklepParagon) + .HasForeignKey(d => new { d.SklepId, d.SklepKasaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKPAR_SKLEPKAS"); + + entity.HasOne(d => d.SklepWaluta).WithMany(p => p.SklepParagon) + .HasForeignKey(d => new { d.SklepId, d.SklepWalId }) + .HasConstraintName("FK_SKLEPPAR_REF_SKPAR_SKLEPWAL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc }).HasName("PK_SKLEPPARTIA"); + + entity.HasIndex(e => new { e.TypPartii, e.SklepId, e.SklepTowId, e.Pozostalo }, "idx_SkPrtTypTowIle"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cecha1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Cecha2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.DataWazn).HasColumnType("datetime"); + entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepPartia) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKPRT_SKLEPTOW"); + + entity.HasOne(d => d.SklepPozDok).WithOne(p => p.SklepPartia) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPAR_REF_SKPRT_SKLEPPOZ"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepNoweKontoId, e.RodzajPow }).HasName("PK_SKLEPPOWKONTLOJ"); + + entity.HasIndex(e => e.SklepStareKontoId, "idx_PowStareSKLoj"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepNoweKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepStareKontoId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepKontoLoj).WithMany(p => p.SklepPowKontLojSklepKontoLoj) + .HasForeignKey(d => new { d.SklepId, d.SklepNoweKontoId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SklepNoweKonto"); + + entity.HasOne(d => d.SklepKontoLojNavigation).WithMany(p => p.SklepPowKontLojSklepKontoLojNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepStareKontoId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SklepStareKonto"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepPromId, e.SklepGrupaId, e.Rodzaj }).HasName("PK_SklPowiazanieProm"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepPromId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepGrupaId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepGrupaPromocji).WithMany(p => p.SklepPowiazanieProm) + .HasForeignKey(d => new { d.SklepId, d.SklepGrupaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklPowProm_SklGrupaPromocji"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepUzId, e.RodzajPow, e.Id }).HasName("PK_SK_POW_UZ"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepPowiazanieUz) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPOW_REF_SKPOW_SKLEPUZY"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.SklepGrAkcId }).HasName("PK_SKLEPPOZAKCYZA"); + + entity.HasIndex(e => new { e.SklepId, e.SklepGrAkcId }, "idx_SkPozAkcGr"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepGrAkcId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepGrupaAkcyzowa).WithMany(p => p.SklepPozAkcyza) + .HasForeignKey(d => new { d.SklepId, d.SklepGrAkcId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkAkcPoz"); + + entity.HasOne(d => d.SklepPozDok).WithMany(p => p.SklepPozAkcyza) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkPozAkc"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc }).HasName("PK_SKLEPPOZDOK"); + + entity.HasIndex(e => new { e.SklepId, e.SklepDokId, e.NrPozycji }, "idx_SklepPozDokNrPoz"); + + entity.HasIndex(e => new { e.SklepId, e.SklepTowId }, "idx_SklepPozDokTowId"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDomyslna).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaPoRab).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaPrzedRab).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleWZgrzewce).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IloscMinus).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IloscPlus).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RabatProc).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepPozDok) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPOZ_REF_SKPOZ_SKLEPDOK"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepPozDok) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPOZ_REF_SKPOZ_SKLEPTOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc }).HasName("PK_SKLEPPOZPAR"); + + entity.HasIndex(e => new { e.SklepId, e.SklepTowId }, "idx_SkPozParTow"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GrupaGTU) + .HasMaxLength(4) + .IsUnicode(false); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.RabatKwot).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WartoscBrutto).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepParagon).WithMany(p => p.SklepPozPar) + .HasForeignKey(d => new { d.SklepId, d.SklepParId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPOZ_REF_SKPOZ_SKLEPPAR"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepPozPar) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .HasConstraintName("FK_SKLEPPOZ_REF_SKTOW_SKLEPTOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc }).HasName("PK_SKLEPPOZPARSZCZEG"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DodInfo) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.SklepPozPar).WithOne(p => p.SklepPozParSzczeg) + .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPOZ_REF_SKPPS_SKLEPPOZ"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepProfilId }).HasName("PK_SKLEPPROFIL"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepProfilId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Utworzony).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Profil).WithMany(p => p.SklepProfil) + .HasForeignKey(d => d.ProfilId) + .HasConstraintName("FK_SKLEPPROFIL_REFERENCE_PROFIL"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepProfil) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPROFIL_REFERENCE_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepProfilId, e.ParGrupa, e.ParNazwa, e.Kolejny }).HasName("PK_SKLEPPROFIL_KONFIG"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepProfilId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParGrupa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.ParNazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Utworzony).HasColumnType("datetime"); + entity.Property(e => e.Wartosc) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.SklepProfil).WithMany(p => p.SklepProfilKonfig) + .HasForeignKey(d => new { d.SklepId, d.SklepProfilId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPPROFILKONFIG_REFERENCE_SKLEPPROFIL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.PMId }).HasName("PK_SKLEPPRTMAG"); + + entity.HasIndex(e => new { e.SklepId, e.SklepTowId, e.SklepMagId, e.Data, e.KolejnyWDniu, e.PMId }, "idx_SkPrtMagFifo"); + + entity.HasIndex(e => new { e.NrPartii, e.SklepId, e.SklepTowId, e.PMId }, "idx_SkPrtMagNrPrt"); + + entity.HasIndex(e => e.Zmiana, "idx_SkPrtMagZmn"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaSpDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.DataWazn).HasColumnType("datetime"); + entity.Property(e => e.Dostarczono).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NrDostawy) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.NrPartii) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Pozostalo).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Rezerwacja).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.SklepMagazyn).WithMany(p => p.SklepPrtMag) + .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkPrtMagMagazyn"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepPrtMag) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkPrtMagTowar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRWPId }).HasName("PK_SKLEPRAPWARTPOCZ"); + + entity.HasIndex(e => new { e.SklepId, e.TypRap, e.Data }, "idx_SRWP_TypRapData"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRWPId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Data).HasColumnType("datetime"); + entity.Property(e => e.ParamTxt) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Wykonano).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepRapWartPocz) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPRAPWARTPOCZ_REFERENCE_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRWPId, e.SklepMagId, e.Typ, e.Numer }).HasName("PK_SKLEPRAPWARTPOCZDANE"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRWPId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepMagId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Typ).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepMagazyn).WithMany(p => p.SklepRapWartPoczDane) + .HasForeignKey(d => new { d.SklepId, d.SklepMagId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPMAG"); + + entity.HasOne(d => d.SklepRapWartPocz).WithMany(p => p.SklepRapWartPoczDane) + .HasForeignKey(d => new { d.SklepId, d.SklepRWPId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPRAPWARTPOCZDANE_REFERENCE_SKLEPRAPWARTPOCZ"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRegulaId }).HasName("PK_SKLEPREGULA"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataCzasDo).HasColumnType("datetime"); + entity.Property(e => e.DataCzasOd).HasColumnType("datetime"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Number1).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Number2).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Number3).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Number4).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Str1) + .HasMaxLength(128) + .IsUnicode(false); + entity.Property(e => e.Str2) + .HasMaxLength(128) + .IsUnicode(false); + entity.Property(e => e.Usunieto).HasColumnType("datetime"); + entity.Property(e => e.Utworzono).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepRegula) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPREGULA_REFERENCE_SKLEP"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.SklepAsId, e.Znaczenie }).HasName("PK_SKLEPREGULAASORT"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepAsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepAsNazwa) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.SklepRegula).WithMany(p => p.SklepRegulaAsort) + .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPREGULAAS_REFERENCE_SKLEPREGULA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.SklepRegulaId, e.Kolejnosc }).HasName("PK_SKLEPREGULADOK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Konto).WithMany(p => p.SklepRegulaDok) + .HasForeignKey(d => d.KontoId) + .HasConstraintName("Ref_SkRegDokKonto"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepRegulaDok) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRegDokDok"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.SklepRegulaId, e.Kolejnosc, e.Znaczenie }).HasName("PK_SKLREGULADOKSZCZEG"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Param3) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepRegulaDok).WithMany(p => p.SklepRegulaDokSzczeg) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.SklepRegulaId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklRgDokSzczegSklRgDok"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.Kod, e.Znaczenie }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Cena).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Ilosc).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Informacja) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NazwaTowaru) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepRegula).WithMany(p => p.SklepRegulaKod) + .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKL_REGULAKOD_REGULA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.SklepRegulaId, e.Kolejnosc }).HasName("PK_SKLEPREGULAPAR"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.Konto).WithMany(p => p.SklepRegulaPar) + .HasForeignKey(d => d.KontoId) + .HasConstraintName("Ref_SkRegParKonto"); + + entity.HasOne(d => d.SklepParagon).WithMany(p => p.SklepRegulaPar) + .HasForeignKey(d => new { d.SklepId, d.SklepParId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRegParPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.SklepRegulaId, e.Kolejnosc, e.Znaczenie }).HasName("PK_SKLREGULAPARSZCZEG"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Param3) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepRegulaPar).WithMany(p => p.SklepRegulaParSzczeg) + .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.SklepRegulaId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklRgParSzczegSklRPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.Znaczenie }).HasName("PK_SKLEPREGULAPARAM"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Param2) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepRegulaParam) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPREGULAPA_REFERENCE_SKLEP"); + + entity.HasOne(d => d.SklepRegula).WithMany(p => p.SklepRegulaParam) + .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPREGULAPA_REFERENCE_SKLEPREGULA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.SklepRegulaId, e.Typ }).HasName("PK_SKLEPREGULAPOZDOK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepPozDok).WithMany(p => p.SklepRegulaPozDok) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRegPozPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.SklepRegulaId, e.Typ, e.KolejnoscRegulaDok }).HasName("PK_SKLREGPOZDOKSZ"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepPozDok).WithMany(p => p.SklepRegulaPozDokSzczeg) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRegPozSzPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc, e.SklepRegulaId, e.Typ }).HasName("PK_SKLEPREGULAPOZPAR"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepPozPar).WithMany(p => p.SklepRegulaPozPar) + .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRegPozPar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepParId, e.Kolejnosc, e.SklepRegulaId, e.Typ, e.KolejnoscRegulaPar }).HasName("PK_SKLREGPOZPARSZ"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Wartosc1).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc2).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc3).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Wartosc4).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepPozPar).WithMany(p => p.SklepRegulaPozParSzczeg) + .HasForeignKey(d => new { d.SklepId, d.SklepParId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRegPozPSzPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.Znaczenie }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepRegula).WithMany(p => p.SklepRegulaTekst) + .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SkRegulaTekst_SkRegula"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRegulaId, e.SklepTowId, e.Znaczenie }).HasName("PK_SKLEPREGULATOWAR"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepRegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("numeric(16, 4)"); + entity.Property(e => e.Ilosc).HasColumnType("numeric(16, 4)"); + + entity.HasOne(d => d.SklepRegula).WithMany(p => p.SklepRegulaTowar) + .HasForeignKey(d => new { d.SklepId, d.SklepRegulaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPREGULATO_REFERENCE_SKLEPREGULA"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepRegulaTowar) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPREGULATO_REFERENCE_SKLEPTOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRolaId }).HasName("PK_SKLEPROLA"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.CentrRola).WithMany(p => p.SklepRola) + .HasForeignKey(d => d.CentrRolaId) + .HasConstraintName("Ref_SklepRolaRola"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepRola) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SklepRolaSklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepRolaId, e.Rodzaj }).HasName("PK_SKLROLAUPR"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepRola).WithMany(p => p.SklepRolaUprawnienie) + .HasForeignKey(d => new { d.SklepId, d.SklepRolaId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklRolaUprSklRola"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.PMId, e.Znaczenie, e.SklepDokId, e.Kolejnosc }).HasName("PK_SKLEPROZPRTMAG"); + + entity.HasIndex(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.Znaczenie, e.PMId }, "idx_SkRozPrtMagPoz"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.IloscPrt).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepPozDok).WithMany(p => p.SklepRozPrtMag) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRozPrtMagPoz"); + + entity.HasOne(d => d.SklepPrtMag).WithMany(p => p.SklepRozPrtMag) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId, d.PMId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkRozPrtMagPrt"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Znaczenie, e.Stawka }).HasName("PK_SKLROZBDODDOK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepRozbicieDodDok) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklepRozbDodDokDok"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Stawka }).HasName("PK_SKLEPROZBICIEDOK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Netto).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.NettoMag).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Podatek).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PodatekMag).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepRozbicieDok) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPROZ_REF_SKLEP_SKLEPDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.RozSklepDokId, e.RozKolejnosc, e.PrtSklepDokId, e.PrtKolejnosc }).HasName("PK_SKLEPROZLPARTII"); + + entity.HasIndex(e => new { e.SklepId, e.PrtSklepDokId, e.PrtKolejnosc }, "idx_SkRozPrt"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RozSklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PrtSklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepPartia).WithMany(p => p.SklepRozlPartii) + .HasForeignKey(d => new { d.SklepId, d.PrtSklepDokId, d.PrtKolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPROZ_REF_SKPRT_SKLEPPAR"); + + entity.HasOne(d => d.SklepPozDok).WithMany(p => p.SklepRozlPartii) + .HasForeignKey(d => new { d.SklepId, d.RozSklepDokId, d.RozKolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPROZ_REF_SKROZ_SKLEPPOZ"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc }).HasName("PK_SKLEPROZLICZA"); + + entity.HasIndex(e => new { e.RozliczanySklepId, e.RozliczanySklepDokId }, "idx_SkRozliczany"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RozliczanySklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.RozliczanySklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Rozliczenie).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.RozliczeniePodatku).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepRozliczaSklepDok) + .HasForeignKey(d => new { d.RozliczanySklepId, d.RozliczanySklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPROZ_REF_SKKOG_SKLEPDOK"); + + entity.HasOne(d => d.SklepDokNavigation).WithMany(p => p.SklepRozliczaSklepDokNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPROZ_REF_SKKTO_SKLEPDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDKId, e.Kolejnosc }).HasName("PK_SKSKLDEFKODU"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDKId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.SklepDefinicjaKodu).WithMany(p => p.SklepSkladnikDefinicjiKodu) + .HasForeignKey(d => new { d.SklepId, d.SklepDKId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKSKLDEFKODUDEFDOKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepSkWzId }).HasName("PK_SKLEPSKLADNIKWZORCA"); + + entity.HasIndex(e => new { e.SklepTowIdWzorca, e.Kolejnosc }, "idx_SkSkladnikWzorca_SkTowIdWzorca"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepSkWzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.SkWzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowIdWzorca).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepSkladnikWzorca) + .HasForeignKey(d => new { d.SklepId, d.SklepTowIdWzorca }) + .HasConstraintName("FK_SKSKLADNIKWZORCA_REFERENCE_SKTOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.Dzien, e.SklepTowId, e.PMId }).HasName("PK_SKLEPSTANPRTMAG"); + + entity.HasIndex(e => new { e.SklepId, e.SklepTowId, e.PMId, e.Dzien }, "idx_SkStanPrt"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.StanPrt).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepDzienRozl).WithMany(p => p.SklepStanPrtMag) + .HasForeignKey(d => new { d.SklepId, d.Dzien }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkStanPrtDzien"); + + entity.HasOne(d => d.SklepPrtMag).WithMany(p => p.SklepStanPrtMag) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId, d.PMId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkStanPrtMag"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.PMId, e.TypDanych }).HasName("PK_SKLEPSZCZEGPRTMAG"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepPrtMag).WithMany(p => p.SklepSzczegPrtMag) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId, d.PMId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SklepSzczegPrtMag"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Znaczenie }).HasName("PK_SKLEPTEKSTDOK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepTekstDok) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPTEK_REF_SKLEP_SKLEPDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId, e.Kolejnosc, e.Znaczenie }).HasName("PK_SKLEPTEKSTPOZ"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepPozDok).WithMany(p => p.SklepTekstPoz) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SklepTekstPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepZgId, e.Wersja, e.Kolejnosc }).HasName("PK_SKLEPTEKSTZGODY"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepZgoda).WithMany(p => p.SklepTekstZgody) + .HasForeignKey(d => new { d.SklepId, d.SklepZgId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKTXTZG_SKZGODA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }).HasName("PK_SKLEPTOWAKCYZA"); + + entity.HasIndex(e => new { e.SklepId, e.SklepGrAkcId }, "idx_SkTowAkcGr"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaMax).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleAkcJM).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KodCN) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Sklad).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SklepGrAkcId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepGrupaAkcyzowa).WithMany(p => p.SklepTowAkcyza) + .HasForeignKey(d => new { d.SklepId, d.SklepGrAkcId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkAkcTow"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowAkcyza) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkTowAkc"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }).HasName("PK_SKLEPTOWDODATEK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.DodSklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowDodatekSklepTowar) + .HasForeignKey(d => new { d.SklepId, d.DodSklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkDodTow"); + + entity.HasOne(d => d.SklepTowarNavigation).WithMany(p => p.SklepTowDodatekSklepTowarNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkTowDod"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Znaczenie }).HasName("PK_SKLEPTOWINTPARAM"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowIntParam) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SkTowIntParamSkTowar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }).HasName("PK_SKLEPTOWKOD"); + + entity.HasIndex(e => e.Kod, "idx_SklepKod"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.IleWKodzie).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Skrot) + .HasMaxLength(120) + .IsUnicode(false); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowKod) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPTOW_REF_KODSK_SKLEPTOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.ParId }); + + entity.HasIndex(e => e.ParId, "idx_SklepTowParWB_ParId"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZasobId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Par).WithMany(p => p.SklepTowParWiseBase) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklepTowParWB_ParId"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowParWiseBase) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklepTowParWB_SklepTowId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Znaczenie }).HasName("PK_SKLEPTOWPOWIAZANIE"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PowSklepTowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowPowiazanieSklepTowar) + .HasForeignKey(d => new { d.SklepId, d.PowSklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkPowTowPow_SkTow"); + + entity.HasOne(d => d.SklepTowarNavigation).WithMany(p => p.SklepTowPowiazanieSklepTowarNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SkTowPow_SkTow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.IdxRodzStrat }).HasName("PK_SKLEPTOWSTRATY"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NormaStrat).HasColumnType("decimal(10, 4)"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowStraty) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKTWSTR_TOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId }).HasName("PK_SKLEPTOWZAMIENNIK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZmId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepTowar).WithOne(p => p.SklepTowZamiennik) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklepTowZamiennik_Tow"); + + entity.HasOne(d => d.SklepZamiennik).WithMany(p => p.SklepTowZamiennik) + .HasForeignKey(d => new { d.SklepId, d.SklepZmId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklepTowZamiennik_Zam"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId, e.Kolejnosc }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZasobId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowZdjecia) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SkTowZdjecia_SkTow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTowId }).HasName("PK_SKLEPTOWAR"); + + entity.HasIndex(e => new { e.SklepId, e.SklepArtId }, "idx_SklepTowArt"); + + entity.HasIndex(e => new { e.SklepId, e.SklepProducent }, "idx_SklepTowProd"); + + entity.HasIndex(e => new { e.SklepId, e.TowId }, "idx_SklepTowSkTow"); + + entity.HasIndex(e => e.TowId, "idx_SklepTowTow"); + + entity.HasIndex(e => e.Zmiana, "idx_SklepTowZmiana"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Asortyment) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.CKU) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Cena5).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Cena6).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaEw).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CentrTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GrupaGTU) + .HasMaxLength(3) + .IsUnicode(false); + entity.Property(e => e.HurtRabat).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.IleWCalosci).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleWOpak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleWZgrzewce).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Indeks1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Indeks2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.JM) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Kategoria) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.KodCN) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KodKrajuPochodzenia) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.KodSklepu) + .HasMaxLength(30) + .IsUnicode(false); + entity.Property(e => e.Marza).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.MaxCenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.MinCenaSp).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.NocNarzut).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.NowoscOd).HasColumnType("datetime"); + entity.Property(e => e.Opis1) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis2) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis3) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis4) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.ProgPromocji).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PrzeliczJM) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Rezerwa1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Rezerwa2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.SklepArtId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepOpakId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepProducent).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepTowar) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPTOW_REF_SKLEP_SKLEP"); + + entity.HasOne(d => d.Tow).WithMany(p => p.SklepTowar) + .HasForeignKey(d => d.TowId) + .HasConstraintName("FK_SKLEPTOW_REF_SKLEP_TOWAR"); + + entity.HasOne(d => d.SklepArtykulNavigation).WithMany(p => p.SklepTowarNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepArtId }) + .HasConstraintName("FK_SKLEPTOW_REF_SKTOW_SKLEPART"); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepTowar) + .HasForeignKey(d => new { d.SklepId, d.SklepProducent }) + .HasConstraintName("FK_SKLEPTOW_REF_SKLEP_SKLEPKON"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepSkWzId, e.SklepTowId }).HasName("PK_SKLEPTOWARSKLADNIKA"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepSkWzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SklepSkladnikWzorca).WithMany(p => p.SklepTowarSkladnika) + .HasForeignKey(d => new { d.SklepId, d.SklepSkWzId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKTOWARSKLADNIKA_REFERENCE_SKSKLADNIKWZORCA"); + + entity.HasOne(d => d.SklepTowar).WithMany(p => p.SklepTowarSkladnika) + .HasForeignKey(d => new { d.SklepId, d.SklepTowId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKTOWARSKLADNIKA_REFERENCE_SKTOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTEId }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTEId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepTrescEmail) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .HasConstraintName("FK_SklepTrescEmail_Uz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTEId, e.Kolejnosc, e.Znaczenie }); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTEId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tresc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepTrescEmail).WithMany(p => p.SklepTrescEmailTekst) + .HasForeignKey(d => new { d.SklepId, d.SklepTEId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SklepTrescEmail_Pe"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepTypOsId }).HasName("PK_SKLEPTYPOS"); + + entity.HasIndex(e => e.TypOsId, "idx_SKTYPOS_TYPOS"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrTypOsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Komentarz) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.TypOsId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepTypOs) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKTYPOS_SKLEP"); + + entity.HasOne(d => d.TypOs).WithMany(p => p.SklepTypOs) + .HasForeignKey(d => d.TypOsId) + .HasConstraintName("FK_SKTYPOS_TYPOS"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepUzId, e.Rodzaj }).HasName("PK_SKLEPUPRAWNIENIE"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepUprawnienie) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPUPR_REF_SKUPR_SKLEPUZY"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepUzId }).HasName("PK_SKLEPUZYTKOWNIK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Haslo) + .HasMaxLength(50) + .IsUnicode(false); + entity.Property(e => e.HasloPrepaid) + .HasMaxLength(100) + .IsUnicode(false); + entity.Property(e => e.IdentPrepaid) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Identyfikator) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Jezyk) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.KodKasjera) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Nazwisko) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.OstZmianaHasla).HasColumnType("datetime"); + entity.Property(e => e.SklepProfilId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepUzytkownik) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPUZY_REF_SKUZ_SKLEP"); + + entity.HasOne(d => d.Uz).WithMany(p => p.SklepUzytkownik) + .HasForeignKey(d => d.UzId) + .HasConstraintName("FK_SKLEPUZYTKOWINK_REFERENCE_UZYTKOWNIK"); + + entity.HasOne(d => d.SklepProfil).WithMany(p => p.SklepUzytkownik) + .HasForeignKey(d => new { d.SklepId, d.SklepProfilId }) + .HasConstraintName("FK_SKLEPUZYTKOWINK_REFERENCE_SKLEPPROFIL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepWalId }).HasName("PK_SK_WALUTA"); + + entity.HasIndex(e => e.WalId, "idx_SkWal"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepWalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Skrot1) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Skrot100) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.WalId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepWaluta) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPWAL_REF_SKWAL_SKLEP"); + + entity.HasOne(d => d.Wal).WithMany(p => p.SklepWaluta) + .HasForeignKey(d => d.WalId) + .HasConstraintName("FK_SKLEPWAL_REF_SKWAL_WALUTA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepDokId }).HasName("PK_SKLEPZALEZNOSC"); + + entity.HasIndex(e => new { e.PoprzedniSklepId, e.PoprzedniSklepDokId }, "idx_SklepPoprzedniDokId"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PoprzedniSklepDokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PoprzedniSklepId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.SklepDok).WithMany(p => p.SklepZaleznoscSklepDok) + .HasForeignKey(d => new { d.PoprzedniSklepId, d.PoprzedniSklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPZAL_REF_SKDOD_SKLEPDOK"); + + entity.HasOne(d => d.SklepDokNavigation).WithOne(p => p.SklepZaleznoscSklepDokNavigation) + .HasForeignKey(d => new { d.SklepId, d.SklepDokId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKLEPZAL_REF_SKODD_SKLEPDOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepZmId }).HasName("PK_SKLEPZAMIENNIK"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.Tabela, e.Id, e.Typ }).HasName("PK_SKLEPZASOB"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Typ) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Sciezka) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepZasob) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SklepZasobSklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.Kiedy }).HasName("PK_SKLEPZDARZOS"); + + entity.HasIndex(e => new { e.SklepId, e.SklepUzId, e.Kiedy }, "idx_SKZDOSUZKIEDY"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKontrId, e.SklepZgId, e.DataDec }, "idx_SKZDOS_OSTDEC"); + + entity.HasIndex(e => new { e.SklepId, e.SklepKontrId, e.SklepZgId, e.Kiedy }, "idx_SKZDOS_OSTZGODA"); + + entity.HasIndex(e => new { e.SklepId, e.SklepTypOsId }, "idx_SKZDOS_SKTPOS"); + + entity.HasIndex(e => new { e.SklepId, e.SklepZgId }, "idx_SKZDOS_SKZG"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.DataDec).HasColumnType("datetime"); + entity.Property(e => e.DodPar) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.SklepTypOsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + + entity.HasOne(d => d.SklepKontr).WithMany(p => p.SklepZdarzOs) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKZDOS_SKKTH"); + + entity.HasOne(d => d.SklepTypOs).WithMany(p => p.SklepZdarzOs) + .HasForeignKey(d => new { d.SklepId, d.SklepTypOsId }) + .HasConstraintName("FK_SKZDOS_SKTPOS"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.SklepZdarzOs) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .HasConstraintName("FK_SKZDOSUZ"); + + entity.HasOne(d => d.SklepZgoda).WithMany(p => p.SklepZdarzOs) + .HasForeignKey(d => new { d.SklepId, d.SklepZgId }) + .HasConstraintName("FK_SKZDOS_SKZG"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepKontrId, e.Kiedy, e.Znaczenie }).HasName("PK_SKZDARZOSOPIS"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepKontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.SklepZdarzOs).WithMany(p => p.SklepZdarzOsOpis) + .HasForeignKey(d => new { d.SklepId, d.SklepKontrId, d.Kiedy }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKZDOSOPIS"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SklepId, e.SklepZgId }).HasName("PK_SKLEPZGODA"); + + entity.HasIndex(e => e.ZgId, "idx_SKZG_ZGODA"); + + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DaneOs) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Komentarz) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Zastosowania) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.SklepZgoda) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SKZG_SKLEP"); + + entity.HasOne(d => d.Zg).WithMany(p => p.SklepZgoda) + .HasForeignKey(d => d.ZgId) + .HasConstraintName("FK_SKZG_ZGODA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowID, e.SklepID, e.CzasID, e.SklepTowID }).HasName("PK_SPRZEDAZ"); + + entity.HasIndex(e => new { e.CzasID, e.SklepID, e.TowID }, "Sprzedaz_Czas_Sklep_Towar"); + + entity.HasIndex(e => new { e.CzasID, e.TowID, e.SklepID }, "Sprzedaz_Czas_Towar_Sklep"); + + entity.HasIndex(e => new { e.SklepID, e.TowID }, "Sprzedaz_Sklep_Towar"); + + entity.HasIndex(e => new { e.TowID, e.SklepID }, "Sprzedaz_Towar_Sklep"); + + entity.HasIndex(e => e.SklepID, "idx_Sprzedaz_SklepId"); + + entity.HasIndex(e => e.TowID, "idx_Sprzedaz_TowId"); + + entity.Property(e => e.TowID).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepID).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CzasID).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepTowID).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaSprzedazyBrutto).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.CenaSprzedazyNetto).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.CenaZakInne).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.CenaZakPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.CenaZakZakupy).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.CenaZakupuNetto).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlSprzedana).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlSztTowFakt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlSztTowHurt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlSztTowPar).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlSztTowPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlSztTowRozchody).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlTowFakt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlTowPar).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlZakInne).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlZakPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlZakZakupy).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.IlZakupiona).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.StanTowaru).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.Version) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.WartNetZapas).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzBrtFakt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzBrtHurt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzBrtPar).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzBrtPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzBrtRozchody).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzNetFakt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzNetHurt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzNetPar).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzNetPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartSprzNetRozchody).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakBrtFakt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakBrtHurt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakBrtPar).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakBrtPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakBrtRozchody).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakInne).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakNetFakt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakNetHurt).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakNetPar).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakNetPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakNetRozchody).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakPrzes).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartZakZakupy).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartoscSprzedazWCenieZakupu).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartoscSprzedazyBrutto).HasColumnType("decimal(14, 3)"); + entity.Property(e => e.WartoscSprzedazyNetto).HasColumnType("decimal(14, 3)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.Dzien, e.TowId, e.PMId }).HasName("PK_STANPRTMAG"); + + entity.HasIndex(e => new { e.TowId, e.PMId, e.Dzien }, "idx_StanPrt"); + + entity.Property(e => e.Dzien).HasColumnType("datetime"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.StanPrt).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.DzienNavigation).WithMany(p => p.StanPrtMag) + .HasForeignKey(d => d.Dzien) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_StanPrtDzien"); + + entity.HasOne(d => d.PrtMag).WithMany(p => p.StanPrtMag) + .HasForeignKey(d => new { d.TowId, d.PMId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_StanPrtMag"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.ZgId }).HasName("PK_STANZGODY"); + + entity.HasIndex(e => e.ZgId, "idx_STZG_ZG"); + + entity.HasIndex(e => e.Zmiana, "idx_STZG_ZMIANA"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DataDec).HasColumnType("datetime"); + entity.Property(e => e.Kiedy) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.StanZgody) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_STZG_KTH"); + + entity.HasOne(d => d.Zg).WithMany(p => p.StanZgody) + .HasForeignKey(d => d.ZgId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_STZG_ZG"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ModId).HasName("PK_STRUKTURA_7_3"); + + entity.Property(e => e.ModId).ValueGeneratedNever(); + entity.Property(e => e.Kiedy).HasColumnType("datetime"); + entity.Property(e => e.Wersja) + .HasMaxLength(40) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KodSubsys).HasName("PK_SUBSYS"); + + entity.HasIndex(e => new { e.TowId, e.KodSubsys }, "idx_SubsysTow"); + + entity.HasIndex(e => e.Zmiana, "idx_SubsysZmiana"); + + entity.Property(e => e.KodSubsys) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.DataDok).HasColumnType("datetime"); + entity.Property(e => e.IleWZgrzewce).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KodZgrzewki) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.NrDok) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Tow).WithMany(p => p.Subsys) + .HasForeignKey(d => d.TowId) + .HasConstraintName("FK_SUBSYS_TOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.PMId, e.TypDanych }).HasName("PK_SZCZEGPRTMAG"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.PrtMag).WithMany(p => p.SzczegPrtMag) + .HasForeignKey(d => new { d.TowId, d.PMId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_SzczegPrtMag"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.GrAkcId, e.OdDaty }).HasName("PK_TABELAAKCYZOWA"); + + entity.Property(e => e.GrAkcId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.OdDaty).HasColumnType("datetime"); + entity.Property(e => e.MinStawkaAkc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.ProcCenyMax).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.StawkaAkc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.GrAkc).WithMany(p => p.TabelaAkcyzowa) + .HasForeignKey(d => d.GrAkcId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_TabAkc"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Znaczenie }).HasName("PK_TEKSTDOK"); + + entity.HasIndex(e => new { e.Tekst, e.Znaczenie }, "idx_TekstDokTekstZnaczenie"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Dok).WithMany(p => p.TekstDok) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TEKSTDOK_REF_TEKST_DOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DokId, e.Kolejnosc, e.Znaczenie }).HasName("PK_TEKSTPOZ"); + + entity.HasIndex(e => e.Znaczenie, "idx_TekstPoz_Znaczenie"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.PozDok).WithMany(p => p.TekstPoz) + .HasForeignKey(d => new { d.DokId, d.Kolejnosc }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_TekstPoz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ZgId, e.Wersja, e.Kolejnosc }).HasName("PK_TEKSTZGODY"); + + entity.HasIndex(e => e.Zmiana, "idx_TXTZG_ZMIANA"); + + entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Zg).WithMany(p => p.TekstZgody) + .HasForeignKey(d => d.ZgId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TXTZG_ZGODA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.Kolejnosc }).HasName("PK_TOWAKCYZA"); + + entity.HasIndex(e => e.GrAkcId, "idx_TowAkcGr"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaMax).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.GrAkcId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.IleAkcJM).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KodCN) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Sklad).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.GrAkc).WithMany(p => p.TowAkcyza) + .HasForeignKey(d => d.GrAkcId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_AkcTow"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowAkcyza) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_TowAkc"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.Kolejnosc }).HasName("PK_TOWDODATEK"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.DodTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.DodTow).WithMany(p => p.TowDodatekDodTow) + .HasForeignKey(d => d.DodTowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_DodTow"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowDodatekTow) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_TowDod"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.Znaczenie }).HasName("PK_TOWIntPARAM"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowIntParam) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TowIntParamTowar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.KrajId }).HasName("PK_TOWKRAJ"); + + entity.HasIndex(e => new { e.KrajId, e.TowId }, "idx_KrajTow"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KrajId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Indeks1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Indeks2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Opis1) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis2) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis3) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis4) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Skrot) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Kraj).WithMany(p => p.TowKraj) + .HasForeignKey(d => d.KrajId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Ref_KrajTow"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowKraj) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Ref_TowKraj"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.ParId }); + + entity.HasIndex(e => e.ParId, "idx_TowParWB_ParId"); + + entity.HasIndex(e => e.ZasobId, "idx_TowParWB_ZasobId"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.ZasobId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Par).WithMany(p => p.TowParWiseBase) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TowParWB_ParId"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowParWiseBase) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TowParWB_TowId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.Znaczenie }).HasName("PK_TOWPOWIAZANIE"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PowTowId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.PowTow).WithMany(p => p.TowPowiazaniePowTow) + .HasForeignKey(d => d.PowTowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_PowTowPow_Tow"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowPowiazanieTow) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_TowPow_Tow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.IdxRodzStrat }).HasName("PK_TOWSTRATY"); + + entity.HasIndex(e => e.IdxRodzStrat, "idx_TwStrRS"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NormaStrat).HasColumnType("decimal(10, 4)"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowStraty) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TWSTR_TOW"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.IdxRodzStrat, e.SklepId }).HasName("PK_TOWSTRATYDLASKLEPU"); + + entity.HasIndex(e => e.SklepId, "idx_TwStrSk"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NormaStrat).HasColumnType("decimal(10, 4)"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.TowStratyDlaSklepu) + .HasForeignKey(d => d.SklepId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TWSTRSKL_SKL"); + + entity.HasOne(d => d.TowStraty).WithMany(p => p.TowStratyDlaSklepu) + .HasForeignKey(d => new { d.TowId, d.IdxRodzStrat }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TWSTRSKL_TWSTR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.ParId }).HasName("PK_TOWWARTOSC"); + + entity.HasIndex(e => new { e.ParId, e.Wartosc }, "idx_TowWartParIdWart"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Par).WithMany(p => p.TowWartosc) + .HasForeignKey(d => d.ParId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TOWWARTO_REF_PARTO_PARAMETR"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowWartosc) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TOWWARTO_REF_TOWWA_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TowId).HasName("PK_TOWZAMIENNIK"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZmId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Tow).WithOne(p => p.TowZamiennik) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TowZamiennik_Tow"); + + entity.HasOne(d => d.Zm).WithMany(p => p.TowZamiennik) + .HasForeignKey(d => d.ZmId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TowZamiennik_Zam"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TowId, e.Kolejnosc }); + + entity.HasIndex(e => e.ZasobId, "idx_TowZdjecia_ZasobId"); + + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZasobId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowZdjecia) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TowZdjecia_TowId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TowId).HasName("PK_TOWAR"); + + entity.HasIndex(e => e.ArtId, "idx_TowArtId"); + + entity.HasIndex(e => e.AsId, "idx_TowAsId"); + + entity.HasIndex(e => e.CKU, "idx_TowCKU"); + + entity.HasIndex(e => e.JMId, "idx_TowJMId"); + + entity.HasIndex(e => e.KatId, "idx_TowKatId"); + + entity.HasIndex(e => e.Kod, "idx_TowKod"); + + entity.HasIndex(e => e.KodZgrzewki, "idx_TowKodZgrzewki"); + + entity.HasIndex(e => e.Producent, "idx_TowProducent"); + + entity.HasIndex(e => e.Skrot, "idx_TowSkrot"); + + entity.HasIndex(e => e.Zmiana, "idx_TowZmiana"); + + entity.Property(e => e.TowId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ArtId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.AsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CKU) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Cena5).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Cena6).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDet).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaDod).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaEw).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaHurt).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CenaNoc).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.CentrTowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.GrupaGTU) + .HasMaxLength(3) + .IsUnicode(false); + entity.Property(e => e.HurtRabat).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.IleWCalosci).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.IleWZgrzewce).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Indeks1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Indeks2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.JMId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KatId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KodCN) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KodSklepu) + .HasMaxLength(30) + .IsUnicode(false); + entity.Property(e => e.KodZgrzewki) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.KrajIdPochodzenia).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Marza).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.MaxCenaZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.MinCenaSp).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.NocNarzut).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.NowoscOd).HasColumnType("datetime"); + entity.Property(e => e.Opis1) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis2) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis3) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Opis4) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Producent).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ProgPromocji).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.PrzeliczJM) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Rezerwa1) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Rezerwa2) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Skrot) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.SubsysKoduGlownego) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + entity.Property(e => e.ZmianaIstotna).HasColumnType("datetime"); + entity.Property(e => e.ZmianaTylkoCen).HasColumnType("datetime"); + + entity.HasOne(d => d.Art).WithMany(p => p.Towar) + .HasForeignKey(d => d.ArtId) + .HasConstraintName("FK_TOWAR_REF_TOWAR_ARTYKUL"); + + entity.HasOne(d => d.As).WithMany(p => p.Towar) + .HasForeignKey(d => d.AsId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TOWAR_REF_TOWAS_ASORT"); + + entity.HasOne(d => d.JM).WithMany(p => p.Towar) + .HasForeignKey(d => d.JMId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TOWAR_REF_TOWJM_JM"); + + entity.HasOne(d => d.Kat).WithMany(p => p.Towar) + .HasForeignKey(d => d.KatId) + .HasConstraintName("FK_TOWAR_REF_TOWKA_KATEGORI"); + + entity.HasOne(d => d.KrajIdPochodzeniaNavigation).WithMany(p => p.Towar) + .HasForeignKey(d => d.KrajIdPochodzenia) + .HasConstraintName("FK_Ref_TowarKrajPochodzenia"); + + entity.HasOne(d => d.ProducentNavigation).WithMany(p => p.Towar) + .HasForeignKey(d => d.Producent) + .HasConstraintName("FK_TOWAR_REF_PRODU_KONTRAHE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.SkWzId, e.TowId }).HasName("PK_TOWARSKLADNIKA"); + + entity.HasIndex(e => e.SkWzId, "idx_TowarSkladniaka"); + + entity.Property(e => e.SkWzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TowId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cena).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Ilosc).HasColumnType("decimal(15, 4)"); + + entity.HasOne(d => d.SkWz).WithMany(p => p.TowarSkladnika) + .HasForeignKey(d => d.SkWzId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TOWARSKLADNIKA_REFERENCE_SKLADNIKWZORCA"); + + entity.HasOne(d => d.Tow).WithMany(p => p.TowarSkladnika) + .HasForeignKey(d => d.TowId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TOWARSKLADNIKA_REFERENCE_TOWAR"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TEId); + + entity.Property(e => e.TEId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Uz).WithMany(p => p.TrescEmail) + .HasForeignKey(d => d.UzId) + .HasConstraintName("FK_TrescEmail_Uz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.TEId, e.Kolejnosc, e.Znaczenie }); + + entity.Property(e => e.TEId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tresc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.TE).WithMany(p => p.TrescEmailTekst) + .HasForeignKey(d => d.TEId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_TrescEmail_Pe"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TypOsId).HasName("PK_TYPOS"); + + entity.HasIndex(e => e.Zmiana, "idx_TYPOS_ZMIANA"); + + entity.Property(e => e.TypOsId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrTypOsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Komentarz) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.UlId); + + entity.Property(e => e.UlId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.MId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.MIdNavigation).WithMany(p => p.Ulica) + .HasForeignKey(d => d.MId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Ulica_MId"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.UzId, e.Rodzaj }).HasName("PK_UPRAWNIENIE"); + + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Uz).WithMany(p => p.Uprawnienie) + .HasForeignKey(d => d.UzId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_UPRAWNIE_REF_UZUPR_UZYTKOWN"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.UzNSId, e.Rodzaj }).HasName("PK_UPRAWNIENIENASKLEP"); + + entity.Property(e => e.UzNSId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.UzNS).WithMany(p => p.UprawnienieNaSklep) + .HasForeignKey(d => d.UzNSId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("Ref_UprNaSklepUzNaSklep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.UzNSId).HasName("PK_UZNASKLEP"); + + entity.HasIndex(e => e.Identyfikator, "idx_UzNaSklelp_Ident"); + + entity.HasIndex(e => new { e.SklepId, e.SklepUzId }, "idx_UzNaSklelp_SIdSUzId"); + + entity.Property(e => e.UzNSId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Haslo) + .HasMaxLength(50) + .IsUnicode(false); + entity.Property(e => e.HasloPrepaid) + .HasMaxLength(50) + .IsUnicode(false); + entity.Property(e => e.IdentPrePaid) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Identyfikator) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Jezyk) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.KodKasjera) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Nazwisko) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WymusZmianeHasla).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Sklep).WithMany(p => p.UzNaSklep) + .HasForeignKey(d => d.SklepId) + .HasConstraintName("Ref_UzNaSklepSklep"); + + entity.HasOne(d => d.SklepUzytkownik).WithMany(p => p.UzNaSklep) + .HasForeignKey(d => new { d.SklepId, d.SklepUzId }) + .HasConstraintName("Ref_UzNaSklepSklepUz"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.UzId).HasName("PK_UZYTKOWNIK"); + + entity.HasIndex(e => e.CentrUzId, "idx_CentrUzId"); + + entity.Property(e => e.UzId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrUzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrUzNSId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Haslo) + .HasMaxLength(50) + .IsUnicode(false); + entity.Property(e => e.HasloPrepaid) + .HasMaxLength(100) + .IsUnicode(false); + entity.Property(e => e.IdentPrepaid) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Identyfikator) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Jezyk) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.KodKasjera) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Nazwisko) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.OstZmianaHasla).HasColumnType("datetime"); + entity.Property(e => e.ProfilId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.WymusZmianeHasla).HasColumnType("datetime"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Profil).WithMany(p => p.Uzytkownik) + .HasForeignKey(d => d.ProfilId) + .HasConstraintName("FK_UZYTKOWINK_REFERENCE_PROFIL"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Stawka).HasName("PK_VAT"); + + entity.Property(e => e.Stawka).ValueGeneratedNever(); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WalId).HasName("PK_WALUTA"); + + entity.HasIndex(e => e.CentrWalId, "idx_CentrWalId"); + + entity.Property(e => e.WalId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrWalId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kod) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Kurs).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.KursZak).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Skrot1) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Skrot100) + .HasMaxLength(10) + .IsUnicode(false); + entity.Property(e => e.Spread).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.SpreadZak).HasColumnType("decimal(15, 4)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Upgrade).HasName("PK_WERSJA_7_2"); + + entity.Property(e => e.Upgrade).ValueGeneratedNever(); + entity.Property(e => e.Nazwa) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WzId).HasName("PK_WZORZEC"); + + entity.HasIndex(e => e.CentrWzId, "idx_CentrWzId"); + + entity.Property(e => e.WzId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrWzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Nazwa) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Opis) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Param1).HasColumnType("decimal(10, 4)"); + entity.Property(e => e.Param2).HasColumnType("decimal(10, 4)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.DokId).HasName("PK_ZALEZNOSC"); + + entity.HasIndex(e => e.PoprzedniDokId, "idx_PoprzedniDokId"); + + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.PoprzedniDokId).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Dok).WithOne(p => p.ZaleznoscDok) + .HasForeignKey(d => d.DokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZALEZNOS_REF_ODDOK_DOK"); + + entity.HasOne(d => d.PoprzedniDok).WithMany(p => p.ZaleznoscPoprzedniDok) + .HasForeignKey(d => d.PoprzedniDokId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZALEZNOS_REF_DODOK_DOK"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ZmId).HasName("PK_ZAMIENNIK"); + + entity.Property(e => e.ZmId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrZmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.Tabela, e.Id, e.Typ }).HasName("PK_ZASOB"); + + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Typ) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.Sciezka) + .HasMaxLength(255) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ZdarzLojId).HasName("PK_ZDARZLOJ"); + + entity.HasIndex(e => e.Cecha, "IxZdarzLoj_Cecha"); + + entity.HasIndex(e => e.DataCzas, "IxZdarzLoj_DataCzas"); + + entity.HasIndex(e => e.KodKarty, "IxZdarzLoj_KodKarty"); + + entity.HasIndex(e => e.KontoId, "IxZdarzLoj_KontoId"); + + entity.HasIndex(e => e.TransUUID, "IxZdarzLoj_TransUUID"); + + entity.Property(e => e.ZdarzLojId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Cecha) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.DataCzas).HasColumnType("datetime"); + entity.Property(e => e.DataCzasZapisu).HasColumnType("datetime"); + entity.Property(e => e.DokId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KartaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.KodKarty) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.KontoId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kwota).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.Opis) + .HasMaxLength(64) + .IsUnicode(false); + entity.Property(e => e.PosNo) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.RegulaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ShopNo) + .HasMaxLength(32) + .IsUnicode(false); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.StanPo).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.StanPrzed).HasColumnType("decimal(15, 4)"); + entity.Property(e => e.TransUUID) + .HasMaxLength(64) + .IsUnicode(false); + + entity.HasOne(d => d.Karta).WithMany(p => p.ZdarzLoj) + .HasForeignKey(d => d.KartaId) + .HasConstraintName("Ref_ZdarzKarta"); + + entity.HasOne(d => d.Konto).WithMany(p => p.ZdarzLoj) + .HasForeignKey(d => d.KontoId) + .HasConstraintName("Ref_ZdarzKonto"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.Kiedy }).HasName("PK_ZDARZOS"); + + entity.HasIndex(e => new { e.UzId, e.Kiedy }, "idx_ZDOSUZKIEDY"); + + entity.HasIndex(e => new { e.KontrId, e.ZgId, e.DataDec }, "idx_ZDOS_OSTDEC"); + + entity.HasIndex(e => new { e.KontrId, e.ZgId, e.Kiedy }, "idx_ZDOS_OSTZGODA"); + + entity.HasIndex(e => e.TypOsId, "idx_ZDOS_TPOS"); + + entity.HasIndex(e => e.ZgId, "idx_ZDOS_ZG"); + + entity.HasIndex(e => e.Zmiana, "idx_ZDOS_ZMIANA"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.DataDec).HasColumnType("datetime"); + entity.Property(e => e.DodPar) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.TypOsId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.UzId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.ZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Kontr).WithMany(p => p.ZdarzOs) + .HasForeignKey(d => d.KontrId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZDOS_KTH"); + + entity.HasOne(d => d.TypOs).WithMany(p => p.ZdarzOs) + .HasForeignKey(d => d.TypOsId) + .HasConstraintName("FK_ZDOS_TPOS"); + + entity.HasOne(d => d.Uz).WithMany(p => p.ZdarzOs) + .HasForeignKey(d => d.UzId) + .HasConstraintName("FK_ZDOSUZ"); + + entity.HasOne(d => d.Zg).WithMany(p => p.ZdarzOs) + .HasForeignKey(d => d.ZgId) + .HasConstraintName("FK_ZDOS_ZG"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KontrId, e.Kiedy, e.Znaczenie }).HasName("PK_ZDARZOSOPIS"); + + entity.Property(e => e.KontrId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Kiedy) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.ZdarzOs).WithMany(p => p.ZdarzOsOpis) + .HasForeignKey(d => new { d.KontrId, d.Kiedy }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZDOSOPIS"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ZgId).HasName("PK_ZGODA"); + + entity.HasIndex(e => e.Zmiana, "idx_ZG_ZMIANA"); + + entity.Property(e => e.ZgId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.CentrZgId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.DaneOs) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Komentarz) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Nazwa) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.Wersja) + .HasMaxLength(20) + .IsUnicode(false); + entity.Property(e => e.Zastosowania) + .HasMaxLength(120) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KasaId, e.ZlecId, e.Kolejnosc }).HasName("PK_ZLECKOMUNIKAT"); + + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZlecId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Zlecenie).WithMany(p => p.ZlecKomunikat) + .HasForeignKey(d => new { d.KasaId, d.ZlecId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZLECKOMU_REF_ZLECK_ZLECENIE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KasaId, e.ZlecId, e.ParNazwa }).HasName("PK_ZLECPARAM"); + + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZlecId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ParNazwa) + .HasMaxLength(40) + .IsUnicode(false); + entity.Property(e => e.ParWartosc) + .HasMaxLength(255) + .IsUnicode(false); + + entity.HasOne(d => d.Zlecenie).WithMany(p => p.ZlecParam) + .HasForeignKey(d => new { d.KasaId, d.ZlecId }) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZLECPARA_REF_ZLECP_ZLECENIE"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.KasaId, e.ZlecId }).HasName("PK_ZLECENIE"); + + entity.Property(e => e.KasaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.ZlecId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.NazwaDod) + .HasMaxLength(60) + .IsUnicode(false); + entity.Property(e => e.ParId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Utworzono).HasColumnType("datetime"); + entity.Property(e => e.Wstrzymanie) + .HasMaxLength(255) + .IsUnicode(false); + entity.Property(e => e.Zmiana).HasColumnType("datetime"); + + entity.HasOne(d => d.Kasa).WithMany(p => p.Zlecenie) + .HasForeignKey(d => d.KasaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZLECENIE_REF_ZLECK_KASA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ZmId).HasName("PK_ZMIANA"); + + entity.HasIndex(e => new { e.SklepId, e.TabId, e.Czas }, "idx_ZmSkTabIdCzas"); + + entity.HasIndex(e => new { e.TabId, e.Czas }, "idx_ZmTabIdCzas"); + + entity.HasIndex(e => e.SesjaId, "idx_ZmianaSesjaId"); + + entity.Property(e => e.ZmId) + .ValueGeneratedOnAdd() + .HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Czas).HasColumnType("datetime"); + entity.Property(e => e.SesjaId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.SklepId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.TabId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Tekst) + .HasMaxLength(40) + .IsUnicode(false); + + entity.HasOne(d => d.Sesja).WithMany(p => p.Zmiana) + .HasForeignKey(d => d.SesjaId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZMIANA_REF_SESJA_SESJA"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.ZmId, e.Id }).HasName("PK_ZMIANATABELI"); + + entity.Property(e => e.ZmId).HasColumnType("numeric(9, 0)"); + entity.Property(e => e.Id).HasColumnType("numeric(9, 0)"); + + entity.HasOne(d => d.Zm).WithMany(p => p.ZmianaTabeli) + .HasForeignKey(d => d.ZmId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_ZMIANATA_REF_ZMTAB_ZMIANA"); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +}