Exemplo n.º 1
0
        /// <summary>
        /// Writes CRUD interface methods definition for the specified table.
        /// </summary>
        /// <param name="table">The table to write interface for.</param>
        public void WriteTableDataProviderInterface(TableInfo table)
        {
            MethodSignature[] signatures = new MethodSignature[4];
            signatures[0] = MethodSignature.GetCreateSignature(table);
            signatures[1] = MethodSignature.GetUpdateSignature(table);
            signatures[2] = MethodSignature.GetDeleteSignature(table);
            signatures[3] = MethodSignature.GetReadSignature(table);

            foreach (var signature in signatures)
            {
                WriteLine(signature.ToString("i", null));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Writes data provider methods definition for the specified table.
        /// </summary>
        /// <param name="table">The table to write methods for.</param>
        public void WriteTableDataProviderImplementation(TableInfo table)
        {
            MethodSignature signature = MethodSignature.GetCreateSignature(table);
            IMethodBuilder  builder   = new CreateMethodBuilder(table);

            WrapMethodBody(signature, builder);

            signature = MethodSignature.GetUpdateSignature(table);
            builder   = new UpdateMethodBuilder(table);
            WrapMethodBody(signature, builder);

            signature = MethodSignature.GetDeleteSignature(table);
            builder   = new DeleteMethodBuilder(table);
            WrapMethodBody(signature, builder);

            signature = MethodSignature.GetReadSignature(table);
            builder   = new ReadMethodBuilder(table);
            WrapMethodBody(signature, builder);
        }