2024-05-16 10:37:44 +02:00

173 lines
9.5 KiB
C#

// <auto-generated />
using System;
using System.Collections.Generic;
using System.Reflection;
using Blink.Backoffice.Services.PcmDb.Entities;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.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("<TowId>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
afterSaveBehavior: PropertySaveBehavior.Throw,
sentinel: 0m);
towId.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone(
comparer: new ValueComparer<decimal>(
(decimal v1, decimal v2) => v1 == v2,
(decimal v) => v.GetHashCode(),
(decimal v) => v),
keyComparer: new ValueComparer<decimal>(
(decimal v1, decimal v2) => v1 == v2,
(decimal v) => v.GetHashCode(),
(decimal v) => v),
providerValueComparer: new ValueComparer<decimal>(
(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("<IdxRodzStrat>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
afterSaveBehavior: PropertySaveBehavior.Throw,
sentinel: (short)0);
idxRodzStrat.TypeMapping = SqlServerShortTypeMapping.Default.Clone(
comparer: new ValueComparer<short>(
(short v1, short v2) => v1 == v2,
(short v) => (int)v,
(short v) => v),
keyComparer: new ValueComparer<short>(
(short v1, short v2) => v1 == v2,
(short v) => (int)v,
(short v) => v),
providerValueComparer: new ValueComparer<short>(
(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("<NormaStrat>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
nullable: true);
normaStrat.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone(
comparer: new ValueComparer<decimal?>(
(Nullable<decimal> v1, Nullable<decimal> v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue,
(Nullable<decimal> v) => v.HasValue ? ((decimal)v).GetHashCode() : 0,
(Nullable<decimal> v) => v.HasValue ? (Nullable<decimal>)(decimal)v : default(Nullable<decimal>)),
keyComparer: new ValueComparer<decimal?>(
(Nullable<decimal> v1, Nullable<decimal> v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue,
(Nullable<decimal> v) => v.HasValue ? ((decimal)v).GetHashCode() : 0,
(Nullable<decimal> v) => v.HasValue ? (Nullable<decimal>)(decimal)v : default(Nullable<decimal>)),
providerValueComparer: new ValueComparer<decimal?>(
(Nullable<decimal> v1, Nullable<decimal> v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue,
(Nullable<decimal> v) => v.HasValue ? ((decimal)v).GetHashCode() : 0,
(Nullable<decimal> v) => v.HasValue ? (Nullable<decimal>)(decimal)v : default(Nullable<decimal>)),
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("<Odliczanie>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
sentinel: (short)0);
odliczanie.TypeMapping = SqlServerShortTypeMapping.Default.Clone(
comparer: new ValueComparer<short>(
(short v1, short v2) => v1 == v2,
(short v) => (int)v,
(short v) => v),
keyComparer: new ValueComparer<short>(
(short v1, short v2) => v1 == v2,
(short v) => (int)v,
(short v) => v),
providerValueComparer: new ValueComparer<short>(
(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("<Tow>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly));
var towStraty = principalEntityType.AddNavigation("TowStraty",
runtimeForeignKey,
onDependent: false,
typeof(ICollection<TowStraty>),
propertyInfo: typeof(Towar).GetProperty("TowStraty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly),
fieldInfo: typeof(Towar).GetField("<TowStraty>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);
}
}