本文整理汇总了C#中Persistence类的典型用法代码示例。如果您正苦于以下问题:C# Persistence类的具体用法?C# Persistence怎么用?C# Persistence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Persistence类属于命名空间,在下文中一共展示了Persistence类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Validate
protected override XElement Validate(XElement item)
{
// Validate with XSD
XElement xsdErrors = this.ValidateXSD(item, HttpContext.Current.Server.MapPath(@"~\Xslt\Senior\Senior.xsd"));
if (xsdErrors != null && xsdErrors.Elements("Error").Count() > 0)
{
return xsdErrors;
}
// Validate with Stored Proc
string result = string.Empty;
using (Persistence oDB = new Persistence())
{
Persistence.ParameterCollection parameters = new Persistence.ParameterCollection();
parameters.Add("InputXml");
parameters[0].Value = item.ToString();
oDB.Execute("Masters_ConnectionString", "ValidateSeniorData", parameters, out result);
}
if (!string.IsNullOrEmpty(result))
{
XElement spErrors = XElement.Parse(result);
spErrors.Elements("Error").Where(e => string.IsNullOrEmpty(e.Value)).Remove();
if (spErrors.Elements("Error").Count() > 0)
{
return spErrors;
}
}
// SUCCESS!
return null;
}
开发者ID:CaffGeek,项目名称:manitobamasterbowlers.com,代码行数:34,代码来源:Upload.Senior.cs
示例2: Export
public void Export(Persistence.Lookup settings)
{
settings.Add("AgeSpecies", mKey.mAgeSpecies.ToString());
settings.Add("Occult", mKey.mOccult.ToString());
settings.Add("Commodity", mKey.mKind.ToString());
settings.Add("Value", mValue);
}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:MotiveKeyValue.cs
示例3: ConvertLayoutTypes
private static void ConvertLayoutTypes(TypeVisualiserLayoutFile oldDiagram, Persistence.CanvasLayoutData canvasLayoutv105)
{
foreach (TypeLayoutData oldType in oldDiagram.ViewportSaveData.CanvasLayout.Types)
{
TypeLayoutData copyOfOldType = oldType;
AssociationData association = oldDiagram.ViewportSaveData.Subject.Associations.FirstOrDefault(x => x.AssociatedTo.Id == copyOfOldType.Id);
if (association == null)
{
if (oldDiagram.ViewportSaveData.Subject.Implements != null)
{
association = oldDiagram.ViewportSaveData.Subject.Implements.FirstOrDefault(x => x.AssociatedTo.Id == oldType.Id);
}
if (association == null && oldDiagram.ViewportSaveData.Subject.Parent != null)
{
association = oldDiagram.ViewportSaveData.Subject.Parent.AssociatedTo.Id == oldType.Id ? oldDiagram.ViewportSaveData.Subject.Parent : null;
}
}
if (association == null)
{
throw new NotSupportedException("Association Id " + oldType.Id + " not found in the Subject's data. Cannot deserialise from this data.");
}
var newType = new Persistence.TypeLayoutData { Id = oldType.Id.ToString(), TopLeft = oldType.TopLeft, Visible = oldType.Visible, ContentType = association.GetType().FullName, };
canvasLayoutv105.Types.Add(newType);
}
}
开发者ID:Benrnz,项目名称:TypeVisualiser,代码行数:28,代码来源:Adaptor.cs
示例4: Import
public void Import(Persistence.Lookup settings)
{
MasterController.Settings.SkillStamps.Clear();
MasterController.Settings.SkillStamps.AddRange(settings.GetList<SkillStamp>(""));
MasterController.Settings.UpdateStamp();
}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:AddStampSetting.cs
示例5: Tracker
public Tracker(Persistence.IPersister persister, Persistence.Finder.IItemFinder find, N2.Web.IUrlParser urlParser, N2.Web.IErrorHandler errorHandler)
{
this.persister = persister;
this.find = find;
this.urlParser = urlParser;
this.errorHandler = errorHandler;
}
开发者ID:spmason,项目名称:n2cms,代码行数:7,代码来源:Tracker.cs
示例6: Clear_ShouldClearAllAndLog
public void Clear_ShouldClearAllAndLog(
[Frozen]Mock<ILogger> logger,
[Frozen]Mock<IEntityFrameworkContext> efContext,
[Frozen]Mock<IAzureQueueContext> aqContext,
[Frozen]Mock<IAzureTableContext> atContext,
[Frozen]Mock<IAzureBlobContext> abContext,
[Frozen]Mock<IEntityFrameworkChangeTracker> changeTracker,
Persistence.UnitOfWork uow)
{
EntityFrameworkContextExtensions.Factory = efc => changeTracker.Object;
// Act
uow.Clear();
// Assert
changeTracker.Verify(t => t.Clear(), Times.Once);
aqContext.Verify(c => c.Clear(), Times.Once);
atContext.Verify(c => c.Clear(), Times.Once);
abContext.Verify(c => c.Clear(), Times.Once);
logger.Verify(l => l.Log("Clearing Entity Framework context..."), Times.Once);
logger.Verify(l => l.Log("Clearing Azure Queue context..."), Times.Once);
logger.Verify(l => l.Log("Clearing Azure Table context..."), Times.Once);
logger.Verify(l => l.Log("Clearing Azure Blob context..."), Times.Once);
}
开发者ID:LeonardoLimaDaSilva,项目名称:Abstractor,代码行数:27,代码来源:UnitOfWorkTests.cs
示例7: SecurityEnforcer
public SecurityEnforcer(Persistence.IPersister persister, ISecurityManager security, Definitions.IDefinitionManager definitions, Web.IUrlParser urlParser, Web.IWebContext webContext)
{
this.webContext = webContext;
this.persister = persister;
this.security = security;
this.definitions = definitions;
this.urlParser = urlParser;
}
开发者ID:spmason,项目名称:n2cms,代码行数:8,代码来源:SecurityEnforcer.cs
示例8: Recommendation
/// <summary>
/// Initializes a new instance of the <see cref="Recommendation"/> class.
/// </summary>
/// <param name="recommendation">The recommendation.</param>
public Recommendation(Persistence.Recommendation recommendation)
{
this.ID = recommendation.ID;
this.UserID = recommendation.UserID;
this.OperatingSystem = recommendation.OSID;
this.Description = recommendation.Description;
this.AppName = recommendation.AppDesignation;
}
开发者ID:eviternity,项目名称:Apps4KidsWebApp,代码行数:12,代码来源:Recommendation.cs
示例9: Export
public void Export(Persistence.Lookup settings)
{
if (mName == null) return;
settings.Add("Name", mName);
settings.Add("Criteria", mElements);
}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:8,代码来源:SavedFilter.cs
示例10: SecurityEnforcer
public SecurityEnforcer(Persistence.IPersister persister, ISecurityManager security, ContentActivator activator, Web.IUrlParser urlParser, Web.IWebContext webContext)
{
this.webContext = webContext;
this.persister = persister;
this.security = security;
this.activator = activator;
this.urlParser = urlParser;
}
开发者ID:Jobu,项目名称:n2cms,代码行数:8,代码来源:SecurityEnforcer.cs
示例11: getInstance
public static Persistence getInstance()
{
if(_instance == null)
{
_instance = GameObject.FindObjectOfType<Persistence>();
}
return _instance;
}
开发者ID:Rolom,项目名称:medusa,代码行数:8,代码来源:Persistence.cs
示例12: Export
public override void Export(Persistence.Lookup settings)
{
base.Export(settings);
if (mValue != null)
{
settings.Add("Value", mValue.ToString());
}
}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:9,代码来源:ValueStore.cs
示例13: Import
public void Import(Persistence.Lookup settings)
{
mKey = new MotiveKey(
settings.GetEnum<CASAgeGenderFlags>("AgeSpecies", CASAgeGenderFlags.None),
settings.GetEnum<OccultTypes>("Occult", OccultTypes.None),
settings.GetEnum<CommodityKind>("Commodity", CommodityKind.None)
);
mValue = settings.GetFloat("Value", 1);
}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:9,代码来源:MotiveKeyValue.cs
示例14: User
/// <summary>
/// Initializes a new instance of the <see cref="User"/> class.
/// </summary>
/// <param name="user">The user.</param>
public User(Persistence.User user)
{
this.ID = user.ID;
this.FirstName = user.FirstName;
this.Lastname = user.LastName;
this.Children = user.Children;
this.CountryOfOriginID = user.CountryOfOriginID;
this.IsAdmin = user.Admin != null;
}
开发者ID:eviternity,项目名称:Apps4KidsWebApp,代码行数:13,代码来源:User.cs
示例15: SecurityEnforcer
public SecurityEnforcer(Persistence.IPersister persister, ISecurityManager security, ContentActivator activator, Web.IUrlParser urlParser, Web.IWebContext webContext, Configuration.HostSection config)
{
this.webContext = webContext;
this.persister = persister;
this.security = security;
this.activator = activator;
this.urlParser = urlParser;
this.permissionDeniedHttpCode = config.Web.PermissionDeniedHttpCode;
}
开发者ID:brianmatic,项目名称:n2cms,代码行数:9,代码来源:SecurityEnforcer.cs
示例16: Recention
/// <summary>
/// Initializes a new instance of Recention
/// </summary>
/// <param name="recention">The recention (Database entity)</param>
internal Recention(Persistence.Recention recention)
{
this.ID = recention.ID;
this.Rating = recention.Rating;
this.Comment = recention.Comment;
this.Date = recention.Date;
this.User = string.Format("{0} {1}", recention.User.FirstName , recention.User.LastName);
this.UserID = recention.UserID;
this.AppID = recention.AppID;
}
开发者ID:eviternity,项目名称:Apps4KidsWebApp,代码行数:14,代码来源:Recention.cs
示例17: Commit
protected override void Commit(XElement item)
{
// Save it
using (Persistence oDB = new Persistence())
{
Persistence.ParameterCollection parameters = new Persistence.ParameterCollection();
parameters.Add("InputXml");
parameters[0].Value = item.ToString();
oDB.Execute("Masters_ConnectionString", "SaveSeniorData", parameters);
}
}
开发者ID:CaffGeek,项目名称:manitobamasterbowlers.com,代码行数:11,代码来源:Upload.Senior.cs
示例18: DataPortal_Create
/// <summary>
/// Loads service object fields values (parameter) into the current business object
/// fields. Curent business object is a transient one. It may be persisted some time
/// somewhere but for the moment we assume it is not and deal with it like transient.
/// </summary>
/// <param name="entity">The source.</param>
protected void DataPortal_Create(Persistence.Model.VacationRequestEntity entity)
{
_requestNumber = entity.Id;
_submissionDate = entity.CreationDate;
_stateId = entity.State;
_employeeFullName = entity.Employee.Firstname + " " + entity.Employee.LastName;
EmployeeId = entity.Employee.Id;
StartDate = entity.StartDate;
EndDate = entity.EndDate;
}
开发者ID:stonemonkey,项目名称:VacationManager,代码行数:17,代码来源:VacationRequest.Server.cs
示例19: ConvertLayoutAnnotations
private static void ConvertLayoutAnnotations(TypeVisualiserLayoutFile oldDiagram, Persistence.CanvasLayoutData canvasLayoutv105)
{
foreach (AnnotationData oldAnnotation in oldDiagram.ViewportSaveData.CanvasLayout.Annotations)
{
canvasLayoutv105.Types.Add(new Persistence.TypeLayoutData
{
ContentType = typeof(Persistence.AnnotationData).FullName,
Id = oldAnnotation.Id.ToString(),
TopLeft = oldAnnotation.TopLeft,
Visible = oldAnnotation.Show,
Data = oldAnnotation.Text,
});
}
}
开发者ID:Benrnz,项目名称:TypeVisualiser,代码行数:14,代码来源:Adaptor.cs
示例20: Import
public override void Import(Persistence.Lookup settings)
{
base.Import(settings);
FieldInfo field = GetFieldInfo();
if (field != null)
{
ITunableConvertOption converter = TunableTypeOption.GetFieldOption(GetParsingType(field));
if (converter != null)
{
mValue = converter.Clone(GetTunableFieldInfo ()).Convert(settings.GetString("Value"), false);
}
}
}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:14,代码来源:ValueStore.cs
注:本文中的Persistence类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论