Skip to content

Commit

Permalink
Release 6
Browse files Browse the repository at this point in the history
  • Loading branch information
smbadiwe committed Sep 13, 2016
1 parent cafbb5a commit b8105a8
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>$id$</id>
<version>1.0.0.5</version>
<version>1.0.0.6</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
Expand All @@ -13,7 +13,7 @@
<copyright>Copyright 2016</copyright>
<tags>SaaS MultiTenant MultiTenancy Framework Software-as-a-Service IoC SimpleInjector</tags>
<dependencies>
<dependency id="MultiTenancyFramework.Core" version="1.0.0.5" />
<dependency id="MultiTenancyFramework.Core" version="1.0.0.6" />
</dependencies>
</metadata>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>$id$</id>
<version>1.0.0.5</version>
<version>1.0.0.6</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
Expand All @@ -13,9 +13,9 @@
<copyright>$copyright$</copyright>
<tags>SaaS MultiTenant MultiTenancy Framework Software-as-a-Service MVC5 NHibernate FluentNHibernate</tags>
<dependencies>
<dependency id="MultiTenancyFramework.Core" version="1.0.0.5" />
<dependency id="MultiTenancyFramework.Mvc" version="1.0.0.5" />
<dependency id="MultiTenancyFramework.NHibernate" version="1.0.0.5" />
<dependency id="MultiTenancyFramework.Core" version="1.0.0.6" />
<dependency id="MultiTenancyFramework.Mvc" version="1.0.0.6" />
<dependency id="MultiTenancyFramework.NHibernate" version="1.0.0.6" />
</dependencies>
</metadata>
<files>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>$id$</id>
<version>1.0.0.5</version>
<version>1.0.0.6</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
Expand All @@ -13,7 +13,7 @@
<copyright>Copyright 2016</copyright>
<tags>SaaS MultiTenant MultiTenancy Framework Software-as-a-Service MVC5</tags>
<dependencies>
<dependency id="MultiTenancyFramework.Core" version="1.0.0.5" />
<dependency id="MultiTenancyFramework.Core" version="1.0.0.6" />
</dependencies>
</metadata>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using MultiTenancyFramework.Entities;
using System.Collections.Generic;

namespace MultiTenancyFramework.Data.Queries
{
public sealed class GetPhotosByOwnerIdAndImageTypeQuery : IDbQuery<IList<Photo>>
{
public string OwnerID { get; set; }
public ImageType ImageType { get; set; }
}
}
23 changes: 22 additions & 1 deletion MultiTenancyFramework.Core/Entities/Photo.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
namespace MultiTenancyFramework.Entities
{
/// <summary>
/// A person's photo record
/// </summary>
public class Photo : Entity
{
public virtual long OwnerID { get; set; }
/// <summary>
/// The ID representing the person that owns this photo record
/// </summary>
public virtual string OwnerID { get; set; }

/// <summary>
/// The image, as byte array, typically to be saved in the Database
/// </summary>
public virtual byte[] Image { get; set; }

/// <summary>
/// Url (filepath) of the image, use when you're saving the image to disk, not database
/// </summary>
public virtual string ImageUrl { get; set; }

/// <summary>
/// Image type
/// </summary>
public virtual ImageType ImageType { get; set; }

/// <summary>
/// Set to true by default.
/// </summary>
public override bool SkipAudit { get; set; } = true;
}
}
5 changes: 4 additions & 1 deletion MultiTenancyFramework.Core/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public enum ImageType
{
Passport = 0,
Picture,
Signature
Signature,
LeftThumbPrint,
RightThumbPrint,
Other = 99,
}

public enum Gender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<Compile Include="Commands\ICommandProcessor.cs" />
<Compile Include="Data\IDataInitializer.cs" />
<Compile Include="Data\IPrivilegeDAO.cs" />
<Compile Include="Data\Queries\GetPhotosByOwnerIdAndImageTypeQuery.cs" />
<Compile Include="Data\Queries\GetUserRoleByNameQuery.cs" />
<Compile Include="Data\Queries\GetPrivilegesByGridSearchParamsQuery.cs" />
<Compile Include="Entities\Privilege.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>$id$</id>
<version>1.0.0.5</version>
<version>1.0.0.6</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
Expand Down
16 changes: 16 additions & 0 deletions MultiTenancyFramework.NHibernate/Maps/PhotoMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using MultiTenancyFramework.Entities;

