public virtual ActionResult Create() { var item = new Item(); database.Add(item); return(new Created(item, "http://localhost:1198/Items/" + item.Id)); }
public void GenericTools_Data_MemoryDatabase_int() { var db = new MemoryDatabase <int>(); db.Add(3); db.Add(7); db.Add(5); MakeSure.That(db.GetAll().Sum(i => i)).Is(15); }
public void GenericTools_Data_MemoryDatabase() { var db = new MemoryDatabase <SampleModel>(); db.Add(new SampleModel()); db.Add(new SampleModel { Age = 17 }); db.Add(new SampleModel { Type = ModelType.Test }); MakeSure.That(db.Count).Is(3); MakeSure.That(db.Get(i => i.Age == 17).Age).Is(17); MakeSure.That(db.GetAll(i => i.Type == ModelType.Sample).Count()).Is(2); }
public ItemsController() { database = new MemoryDatabase(); database.Add(new Item()); }