Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Devart.Data.SQLite.EF6" Version="5.14.1519" />
<PackageReference Include="EntityFramework" Version="6.3.0" />
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="coverlet.collector" Version="1.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Devart.Data.SQLite.EF6" Version="6.1.134" />
<PackageReference Include="EntityFramework" Version="6.4.4" />
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Highway.Data.EntityFramework\Highway.Data.EntityFramework.csproj" />
<ProjectReference Include="..\Highway.Data.Test\Highway.Data.Test.csproj" />
<ProjectReference Include="..\Highway.Data\Highway.Data.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Highway.Data.EntityFramework\Highway.Data.EntityFramework.csproj" />
<ProjectReference Include="..\Highway.Data.Test\Highway.Data.Test.csproj" />
<ProjectReference Include="..\Highway.Data\Highway.Data.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>8.0.0-Beta3</Version>
<Authors>Tim Rayburn, Devlin Liles</Authors>
<Description>The fastest and smoothest way to good architecture.</Description>
<Copyright>2012-2023 Devlin Liles</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>http://hwyfwk.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/highwayframework/highway.data</RepositoryUrl>
<PackageTags>Architecture ORM Repository Specification Productivity</PackageTags>
<PackageReleaseNotes />
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>
<PropertyGroup>
<Version>8.0.0-Beta3</Version>
<Authors>Tim Rayburn, Devlin Liles</Authors>
<Description>The fastest and smoothest way to good architecture.</Description>
<Copyright>2012-2023 Devlin Liles</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>http://hwyfwk.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/highwayframework/highway.data</RepositoryUrl>
<PackageTags>Architecture ORM Repository Specification Productivity</PackageTags>
<PackageReleaseNotes />
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net462</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>Highway.Data</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net462</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>Highway.Data</RootNamespace>
</PropertyGroup>

<ItemGroup>
<None Include="..\images\icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<None Remove="Highway.Data.EntityFramework.csproj.DotSettings" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Common.Logging" Version="3.4.1" />
<PackageReference Include="EntityFramework" Version="6.3.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\images\icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Highway.Data\Highway.Data.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Common.Logging" Version="3.4.1" />
<PackageReference Include="EntityFramework" Version="6.4.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Highway.Data\Highway.Data.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class AdvancedCommand : QueryBase, ICommand
/// <param name="context">The data context that the command is executed against</param>
public virtual void Execute(IDataContext context)
{
Context = context;
CheckContextAndQuery(ContextQuery);
DataSource = context;
CheckDataSourceAndQuery(ContextQuery);
ContextQuery((DataContext)context);
}
}
Expand Down
38 changes: 19 additions & 19 deletions src/Highway.Data.EntityFramework/QueryObjects/AdvancedQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ public class AdvancedQuery<T> : QueryBase, IQuery<T>
/// This executes the expression in ContextQuery on the context that is passed in, resulting in a
/// <see cref="IQueryable{T}" /> that is returned as an <see cref="IEnumerable{T}" />
/// </summary>
/// <param name="context">the data context that the query should be executed against</param>
/// <param name="dataSource">the data source that the query should be executed against</param>
/// <returns>
/// <see cref="IEnumerable{T}" />
/// </returns>
public virtual IEnumerable<T> Execute(IDataSource context)
public virtual IEnumerable<T> Execute(IDataSource dataSource)
{
return PrepareQuery(context);
return PrepareQuery(dataSource);
}

public string OutputQuery(IDataSource context)
public string OutputQuery(IDataSource dataSource)
{
var query = PrepareQuery(context);
var query = PrepareQuery(dataSource);

return query.ToString();
}
Expand Down Expand Up @@ -59,13 +59,13 @@ protected virtual IQueryable<T> AppendExpressions(IQueryable<T> query)
/// <returns>an <see cref="IQueryable{T}" /></returns>
protected virtual IQueryable<T> ExtendQuery()
{
return ContextQuery((DataContext)Context);
return ContextQuery((DataContext)DataSource);
}

