本文整理汇总了C#中Company.AddMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# Company.AddMetadata方法的具体用法?C# Company.AddMetadata怎么用?C# Company.AddMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company.AddMetadata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCompany
protected new void CreateCompany()
{
var company = new Company("TEST") {Name = "Test", Description = "설명입니다"};
company.AddMetadata("a", new MetadataValue("A"));
company.AddMetadata("b", new MetadataValue("B"));
company.AddLocale(new CultureInfo("en"), new CompanyLocale {Name = "TEST"});
company.AddLocale(new CultureInfo("ko"), new CompanyLocale {Name = "테스트"});
Repository<Company>.SaveOrUpdate(company);
}
示例2: CompanyTestByHybrid
public void CompanyTestByHybrid()
{
var company = new Company("RWC2") {Name = "RealWeb", Description = "설명입니다"};
company.AddMetadata("a", new MetadataValue("A"));
company.AddMetadata("b", new MetadataValue("B"));
company.AddLocale(new CultureInfo("en"), new CompanyLocale {Name = "REALWEB"});
company.AddLocale(new CultureInfo("ko"), new CompanyLocale {Name = "리얼웹"});
new PersistenceSpecification<Company>(UnitOfWork.CurrentSession)
.VerifyTheMappings(company);
}
示例3: CompanyTestByUnitOfWork
public void CompanyTestByUnitOfWork()
{
var company = new Company("RWC") {Name = "RealWeb", Description = "설명입니다"};
company.AddMetadata("a", new MetadataValue("A"));
company.AddMetadata("b", new MetadataValue("B"));
company.AddLocale(new CultureInfo("en"), new CompanyLocale {Name = "REALWEB"});
company.AddLocale(new CultureInfo("ko"), new CompanyLocale {Name = "리얼웹"});
Repository<Company>.SaveOrUpdate(company);
UnitOfWork.Current.TransactionalFlush();
UnitOfWork.Current.Clear();
var loaded = Repository<Company>.Get(company.Id);
Assert.AreEqual(company, loaded);
loaded.LocaleMap.Count.Should().Be(2);
}