关于C#嵌套类的问题,请帮我看看是否符合编程原则?
namespace DataAccess.Library{
public class Common
{
public class Book_Table
{
public const string Book_Press_cnsql = "SELECT [Press] FROM [book1].[dbo].[Book]";
public const string Book_cnsql = "SELECT ID, ISBN, Name AS 书名, Author AS 作者, Press AS 出版社, PublishDate AS 出版日期,Price AS 定价, Pages AS 页数, Barcode AS 条码, CD AS 光盘,Storage AS 库存量 FROM Book";
public const string Book_StoredProcedure = "Book1";
}
}
}
请帮我看看这样写是否符合? --------------------编程问答-------------------- 不符合...嵌套类用于具有明确的依存关系的从属类...
而你这个Book_Table和Common从命名上看就不具有依存关系...Common一般都用作namespace...
ps:不建议在类名中用_符号连接两个单词... --------------------编程问答-------------------- 那要怎么写?
补充:.NET技术 , C#