Skip to content

Commit

Permalink
BaseRepository uses Paging extensions.
Browse files Browse the repository at this point in the history
Deleted deprecated, not used or experimental classes.
Changed assemebly version to 4.5.0.0
  • Loading branch information
cmendible committed Oct 29, 2014
1 parent a2e2e3e commit bd0b4d1
Show file tree
Hide file tree
Showing 45 changed files with 124 additions and 3,412 deletions.
4 changes: 2 additions & 2 deletions CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.2.0.0")]
[assembly: AssemblyVersion("4.5.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDelaySign(false)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: NeutralResourcesLanguage("en-US")]
27 changes: 1 addition & 26 deletions Hexa.Core.EntityFramework/AuditableContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Hexa.Core.Domain
public class AuditableContext : DbContext
{
public AuditableContext(string nameOrConnectionString)
: base(nameOrConnectionString)
: base(nameOrConnectionString)
{
}

Expand Down Expand Up @@ -67,31 +67,6 @@ protected void AuditEntities()
{
entry.Entity.UpdatedBy = userUniqueId;
entry.Entity.UpdatedAt = now;

var auditTrailFactory = IoC.TryGetInstance<IAuditTrailFactory>();
if (auditTrailFactory != null && auditTrailFactory.IsEntityRegistered(entry.Entity.GetType().Name))
{
string tableName = entry.Entity.GetType().Name;
IEnumerable<string> changedProperties = entry.CurrentValues.PropertyNames.Where(p => entry.Property(p).IsModified);

Guid changeSetUniqueId = GuidExtensions.NewCombGuid();

foreach (string property in changedProperties)
{
string propertyName = property;
object oldValue = entry.OriginalValues[property];
object newValue = entry.CurrentValues[property];
IEntityAuditTrail auditTrail = auditTrailFactory.CreateAuditTrail(
changeSetUniqueId,
tableName,
this.GetEntityUniqueId(entry.Entity),
propertyName, oldValue, newValue,
userUniqueId,
now);

this.Set(auditTrail.GetType()).Add(auditTrail);
}
}
}
}
}
Expand Down
32 changes: 0 additions & 32 deletions Hexa.Core.NHibernate/EventSourcing/EventDescriptorMap.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Hexa.Core.NHibernate/EventSourcing/LoadEventDescriptors.hbm.xml

This file was deleted.

73 changes: 0 additions & 73 deletions Hexa.Core.NHibernate/EventSourcing/NHEventStore.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Hexa.Core.NHibernate/Hexa.Core.NHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="EventSourcing\EventDescriptorMap.cs" />
<Compile Include="INHUnitOfWork.cs" />
<Compile Include="NHRepository.cs" />
<Compile Include="EventSourcing\NHEventStore.cs" />
<Compile Include="Conventions\EnumConvention.cs" />
<Compile Include="Conventions\ForeignKeyColumnNames.cs" />
<Compile Include="Conventions\ForeignKeyConstraintNames.cs" />
Expand Down Expand Up @@ -130,9 +128,6 @@
<Name>Hexa.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="EventSourcing\LoadEventDescriptors.hbm.xml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\msbuild.targets\CodeMetrics.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Expand Down
29 changes: 0 additions & 29 deletions Hexa.Core.NHibernate/Listeners/AuditEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,35 +74,6 @@ public bool OnPreUpdate(PreUpdateEvent @event)

DateTime updatedAt = DateTime.Now;

var auditTrailFactory = IoC.TryGetInstance<IAuditTrailFactory>();
if (auditTrailFactory != null && auditTrailFactory.IsEntityRegistered(@event.Persister.EntityName))
{
string tableName = @event.Persister.EntityName;
int[] changedPropertiesIdx = @event.Persister.FindDirty(
@event.State,
@event.OldState,
@event.Entity,
@event.Session.GetSessionImplementation());

Guid changeSetUniqueId = GuidExtensions.NewCombGuid();

foreach (int idx in changedPropertiesIdx)
{
string propertyName = @event.Persister.PropertyNames[idx];
object oldValue = @event.OldState[idx];
object newValue = @event.State[idx];
IEntityAuditTrail auditTrail = auditTrailFactory.CreateAuditTrail(
changeSetUniqueId,
tableName,
@event.Id.ToString(),
propertyName, oldValue, newValue,
userUniqueId,
updatedAt);

@event.Session.Save(auditTrail);
}
}

this._Set(@event.Persister, @event.State, "UpdatedBy", userUniqueId);
this._Set(@event.Persister, @event.State, "UpdatedAt", updatedAt);
auditable.UpdatedBy = userUniqueId;
Expand Down
Loading

0 comments on commit bd0b4d1

Please sign in to comment.