Ejemplo n.º 1
0
        public IObservable <CreateTablesResult> CreateTablesAsync(params Type[] types)
        {
            return(_pool.EnqueueConnectionOp(conn => {
                var result = new CreateTablesResult();

                foreach (Type type in types)
                {
                    int aResult = conn.CreateTable(type);
                    result.Results[type] = aResult;
                }
                return result;
            }));
        }
Ejemplo n.º 2
0
        public CreateTablesResult CreateTables(params Type[] types)
        {
            CreateTablesResult result = new CreateTablesResult();
            var conn = GetConnection();

            using (conn.Lock()) {
                foreach (Type type in types)
                {
                    int aResult = conn.CreateTable(type);
                    result.Results [type] = aResult;
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
		public Task<CreateTablesResult> CreateTablesAsync (params Type[] types)
		{
			return Task.Factory.StartNew (() => {
				CreateTablesResult result = new CreateTablesResult ();
				var conn = GetConnection ();
				using (conn.Lock ()) {
					foreach (Type type in types) {
						int aResult = conn.CreateTable (type);
						result.Results[type] = aResult;
					}
				}
				return result;
			});
		}
Ejemplo n.º 4
0
 public Task <CreateTablesResult> CreateTablesAsync(string contextName = null, CreateFlags createFlags = CreateFlags.None, params Type[] types)
 {
     return(Task.Factory.StartNew(() =>
     {
         CreateTablesResult result = new CreateTablesResult();
         var conn = GetConnection();
         using (conn.Lock())
         {
             foreach (Type type in types)
             {
                 int aResult = conn.CreateTable(type, contextName, createFlags);
                 result.Results[type] = aResult;
             }
         }
         return result;
     }));
 }