fixing missing reference
[castle.git] / Samples / ActiveRecord / MoreComplexSample / Product.cs
blob785411236765f4fdaa22391dc03ae1263890c2ef
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace MoreComplexSample
17 using System;
18 using Castle.ActiveRecord;
19 using Iesi.Collections.Generic;
21 [ActiveRecord]
22 public class Product : ActiveRecordBase
24 private int id;
25 private String name;
26 private float price;
27 private ISet<Category> categories = new HashedSet<Category>();
29 [PrimaryKey]
30 public int Id
32 get { return id; }
33 set { id = value; }
36 [Property]
37 public string Name
39 get { return name; }
40 set { name = value; }
43 [Property]
44 public float Price
46 get { return price; }
47 set { price = value; }
50 [HasAndBelongsToMany(
51 Table="ProductCategory", ColumnKey="ProductId", ColumnRef="CategoryId", Lazy=true)]
52 public ISet<Category> Categories
54 get { return categories; }
55 set { categories = value; }