Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to netstandard 2.0 and add Linq support #12

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
093bce5
Add .vs folder to gitignore
whyer Dec 9, 2019
7e74e82
Fix how strings are compared in unit tests
whyer Dec 9, 2019
51f1348
Revert changes to how users are compared in queries
whyer Dec 9, 2019
c55973d
Remove checked in packages
whyer Dec 9, 2019
b3af357
Migrate to package references
whyer Dec 9, 2019
0b6b977
Upgrade xunit
whyer Dec 9, 2019
350828a
Remove checked in packages
whyer Dec 9, 2019
4994359
Upgrade to 4.6.1
whyer Dec 9, 2019
393afc7
Upgrade to NHibernate 5.2.6
whyer Dec 9, 2019
f391964
Fix errors after NHibernate upgrade
whyer Dec 9, 2019
af71d20
Add possibility to easy change between SqlLite and Sql Server
whyer Dec 9, 2019
844706f
Change Release Connections mode to auto and fexed test that broke
whyer Dec 9, 2019
c68b140
Change dependency to nuget
whyer Dec 9, 2019
bffb8f1
Remove build tool-script not used anymore
whyer Dec 9, 2019
d2955f7
Lower NHibernate version to 5.2.0
whyer Dec 9, 2019
12f1421
Remove unused variable
whyer Dec 9, 2019
457a69b
Cleanup app.config
whyer Dec 9, 2019
6db8492
Ugly hack to get correct msbuild
whyer Dec 9, 2019
7826e16
Convert to SDK projekt, netstandard2.0
whyer Dec 10, 2019
ed1f4b0
Remove ActiveRecord and Windsor projects
whyer Dec 10, 2019
f155fde
Add mapping files as embedded resources
whyer Dec 10, 2019
aea59b3
Move test project into Core-test project
whyer Dec 10, 2019
366c629
Add nuget metadata to project file
whyer Dec 10, 2019
5730523
Fix so we can switch to sql database
whyer Dec 12, 2019
c853db0
Fix xunit warnings
whyer Dec 13, 2019
bb06911
Begin work on linq
whyer Dec 13, 2019
a0d767c
Add filter for stuff on permission table
whyer Dec 13, 2019
7ddf476
Add session to linq overloads
whyer Dec 14, 2019
c04ccbe
Add xUnit logging to tests
whyer Dec 14, 2019
54e29b7
Extracting key from entity
whyer Dec 14, 2019
d9f675d
Add usergroups to query
whyer Dec 16, 2019
ea062b3
Add usergroup overload
whyer Dec 16, 2019
84adb03
Add back Rollback, some SQLite tests fail with commit
whyer Dec 16, 2019
cc4e276
Cleanup
whyer Dec 16, 2019
5e7b3b1
Remove session from method calls, use injected instead
whyer Dec 16, 2019
22ecbf9
Bump version to 2.0
whyer Dec 16, 2019
9f881c0
Tabs to spaces
whyer Dec 16, 2019
b2e3d60
Add missing XML comments
whyer Dec 16, 2019
e2b27a4
Remove need for change in IEntityInformationExtractor interface
whyer Dec 16, 2019
cc2ee93
Add AssemblyInfo to git
whyer Dec 20, 2019
70a7017
Remove old build scripts (psake)
whyer Dec 20, 2019
350cd49
Updated readme and added to nuget
whyer Dec 20, 2019
5653e6a
Add support for source package
whyer Dec 20, 2019
213f6b5
Lower dependency on LinqKit.Core
whyer Dec 20, 2019
3d07ab9
Change the interface to return a new query
whyer Dec 20, 2019
5937847
Add extension methods for queries and some tests
whyer Dec 21, 2019
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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ build/
*.suo
*.sln.cache
_ReSharper.*/
AssemblyInfo.cs
*.user
/Rhino.Security/Rhino.Security.xml
/Rhino.Security/Rhino.Security.XML
/Rhino.Security/Rhino.Security.XML
.vs
[Pp]ackages
11 changes: 1 addition & 10 deletions How to build.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
In order to build this project, you need to execute the psake build script from the PowerShell console.
You do this using the following command from the root project directory:

