|
| 1 | +// <auto-generated /> |
| 2 | +using System; |
| 3 | +using System.Collections.Generic; |
| 4 | +using System.Reflection; |
| 5 | +using EntityFrameworkCore.Jet.Storage.Internal; |
| 6 | +using Microsoft.EntityFrameworkCore.ChangeTracking; |
| 7 | +using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; |
| 8 | +using Microsoft.EntityFrameworkCore.Infrastructure; |
| 9 | +using Microsoft.EntityFrameworkCore.Metadata; |
| 10 | +using Microsoft.EntityFrameworkCore.Metadata.Internal; |
| 11 | +using Microsoft.EntityFrameworkCore.Scaffolding; |
| 12 | +using Microsoft.EntityFrameworkCore.Storage; |
| 13 | + |
| 14 | +#pragma warning disable 219, 612, 618 |
| 15 | +#nullable disable |
| 16 | + |
| 17 | +namespace TestNamespace |
| 18 | +{ |
| 19 | + [EntityFrameworkInternal] |
| 20 | + public partial class DependentDerivedEntityType |
| 21 | + { |
| 22 | + public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null) |
| 23 | + { |
| 24 | + var runtimeEntityType = model.AddEntityType( |
| 25 | + "Microsoft.EntityFrameworkCore.Scaffolding.CompiledModelTestBase+DependentDerived<byte?>", |
| 26 | + typeof(CompiledModelTestBase.DependentDerived<byte?>), |
| 27 | + baseEntityType, |
| 28 | + discriminatorProperty: "EnumDiscriminator", |
| 29 | + discriminatorValue: CompiledModelTestBase.Enum1.Two, |
| 30 | + propertyCount: 2); |
| 31 | + |
| 32 | + var data = runtimeEntityType.AddProperty( |
| 33 | + "Data", |
| 34 | + typeof(string), |
| 35 | + propertyInfo: typeof(CompiledModelTestBase.DependentDerived<byte?>).GetProperty("Data", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), |
| 36 | + fieldInfo: typeof(CompiledModelTestBase.DependentDerived<byte?>).GetField("<Data>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), |
| 37 | + nullable: true, |
| 38 | + maxLength: 20, |
| 39 | + unicode: false); |
| 40 | + data.SetGetter( |
| 41 | + string (CompiledModelTestBase.DependentDerived<byte?> instance) => DependentDerivedUnsafeAccessors<byte?>.Data(instance), |
| 42 | + bool (CompiledModelTestBase.DependentDerived<byte?> instance) => DependentDerivedUnsafeAccessors<byte?>.Data(instance) == null); |
| 43 | + data.SetSetter( |
| 44 | + CompiledModelTestBase.DependentDerived<byte?> (CompiledModelTestBase.DependentDerived<byte?> instance, string value) => |
| 45 | + { |
| 46 | + DependentDerivedUnsafeAccessors<byte?>.Data(instance) = value; |
| 47 | + return instance; |
| 48 | + }); |
| 49 | + data.SetMaterializationSetter( |
| 50 | + CompiledModelTestBase.DependentDerived<byte?> (CompiledModelTestBase.DependentDerived<byte?> instance, string value) => |
| 51 | + { |
| 52 | + DependentDerivedUnsafeAccessors<byte?>.Data(instance) = value; |
| 53 | + return instance; |
| 54 | + }); |
| 55 | + data.SetAccessors( |
| 56 | + string (IInternalEntry entry) => DependentDerivedUnsafeAccessors<byte?>.Data(((CompiledModelTestBase.DependentDerived<byte?>)(entry.Entity))), |
| 57 | + string (IInternalEntry entry) => DependentDerivedUnsafeAccessors<byte?>.Data(((CompiledModelTestBase.DependentDerived<byte?>)(entry.Entity))), |
| 58 | + string (IInternalEntry entry) => entry.ReadOriginalValue<string>(data, 4), |
| 59 | + string (IInternalEntry entry) => entry.GetCurrentValue<string>(data)); |
| 60 | + data.SetPropertyIndexes( |
| 61 | + index: 4, |
| 62 | + originalValueIndex: 4, |
| 63 | + shadowIndex: -1, |
| 64 | + relationshipIndex: -1, |
| 65 | + storeGenerationIndex: -1); |
| 66 | + data.TypeMapping = JetStringTypeMapping.Default.Clone( |
| 67 | + comparer: new ValueComparer<string>( |
| 68 | + bool (string v1, string v2) => v1 == v2, |
| 69 | + int (string v) => ((object)v).GetHashCode(), |
| 70 | + string (string v) => v), |
| 71 | + keyComparer: new ValueComparer<string>( |
| 72 | + bool (string v1, string v2) => v1 == v2, |
| 73 | + int (string v) => ((object)v).GetHashCode(), |
| 74 | + string (string v) => v), |
| 75 | + providerValueComparer: new ValueComparer<string>( |
| 76 | + bool (string v1, string v2) => v1 == v2, |
| 77 | + int (string v) => ((object)v).GetHashCode(), |
| 78 | + string (string v) => v), |
| 79 | + mappingInfo: new RelationalTypeMappingInfo( |
| 80 | + storeTypeName: "char(20)", |
| 81 | + size: 20, |
| 82 | + unicode: false, |
| 83 | + fixedLength: true)); |
| 84 | + data.AddAnnotation("Relational:IsFixedLength", true); |
| 85 | + |
| 86 | + var money = runtimeEntityType.AddProperty( |
| 87 | + "Money", |
| 88 | + typeof(decimal), |
| 89 | + precision: 9, |
| 90 | + scale: 3, |
| 91 | + sentinel: 0m); |
| 92 | + money.SetAccessors( |
| 93 | + decimal (IInternalEntry entry) => entry.ReadShadowValue<decimal>(3), |
| 94 | + decimal (IInternalEntry entry) => entry.ReadShadowValue<decimal>(3), |
| 95 | + decimal (IInternalEntry entry) => entry.ReadOriginalValue<decimal>(money, 5), |
| 96 | + decimal (IInternalEntry entry) => entry.GetCurrentValue<decimal>(money)); |
| 97 | + money.SetPropertyIndexes( |
| 98 | + index: 5, |
| 99 | + originalValueIndex: 5, |
| 100 | + shadowIndex: 3, |
| 101 | + relationshipIndex: -1, |
| 102 | + storeGenerationIndex: -1); |
| 103 | + money.TypeMapping = JetDecimalTypeMapping.Default.Clone( |
| 104 | + comparer: new ValueComparer<decimal>( |
| 105 | + bool (decimal v1, decimal v2) => v1 == v2, |
| 106 | + int (decimal v) => ((object)v).GetHashCode(), |
| 107 | + decimal (decimal v) => v), |
| 108 | + keyComparer: new ValueComparer<decimal>( |
| 109 | + bool (decimal v1, decimal v2) => v1 == v2, |
| 110 | + int (decimal v) => ((object)v).GetHashCode(), |
| 111 | + decimal (decimal v) => v), |
| 112 | + providerValueComparer: new ValueComparer<decimal>( |
| 113 | + bool (decimal v1, decimal v2) => v1 == v2, |
| 114 | + int (decimal v) => ((object)v).GetHashCode(), |
| 115 | + decimal (decimal v) => v), |
| 116 | + mappingInfo: new RelationalTypeMappingInfo( |
| 117 | + storeTypeName: "decimal(9,3)", |
| 118 | + precision: 9, |
| 119 | + scale: 3)); |
| 120 | + |
| 121 | + return runtimeEntityType; |
| 122 | + } |
| 123 | + |
| 124 | + public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) |
| 125 | + { |
| 126 | + var principalId = runtimeEntityType.FindProperty("PrincipalId"); |
| 127 | + var principalAlternateId = runtimeEntityType.FindProperty("PrincipalAlternateId"); |
| 128 | + var enumDiscriminator = runtimeEntityType.FindProperty("EnumDiscriminator"); |
| 129 | + var id = runtimeEntityType.FindProperty("Id"); |
| 130 | + var data = runtimeEntityType.FindProperty("Data"); |
| 131 | + var money = runtimeEntityType.FindProperty("Money"); |
| 132 | + var principal = runtimeEntityType.FindNavigation("Principal"); |
| 133 | + runtimeEntityType.SetOriginalValuesFactory( |
| 134 | + ISnapshot (IInternalEntry source) => |
| 135 | + { |
| 136 | + var structuralType8 = ((CompiledModelTestBase.DependentDerived<byte?>)(source.Entity)); |
| 137 | + return ((ISnapshot)(new Snapshot<long, Guid, CompiledModelTestBase.Enum1, byte?, string, decimal>(((ValueComparer<long>)(((IProperty)principalId).GetValueComparer())).Snapshot(source.GetCurrentValue<long>(principalId)), ((ValueComparer<Guid>)(((IProperty)principalAlternateId).GetValueComparer())).Snapshot(source.GetCurrentValue<Guid>(principalAlternateId)), ((ValueComparer<CompiledModelTestBase.Enum1>)(((IProperty)enumDiscriminator).GetValueComparer())).Snapshot(source.GetCurrentValue<CompiledModelTestBase.Enum1>(enumDiscriminator)), (source.GetCurrentValue<byte?>(id) == null ? null : ((ValueComparer<byte?>)(((IProperty)id).GetValueComparer())).Snapshot(source.GetCurrentValue<byte?>(id))), (source.GetCurrentValue<string>(data) == null ? null : ((ValueComparer<string>)(((IProperty)data).GetValueComparer())).Snapshot(source.GetCurrentValue<string>(data))), ((ValueComparer<decimal>)(((IProperty)money).GetValueComparer())).Snapshot(source.GetCurrentValue<decimal>(money))))); |
| 138 | + }); |
| 139 | + runtimeEntityType.SetStoreGeneratedValuesFactory( |
| 140 | + ISnapshot () => ((ISnapshot)(new Snapshot<long, Guid>(((ValueComparer<long>)(((IProperty)principalId).GetValueComparer())).Snapshot(default(long)), ((ValueComparer<Guid>)(((IProperty)principalAlternateId).GetValueComparer())).Snapshot(default(Guid)))))); |
| 141 | + runtimeEntityType.SetTemporaryValuesFactory( |
| 142 | + ISnapshot (IInternalEntry source) => ((ISnapshot)(new Snapshot<long, Guid>(default(long), default(Guid))))); |
| 143 | + runtimeEntityType.SetShadowValuesFactory( |
| 144 | + ISnapshot (IDictionary<string, object> source) => ((ISnapshot)(new Snapshot<long, Guid, CompiledModelTestBase.Enum1, decimal>((source.ContainsKey("PrincipalId") ? ((long)(source["PrincipalId"])) : 0L), (source.ContainsKey("PrincipalAlternateId") ? ((Guid)(source["PrincipalAlternateId"])) : new Guid("00000000-0000-0000-0000-000000000000")), (source.ContainsKey("EnumDiscriminator") ? ((CompiledModelTestBase.Enum1)(source["EnumDiscriminator"])) : CompiledModelTestBase.Enum1.Default), (source.ContainsKey("Money") ? ((decimal)(source["Money"])) : 0M))))); |
| 145 | + runtimeEntityType.SetEmptyShadowValuesFactory( |
| 146 | + ISnapshot () => ((ISnapshot)(new Snapshot<long, Guid, CompiledModelTestBase.Enum1, decimal>(default(long), default(Guid), default(CompiledModelTestBase.Enum1), default(decimal))))); |
| 147 | + runtimeEntityType.SetRelationshipSnapshotFactory( |
| 148 | + ISnapshot (IInternalEntry source) => |
| 149 | + { |
| 150 | + var structuralType8 = ((CompiledModelTestBase.DependentDerived<byte?>)(source.Entity)); |
| 151 | + return ((ISnapshot)(new Snapshot<long, Guid, object>(((ValueComparer<long>)(((IProperty)principalId).GetKeyValueComparer())).Snapshot(source.GetCurrentValue<long>(principalId)), ((ValueComparer<Guid>)(((IProperty)principalAlternateId).GetKeyValueComparer())).Snapshot(source.GetCurrentValue<Guid>(principalAlternateId)), source.GetCurrentValue<CompiledModelTestBase.PrincipalDerived<CompiledModelTestBase.DependentBase<byte?>>>(principal)))); |
| 152 | + }); |
| 153 | + runtimeEntityType.SetCounts(new PropertyCounts( |
| 154 | + propertyCount: 6, |
| 155 | + navigationCount: 1, |
| 156 | + complexPropertyCount: 0, |
| 157 | + complexCollectionCount: 0, |
| 158 | + originalValueCount: 6, |
| 159 | + shadowCount: 4, |
| 160 | + relationshipCount: 3, |
| 161 | + storeGeneratedCount: 2)); |
| 162 | + runtimeEntityType.AddAnnotation("Relational:FunctionName", null); |
| 163 | + runtimeEntityType.AddAnnotation("Relational:Schema", null); |
| 164 | + runtimeEntityType.AddAnnotation("Relational:SqlQuery", null); |
| 165 | + runtimeEntityType.AddAnnotation("Relational:TableName", "DependentBase<byte?>"); |
| 166 | + runtimeEntityType.AddAnnotation("Relational:ViewName", null); |
| 167 | + runtimeEntityType.AddAnnotation("Relational:ViewSchema", null); |
| 168 | + |
| 169 | + Customize(runtimeEntityType); |
| 170 | + } |
| 171 | + |
| 172 | + static partial void Customize(RuntimeEntityType runtimeEntityType); |
| 173 | + } |
| 174 | +} |
0 commit comments