protected virtual IQueryable<T> PrepareQuery(IDataSource context)
protected virtual IQueryable<T> PrepareQuery(IDataSource dataSource)
{
Context = context;
CheckContextAndQuery(ContextQuery);
DataSource = dataSource;
CheckDataSourceAndQuery(ContextQuery);
var query = ExtendQuery();

return AppendExpressions(query);
Expand All @@ -88,18 +88,18 @@ public class AdvancedQuery<TSelection, TProjection> : QueryBase, IQuery<TSelecti
/// This executes the expression in ContextQuery on the context that is passed in, resulting in a
/// <see cref="IQueryable{T}" /> that is returned as an <see cref="IEnumerable{T}" />
/// </summary>
/// <param name="context">the data context that the query should be executed against</param>
/// <param name="dataSource">the data source that the query should be executed against</param>
/// <returns>
/// <see cref="IEnumerable{T}" />
/// </returns>
public virtual IEnumerable<TProjection> Execute(IDataSource context)
public virtual IEnumerable<TProjection> Execute(IDataSource dataSource)
{
return PrepareQuery(context);
return PrepareQuery(dataSource);
}

public virtual string OutputQuery(IDataSource context)
public virtual string OutputQuery(IDataSource dataSource)
{
var query = PrepareQuery(context);
var query = PrepareQuery(dataSource);

return query.ToString();
}
Expand Down Expand Up @@ -128,18 +128,18 @@ protected virtual IQueryable<TProjection> AppendExpressions(IQueryable<TSelectio
/// <returns>an <see cref="IQueryable{TSelection}" /></returns>
protected virtual IQueryable<TSelection> ExtendQuery()
{
return Selector((DataContext)Context);
return Selector((DataContext)DataSource);
}

/// <summary>
/// Appends the projection to the query and prepares it for execution
/// </summary>
/// <param name="context">the context to prepare against</param>
/// <param name="dataSource">the source to prepare against</param>
/// <returns>The prepared but un-executed queryable</returns>
protected virtual IQueryable<TProjection> PrepareQuery(IDataSource context)
protected virtual IQueryable<TProjection> PrepareQuery(IDataSource dataSource)
{
Context = context;
CheckContextAndQuery(Selector);
DataSource = dataSource;
CheckDataSourceAndQuery(Selector);
var query = ExtendQuery();

return AppendExpressions(query);
Expand Down
10 changes: 5 additions & 5 deletions src/Highway.Data.EntityFramework/QueryObjects/AdvancedScalar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public class AdvancedScalar<T> : QueryBase, IScalar<T>
/// <summary>
/// Executes the expression against the passed in context
/// </summary>
/// <param name="context">The data context that the scalar query is executed against</param>
/// <param name="dataSource">The data source that the scalar query is executed against</param>
/// <returns>The instance of <typeparamref name="T" /> that the query materialized if any</returns>
public T Execute(IDataSource context)
public T Execute(IDataSource dataSource)
{
Context = context;
CheckContextAndQuery(ContextQuery);
DataSource = dataSource;
CheckDataSourceAndQuery(ContextQuery);

return ContextQuery((DataContext)context);
return ContextQuery((DataContext)dataSource);
}
}
}
10 changes: 5 additions & 5 deletions src/Highway.Data.EntityFramework/QueryObjects/SqlQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public class SqlQuery<T> : IQuery<T>

public string SqlStatement { get; set; }

public IEnumerable<T> Execute(IDataSource context)
public IEnumerable<T> Execute(IDataSource dataSource)
{
if (!(context is DbContext efContext))
if (!(dataSource is DbContext efContext))
{
throw new InvalidOperationException("You cannot execute EF Sql Queries against a non-EF context");
}
Expand All @@ -25,14 +25,14 @@ public IEnumerable<T> Execute(IDataSource context)
}
}

public string OutputQuery(IDataSource context)
public string OutputQuery(IDataSource dataSource)
{
return SqlStatement;
}

public string OutputSQLStatement(IDataSource context)
public string OutputSQLStatement(IDataSource dataSource)
{
return OutputQuery(context);
return OutputQuery(dataSource);
}
}
}
4 changes: 2 additions & 2 deletions src/Highway.Data.EntityFramework/QueryObjects/SqlScalar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public abstract class SqlScalar<T> : IScalar<T>
{
protected Func<SqlConnection, T> ContextQuery;

public T Execute(IDataSource context)
public T Execute(IDataSource dataSource)
{
var efContext = context as DbContext;
var efContext = dataSource as DbContext;
using (var conn = new SqlConnection(efContext.Database.Connection.ConnectionString))
{
return ContextQuery.Invoke(conn);
Expand Down
48 changes: 26 additions & 22 deletions src/Highway.Data.ReadonlyTests/Highway.Data.ReadonlyTests.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>c39235ad-b1cf-4ff5-999d-b7e0cf62b924</UserSecretsId>
</PropertyGroup>
<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>c39235ad-b1cf-4ff5-999d-b7e0cf62b924</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>
<ItemGroup>
<None Remove="Highway.Data.ReadonlyTests.csproj.DotSettings" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Highway.Data.EntityFramework\Highway.Data.EntityFramework.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Highway.Data.EntityFramework\Highway.Data.EntityFramework.csproj" />
</ItemGroup>

</Project>
30 changes: 13 additions & 17 deletions src/Highway.Data.Test/Highway.Data.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="coverlet.collector" Version="1.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Highway.Data\Highway.Data.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Highway.Data\Highway.Data.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public interface IEventInterceptor<in T> : IInterceptor
/// <summary>
/// Executes the interceptors that were applied during the domain creation
/// </summary>
/// <param name="context">The DataContext that the current interceptor is using</param>
/// <param name="dataSource">The data source that the current interceptor is using</param>
/// <param name="eventArgs">the EventArgs for the current event being intercepted</param>
/// <returns></returns>
InterceptorResult Apply(IDataSource context, T eventArgs);
InterceptorResult Apply(IDataSource dataSource, T eventArgs);
}

/// <summary>
Expand Down
Loading