Inheritance: IDisposable
Exemple #1
0
 public void Write(string key, object value)
 {
     using (var scope = new SinghamScope("dataService.connection.write"))
     {
         this.Db.Store.Write(key, value);
     }
 }
Exemple #2
0
 public void Delete(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.delete"))
     {
         this.Db.Store.Delete(key);
     }
 }
Exemple #3
0
 public object Read(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.read"))
     {
         return this.Db.Store.Read(key);
     }
 }
Exemple #4
0
 public void Write(string key, object value)
 {
     using (var scope = new SinghamScope("dataService.connection.write"))
     {
         this.Db.Store.Write(key, value);
     }
 }
Exemple #5
0
 public void Delete(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.delete"))
     {
         this.Db.Store.Delete(key);
     }
 }
Exemple #6
0
 public object Read(string key)
 {
     using (var scope = new SinghamScope("dataService.connection.read"))
     {
         return(this.Db.Store.Read(key));
     }
 }
Exemple #7
0
 public Connection CreateConnection()
 {
     using (var scope = new SinghamScope("dataService.getSession"))
     {
         int sessionId = GetSession ();
         return new Connection (this, sessionId);
     }
 }
Exemple #8
0
 public Connection CreateConnection()
 {
     using (var scope = new SinghamScope("dataService.getSession"))
     {
         int sessionId = GetSession();
         return(new Connection(this, sessionId));
     }
 }
Exemple #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.");
     }
 }
Exemple #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.");
     }
 }
Exemple #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()));
         }
     }
 }
Exemple #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()) );
         }
     }
 }
Exemple #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);
     }
 }
Exemple #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);
         }
     }
 }