• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CreateInsertParameters

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

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

            SqlParameter auditemptypepara = new SqlParameter("@AuditEmpType", SqlDbType.Int, 4);
            auditemptypepara.Value = wf_auditemp.AuditEmpType;
            paras.Add(auditemptypepara);

            SqlParameter valueidpara = new SqlParameter("@ValueId", SqlDbType.Int, 4);
            valueidpara.Value = wf_auditemp.ValueId;
            paras.Add(valueidpara);

            SqlParameter auditempstatuspara = new SqlParameter("@AuditEmpStatus", SqlDbType.Int, 4);
            auditempstatuspara.Value = wf_auditemp.AuditEmpStatus;
            paras.Add(auditempstatuspara);

            SqlParameter creatoridpara = new SqlParameter("@CreatorId", SqlDbType.Int, 4);
            creatoridpara.Value = obj.CreatorId;
            paras.Add(creatoridpara);

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


示例17: Add

        /// <summary>Adds a new model (as specified by the xml node) to the specified parent.</summary>
        /// <param name="parent">The parent to add the model to</param>
        /// <param name="node">The XML representing the new model</param>
        /// <returns>The newly created model.</returns>
        public static IModel Add(IModel parent, XmlNode node)
        {
            IModel modelToAdd = XmlUtilities.Deserialise(node, Assembly.GetExecutingAssembly()) as Model;

            // Get all child models
            List<IModel> modelsToNotify = Apsim.ChildrenRecursively(modelToAdd);

            // Call deserialised in all models.
            object[] args = new object[] { true };
            CallEventHandler(modelToAdd, "Deserialised", args);
            foreach (IModel modelToNotify in modelsToNotify)
                CallEventHandler(modelToNotify, "Deserialised", args);

            // Corrently parent all models.
            Add(parent, modelToAdd);

            // Ensure the model name is valid.
            Apsim.EnsureNameIsUnique(modelToAdd);

            // Call OnLoaded
            Apsim.CallEventHandler(modelToAdd, "Loaded", null);
            foreach (IModel child in modelsToNotify)
                Apsim.CallEventHandler(child, "Loaded", null);

            Locator(parent).Clear();

            return modelToAdd;
        }
开发者ID:hol353,项目名称:ApsimX,代码行数:32,代码来源:Apsim.cs


示例18: LogInDialogViewModel

		public LogInDialogViewModel(IModel model)
		{
			_model = model;
			_oAuth2Client = new OAuth2Client();
			InitializeModelEvents();
			InitializeRelayCommands();
		}
开发者ID:renatewegener,项目名称:PTM-CollectorLight,代码行数:7,代码来源:LogInDialogViewModel.cs


示例19: CreateUpdateParameters

        public override List<SqlParameter> CreateUpdateParameters(IModel obj)
        {
            SmsRead sm_smsread = (SmsRead)obj;

            List<SqlParameter> paras = new List<SqlParameter>();

            SqlParameter smsreadidpara = new SqlParameter("@SmsReadId", SqlDbType.Int, 4);
            smsreadidpara.Value = sm_smsread.SmsReadId;
            paras.Add(smsreadidpara);

            SqlParameter smsidpara = new SqlParameter("@SmsId", SqlDbType.Int, 4);
            smsidpara.Value = sm_smsread.SmsId;
            paras.Add(smsidpara);

            SqlParameter empidpara = new SqlParameter("@EmpId", SqlDbType.Int, 4);
            empidpara.Value = sm_smsread.EmpId;
            paras.Add(empidpara);

            SqlParameter lastreadtimepara = new SqlParameter("@LastReadTime", SqlDbType.DateTime, 8);
            lastreadtimepara.Value = sm_smsread.LastReadTime;
            paras.Add(lastreadtimepara);

            SqlParameter readstatuspara = new SqlParameter("@ReadStatus", SqlDbType.Int, 4);
            readstatuspara.Value = sm_smsread.ReadStatus;
            paras.Add(readstatuspara);

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


示例20: Update

        public int Update(Common.DataContext ctx, IModel.BaseTable baseTable)
        {
            int rel = 0;
            rel = dal.Update(ctx, baseTable);

            return rel;
        }
开发者ID:jxzly229190,项目名称:YrealWeb_Online,代码行数:7,代码来源:BLLBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IModelBinder类代码示例发布时间:2022-05-24
下一篇:
C# IMod类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap