public override TBusinesEntity Reload(TBusinesEntity entity, IInclude <TBusinesEntity> include) { var reloadEntity = Reload(entity); include.Include(reloadEntity); return(reloadEntity); }
private object DoInclude(IInclude tag, IContainer parent, IValueStack stack) { var dal = ApplicationContext.Current.Dal; object component = CreateObject(stack, dal.GetScreenByName(tag.File)); if (!(component is IComponent)) { throw new Exception("Only Component container is allowed to be included"); } object[] controls = ((IContainer)component).Controls; if (parent != null) { foreach (var control in controls) { parent.AddChild(control); } return(parent); } // uglu hack: так как метод Build возвращает object, а нам нужно вернуть несколько объектов // , мы можем вернуть тут массив, но должны помнить, // что это массив (см. Controls/LayoutableContainerBehaviour.cs метод Inject) return(controls); }
public Task <Customer> GetCustomerById(int id, IInclude <Customer> include = null) { var query = base.Set.Where(x => x.Id == id); if (include != null) { query = include.GetIncludes()(query); } return(query.FirstOrDefaultAsync()); }
internal void AddToIncludeSet(TDiscriminant discriminant, IInclude include) { if (_includeByDiscriminantValue.ContainsKey(discriminant)) { throw new LinkItException( $"Invalid configuration for linked source {typeof(TLinkedSource).GetFriendlyName()}, polymorphic list target {{{LinkTarget.Expression}}}: cannot have more than one include with the same discriminant ({discriminant})." ); } _includeByDiscriminantValue.Add(discriminant, include); }
internal void AddToIncludeSet(TDiscriminant discriminant, IInclude include) { if (_includeByDiscriminantValue.ContainsKey(discriminant)) { throw new ArgumentException( $"{LinkTarget.Id}: cannot have many includes for the same discriminant ({discriminant})." ); } _includeByDiscriminantValue.Add(discriminant, include); }
public string ResolvePath(string path) { IInclude include = FindInclude(path); if (include != null) { return(VersionPath(include.Src, include.Version ?? Version)); } return(VersionPath(path, Version)); }
public IEnumerable <TBusinesEntity> Query(TQueryObject query, IInclude <TBusinesEntity> include) { var storeObjects = ExecuteQuery(DataContext, query); var mapper = _mapperGenerator(DataContext); return(storeObjects.ToList().Select(s => { var bEntity = mapper.MapStorageToBusines(s); include.Include(bEntity); return bEntity; })); }
/// <summary> /// Given an element parsed from a XAML file, this method unwraps the include's content and returns it, /// if it is an <see cref="IInclude"/>. /// </summary> /// <param name="maybeIncludeElement">Element parsed from a XAML file.</param> /// <returns>The given <paramref name="maybeIncludeElement"/> or its content, if it is an include.</returns> public static object UnwrapIncludesAndCleanup(object maybeIncludeElement) { IInclude include = maybeIncludeElement as IInclude; if (include == null) { return(maybeIncludeElement); } object content = include.PassContent(); object result = UnwrapIncludesAndCleanup(content); IDisposable disposable = include as IDisposable; if (disposable != null) { disposable.Dispose(); } return(result); }
private LoadLinkProtocolForLinkedSourceBuilder <TLinkedSource> AddNonPolymorphicLoadLinkExpression <TTargetProperty, TId>( Func <TLinkedSource, IEnumerable <TId> > getLookupIds, ILinkTarget <TLinkedSource, TTargetProperty> linkTarget, IInclude include) { var loadLinkExpression = new LoadLinkExpressionImpl <TLinkedSource, TTargetProperty, TId, bool>( getLookupIds, linkTarget, new IncludeSet <TLinkedSource, TTargetProperty, TId, bool>( new Dictionary <bool, IInclude> { { true, //always one include when not polymorphic include } }, link => true ) ); return(AddLoadLinkExpression(loadLinkExpression)); }
public IInclude <TEntity> With(IInclude <TEntity> include) { _include.With(include); return(this); }
public TreeNode(string name, IInclude model) : this(name) { NodeModel = model; }
public override IEnumerable <TBusinesEntity> LazyQuery(ISpecification <TBusinesEntity> specification, IInclude <TBusinesEntity> include) { foreach (var item in QueryBase(specification)) { include.Include(item); yield return(item); } }
public override IEnumerable <TBusinesEntity> Query(ISpecification <TBusinesEntity> specification, IInclude <TBusinesEntity> include) { var result = Query(specification); foreach (var item in result) { include.Include(item); } return(result); }
public AppointmentRepository(ClinicContext context, IInclude include) : base(context) { _include = include; }
public abstract IEnumerable <TBusinesEntity> LazyQuery(ISpecification <TBusinesEntity> specification, IInclude <TBusinesEntity> include);
public FolderNode(string name, IInclude model) : base(name, model) { }
public FileNode(string name, IInclude model) : base(name, model) { }
public IInclude <TBusinesEntity> With(IInclude <TBusinesEntity> include) { _Includes.Add(include); return(this); }
private object DoInclude(IInclude tag, IContainer parent, IValueStack stack) { var dal = ApplicationContext.Current.Dal; object component = CreateObject(stack, dal.GetScreenByName(tag.File)); if (!(component is IComponent)) throw new Exception("Only Component container is allowed to be included"); object[] controls = ((IContainer)component).Controls; if (parent != null) { foreach (var control in controls) parent.AddChild(control); return parent; } // uglu hack: так как метод Build возвращает object, а нам нужно вернуть несколько объектов // , мы можем вернуть тут массив, но должны помнить, // что это массив (см. Controls/LayoutableContainerBehaviour.cs метод Inject) return controls; }
public abstract TBusinesEntity Reload(TBusinesEntity entity, IInclude <TBusinesEntity> include);