本文整理汇总了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));
示例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;
}
示例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;
}
示例4: BrokerWrapper
internal BrokerWrapper(IConnectionBuilder connectionBuilder,
IModel model,
EnvironmentConfiguration configuration)
: base(configuration, connectionBuilder)
{
_model = model;
}
示例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;
}
示例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);
}
}
示例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()));
}
示例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;
}
示例9: RabbitMQMessageBus
public RabbitMQMessageBus(IDependencyResolver resolver, string rabbitMqExchangeName, IModel rabbitMqChannel) : base(resolver)
{
_rabbitmqchannel = rabbitMqChannel;
_rabbitmqExchangeName = rabbitMqExchangeName;
EnsureConnection();
}
示例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);
}
示例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);
}
}
}
}
示例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");
}
}
}
示例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);
}
示例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;
}
示例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);
}