public DataPortalMethodInfo() { #if !(ANDROID || IOS) && !NETFX_CORE TransactionalAttribute = new TransactionalAttribute(TransactionalTypes.Manual); #else TransactionalType = TransactionalTypes.Manual; #endif }
public DataPortalMethodInfo() { #if !SILVERLIGHT && !NETFX_CORE TransactionalAttribute = new TransactionalAttribute(TransactionalTypes.Manual); #else TransactionalType = TransactionalTypes.Manual; #endif }
public DataPortalMethodInfo(MethodInfo info) : this() { if (info != null) { this.RunLocal = IsRunLocal(info); this.TransactionalType = GetTransactionalType(info); } }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> /// <param name="transactionIsolationLevel"> /// Specifies override for transaction isolation level. /// Default can be specified in .config file via CslaTransactionIsolationLevel setting /// If none specified, Serializable level is used /// </param> /// <param name="timeoutInSeconds"> /// Timeout for transaction, in seconds /// </param> public TransactionalAttribute( TransactionalTypes transactionType, TransactionIsolationLevel transactionIsolationLevel, int timeoutInSeconds) { TransactionType = transactionType; TransactionIsolationLevel = transactionIsolationLevel; TimeoutInSeconds = timeoutInSeconds; }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> /// <param name="transactionIsolationLevel"> /// Specifies override for transaction isolation level. /// Default can be specified in .config file via CslaTransactionIsolationLevel setting /// If none specified, Serializable level is used /// </param> /// <param name="timeoutInSeconds"> /// Timeout for transaction, in seconds /// </param> public TransactionalAttribute( TransactionalTypes transactionType, TransactionIsolationLevel transactionIsolationLevel, int timeoutInSeconds) { TransactionType = transactionType; TransactionIsolationLevel = transactionIsolationLevel; TimeoutInSeconds = timeoutInSeconds; }
public DataPortalMethodInfo() { #if !SILVERLIGHT && !NETFX_CORE TransactionalAttribute = new TransactionalAttribute(TransactionalTypes.Manual); #else TransactionalType = TransactionalTypes.Manual; #endif }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> public TransactionalAttribute(TransactionalTypes transactionType) { TransactionType = transactionType; if (transactionType == TransactionalTypes.TransactionScope || transactionType == TransactionalTypes.EnterpriseServices) { TransactionIsolationLevel = ApplicationContext.DefaultTransactionIsolationLevel; TimeoutInSeconds = ApplicationContext.DefaultTransactionTimeoutInSeconds; } }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> public TransactionalAttribute(TransactionalTypes transactionType) { TransactionType = transactionType; if (transactionType == TransactionalTypes.TransactionScope || transactionType == TransactionalTypes.EnterpriseServices) { TransactionIsolationLevel = ApplicationContext.DefaultTransactionIsolationLevel; TimeoutInSeconds = ApplicationContext.DefaultTransactionTimeoutInSeconds; } }
public DataPortalMethodInfo(System.Reflection.MethodInfo info) : this() { if (info != null) { RunLocal = IsRunLocal(info); #if !(ANDROID || IOS) && !NETFX_CORE TransactionalAttribute = GetTransactionalAttribute(info); #else TransactionalType = TransactionalTypes.Manual; #endif } }
public DataPortalMethodInfo(System.Reflection.MethodInfo info) : this() { if (info != null) { RunLocal = IsRunLocal(info); #if !SILVERLIGHT && !NETFX_CORE TransactionalAttribute = GetTransactionalAttribute(info); #else TransactionalType = TransactionalTypes.Manual; #endif } }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> public TransactionalAttribute(TransactionalTypes transactionType) { TransactionType = transactionType; #if NETSTANDARD2_0 || NET5_0 || NET6_0 if (transactionType == TransactionalTypes.TransactionScope) #else if (transactionType == TransactionalTypes.TransactionScope || transactionType == TransactionalTypes.EnterpriseServices) #endif { TransactionIsolationLevel = ApplicationContext.DefaultTransactionIsolationLevel; TimeoutInSeconds = ApplicationContext.DefaultTransactionTimeoutInSeconds; } }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> /// <param name="transactionIsolationLevel"> /// Specifies override for transaction isolation level. /// Default can be specified in .config file via CslaTransactionIsolationLevel setting /// If none specified, Serializable level is used /// </param> /// <param name="asyncFlowOption"> /// Specifies the async flow option used to initialize /// the transaction. /// </param> public TransactionalAttribute( TransactionalTypes transactionType, TransactionIsolationLevel transactionIsolationLevel, TransactionScopeAsyncFlowOption asyncFlowOption) { TransactionType = transactionType; TransactionIsolationLevel = transactionIsolationLevel; #if NETSTANDARD2_0 if (transactionType == TransactionalTypes.TransactionScope) #else if (transactionType == TransactionalTypes.TransactionScope || transactionType == TransactionalTypes.EnterpriseServices) #endif { TimeoutInSeconds = ApplicationContext.DefaultTransactionTimeoutInSeconds; } AsyncFlowOption = asyncFlowOption; }
/// <summary> /// Marks a method to run within a COM+ /// transactional context. /// </summary> public TransactionalAttribute() { _type = TransactionalTypes.EnterpriseServices; }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> public TransactionalAttribute(TransactionalTypes transactionType) { _type = transactionType; }
private void Initialize(CodeTemplate template) { _namespace = (string)template.GetProperty("ClassNamespace"); _dalNamespace = (string)template.GetProperty("DalNamespace"); if (_dalNamespace == string.Empty) _dalNamespace = "Dal"; _objectName = (string)template.GetProperty("ObjectName"); _baseClass = (string)template.GetProperty("BaseClass"); //template settings _transactionType = (TransactionalTypes)template.GetProperty("TransactionalType"); _propertyAuthorization = (PropertyAccessSecurity)template.GetProperty("PropertyAuthorization"); _useSecurity = (bool)template.GetProperty("AuthorizationRules"); _codeGenMethod = (CodeGenerationMethod)template.GetProperty("GenerationMethod"); _classType = (GenerationClassType)template.GetProperty("ClassType"); //db commands _fetchCommand = string.Format(FetchCommandFormat, _objectName); _insertCommand = string.Format(InsertCommandFormat, _objectName); _updateCommand = string.Format(UpdateCommandFormat, _objectName); _deleteCommand = string.Format(DeleteCommandFormat, _objectName); }
private void LoadFromXml(CodeTemplate template) { //read from xml file string path = (string)template.GetProperty("XmlFilePath"); XmlTextReader xtr = new XmlTextReader(path); if(!MoveToObject(xtr, _objectName)) throw new ApplicationException(string.Format("Object {0} does not exist!", _objectName)); //read object attributes while (xtr.MoveToNextAttribute()) { switch (xtr.LocalName.ToLower()) { case "namespace": _namespace = xtr.Value; break; case "dalnamespace": _dalNamespace = xtr.Value; break; case "access": _access = xtr.Value; break; case "type": _objectType = (ObjectType)Enum.Parse(typeof(ObjectType), xtr.Value, true); break; case "base": _baseClass = xtr.Value; break; } } if (_entityName == string.Empty) _entityName = _objectName; //read object elements while (xtr.Read()) { if (xtr.NodeType == XmlNodeType.EndElement && xtr.LocalName.ToLower() == "object") break; //reach end of object node if (xtr.NodeType == XmlNodeType.Element) { switch (xtr.LocalName.ToLower()) { case "properties": LoadProperties(xtr); //read properties break; case "transactionaltype": _transactionType = (TransactionalTypes)Enum.Parse(typeof(TransactionalTypes), xtr.ReadElementString()); break; case "propertyauthorization": _propertyAuthorization = (PropertyAccessSecurity)Enum.Parse(typeof(PropertyAccessSecurity), xtr.ReadElementString()); break; case "authorizationrules": _useSecurity = bool.Parse(xtr.ReadElementString()); break; case "relationship": while (xtr.MoveToNextAttribute()) { switch (xtr.LocalName.ToLower()) { case "parent": _parent = xtr.Value; break; case "child": _child = xtr.Value; break; } } break; case "dbcommands": _dbName = xtr.GetAttribute("DbName"); while (xtr.Read()) { if (xtr.NodeType == XmlNodeType.EndElement && xtr.LocalName.ToLower() == "dbcommands") break; //reach end of properties node if (xtr.NodeType == XmlNodeType.Element) { switch (xtr.LocalName.ToLower()) { case "fetchcommand": _fetchCommand = xtr.ReadElementString(); break; case "insertcommand": _insertCommand = xtr.ReadElementString(); break; case "updatecommand": _updateCommand = xtr.ReadElementString(); break; case "deletecommand": _deleteCommand = xtr.ReadElementString(); break; } } } break; } } } //whild(xtr.Read()) xtr.Close(); }
/// <summary> /// Marks a method to run within the specified /// type of transactional context. /// </summary> /// <param name="transactionType"> /// Specifies the transactional context within which the /// method should run.</param> public TransactionalAttribute(TransactionalTypes transactionType) { _type = transactionType; }
/// <summary> /// Marks a method to run within a COM+ /// transactional context. /// </summary> public TransactionalAttribute() { _type = TransactionalTypes.TransactionScope; }
public DataPortalMethodInfo() { this.RunLocal = false; this.TransactionalType = TransactionalTypes.Manual; }
public void Invoke(Csla.DataPortalEventArgs args) { _transactionalType = args.DataPortalContext.TransactionalType; }
public void Invoke(Csla.DataPortalEventArgs args) { _transactionalType = args.DataPortalContext.TransactionalType; }
/// <summary> /// Marks a method to run within a COM+ /// transactional context. /// </summary> public TransactionalAttribute() { _type = TransactionalTypes.EnterpriseServices; }