namespace MultiTenancyFramework.NHibernate.Maps
{
public class PhotoMap : EntityMap<Photo>
{
public PhotoMap()
{
Map(x => x.Name);
Map(x => x.Image);
Map(x => x.ImageUrl);
Map(x => x.ImageType);
Map(x => x.OwnerID);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Maps\PhotoMap.cs" />
<Compile Include="Maps\PrivilegeMap.cs" />
<Compile Include="PrivilegeDAO.cs" />
<Compile Include="AppUserDAO.cs" />
Expand Down Expand Up @@ -108,6 +109,7 @@
<Compile Include="NHManager\WebSessionStorage.cs" />
<Compile Include="NHUtils.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Queries\GetPhotosByOwnerIdAndImageTypeQueryHandler.cs" />
<Compile Include="Queries\GetUserRoleByNameQueryHandler.cs" />
<Compile Include="Queries\GetAppUsersByGridSearchParamsQueryHandler.cs" />
<Compile Include="Queries\GetDatabaseConnectionByNameAndConnectionStringQueryHandler.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>$id$</id>
<version>1.0.0.5</version>
<version>1.0.0.6</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
Expand All @@ -13,7 +13,7 @@
<copyright>$copyright$</copyright>
<tags>SaaS MultiTenant MultiTenancy Framework Software-as-a-Service MVC5 NHibernate FluentNHibernate</tags>
<dependencies>
<dependency id="MultiTenancyFramework.Core" version="1.0.0.5" />
<dependency id="MultiTenancyFramework.Core" version="1.0.0.6" />
</dependencies>
</metadata>
<files>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using MultiTenancyFramework.Data.Queries;
using MultiTenancyFramework.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MultiTenancyFramework.NHibernate.Queries
{
public sealed class GetPhotosByOwnerIdAndImageTypeQueryHandler
: CoreGeneralDAO, IDbQueryHandler<GetPhotosByOwnerIdAndImageTypeQuery, IList<Photo>>
{
public IList<Photo> Handle(GetPhotosByOwnerIdAndImageTypeQuery theQuery)
{
if (string.IsNullOrWhiteSpace(theQuery.OwnerID)) return new List<Photo>();

var session = BuildSession();
var query = session.QueryOver<Photo>()
.Where(x => x.OwnerID == theQuery.OwnerID)
.And(x => x.ImageType == theQuery.ImageType);
return query.List();
}
}
}
8 changes: 4 additions & 4 deletions WebTestsNuget/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<package id="Microsoft.Owin.Security.Cookies" version="2.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Security.OAuth" version="2.1.0" targetFramework="net461" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net461" />
<package id="MultiTenancyFramework.Core" version="1.0.0.5" targetFramework="net461" />
<package id="MultiTenancyFramework.Mvc" version="1.0.0.5" targetFramework="net461" />
<package id="MultiTenancyFramework.Mvc.NHibernate" version="1.0.0.5" targetFramework="net461" />
<package id="MultiTenancyFramework.NHibernate" version="1.0.0.5" targetFramework="net461" />
<package id="MultiTenancyFramework.Core" version="1.0.0.6" targetFramework="net461" />
<package id="MultiTenancyFramework.Mvc" version="1.0.0.6" targetFramework="net461" />
<package id="MultiTenancyFramework.Mvc.NHibernate" version="1.0.0.6" targetFramework="net461" />
<package id="MultiTenancyFramework.NHibernate" version="1.0.0.6" targetFramework="net461" />
<package id="MySql.Data" version="6.9.9" targetFramework="net461" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="NHibernate" version="4.0.0.4000" targetFramework="net461" />
Expand Down

0 comments on commit b8105a8

Please sign in to comment.