예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
파일: Common.cs 프로젝트: x64/bltoolkit
        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);
            }
        }
예제 #5
0
		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);
			}
		}
예제 #6
0
		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);
			}
		}
예제 #7
0
        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));
 }
예제 #9
0
 public Startup(IConfiguration configuration)
 {
     Configuration = configuration;
     MyDbManager.GetInstance();
 }
예제 #10
0
 public ActionResult <bool> PostRooms([FromBody] Reservation value)
 {
     return(new ActionResult <bool>(MyDbManager.GetInstance().CreateInCollection <Reservation>(value)));
 }
예제 #11
0
 public ActionResult <bool> PostUser([FromBody] User value)
 {
     return(new ActionResult <bool>(MyDbManager.GetInstance().CreateInCollection <User>(value)));
 }
예제 #12
0
 public ActionResult <bool> PostHotel([FromBody] Hotel value)
 {
     return(new ActionResult <bool>(MyDbManager.GetInstance().CreateInCollection <Hotel>(value)));
 }