Наследование: IDisposable
Пример #1
0
 public void Write(string key, object value)
 {
     using (var scope = new SinghamScope("dataService.connection.write"))
     {
         this.Db.Store.Write(key, value);
     }
 }
Пример #2
0
 public void Delete(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.delete"))
     {
         this.Db.Store.Delete(key);
     }
 }
Пример #3
0
 public object Read(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.read"))
     {
         return this.Db.Store.Read(key);
     }
 }
Пример #4
0
 public void Write(string key, object value)
 {
     using (var scope = new SinghamScope("dataService.connection.write"))
     {
         this.Db.Store.Write(key, value);
     }
 }
Пример #5
0
 public void Delete(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.delete"))
     {
         this.Db.Store.Delete(key);
     }
 }
Пример #6
0
 public object Read(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.read"))
     {
         return(this.Db.Store.Read(key));
     }
 }
Пример #7
0
 public Connection CreateConnection()
 {
     using (var scope = new SinghamScope("dataService.getSession"))
     {
         int sessionId = GetSession ();
         return new Connection (this, sessionId);
     }
 }
Пример #8
0
 public Connection CreateConnection()
 {
     using (var scope = new SinghamScope("dataService.getSession"))
     {
         int sessionId = GetSession();
         return(new Connection(this, sessionId));
     }
 }
Пример #9
0
 private void ExecuteDelete(HttpContext context)
 {
     using (var scope = new SinghamScope("dataService.delete"))
     {
         var key = IdGenerator.Next(1000);
         using (var conn = Global.Db.CreateConnection()) {
             conn.Delete(key.ToString());
         }
         context.Response.Write("Deleted from db.");
     }
 }
Пример #10
0
 private void ExecuteWrite(HttpContext context)
 {
     using (var scope = new SinghamScope("dataService.write"))
     {
         var key = IdGenerator.Next (1000);
         using (var conn = Global.Db.CreateConnection()) {
             conn.Write (key.ToString (), key.ToString ());
         }
         context.Response.Write ("Written to db.");
     }
 }
Пример #11
0
 private void ExecuteRead(HttpContext context)
 {
     using (var scope = new SinghamScope("dataService.read"))
     {
         using (var conn = Global.Db.CreateConnection())
         {
             var id    = IdGenerator.Next(1000);
             var value = conn.Read(id.ToString());
             context.Response.Write("Value: " + (value == null ? "NULL" : value.ToString()));
         }
     }
 }
Пример #12
0
 private void ExecuteRead(HttpContext context)
 {
     using( var scope = new SinghamScope("dataService.read"))
     {
         using (var conn = Global.Db.CreateConnection())
         {
             var id = IdGenerator.Next(1000);
             var value = conn.Read(id.ToString());
             context.Response.Write("Value: " + ( value == null ? "NULL" : value.ToString()) );
         }
     }
 }
Пример #13
0
 public virtual void ProcessRequest(HttpContext context)
 {
     using( var scope = new SinghamScope("dataService.call") )
     {
         var operation = context.Request.Params["operation"];
         if( operation.Equals("read", StringComparison.OrdinalIgnoreCase) == true )
             ExecuteRead(context);
         else if( operation.Equals("write", StringComparison.OrdinalIgnoreCase) == true )
             ExecuteWrite(context);
         else if( operation.Equals("delete", StringComparison.OrdinalIgnoreCase) == true )
             ExecuteDelete(context);
     }
 }
Пример #14
0
 public virtual void ProcessRequest(HttpContext context)
 {
     using (var scope = new SinghamScope("dataService.call"))
     {
         var operation = context.Request.Params["operation"];
         if (operation.Equals("read", StringComparison.OrdinalIgnoreCase) == true)
         {
             ExecuteRead(context);
         }
         else if (operation.Equals("write", StringComparison.OrdinalIgnoreCase) == true)
         {
             ExecuteWrite(context);
         }
         else if (operation.Equals("delete", StringComparison.OrdinalIgnoreCase) == true)
         {
             ExecuteDelete(context);
         }
     }
 }