internal static Dictionary<EntitySetBase, DbMappingView> GenerateViews(
            EntityContainerMapping containerMapping, IList<EdmSchemaError> errors)
        {
            var views = new Dictionary<EntitySetBase, DbMappingView>();

            if (!containerMapping.HasViews)
            {
                return views;
            }

            // If the entity container mapping has only query views, add a warning and return.
            if (!containerMapping.HasMappingFragments())
            {
                Debug.Assert(
                    2088 == (int)MappingErrorCode.MappingAllQueryViewAtCompileTime,
                    "Please change the ERRORCODE_MAPPINGALLQUERYVIEWATCOMPILETIME value as well.");

                errors.Add(
                    new EdmSchemaError(
                        Strings.Mapping_AllQueryViewAtCompileTime(containerMapping.Identity),
                        (int)MappingErrorCode.MappingAllQueryViewAtCompileTime,
                        EdmSchemaErrorSeverity.Warning));

                return views;
            }

            var viewGenResults = ViewgenGatekeeper.GenerateViewsFromMapping(
                containerMapping, new ConfigViewGenerator { GenerateEsql = true });

            if (viewGenResults.HasErrors)
            {
                viewGenResults.Errors.Each(e => errors.Add(e));
            }

            foreach (var extentViewPair in viewGenResults.Views.KeyValuePairs)
            {
                // Multiple views are returned for an extent but the first view is 
                // the only one that we will use for now. In the future, we might 
                // start using the other views which are per type within an extent.
                views.Add(extentViewPair.Key, new DbMappingView(extentViewPair.Value[0].eSQL));
            }

            return views;
        }