本文整理汇总了C#中Models.UpdateEntity方法的典型用法代码示例。如果您正苦于以下问题:C# Models.UpdateEntity方法的具体用法?C# Models.UpdateEntity怎么用?C# Models.UpdateEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Models
的用法示例。
在下文中一共展示了Models.UpdateEntity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public void Create(Models.Client model)
{
if (model == null) throw new ArgumentException("model");
using (var entities = IdentityServerConfigurationContext.Get())
{
var item = new Client();
model.UpdateEntity(item);
entities.Clients.Add(item);
entities.SaveChanges();
model.ID = item.Id;
}
}
示例2: Update
public void Update(Models.OpenIdConnectClient model)
{
if (model == null) throw new ArgumentNullException("model");
using (var entities = IdentityServerConfigurationContext.Get())
{
var item = entities.OpenIdConnectClients.Find(model.ClientId);
if (item != null)
{
model.UpdateEntity(item);
entities.SaveChanges();
}
}
}
示例3: Update
public void Update(Models.IdentityProvider item)
{
using (var entities = IdentityServerConfigurationContext.Get())
{
ValidateUniqueName(item, entities);
var dbitem = entities.IdentityProviders.Where(idp => idp.ID == item.ID).FirstOrDefault();
if (dbitem != null)
{
item.UpdateEntity(dbitem);
entities.SaveChanges();
}
}
}
示例4: Update
public void Update(Models.Client model)
{
if (model == null) throw new ArgumentException("model");
using (var entities = IdentityServerConfigurationContext.Get())
{
var item = entities.Clients.Where(x => x.Id == model.ID).Single();
model.UpdateEntity(item);
entities.SaveChanges();
}
}
示例5: Create
public void Create(Models.OpenIdConnectClient model)
{
if (model == null) throw new ArgumentNullException("model");
var item = new OpenIdConnectClientEntity();
model.UpdateEntity(item);
using (var entities = IdentityServerConfigurationContext.Get())
{
entities.OpenIdConnectClients.Add(item);
entities.SaveChanges();
}
}