Ncqrs.Eventing.Storage.SQL.MsSqlServerEventStore.GetTableCreationQueries C# (CSharp) Method

GetTableCreationQueries() public static method

Gets the table creation queries that can be used to create the tables that are needed for a database that is used as an event store.
This returns the content of the TableCreationScript.sql that is embedded as resource.
public static GetTableCreationQueries ( ) : IEnumerable
return IEnumerable
        public static IEnumerable<String> GetTableCreationQueries()
        {
            var currentAsm = Assembly.GetExecutingAssembly();

            const string resourcename = "Ncqrs.Eventing.Storage.SQL.TableCreationScript.sql";
            var resource = currentAsm.GetManifestResourceStream(resourcename);

            if (resource == null) throw new ApplicationException("Could not find the resource " + resourcename + " in assembly " + currentAsm.FullName);

            var result = new List<string>();

            using(var reader = new StreamReader(resource))
            {
                string line = null;
                while((line = reader.ReadLine()) != null)
                {
                    result.Add(line);
                }
            }

            return result;
        }