Example #1
0
        private questStatus read(MasterPricingEntities dbContext, DatabaseId databaseId, string schema, string name, out Quest.Services.Dbio.MasterPricing.Views view)
        {
            // Initialize
            questStatus status = null;

            view = null;


            try
            {
                view = dbContext.Views.Where(r => r.DatabaseId == databaseId.Id && r.Schema == schema && r.Name == name).SingleOrDefault();
                if (view == null)
                {
                    return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}",
                                                                         this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                         String.Format("Name {0} not found", name))));
                }
            }
            catch (System.Exception ex)
            {
                status = new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}",
                                                                       this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                       ex.InnerException != null ? ex.InnerException.Message : ex.Message));
                LogException(ex, status);
                return(status);
            }
            return(new questStatus(Severity.Success));
        }