removing unused files

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041355
This commit is contained in:
loudej
2009-11-19 05:42:26 +00:00
parent 957a4b0127
commit baba3c3eca
3 changed files with 0 additions and 54 deletions

View File

@@ -1,42 +0,0 @@
using System;
using System.Linq;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;
namespace Orchard.Models.Records {
public abstract class ModelPartRecord {
public virtual int Id { get; set; }
public virtual ModelRecord Model { get; set; }
}
public class ModelPartRecordAlteration : IAutoMappingAlteration {
public void Alter(AutoPersistenceModel model) {
model.OverrideAll(mapping => {
var genericArguments = mapping.GetType().GetGenericArguments();
if (!genericArguments.Single().IsSubclassOf(typeof(ModelPartRecord))) {
return;
}
var type = typeof(Alteration<>).MakeGenericType(genericArguments);
var alteration = (IAlteration)Activator.CreateInstance(type);
alteration.Override(mapping);
});
}
interface IAlteration {
void Override(object mapping);
}
class Alteration<T> : IAlteration where T : ModelPartRecord {
public void Override(object o) {
var mapping = (AutoMapping<T>)o;
mapping.Id(x => x.Id).GeneratedBy.Foreign("Model");
mapping.HasOne(x => x.Model);
}
}
}
}

View File

@@ -1,6 +0,0 @@
namespace Orchard.Models.Records {
public class ModelRecord {
public virtual int Id { get; set; }
public virtual ModelTypeRecord ModelType { get; set; }
}
}

View File

@@ -1,6 +0,0 @@
namespace Orchard.Models.Records {
public class ModelTypeRecord {
public virtual int Id { get; set; }
public virtual string Name { get; set; }
}
}