protected internal virtual MappingContext <T> ApplyChanges <T>(ControllerBase controller, T entity, string prefix, Mapping <T> mapping, PropertyRoute route, SortedList <string, string> inputs) where T : ModifiableEntity { using (HeavyProfiler.Log("ApplyChanges", () => typeof(T).TypeName())) using (new EntityCache(EntityCacheType.Normal)) { EntityCache.AddFullGraph((ModifiableEntity)entity); RootContext <T> ctx = new RootContext <T>(prefix, inputs, route, controller) { Value = entity }; mapping(ctx); return(ctx); } }
public static MappingContext <T> ApplyChanges <T>(this T entity, ControllerBase controller, string prefix = null, PropertyRoute route = null, SortedList <string, string> inputs = null) where T : ModifiableEntity { Mapping <T> mapping = (Mapping <T>)Navigator.EntitySettings(typeof(T)).UntypedMappingMain; return(ApplyChanges <T>(entity, controller, mapping, prefix, route, inputs)); }
public static MappingContext <T> ApplyChanges <T>(this T entity, ControllerBase controller, Mapping <T> mapping, string prefix = null, PropertyRoute route = null, SortedList <string, string> inputs = null) where T : ModifiableEntity { if (prefix == null) { prefix = controller.Prefix(); } if (inputs == null) { inputs = controller.ControllerContext.HttpContext.Request.Form.ToSortedList(prefix); } if (route == null) { if (!typeof(IRootEntity).IsAssignableFrom(typeof(T))) { throw new InvalidOperationException("In order to use ApplyChanges with EmbeddedEntities set 'route' argument"); } route = PropertyRoute.Root(typeof(T)); } return(Manager.ApplyChanges <T>(controller, entity, prefix, mapping, route, inputs)); }
public static MListMapping <T> AsMListMapping <T>(this Mapping <MList <T> > mapping) where T : class { return((MListMapping <T>)mapping.Target); }
public LiteMapping() { EntityMapping = Mapping.New <S>(); EntityHasChanges = AnyNonSpecialImput; }
public static EntityMapping <T> AsEntityMapping <T>(this Mapping <T> mapping) where T : ModifiableEntity { return((EntityMapping <T>)mapping.Target); }
public static AutoEntityMapping <T> AsAutoEntityMapping <T>(this Mapping <T> mapping) where T : class { return((AutoEntityMapping <T>)mapping.Target); }
public MListDictionaryMapping(Expression <Func <S, K> > getKeyExpression) : this(getKeyExpression, Mapping.New <S>()) { }
public static void RegisterValue <T>(Mapping <T> mapping) { MappingRepository <T> .Mapping = mapping; }
public MListCorrelatedMapping(Mapping <S> elementMapping) : base(elementMapping) { }
public MListMapping(Mapping <S> elementMapping) : base(elementMapping) { }
public BaseMListMapping <S> SetElementMapping(Mapping <S> elementMapping) { this.ElementMapping = elementMapping; return(this); }
public BaseMListMapping(Mapping <S> elementMapping) { this.ElementMapping = elementMapping; }
public BaseMListMapping() { ElementMapping = Mapping.New <S>(); }