mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 17:47:54 +08:00
removing unused files
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041355
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
namespace Orchard.Models.Records {
|
||||
public class ModelRecord {
|
||||
public virtual int Id { get; set; }
|
||||
public virtual ModelTypeRecord ModelType { get; set; }
|
||||
}
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
namespace Orchard.Models.Records {
|
||||
public class ModelTypeRecord {
|
||||
public virtual int Id { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user