/// <summary> /// Compose operation signature. /// </summary> /// <returns> /// Operation signature string. /// </returns> /// <param name='operation'> /// Entity operation object /// </param> /// <param name='fullTypeName'> /// Use full names of types /// </param> public override string ToOperationSignature(IEntityOperation operation, bool fullTypeName) { StringBuilder sb = new StringBuilder(); if (operation.Params.HasReturns) { sb.AppendFormat("{0} ", ToTypeName(operation.Params.Returns.Type, operation.Params.Returns.TypeDefinition, fullTypeName)); } else { sb.AppendFormat("void "); } sb.AppendFormat("{0}(", operation.Name); int i = 0; foreach (IEntityOperationParam param in operation.Params) { if (i++ > 0) { sb.AppendFormat(", "); } sb.AppendFormat("{0}{1} {2}", param.IsOut ? "out " : param.IsRef ? "ref " : "", ToTypeName(param.Type, param.TypeDefinition, fullTypeName), param.Name); } sb.AppendFormat(")"); return(sb.ToString()); }
protected void SetOperationState(IEntityOperation operation) { Guard.Against <ArgumentNullException>(operation == null, "Ошибка установки состояния операции: не определен объект"); IsValidLastOperation = operation.IsValid; LastOperationErrorText = operation.ErrorText; }
// Method generation public virtual string ToOperationSignature(IEntityOperation operation, bool fullTypeName) { throw new NotSupportedException("Operation signature should be implemented in concrete environment"); }
public NaturalKeyedMemoryDbTable(IEntityOperation entityOperation) : base(entityOperation) { }
public SurrogateKeyedMemoryDbTable(IEntityOperation entityOperation) : base(entityOperation) { }
protected MemoryDbTable(IEntityOperation entityOperation) { EntityOperation = (EntityOperation <TEntity>)entityOperation; Relation = new Dictionary <TKey, TEntity>(StructuralEqualityComparer <TKey> .Instance); }
public static string GetParamClassPropertyName(IEntityOperation operation) { return(String.Format("{0}Params", operation.Name)); }
public string GetParamClassName(IEntityOperation operation, bool fullName) { return(String.Format("{0}{1}Params", environment.ToTypeName(operation.Entity, fullName), operation.Name)); }
public static string GetServiceMethodName(IEntityOperation operation) { return(operation.Name); }
public static string GetRestServicePath(IEntityOperation operation) { return(RestServiceHelper.GetRestServicePath(operation.Entity, operation.Name)); }