コード例 #1
0
        public static bool GetBlobById(TenantUserSession tenantUserSession, long Id, out azureblob azureblob, out Exception exception)
        {
            exception = null;
            azureblob = null;
            bool result = false;

            try
            {
                using (var context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
                {
                    //context.Configuration.LazyLoadingEnabled = true;
                    azureblob = context.azureblobs.Where(e => e.Id == Id).FirstOrDefault <azureblob>();
                    result    = true;
                }
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            return(result);
        }
コード例 #2
0
        public static bool UpdateBlobbatchstatus(TenantUserSession tenantUserSession, azureblob azureblob, out Exception exception)
        {
            exception = null;
            bool result = false;

            try
            {
                ContextTenant context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString);
                azureblob     temp    = context.azureblobs.Where(x => x.batchno == azureblob.batchno).Select(x => x).FirstOrDefault();
                temp.status = azureblob.status;
                context.azureblobs.Add(temp);
                context.SaveChanges();
                result = true;
            }
            catch (Exception ex)
            {
                exception = ex;
                result    = false;
            }
            return(result);
        }
コード例 #3
0
        public static bool AddBlob(TenantUserSession tenantUserSession, azureblob azureblob, out Exception exception)
        {
            exception = null;
            bool result = false;

            try
            {
                using (var context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
                {
                    if (azureblob != null)
                    {
                        context.azureblobs.Add(azureblob);
                        context.SaveChanges();

                        result = true;
                    }
                }
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            return(result);
        }