|
| 1 | +// Copyright (C) 2021 Xtensive LLC. |
| 2 | +// This code is distributed under MIT license terms. |
| 3 | +// See the License.txt file in the project root for more information. |
| 4 | + |
| 5 | +using System; |
| 6 | + |
| 7 | +namespace Xtensive.Orm.Tests.Storage.SchemaSharing.Model |
| 8 | +{ |
| 9 | + [HierarchyRoot] |
| 10 | + public class Product : Entity |
| 11 | + { |
| 12 | + [Field, Key] |
| 13 | + public int Id { get; set; } |
| 14 | + |
| 15 | + [Field] |
| 16 | + public string Name { get; set; } |
| 17 | + } |
| 18 | + |
| 19 | + [HierarchyRoot] |
| 20 | + public class PriceList : Entity |
| 21 | + { |
| 22 | + [Field, Key] |
| 23 | + public int Id { get; set; } |
| 24 | + |
| 25 | + [Field] |
| 26 | + public DateTime CreatedOn { get; set; } |
| 27 | + |
| 28 | + [Field] |
| 29 | + public bool IsArchived { get; set; } |
| 30 | + |
| 31 | + [Field] |
| 32 | + public EntitySet<PriceListItem> Items { get; set; } |
| 33 | + } |
| 34 | + |
| 35 | + [HierarchyRoot] |
| 36 | + public class PriceListItem : Entity |
| 37 | + { |
| 38 | + [Field, Key] |
| 39 | + public int Id { get; set; } |
| 40 | + |
| 41 | + [Field] |
| 42 | + [Association(PairTo = "Items", OnOwnerRemove = OnRemoveAction.Clear, OnTargetRemove = OnRemoveAction.Cascade)] |
| 43 | + public PriceList PriceList { get; set; } |
| 44 | + |
| 45 | + [Field] |
| 46 | + [Association(OnOwnerRemove = OnRemoveAction.None, OnTargetRemove = OnRemoveAction.Deny)] |
| 47 | + public Product Product { get; set; } |
| 48 | + |
| 49 | + [Field] |
| 50 | + public double Price { get; set; } |
| 51 | + |
| 52 | + [Field] |
| 53 | + public Currency Currency { get; set; } |
| 54 | + } |
| 55 | + |
| 56 | + [HierarchyRoot] |
| 57 | + public class Currency : Entity |
| 58 | + { |
| 59 | + [Field, Key] |
| 60 | + public int Id { get; set; } |
| 61 | + |
| 62 | + [Field] |
| 63 | + public string Name { get; set; } |
| 64 | + |
| 65 | + [Field] |
| 66 | + public string ShortName { get; set; } |
| 67 | + |
| 68 | + [Field] |
| 69 | + public string Symbol { get; set; } |
| 70 | + } |
| 71 | + |
| 72 | + [HierarchyRoot] |
| 73 | + public class TypeForUgrade : Entity |
| 74 | + { |
| 75 | + [Field, Key] |
| 76 | + public int Id { get; set; } |
| 77 | + |
| 78 | + [Field] |
| 79 | + public string Text { get; set; } |
| 80 | + } |
| 81 | +} |
0 commit comments