예제 #1
0
 /// <summary>
 /// 创建Property
 /// </summary>
 public async Task DynamicPropertyTest()
 {
     var contractProperty = new DynamicProperty
     {
         PropertyName = "CompanyName", //我方公司名称
         InputType    = InputTypeBase.GetName <SingleLineStringInputType>(),
         Permission   = "",
         TenantId     = 1
     };
     await _dynamicPropertyManager.AddAsync(contractProperty);
 }
        public void AddAllowedInputType <TInputType>() where TInputType : IInputType
        {
            var inputTypeName = InputTypeBase.GetName <TInputType>();

            if (inputTypeName.IsNullOrWhiteSpace())
            {
                throw new ArgumentNullException(typeof(TInputType).FullName + "/" + nameof(inputTypeName));
            }

            if (_allowedInputTypes.ContainsKey(inputTypeName))
            {
                throw new Exception($"Input types must be unique.There is already an input type named \"{inputTypeName}\"");
            }

            _allowedInputTypes.Add(inputTypeName, typeof(TInputType));
        }