static void EntityEventsGlobal_Saving(Entity ident) { if (ident.IsGraphModified && EntityKindCache.RequiresSaveOperation(ident.GetType()) && !AllowSaveGlobally && !IsSaveAllowedInContext(ident.GetType())) { throw new InvalidOperationException("Saving '{0}' is controlled by the operations. Use OperationLogic.AllowSave<{0}>() or execute {1}".FormatWith( ident.GetType().Name, operations.GetValue(ident.GetType()).Values .Where(IsExecuteNoLite) .CommaOr(o => o.OperationSymbol.Key))); } }
public static void TaskSetValueProperty(FrameworkElement fe, string route, PropertyRoute context) { DependencyProperty valueProperty = ValuePropertySelector.GetValue(fe.GetType()); bool isReadOnly = context.PropertyRouteType == PropertyRouteType.FieldOrProperty && context.PropertyInfo.IsReadOnly() || context.PropertyRouteType == PropertyRouteType.Mixin; if (!BindingOperations.IsDataBound(fe, valueProperty)) { Binding b = new Binding(route) { Mode = isReadOnly ? BindingMode.OneWay : BindingMode.TwoWay, NotifyOnValidationError = true, ValidatesOnExceptions = true, ValidatesOnDataErrors = true, }; fe.SetBinding(valueProperty, b); } }
public static Type Type(Type entityType) { return(PrimaryKeyType.GetValue(entityType)); }
public static IPropertyValidator?TryGetPropertyValidator(Type type, string property) { GenerateType(type); return(validators.GetValue(type).TryGetC(property)); }
private Expression BuildExtension(Type parentType, string key, Expression parentExpression) { LambdaExpression lambda = RegisteredExtensions.GetValue(parentType)[key].Lambda; return(ExpressionReplacer.Replace(Expression.Invoke(lambda, parentExpression))); }