Hi all, having some trouble so I read over Wiki again and started from the "Getting Started" page: http://wiki.nettiers.com/gettingstarted2
I have generated from Northwind to keep things simple:
- Northwind.Data
- Northwind.Data.SqlClient
- Northwind.Entities
- Northwind.Services
- Northwind.Web
- Northwind.WebSite
This is what I have done so far:
1 #region Using Directives
2
3 using System;
4 using System.Web.UI;
5 using Northwind.Entities;
6 using Northwind.Services;
7
8 #endregion
9
10 namespace Northwind.Website
11 {
12 public partial class _Default : Page
13 {
14
15 private ProductsService productService;
16 protected ProductsService ProductService
17 {
18 get
19 {
20 if (productService == null)
21 {
22 productService = new ProductsService();
23 }
24 return productService;
25 }
26 }
27 protected void Page_Load(object sender, EventArgs e)
28 {
29
30 //GridView1.DataSource = ProductService.GetAll(); OK
31
32 //GridView1.DataSource = ProductService.GetByCategoryID(1); OK
33
34 //GridView1.DataSource = ProductService.GetByProductID(1);
35 //Error Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.
36
37 GridView1.DataBind();
38 }
39
40 protected void test()
41 {
42 //GetAll()
43 TList<Products> productsList = ProductService.GetAll();
44 }
45 }
46 }
Firstly, using the Services Layer I can bind with some methods but not all. All the FK methods are ok as well as by any index that is created. However I get error on PK, as above. I havn't got through all methods yet such as DeepLoad but that's ok I'll get to that when I can get basic stuff working.
I then continued the Wiki Getting Started with TList<T> and get intelliSense error on first one above.
"The type 'Products' must be convertible to 'Nothwind.Entities.IEntity' in order to use it as a parameter 'T' in the generic class 'Northwind.Entities.TList<T>'
Please, please, please can someone point me in the right direction as I think NetTiers is a great idea and would like to use it. In the past I have usually written evrything by hand although I usually only write two tier projects but would like to advance my skills and knowledge. I'm sure once I can get over this initial bump it will be fun to program against.
Thanks in advance
Axe
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
- Sherlock Holmes, as recorded by Sir A. C. Doyle in "The Blanched Soldier"