当前位置: 首页>>代码示例>>C#>>正文


C# IModel类代码示例

本文整理汇总了C#中IModel的典型用法代码示例。如果您正苦于以下问题:C# IModel类的具体用法?C# IModel怎么用?C# IModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IModel类属于命名空间,在下文中一共展示了IModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DefaultSequenceUsed

 private bool DefaultSequenceUsed(IModel model) =>
     model != null
     && model.Npgsql().DefaultSequenceName == null
     && (model.Npgsql().ValueGenerationStrategy == NpgsqlValueGenerationStrategy.Sequence
         || model.EntityTypes.SelectMany(t => t.GetProperties()).Any(
             p => p.Npgsql().ValueGenerationStrategy == NpgsqlValueGenerationStrategy.Sequence
                  && p.Npgsql().SequenceName == null));
开发者ID:Emill,项目名称:Npgsql,代码行数:7,代码来源:NpgsqlModelDiffer.cs

示例2: CreateInsertParameters

        public override List<SqlParameter> CreateInsertParameters(IModel obj, ref SqlParameter returnValue)
        {
            FinBusInvAllotDetail inv_finbusinvallotdetail = (FinBusInvAllotDetail)obj;

            List<SqlParameter> paras = new List<SqlParameter>();
            returnValue.Direction = ParameterDirection.Output;
            returnValue.SqlDbType = SqlDbType.Int;
            returnValue.ParameterName = "@DetailId";
            returnValue.Size = 4;
            paras.Add(returnValue);

            SqlParameter allotidpara = new SqlParameter("@AllotId", SqlDbType.Int, 4);
            allotidpara.Value = inv_finbusinvallotdetail.AllotId;
            paras.Add(allotidpara);

            SqlParameter businessinvoiceidpara = new SqlParameter("@BusinessInvoiceId", SqlDbType.Int, 4);
            businessinvoiceidpara.Value = inv_finbusinvallotdetail.BusinessInvoiceId;
            paras.Add(businessinvoiceidpara);

            SqlParameter financeinvoiceidpara = new SqlParameter("@FinanceInvoiceId", SqlDbType.Int, 4);
            financeinvoiceidpara.Value = inv_finbusinvallotdetail.FinanceInvoiceId;
            paras.Add(financeinvoiceidpara);

            SqlParameter allotbalapara = new SqlParameter("@AllotBala", SqlDbType.Decimal, 9);
            allotbalapara.Value = inv_finbusinvallotdetail.AllotBala;
            paras.Add(allotbalapara);

            SqlParameter detailstatuspara = new SqlParameter("@DetailStatus", SqlDbType.Int, 4);
            detailstatuspara.Value = (int)Common.StatusEnum.已生效;
            paras.Add(detailstatuspara);

            return paras;
        }
开发者ID:weiliji,项目名称:NFMT,代码行数:33,代码来源:FinBusInvAllotDetailDAL.cs

示例3: NameField

 /// <summary>
 /// Initializes a new instance of the NameField class with the specified id, parent node and
 /// references. 
 /// </summary>
 /// <param name="id">The id of the new NameField.</param>
 /// <param name="elementManager">A reference to the ElementManager.</param>
 /// <param name="model">A reference to the Model.</param>
 /// <param name="parentNode">A reference to the parent node of the NameField.</param>
 public NameField(String id, ElementManager elementManager, IModel model, IVisualNode parentNode)
 {
     _id = id;
     _elementManager = elementManager;
     _model = model;
     _parentNode = parentNode;
 }
开发者ID:HSchoenfelder,项目名称:Petedit,代码行数:15,代码来源:NameField.cs

示例4: BrokerWrapper

 internal BrokerWrapper(IConnectionBuilder connectionBuilder,
                        IModel model,
                        EnvironmentConfiguration configuration)
     : base(configuration, connectionBuilder)
 {
     _model = model;
 }
开发者ID:lsfera,项目名称:Carrot,代码行数:7,代码来源:Connecting.cs

示例5: saveBankInformation

        public TBankData saveBankInformation(IModel model)
        {
        //    try
        //    {
        //        bankModel = (BankModel)model;

                
        //        bankEntity.BankName = bankModel.BankName;
        //        bankEntity.Branch = bankModel.BankBranch;
        //        bankEntity.AccountNo = bankModel.BankAccountNumber;
        //        bankEntity.IFSC_CODE = bankModel.IFSCCode;
        //        bankEntity.MICR_CODE = bankModel.MICRCode;

        //        _dataContext.BankInfos.InsertOnSubmit(bankEntity);
        //        _dataContext.SubmitChanges();

        //        tbankData.SuccessCode = SuccessCodes.RECORD_SAVED_SUCCESSFULLY;
        //        tbankData.SuccessMessage = SuccessMessages.RECORD_SAVED_SUCCESSFULLY_MSG;

        //        return tbankData;
        //    }

        //    catch (Exception exp)
        //    {
        //        tbankData.ErrorCode = ErrorCodes.DATA_ACCESS_ERROR;
        //        tbankData.ErrorMessage = exp.StackTrace;
        //        return tbankData;

        //    }

            return null;
        }
