public static IDataObjectAccess <TDataObject> Find <TDataObject>(this IEphorteContext ephorteContext, Expression <Func <TDataObject, bool> > predicate, params Expression <Func <TDataObject, object> >[] includeSelectors) where TDataObject : class { var relatedObjects = includeSelectors.Select(EvaluateMemberSelector).ToArray(); var result = ephorteContext.Find(typeof(TDataObject).Name, ExtractPrimaryKeyFromKeySelector(predicate), relatedObjects); return(new TypedDataObjectAccess <TDataObject>(result)); }
/// <summary> /// Gets the custom field descriptors. /// </summary> /// <param name="ephorteContext">The ephorte context.</param> /// <param name="dataObjectName">Name of the data object.</param> /// <param name="predicate">The predicate.</param> /// <param name="category">The category.</param> /// <returns></returns> public static ICollection <ICustomFieldDescriptor> GetCustomFieldDescriptors(this IEphorteContext ephorteContext, string dataObjectName, string predicate, string category) { var dataObject = ephorteContext.Create(dataObjectName); var dataObjectType = dataObject.GetType(); var predicateExpression = DynamicExpression.ParseLambda(dataObjectType, typeof(bool), predicate); var primaryKeys = ExtractPrimaryKeyFromKeySelector(predicateExpression); return(ephorteContext.GetCustomFieldDescriptors(dataObjectName, primaryKeys, category)); }
/// <summary> /// Finds the specified ephorte context. /// </summary> /// <param name="ephorteContext">The ephorte context.</param> /// <param name="dataObjectName">Name of the data object.</param> /// <param name="predicate">The predicate.</param> /// <param name="relatedObjects">The related objects.</param> /// <returns></returns> public static IDataObjectAccess Find(this IEphorteContext ephorteContext, string dataObjectName, string predicate, params string[] relatedObjects) { var dataObject = ephorteContext.Create(dataObjectName); var dataObjectType = dataObject.GetType(); var predicateExpression = DynamicExpression.ParseLambda(dataObjectType, typeof(bool), predicate); var primaryKeys = ExtractPrimaryKeyFromKeySelector(predicateExpression); return(ephorteContext.Find(dataObjectName, primaryKeys, relatedObjects)); }
protected override void OnEphorteContextChanged(IEphorteContext ephorteContext) { _ephorte = new EphorteContextHelper(ephorteContext); }
protected virtual void OnEphorteContextChanged(IEphorteContext ephorteContext) { }
public static ICollection <ICustomFieldDescriptor> GetCustomFieldDescriptors <TDataObject>(this IEphorteContext ephorteContext, Expression <Func <TDataObject, bool> > predicate, string category) { return(ephorteContext.GetCustomFieldDescriptors(typeof(TDataObject).Name, ExtractPrimaryKeyFromKeySelector(predicate), category)); }
/// <summary> /// Initializes the specified ephorte context. /// </summary> /// <typeparam name="TDataObject">The type of the data object.</typeparam> /// <param name="ephorteContext">The ephorte context.</param> /// <param name="dataObject">The data object.</param> /// <returns></returns> public static IDataObjectAccess <TDataObject> Initialize <TDataObject>(this IEphorteContext ephorteContext, TDataObject dataObject) where TDataObject : class { var result = ephorteContext.Initialize(dataObject); return(new TypedDataObjectAccess <TDataObject>(result)); }
/// <summary> /// Initializes the specified ephorte context. /// </summary> /// <typeparam name="TDataObject">The type of the data object.</typeparam> /// <param name="ephorteContext">The ephorte context.</param> /// <param name="dataObject">The data object.</param> /// <returns></returns> public static async Task <IDataObjectAccess <TDataObject> > InitializeAsync <TDataObject>(this IEphorteContext ephorteContext, TDataObject dataObject) where TDataObject : class { var result = await ephorteContext.InitializeAsync(dataObject); return(new TypedDataObjectAccess <TDataObject>(result)); }
/// <summary> /// Creates the specified ephorte context. /// </summary> /// <typeparam name="TDataObject">The type of the T data object.</typeparam> /// <param name="ephorteContext">The ephorte context.</param> /// <returns>``0.</returns> public static TDataObject Create <TDataObject>(this IEphorteContext ephorteContext) { return((TDataObject)ephorteContext.Create(typeof(TDataObject).Name)); }
public EphorteContextHelper(IEphorteContext ephorteContext) { _ephorteContext = ephorteContext; }
public Oms(Action <string> logInformation, NCoreFactory nCoreFactory) { _log = logInformation ?? throw new ArgumentNullException(nameof(logInformation)); EphorteContext = nCoreFactory.Create(); }