|
@@ -0,0 +1,67 @@
|
|
|
|
|
+// <auto-generated />
|
|
|
|
|
+using System;
|
|
|
|
|
+using System.Reflection;
|
|
|
|
|
+using Benchmarks.Model;
|
|
|
|
|
+using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
+using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
|
+
|
|
|
|
|
+#pragma warning disable 219, 612, 618
|
|
|
|
|
+#nullable disable
|
|
|
|
|
+
|
|
|
|
|
+namespace Benchmarks
|
|
|
|
|
+{
|
|
|
|
|
+ [EntityFrameworkInternal]
|
|
|
|
|
+ public partial class WorldEntityType
|
|
|
|
|
+ {
|
|
|
|
|
+ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType baseEntityType = null)
|
|
|
|
|
+ {
|
|
|
|
|
+ var runtimeEntityType = model.AddEntityType(
|
|
|
|
|
+ "Benchmarks.Model.World",
|
|
|
|
|
+ typeof(World),
|
|
|
|
|
+ baseEntityType,
|
|
|
|
|
+ propertyCount: 2,
|
|
|
|
|
+ keyCount: 1);
|
|
|
|
|
+
|
|
|
|
|
+ var id = runtimeEntityType.AddProperty(
|
|
|
|
|
+ "Id",
|
|
|
|
|
+ typeof(int),
|
|
|
|
|
+ propertyInfo: typeof(World).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly),
|
|
|
|
|
+ fieldInfo: typeof(World).GetField("<Id>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
|
|
|
|
|
+ valueGenerated: ValueGenerated.OnAdd,
|
|
|
|
|
+ afterSaveBehavior: PropertySaveBehavior.Throw,
|
|
|
|
|
+ sentinel: 0);
|
|
|
|
|
+ id.AddAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
|
|
|
+ id.AddAnnotation("Relational:ColumnName", "id");
|
|
|
|
|
+
|
|
|
|
|
+ var randomNumber = runtimeEntityType.AddProperty(
|
|
|
|
|
+ "RandomNumber",
|
|
|
|
|
+ typeof(int),
|
|
|
|
|
+ propertyInfo: typeof(World).GetProperty("RandomNumber", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly),
|
|
|
|
|
+ fieldInfo: typeof(World).GetField("<RandomNumber>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
|
|
|
|
|
+ sentinel: 0);
|
|
|
|
|
+ randomNumber.AddAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.None);
|
|
|
|
|
+ randomNumber.AddAnnotation("Relational:ColumnName", "randomnumber");
|
|
|
|
|
+
|
|
|
|
|
+ var key = runtimeEntityType.AddKey(
|
|
|
|
|
+ new[] { id });
|
|
|
|
|
+ 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", "world");
|
|
|
|
|
+ runtimeEntityType.AddAnnotation("Relational:ViewName", null);
|
|
|
|
|
+ runtimeEntityType.AddAnnotation("Relational:ViewSchema", null);
|
|
|
|
|
+
|
|
|
|
|
+ Customize(runtimeEntityType);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ static partial void Customize(RuntimeEntityType runtimeEntityType);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|