public ActionResult <IReservation> GetReservation(string code) { var doc = MyDbManager.GetInstance().GetFromCollection <Reservation>("ReservationCode", code); var result = BsonSerializer.Deserialize <Reservation>(doc); return(new ActionResult <IReservation>(result)); }
public ActionResult <IUser> GetUser(string name) { var doc = MyDbManager.GetInstance().GetFromCollection <User>("Name", name); var result = BsonSerializer.Deserialize <User>(doc); return(new ActionResult <IUser>(result)); }
public ActionResult <IRoom> GetRoom(string number) { var doc = MyDbManager.GetInstance().GetFromCollection <Room>("Number", number); var result = BsonSerializer.Deserialize <Room>(doc); return(new ActionResult <IRoom>(result)); }
public void ReplaceTableTest() { using (var db = new MyDbManager()) { var n = 555; db.Parent.Insert(() => new Parent { ParentID = n, Value1 = n }); db.Parent.Delete(p => p.ParentID == n); } }
public void ReplaceTableTest([IncludeDataContexts("Sql2008", "Sql2012")] string context) { using (var db = new MyDbManager(context)) { var n = 555; db.Parent.Insert(() => new Parent { ParentID = n, Value1 = n }); db.Parent.Delete(p => p.ParentID == n); } }
public void ReplaceTableTest([IncludeDataContexts("Sql2008", "Sql2012")] string context) { using (var db = new MyDbManager()) { var n = 555; db.Parent.Insert(() => new Parent { ParentID = n, Value1 = n }); db.Parent.Delete(p => p.ParentID == n); } }
public bool WriteOnDatabase([FromBody] string data) { return(MyDbManager.GetInstance().WriteOnCollection(data)); }
public Startup(IConfiguration configuration) { Configuration = configuration; MyDbManager.GetInstance(); }
public ActionResult <bool> PostRooms([FromBody] Reservation value) { return(new ActionResult <bool>(MyDbManager.GetInstance().CreateInCollection <Reservation>(value))); }
public ActionResult <bool> PostUser([FromBody] User value) { return(new ActionResult <bool>(MyDbManager.GetInstance().CreateInCollection <User>(value))); }
public ActionResult <bool> PostHotel([FromBody] Hotel value) { return(new ActionResult <bool>(MyDbManager.GetInstance().CreateInCollection <Hotel>(value))); }