Rebranded to EntityFrameworkCore.Projectables

This commit is contained in:
Koen Bekkenutte
2021-05-31 21:27:17 +08:00
parent e3eda6be69
commit 300aab0767
89 changed files with 141 additions and 141 deletions
@@ -2,11 +2,11 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EntityFrameworkCore.Projections</RootNamespace>
<RootNamespace>EntityFrameworkCore.Projectables</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\EntityFrameworkCore.Projections.Generator\EntityFrameworkCore.Projections.Generator.csproj" Pack="false">
<ProjectReference Include="..\EntityFrameworkCore.Projectables.Generator\EntityFrameworkCore.Projectables.Generator.csproj" Pack="false">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Content</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -15,7 +15,7 @@
<ItemGroup>
<!-- Package the generator in the analyzer directory of the nuget package -->
<None Include="$(OutputPath)\EntityFrameworkCore.Projections.Generator.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\EntityFrameworkCore.Projectables.Generator.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>
</Project>
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections
namespace EntityFrameworkCore.Projectables
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public sealed class ProjectableAttribute : Attribute
@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
namespace EntityFrameworkCore.Projections.Generator
namespace EntityFrameworkCore.Projectables.Generator
{
public static class Diagnostics
{
@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="..\EntityFrameworkCore.Projections\Services\ProjectionExpressionClassNameGenerator.cs" Link="ProjectionExpressionClassNameGenerator.cs" />
<Compile Include="..\EntityFrameworkCore.Projectables\Services\ProjectionExpressionClassNameGenerator.cs" Link="ProjectionExpressionClassNameGenerator.cs" />
</ItemGroup>
<ItemGroup>
@@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Generator
namespace EntityFrameworkCore.Projectables.Generator
{
public class ExpressionSyntaxRewriter : CSharpSyntaxRewriter
@@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace EntityFrameworkCore.Projections.Generator
namespace EntityFrameworkCore.Projectables.Generator
{
public class ParameterSyntaxRewriter : CSharpSyntaxRewriter
{
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Generator
namespace EntityFrameworkCore.Projectables.Generator
{
public class ProjectableDescriptor
{
@@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace EntityFrameworkCore.Projections.Generator
namespace EntityFrameworkCore.Projectables.Generator
{
public static class ProjectableInterpreter
{
@@ -32,7 +32,7 @@ namespace EntityFrameworkCore.Projections.Generator
}
var projectableAttributeTypeSymbol = context.Compilation.GetTypeByMetadataName("EntityFrameworkCore.Projections.ProjectableAttribute");
var projectableAttributeTypeSymbol = context.Compilation.GetTypeByMetadataName("EntityFrameworkCore.Projectables.ProjectableAttribute");
var projectableAttributeClass = memberSymbol.GetAttributes()
.Where(x => x.AttributeClass.Name == "ProjectableAttribute")
@@ -1,4 +1,4 @@
using EntityFrameworkCore.Projections.Services;
using EntityFrameworkCore.Projectables.Services;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Text;
@@ -10,7 +10,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Generator
namespace EntityFrameworkCore.Projectables.Generator
{
[Generator]
public class ProjectionExpressionGenerator : ISourceGenerator
@@ -67,7 +67,7 @@ namespace EntityFrameworkCore.Projections.Generator
);
resultBuilder.Append($@"
namespace EntityFrameworkCore.Projections.Generated
namespace EntityFrameworkCore.Projectables.Generated
#nullable disable
{{
public static class {generatedClassName}
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Generator
namespace EntityFrameworkCore.Projectables.Generator
{
public class SyntaxReceiver : ISyntaxReceiver
{
@@ -9,7 +9,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EntityFrameworkCore.Projections.Abstractions\EntityFrameworkCore.Projections.Abstractions.csproj" />
<ProjectReference Include="..\EntityFrameworkCore.Projectables.Abstractions\EntityFrameworkCore.Projectables.Abstractions.csproj" />
</ItemGroup>
</Project>
@@ -1,4 +1,4 @@
using EntityFrameworkCore.Projections.Infrastructure.Internal;
using EntityFrameworkCore.Projectables.Infrastructure.Internal;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using System;
@@ -8,15 +8,15 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Extensions
namespace EntityFrameworkCore.Projectables.Extensions
{
public static class DbContextOptionsExtensions
{
public static DbContextOptionsBuilder<TContext> UseProjections<TContext>(this DbContextOptionsBuilder<TContext> optionsBuilder)
public static DbContextOptionsBuilder<TContext> UseProjectables<TContext>(this DbContextOptionsBuilder<TContext> optionsBuilder)
where TContext : DbContext
=> (DbContextOptionsBuilder<TContext>)UseProjections((DbContextOptionsBuilder)optionsBuilder);
=> (DbContextOptionsBuilder<TContext>)UseProjectables((DbContextOptionsBuilder)optionsBuilder);
public static DbContextOptionsBuilder UseProjections(this DbContextOptionsBuilder optionsBuilder)
public static DbContextOptionsBuilder UseProjectables(this DbContextOptionsBuilder optionsBuilder)
{
var extension = optionsBuilder.Options.FindExtension<ProjectionOptionsExtension>() ?? new ProjectionOptionsExtension();
((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(extension);
@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Extensions
namespace EntityFrameworkCore.Projectables.Extensions
{
public static class TypeExtensions
{
@@ -4,10 +4,10 @@ using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using EntityFrameworkCore.Projections.Services;
using EntityFrameworkCore.Projectables.Services;
using Microsoft.EntityFrameworkCore.Query;
namespace EntityFrameworkCore.Projections.Infrastructure.Internal
namespace EntityFrameworkCore.Projectables.Infrastructure.Internal
{
public class CustomQueryTranslationPreprocessorFactory : IQueryTranslationPreprocessorFactory
{
@@ -10,7 +10,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Infrastructure.Internal
namespace EntityFrameworkCore.Projectables.Infrastructure.Internal
{
public class ProjectionOptionsExtension : IDbContextOptionsExtension
{
@@ -5,7 +5,7 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Services
namespace EntityFrameworkCore.Projectables.Services
{
public sealed class ExpressionArgumentReplacer : ExpressionVisitor
{
@@ -1,7 +1,7 @@
using System.Linq.Expressions;
using System.Reflection;
namespace EntityFrameworkCore.Projections.Services
namespace EntityFrameworkCore.Projectables.Services
{
public interface IProjectionExpressionResolver
{
@@ -5,7 +5,7 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Services
namespace EntityFrameworkCore.Projectables.Services
{
public sealed class ProjectableExpressionReplacer : ExpressionVisitor
{
@@ -4,11 +4,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projections.Services
namespace EntityFrameworkCore.Projectables.Services
{
public static class ProjectionExpressionClassNameGenerator
{
public const string Namespace = "EntityFrameworkCore.Projections.Generated";
public const string Namespace = "EntityFrameworkCore.Projectables.Generated";
public static string GenerateName(string? namespaceName, IEnumerable<string> nestedInClassNames, string memberName)
{
@@ -6,9 +6,9 @@ using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using EntityFrameworkCore.Projections.Extensions;
using EntityFrameworkCore.Projectables.Extensions;
namespace EntityFrameworkCore.Projections.Services
namespace EntityFrameworkCore.Projectables.Services
{
public sealed class ProjectionExpressionResolver : IProjectionExpressionResolver
{