-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incremental steps to netnative support
- Loading branch information
Nate McMaster
committed
Oct 19, 2015
1 parent
00355cc
commit 31f6f24
Showing
9 changed files
with
140 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
src/EntityFramework.Core/Properties/EntityFramework.Core.rd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> | ||
<Library> | ||
<Assembly Name="EntityFramework.Core" Activate="All" /> | ||
<!-- TODO optimize this for types that actually need reflection --> | ||
<Assembly Name="EntityFramework.Core" Dynamic="Required All" /> | ||
|
||
<!-- TODO https://github.com/aspnet/EntityFramework/issues/3477 --> | ||
<Type Name="Microsoft.Data.Entity.DbSet{TEntity}"> | ||
<GenericParameter Name="TEntity" Dynamic="Required All"/> | ||
<ImpliesType Name="Microsoft.Data.Entity.Utilities.ImpliedEntityType{TEntity}" Dynamic="Required All"/> | ||
</Type> | ||
|
||
</Library> | ||
</Directives> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#pragma warning disable 0169 | ||
|
||
using Microsoft.Data.Entity.Storage; | ||
using System; | ||
using Microsoft.Data.Entity.ChangeTracking.Internal; | ||
using Microsoft.Data.Entity.Metadata.Internal; | ||
|
||
namespace Microsoft.Data.Entity.Utilities | ||
{ | ||
// This code exists only to trick the ILC compliation to include metadata | ||
// about combinations of entity types and our internal types. | ||
// This is the jumping off point for a reasoning about what generic types | ||
// may exist at runtime. | ||
// https://github.com/aspnet/EntityFramework/issues/3477 | ||
internal class ImpliedEntityType<TEntity> | ||
where TEntity : class | ||
{ | ||
InternalImplyValuesAndTypes<TEntity> EntityValueProp; | ||
|
||
InternalImpliesTypes<TEntity> EntityProp; | ||
InternalImpliesTypes<char> CharProp; | ||
InternalImpliesTypes<short> Int16Prop; | ||
InternalImpliesTypes<ushort> UInt16Prop; | ||
InternalImpliesTypes<int> Int32Prop; | ||
InternalImpliesTypes<uint> UInt32Prop; | ||
InternalImpliesTypes<long> Int64Prop; | ||
InternalImpliesTypes<long> UInt64Prop; | ||
InternalImpliesTypes<double> DoubleProp; | ||
InternalImpliesTypes<decimal> DecimalProp; | ||
InternalImpliesTypes<float> FloatProp; | ||
InternalImpliesTypes<string> StringProp; | ||
InternalImpliesTypes<bool> BoolProp; | ||
InternalImpliesTypes<byte> ByteProp; | ||
InternalImpliesTypes<Guid> GuidProp; | ||
InternalImpliesTypes<TimeSpan> TimeSpanProp; | ||
InternalImpliesTypes<DateTime> DateTimeProp; | ||
InternalImpliesTypes<DateTimeOffset> DateTimeOffsetProp; | ||
} | ||
|
||
internal class InternalImpliesTypes<T> | ||
{ | ||
void CompileQuery() | ||
=> ((IDatabase)new object()).CompileQuery<T>(null); | ||
|
||
SimpleEntityKeyFactory<T> KeyFactoryType; | ||
} | ||
|
||
internal class InternalImplyTypes<TSystemType, TUserType> | ||
where TUserType : class | ||
{ | ||
ClrPropertyGetter<TUserType, TSystemType> ClrPropertyGetter; | ||
ClrPropertySetter<TUserType, TSystemType> ClrPropertySetter; | ||
} | ||
|
||
internal class InternalImplyValuesAndTypes<TEntity> | ||
where TEntity : class | ||
{ | ||
InternalImplyTypes<char, TEntity> CharProp; | ||
InternalImplyTypes<short, TEntity> Int16Prop; | ||
InternalImplyTypes<ushort, TEntity> UInt16Prop; | ||
InternalImplyTypes<int, TEntity> Int32Prop; | ||
InternalImplyTypes<uint, TEntity> UInt32Prop; | ||
InternalImplyTypes<long, TEntity> Int64Prop; | ||
InternalImplyTypes<long, TEntity> UInt64Prop; | ||
InternalImplyTypes<double, TEntity> DoubleProp; | ||
InternalImplyTypes<decimal, TEntity> DecimalProp; | ||
InternalImplyTypes<float, TEntity> FloatProp; | ||
InternalImplyTypes<string, TEntity> StringProp; | ||
InternalImplyTypes<bool, TEntity> BoolProp; | ||
InternalImplyTypes<byte, TEntity> ByteProp; | ||
InternalImplyTypes<Guid, TEntity> GuidProp; | ||
InternalImplyTypes<TimeSpan, TEntity> TimeSpanProp; | ||
InternalImplyTypes<DateTime, TEntity> DateTimeProp; | ||
InternalImplyTypes<DateTimeOffset, TEntity> DateTimeOffsetProp; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/EntityFramework.MicrosoftSqlServer/Properties/EntityFramework.MicrosoftSqlServer.rd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> | ||
<Library> | ||
<Assembly Name="EntityFramework.MicrosoftSqlServer" Dynamic="Required All" /> | ||
<!-- TODO optimize this for types that actually need reflection --> | ||
<Assembly Name="EntityFramework.MicrosoftSqlServer" Activate="All" /> | ||
</Library> | ||
</Directives> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters