public void Apply(@class entity, IMappingModel model) { if (entityMatch.IsProperMatch(entity.name)) { bindAction(entity.name, model); } }
public void Apply(@class entity,IMappingModel model) { if (entityMatch.IsProperMatch(entity.name)) { bindAction(entity.name, model); } }
public void Apply(object member, IMappingModel model, Action <object> removeAction) { if (IsMatch(member)) { if (exclude) { removeAction(member); } else { foreach (var action in alterActions) { action.Alter(member); } } } }
public void Apply(object member,IMappingModel model, Action<object> removeAction) { if (IsMatch(member)) { if (exclude) { removeAction(member); } else { foreach (var action in alterActions) { action.Alter(member); } } } }
private void GenerateMappingCollection() { mappingCollection = new Dictionary <Type, IMappingModel>(); Func <Type, bool> query = t => t.IsClass && t.Name.Contains("Data") && !t.Name.Equals("BaseData") && t.Namespace.Contains("LMS.DomainModel.DomainObject"); Assembly dataAssembly = Assembly.Load(new AssemblyName("LMS.DomainModel")); List <Type> modelTypes = dataAssembly.GetTypes().Where(query).ToList(); foreach (Type modelType in modelTypes) { if (!mappingCollection.ContainsKey(modelType)) { IMappingModel mappingModel = MakeMappingModel(modelType); mappingCollection[modelType] = mappingModel; } } }
private void ApplyExceptions(string entityName, IMappingModel model) { foreach (var me in memberExceptions) { foreach (var v in model.GetPropertyOfEntity(entityName)) { me.Apply(v, model, p => model.RemoveProperty(entityName, (property)p)); } foreach (var v in model.GetCollectionsOfEntity(entityName)) { me.Apply(v, model, c => model.RemoveCollectionFromEntity(entityName, c)); } foreach (var v in model.GetManyToOnesOfEntity(entityName)) { me.Apply(v, model, mto => model.RemoveManyToOne(entityName, (manytoone)mto)); } } foreach (var alter in alterActions) { alter.Alter(model.GetClassFromEntityName(entityName)); } }
private void ApplyExceptions(string entityName, IMappingModel model) { foreach (var me in memberExceptions) { foreach (var v in model.GetPropertyOfEntity(entityName)) { me.Apply(v,model,p=>model.RemoveProperty(entityName,(property)p)); } foreach (var v in model.GetCollectionsOfEntity(entityName)) { me.Apply(v,model,c=>model.RemoveCollectionFromEntity(entityName,c)); } foreach (var v in model.GetManyToOnesOfEntity(entityName)) { me.Apply(v,model,mto=>model.RemoveManyToOne(entityName,(manytoone)mto)); } } foreach (var alter in alterActions) { alter.Alter(model.GetClassFromEntityName(entityName)); } }
public void Start() { Type modelType = typeof(T); mappingModel = LMSMapper.GetMappingModelForType(modelType); }