本文整理汇总了C#中IObjectContainer.Store方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectContainer.Store方法的具体用法?C# IObjectContainer.Store怎么用?C# IObjectContainer.Store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjectContainer
的用法示例。
在下文中一共展示了IObjectContainer.Store方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StoreData
private void StoreData(IObjectContainer container)
{
container.Store(new Person("Roman","Stoffel")
{
Address = new Address()
{
City = "Zurich",
Street = "FunStreet"
}
});
container.Store(new Person("Joe","Cool")
{
Address = new Address()
{
City = "FunTown",
Street = "Fun Plaza"
}
});
container.Store(new Person("Joanna", "Awesome")
{
Address = new Address()
{
City = "More Fun Town",
Street = "Plaza"
}
});
}
示例2: PopulateContainer
protected override void PopulateContainer(IObjectContainer container)
{
MyTestClass test1 = new MyTestClass();
container.Store(test1);
MyTestClass test2 = new MyTestClass();
container.Store(test2);
}
示例3: StoreSecondCar
public static void StoreSecondCar(IObjectContainer db)
{
Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
db.Store(pilot2);
Car car2 = new Car("BMW");
car2.Pilot = pilot2;
db.Store(car2);
}
示例4: CommitChanges
private static void CommitChanges(IObjectContainer container)
{
// #example: Rollback changes
container.Store(new Pilot("John"));
container.Store(new Pilot("Joanna"));
container.Rollback();
// #end example
}
示例5: StoreInitialObjects
// #end example:
private void StoreInitialObjects(IObjectContainer container)
{
lock (dataLock)
{
container.Store(new Person("Joe"));
container.Store(new Person("Jan"));
container.Store(new Person("Joanna"));
container.Store(new Person("Phil"));
}
}
示例6: StoreData
private static void StoreData(IObjectContainer container)
{
Pilot john = new Pilot("John", 42);
Pilot joanna = new Pilot("Joanna", 45);
Pilot jenny = new Pilot("Jenny", 21);
Pilot rick = new Pilot("Rick", 33);
container.Store(new Car(john, "Ferrari"));
container.Store(new Car(joanna, "Mercedes"));
container.Store(new Car(jenny, "Volvo"));
container.Store(new Car(rick, "Fiat"));
}
示例7: StoreState
public void StoreState(IObjectContainer container) {
if (null != state)
{
if (OnlyNeedUpdate(container))
{
container.Store(state.CurrentHighestIds);
} else
{
container.Store(state);
}
}
}
示例8: Store
private void Store(IObjectContainer objectContainer)
{
Item item = new Item();
item._name = "First";
item._dateTime = new DateTime(2009,1,14);
objectContainer.Store(item);
item = new Item();
item._name = "Second";
item._dateTime = new DateTime(2009, 1, 15);
objectContainer.Store(item);
}
示例9: Store
private void Store(IObjectContainer objectContainer)
{
Item item = new Item();
item._name = "First";
item._enumAsInteger = EnumAsInteger.First;
objectContainer.Store(item);
item = new Item();
item._name = "Second";
item._enumAsInteger = EnumAsInteger.Second;
objectContainer.Store(item);
}
示例10: StoreCars
public static void StoreCars(IObjectContainer db)
{
Pilot pilot1 = new Pilot("Michael Schumacher", 100);
Car car1 = new Car("Ferrari");
car1.Pilot = pilot1;
car1.Snapshot();
db.Store(car1);
Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
Car car2 = new Car("BMW");
car2.Pilot = pilot2;
car2.Snapshot();
car2.Snapshot();
db.Store(car2);
}
示例11: StoreInitialObjects
// #end example:
private void StoreInitialObjects(IObjectContainer container)
{
dataLock.EnterWriteLock();
try
{
container.Store(new Person("Joe"));
container.Store(new Person("Jan"));
container.Store(new Person("Joanna"));
container.Store(new Person("Phil"));
}
finally
{
dataLock.ExitWriteLock();
}
}
示例12: alterarStatus
public Boolean alterarStatus(clsStatus objAtualizar)
{
try
{
if (!temDuplicidade(objAtualizar, "Alterar"))
{
clsStatus objStatusBuscar = new clsStatus();
objStatusBuscar.Codigo = objAtualizar.Codigo;
db = ServidorSingleton.obterServidor().OpenClient();
IObjectSet leitor = db.QueryByExample(objStatusBuscar);
clsStatus objStatus = (clsStatus)leitor.Next();
objStatus.Descricao = objAtualizar.Descricao;
db.Store(objStatus);
db.Commit();
db.Close();
db.Dispose();
return true;
}
else
{
return false;
}
}
catch (Exception ex)
{
throw new Exception("Erro atualizando o status :" + ex.ToString());
}
}
示例13: StoreData
private static void StoreData(IObjectContainer container, Random rnd)
{
for (int i = 0; i < rnd.Next(4096); i++)
{
container.Store(new DataObject(rnd));
}
}
示例14: SetSecondCar
public static void SetSecondCar(IObjectContainer db)
{
Pilot pilot = new Pilot("Michael Schumacher", 100);
Car car = new Car("Ferrari");
car.Pilot = pilot;
db.Store(car);
}
示例15: StoreFirstCar
public static void StoreFirstCar(IObjectContainer db)
{
Car car1 = new Car("Ferrari");
Pilot pilot1 = new Pilot("Michael Schumacher", 100);
car1.Pilot = pilot1;
db.Store(car1);
}