开发者ID:AmitDebadwar,项目名称:MDK,代码行数:32,代码来源:BankDAL.cs

示例6: CallEventHandler

 /// <summary>
 /// Call the specified event on the specified model.
 /// </summary>
 /// <param name="model">The model to call the event on</param>
 /// <param name="eventName">The name of the event</param>
 /// <param name="args">The event arguments. Can be null</param>
 public static void CallEventHandler(IModel model, string eventName, object[] args)
 {
     foreach (EventSubscriber subscriber in FindEventSubscribers(eventName, model))
     {
         subscriber.MethodInfo.Invoke(model, args);
     }
 }
开发者ID:hol353,项目名称:ApsimX,代码行数:13,代码来源:Apsim.cs

示例7: Solution

 public Solution(IModel model, IProblemData problemData)
   : base(model, problemData) {
   Add(new Result(TrainingSharpeRatioResultName, "Share ratio of the signals of the model on the training partition", new DoubleValue()));
   Add(new Result(TestSharpeRatioResultName, "Sharpe ratio of the signals of the model on the test partition", new DoubleValue()));
   Add(new Result(TrainingProfitResultName, "Profit of the model on the training partition", new DoubleValue()));
   Add(new Result(TestProfitResultName, "Profit of the model on the test partition", new DoubleValue()));
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:7,代码来源:Solution.cs

示例8: Create

 public virtual IBasicProperties Create(IModel channel, MessageProperties properties)
 {
     var basicProperties = channel.CreateBasicProperties();
     if(!string.IsNullOrWhiteSpace(properties.MessageId))
     {
         basicProperties.MessageId = properties.MessageId;
     }
     if(!string.IsNullOrWhiteSpace(properties.CorrelationId))
     {
         basicProperties.CorrelationId = properties.CorrelationId;
     }
     if(!string.IsNullOrWhiteSpace(properties.ContentType))
     {
         basicProperties.ContentType = properties.ContentType;
     }
     if(!string.IsNullOrWhiteSpace(properties.ContentEncoding))
     {
         basicProperties.ContentEncoding = properties.ContentEncoding;
     }
     basicProperties.DeliveryMode = (byte) properties.DeliveryMode;
     if(properties.Headers.Keys.Any())
     {
         basicProperties.Headers = new Dictionary<object, object>();
         foreach(var key in properties.Headers.Keys)
         {
             basicProperties.Headers.Add(key, properties.Headers[key]);
         }
     }
     return basicProperties;
 }
开发者ID:swmal,项目名称:RabbitMQUtil,代码行数:30,代码来源:BasicPropertiesFactory.cs

示例9: RabbitMQMessageBus

        public RabbitMQMessageBus(IDependencyResolver resolver, string rabbitMqExchangeName, IModel rabbitMqChannel) : base(resolver)
        {
            _rabbitmqchannel = rabbitMqChannel;
            _rabbitmqExchangeName = rabbitMqExchangeName;

            EnsureConnection();
        }
开发者ID:Myslik,项目名称:SignalR.RabbitMQ,代码行数:7,代码来源:RabbitMQMessageBus.cs

示例10: DeclareQueue

		protected virtual void DeclareQueue(IModel channel)
		{
			if (this.DispatchOnly)
				return;

			var declarationArgs = new Dictionary<string, object>();
			if (this.DeadLetterExchange != null)
				declarationArgs[DeadLetterExchangeDeclaration] = this.DeadLetterExchange.ExchangeName;

			if (this.Clustered)
				declarationArgs[ClusteredQueueDeclaration] = ReplicateToAllNodes;

			var inputQueue = this.InputQueue;
			if (this.RandomInputQueue)
				inputQueue = string.Empty;

			var declaration = channel.QueueDeclare(
				inputQueue, this.DurableQueue, this.ExclusiveQueue, this.AutoDelete, declarationArgs);

			if (declaration != null)
				this.InputQueue = declaration.QueueName;

			if (!this.ReturnAddressSpecified)
				this.ReturnAddress = new Uri(DefaultReturnAddressFormat.FormatWith(this.InputQueue));

			if (this.PurgeOnStartup)
				channel.QueuePurge(this.InputQueue);

			channel.BasicQos(0, (ushort)this.ChannelBuffer, false);
		}
开发者ID:yonglehou,项目名称:NanoMessageBus,代码行数:30,代码来源:RabbitChannelGroupConfiguration.cs

示例11: EnsureNoShadowKeys

        protected void EnsureNoShadowKeys(IModel model)
        {
            foreach (var entityType in model.EntityTypes)
            {
                foreach (var key in entityType.GetKeys())
                {
                    if (key.Properties.Any(p => p.IsShadowProperty))
                    {
                        string message;
                        var referencingFk = model.GetReferencingForeignKeys(key).FirstOrDefault();
                        if (referencingFk != null)
                        {
                            message = Strings.ReferencedShadowKey(
                                Property.Format(key.Properties),
                                entityType.Name,
                                Property.Format(key.Properties.Where(p => p.IsShadowProperty)),
                                Property.Format(referencingFk.Properties),
                                referencingFk.DeclaringEntityType.Name);
                        }
                        else
                        {
                            message = Strings.ShadowKey(
                                Property.Format(key.Properties),
                                entityType.Name,
                                Property.Format(key.Properties.Where(p => p.IsShadowProperty)));
                        }

                        ShowWarning(message);
                    }
                }
            }
        }
开发者ID:JamesWang007,项目名称:EntityFramework,代码行数:32,代码来源:ModelValidator.cs

示例12: ColumnDefinition

        public override void ColumnDefinition(
            string schema, 
            string table, 
            string name, 
            string type, 
            bool nullable, 
            object defaultValue, 
            string defaultValueSql,
            string computedColumnSql, 
            IAnnotatable annotatable, 
            IModel model, 
            SqlBatchBuilder builder)
        {
            base.ColumnDefinition(
                schema, table, name, type, nullable, 
                defaultValue, defaultValueSql, computedColumnSql, annotatable, model, builder);

            var columnAnnotation = annotatable as Annotatable;
            var inlinePk = columnAnnotation?.FindAnnotation(SqliteAnnotationNames.Prefix + SqliteAnnotationNames.InlinePrimaryKey);

            if (inlinePk != null
                && (bool)inlinePk.Value)
            {
                builder.Append(" PRIMARY KEY");
                var autoincrement = columnAnnotation.FindAnnotation(SqliteAnnotationNames.Prefix + SqliteAnnotationNames.Autoincrement);
                if (autoincrement != null
                    && (bool)autoincrement.Value)
                {
                    builder.Append(" AUTOINCREMENT");
                }
            }
        }
开发者ID:JamesWang007,项目名称:EntityFramework,代码行数:32,代码来源:SqliteMigrationSqlGenerator.cs

示例13: Check

        /// <summary>
        ///   Выполняет проверку отношения переходов модели <paramref name = "model" />
        ///   на тотальность.
        /// </summary>
        /// <remarks>
        ///   Отношение переходов модели называется <i>тотальным</i>, если
        ///   из каждого состояния существует переход в некоторое состояние.
        /// </remarks>
        /// <param name = "model">Модель.</param>
        /// <exception cref = "ArgumentNullException"><paramref name = "model" /> является <c>null</c>.</exception>
        /// <returns><c>true</c>, если отношение переходов тотально.</returns>
        public static bool Check(IModel model)
        {
            if (model == null)
                throw new ArgumentNullException ("model");

            return model.States.All (s => model.Transitions (s).Count != 0);
        }
开发者ID:victorsamun,项目名称:NSimulator,代码行数:18,代码来源:ModelTotalityChecker.cs

示例14: CreateInsertParameters

        public override List<SqlParameter> CreateInsertParameters(IModel obj, ref SqlParameter returnValue)
        {
            CorpDept corpdept = (CorpDept)obj;

            List<SqlParameter> paras = new List<SqlParameter>();
            returnValue.Direction = ParameterDirection.Output;
            returnValue.SqlDbType = SqlDbType.Int;
            returnValue.ParameterName = "@CorpEmpId";
            returnValue.Size = 4;
            paras.Add(returnValue);

            SqlParameter deptidpara = new SqlParameter("@DeptId", SqlDbType.Int, 4);
            deptidpara.Value = corpdept.DeptId;
            paras.Add(deptidpara);

            SqlParameter corpidpara = new SqlParameter("@CorpId", SqlDbType.Int, 4);
            corpidpara.Value = corpdept.CorpId;
            paras.Add(corpidpara);

            SqlParameter refstatuspara = new SqlParameter("@RefStatus", SqlDbType.Int, 4);
            refstatuspara.Value = corpdept.RefStatus;
            paras.Add(refstatuspara);

            return paras;
        }
开发者ID:weiliji,项目名称:NFMT,代码行数:25,代码来源:CorpDeptDAL.cs

示例15: SimpleShapeBase

        /// <summary>
        /// Initializes a new instance of the <see cref="T:SimpleShapeBase"/> class.
        /// </summary>
        /// <param name="model">the <see cref="IModel"/></param>
        public SimpleShapeBase(IModel model)
            : base(model)
        {
            mTextRectangle = Rectangle;

            mTextRectangle.Inflate(-TextRectangleInflation, -TextRectangleInflation);
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:11,代码来源:SimpleShapeBase.cs


注:本文中的IModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。