.\psake.ps1 default.ps1

You may need to allow script execution by running the following command as administrator:

Set-ExecutionPolicy unrestricted

Also note that the build script assume that you have git.exe on your path.
Open in Visual Studio 2019 and build. No special steps needed.
47 changes: 14 additions & 33 deletions Rhino.Security.ActiveRecord/Rhino.Security.ActiveRecord.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rhino.Security.ActiveRecord</RootNamespace>
<AssemblyName>Rhino.Security.ActiveRecord</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand All @@ -31,6 +31,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -41,6 +42,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -50,32 +52,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.ActiveRecord, Version=3.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Activerecord.3.0.0.1\lib\net35\Castle.ActiveRecord.dll</HintPath>
</Reference>
<Reference Include="Castle.ActiveRecord.Web, Version=0.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Activerecord.3.0.0.1\lib\net35\Castle.ActiveRecord.Web.dll</HintPath>
</Reference>
<Reference Include="Castle.Components.Validator, Version=2.5.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Components.Validator.2.5.0\lib\NET35\Castle.Components.Validator.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Castle.Core.3.1.0\lib\net35\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Iesi.Collections.3.3.1.4000\lib\Net35\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NHibernate.3.3.1.4000\lib\Net35\NHibernate.dll</HintPath>
</Reference>
<Reference Include="NHibernate.Search, Version=0.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Activerecord.3.0.0.1\lib\net35\NHibernate.Search.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
Expand All @@ -87,12 +66,6 @@
<Compile Include="RegisterRhinoSecurityModels.cs" />
<Compile Include="RhinoSecurity.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Rhino.Security\Rhino.Security.csproj">
<Project>{DBA372FE-3D52-45B3-AF82-B37696328764}</Project>
<Name>Rhino.Security</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
Expand All @@ -111,7 +84,15 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="Castle.Activerecord">
<Version>3.0.0.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Rhino.Security\Rhino.Security.csproj">
<Project>{2ffcef0e-cead-4187-bbcd-cb0f60cf09aa}</Project>
<Name>Rhino.Security</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
12 changes: 0 additions & 12 deletions Rhino.Security.ActiveRecord/packages.config

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
using NHibernate;
using NHibernate.Criterion;
using Rhino.Security.Interfaces;

namespace Rhino.Security.Tests
{
using System;

public class AccountInfromationExtractor : IEntityInformationExtractor<Account>
{
private readonly ISession session;

public AccountInfromationExtractor(ISession session)
{
this.session = session;
}

public Guid GetSecurityKeyFor(Account entity)
{
return entity.SecurityKey;
}

public string GetDescription(Guid securityKey)
{
Account account = session.CreateCriteria<Account>()
.Add(Restrictions.Eq("SecurityKey", securityKey))
.UniqueResult<Account>();
return string.Format("Account: {0}", account.Name);
}

/// <summary>
/// Gets the name of the security key property.
/// </summary>
/// <value>The name of the security key property.</value>
public string SecurityKeyPropertyName
{
get { return "SecurityKey"; }
}
}
using System.Linq.Expressions;
using NHibernate;
using NHibernate.Criterion;
using Rhino.Security.Interfaces;

namespace Rhino.Security.Tests
{
using System;

public class AccountInformationExtractor : IEntityInformationExtractor<Account>
{
private readonly ISession session;

public AccountInformationExtractor(ISession session)
{
this.session = session;
}

public Guid GetSecurityKeyFor(Account entity)
{
return entity.SecurityKey;
}

public string GetDescription(Guid securityKey)
{
Account account = session.CreateCriteria<Account>()
.Add(Restrictions.Eq("SecurityKey", securityKey))
.UniqueResult<Account>();
return string.Format("Account: {0}", account.Name);
}

/// <summary>
/// Gets the name of the security key property.
/// </summary>
/// <value>The name of the security key property.</value>
public string SecurityKeyPropertyName
{
get { return "SecurityKey"; }
}
}
}
43 changes: 0 additions & 43 deletions Rhino.Security.Tests/App.config

This file was deleted.

Loading