Navigation
Home
Documentation
Download
Forums
Samples
FAQ
Team
Support
Project
Bug Report
Feature Request
Submit Patch
Create a new Page
All Pages
Categories
Newest Pages
Recent Changes
Administration
File Management
Login/Logout
Language Selection
Your Profile
Create Account
Quick Search
Advanced Search »
Help Wanted!
If you are using .netTiers and find it as invaluable as we do, please consider giving back to the .netTiers team by helping with our effort to fully document .netTiers. To help, simply
create an account
and you will then be able to edit this wiki.
Back
History
How to generate .netTiers unit test
{TOC} ==Frequently Asked Questions== ===General .netTiers=== ((( ====What do I need to get started with .netTiers?==== You'll need to install CodeSmith, and you can get a free eval copy from the [http://codesmithtools.com/|CodeSmith website]. Then you'll need to [http://nettiers.com/Download.aspx|download the .netTiers templates]. Once you've done that go to the [GettingStarted|Getting Started] section of this wiki for step by step instructions. ====Where do I download the latest .netTiers templates?==== You can find the latest copy of the code at [http://nettiers.com/nightly.aspx|Nightly Downloads] ====What database platforms does .netTiers support?==== Currently .netTiers supports Sql Server 2000, Sql Server 2005, Sql Server Express, Sql Server 2008, & Oracle. Several other database providers like SqlLite and Firebird have limited support with the available Generic Client. ====What about using .netTiers with VB.NET?==== It can be done! .netTiers generates C#, but the assemblies are CLS-compliant. This means that you can build a system from any combination of .NET languages and things generally work the way you expect. There are some [VB Gotchas] though, so make sure you read up before you consider mixing VB.NET with .netTiers. ====How fast is .netTiers compared with other code generators/Object-Relational Mappers?==== ====Who is .netTiers for?==== .netTiers is a tool ideally suited for developers that have a good idea about database schema design and C# development patterns and practices. It also helps if the developer knows a bit about Code Smith since that is the tool used to generate the .NetTiers. Because .netTiers is not a commercial tool there are some rough edges, these are being worked on to constantly improve the development process as such, it would be helpful to have a strong senior architect \ developer on the team to keep the structure secure while working out any kinks. ))) ===Code Generation=== ((( ====How can I refresh my Database schema cache?==== If CodeSmith isn't recognizing the changes in your database schema, try clicking the [...] button of the SourceTables or SourceDatabase properties from your property set. Alternatively, you can close and re-open CodeSmith. UPDATE: In CodeSmith 4.1+, there is a refresh schema button on the property grid toolbar. ))) ===Entity Layer=== ((( ====How much deep-loading functionality does .netTier generate?==== It is possible to deep load an object graph that represents a set of related tables. The API contains several deep-load options that offer control over recursion, parent/child inclusion, exactly which entity types (tables) should be included. Deep-load works the best when loading related data that has a tree-like structure. Deep-load will attempt to handle recursive or circular relationships, but depending on the circumstances, these structures may limit the effectiveness of deep-load. ))) ===Data Layer=== ((( ====I set the {{NetTiersProvider.DefaultCommandTimeout}} property, so why does my (slow) Sproc time out using the SQL provider?==== {BR}Contrary to what you might think, the family of {{Execute*}} functions in {{Data.Bases.NetTiersProvider.ProviderBase}} as implemented by SqlNetTiersProvider, does not honor/implement the {{DefaultCommandTimeout}} found in {{NetTiersProvider}} as the {{CommandTimeout}} value for command execution.{BR} Barring a change to the templates, a possible workaround is the following code:{BR}{BR} {{ // adjust command timeout if the provider is a SQL database{BR} Data.SqlClient.SqlNetTiersProvider p = {BR} :DataRepository.Provider as Data.SqlClient.SqlNetTiersProvider;{BR} {BR} if (null == p){BR} {{BR} : // provider is not a SQL provider, do something else appropriate{BR} : DataRepository.Provider.ExecuteNonQuery("sp_MySlowSproc");{BR} }{BR} else{BR} {{BR} : // get the SqlDatabase Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase db = {BR} :: new SqlDatabase(p.ConnectionString);{BR} : // create a command for the slow sproc{BR} : System.Data.Common.DbCommand cmd ={BR} :: db.GetStoredProcCommand("sp_MySlowSproc");{BR} : // set the timeout as set on the provider (or as needed){BR} : cmd.CommandTimeout = DataRepository.Provider.DefaultCommandTimeout;{BR} : // execute the command (any of the Execute* family){BR} : DataRepository.Provider.ExecuteNonQuery(cmd);{BR} }{BR} }}{BR} {BR} Another possibility would be to make use of the method: {BR} {BR} : {{Data.SqlClient.StoredProcedureProvider.GetCommandWrapper()}}{BR} {BR} but it would only replace approximately 2 of the lines above, and considering the useStoredProcedure parameter it doesn't seem that appropriate.{BR} ====Question==== Answer ))) ====How can I get a count of the Total Items in a table?==== The GetTotalItems() method in the Entity provider is broken: [GetTotalItems_issues|Using GetPaged to retrieve a Count] ====GetPaged doesn't return the correct page==== [GetPaged_issues|The start parameter specifies page, not row number] ===Component Layer=== ((( ====How does the DomainModel component layer implementation work?==== Answer ====How does the ServiceModel component layer implementation work?==== Answer ====Why don't some data access methods (such as Find) show up when I attempt to bind a data source to a service object?==== There is no meta data telling the framework to display the function. Place the following code above the method declaration: <code> [DataObjectMethod(DataObjectMethodType.Select)] public virtual TList<YourObject> Find(string whereClause) </code> ))) Recompile and you should now see that method available. ===Web Layer=== ((( ====What is the Web Library?==== The NetTiers Web Library is a set of Controls and Objects that provide powerful tools to make your web development projects with NetTiers much easier and more efficient. The Web Library offers both Strongly Typed DataSource Controls as well as the more generic EntityDataSource. These are inherited from the ObjectDataSource, but have been improved to exploit the functionality of the NetTiers framework. You can find more info in the [WebLayer|Web Layer] section of this wiki. ====Question==== Answer ))) ===WinForms Layer=== ((( ====What is the WinForms library?==== The WinForms library is similar to the NetTiers Web Controls library, but is still in a developmental stage. It will be a suite of Controls and Objects that will make your WinForms development easier and more efficient. ====Question==== Answer ))) ===Unit Tests Layer=== ((( If I want to use NUnit to test the data access and entity layer, how can I generated the tests? ====Question==== Answer ))) ===Web Services Layer=== ((( ====What is the WebServiceClient Layer? Why not just call the WebService directly?==== Answer ====Question==== Answer ))) ===WCF Layer=== ((( ====Question==== Answer ====Question==== Answer ))) ===Data Grids and Related Tables=== ((( ====How do I display related data in my ASP.net GridView?==== [Display related data in an ASP.net GridView control|Display related data in an ASP.NET GridView control] ====How do I display related data in my winforms GridView?==== [DisplayRelatedDataInWinGridView|Display related data in a WinForms GridView control] ===Security=== ((( ====How to use Security Application Block with NetTiers==== [SecurityBlockUsage|Use the Security Application Block with NetTiers]
ScrewTurn Wiki
version 2.0.31.