DotNet · 2022年4月18日

c#定义泛型方法

 public T getTargetEntity<T>(LocalPluginContext pPluginContext) where T : Entity{


            if (!pPluginContext.PluginExecutionContext.InputParameters.ContainsKey("Target"))
            {
                throw new ArgumentNullException("PurchaseOrder.preCreate lost InputParameters[Target] ");
            }
            T pTEntity = ((Entity)pPluginContext.PluginExecutionContext.InputParameters["Target"]).ToEntity<T>();
            return pTEntity;
        }

最新电影,电视剧,尽在午夜剧场

电影电视剧午夜不寂寞