Work in Progress

master
Harald Christian Joachim Wolff 2018-08-01 23:33:10 +02:00
parent 0d860d7f37
commit fad15a12f9
4 changed files with 20 additions and 1 deletions

View File

@ -1,12 +1,18 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using mapper.attributes;
namespace sharpwawi.models
{
[MappingConstraintAttribute(FieldMappingConstraint = MappingConstraints.DONTMAP,PropertyMappingConstraint = MappingConstraints.ANNOTATEDONLY)]
public class Assembly
{
[Mapped]
[PrimaryKey]
public Part Part { get; private set; }
[Mapped]
[PrimaryKey]
public int Revision { get; private set; }
IList<AssemblyComponent> components = new List<AssemblyComponent>();

View File

@ -1,9 +1,16 @@
namespace sharpwawi.models
using mapper.attributes;
using System;
namespace sharpwawi.models
{
[MappingConstraint(FieldMappingConstraint = MappingConstraints.ANNOTATEDONLY,PropertyMappingConstraint = MappingConstraints.ALL)]
public class AssemblyComponent
{
[PrimaryKey]
public Assembly Assembly { get; private set; }
[PrimaryKey]
public Part Component { get; private set; }
public int Position { get; set; }
public double Quantity { get; set; }
public AssemblyComponent()
@ -15,6 +22,7 @@
this.Assembly = assembly;
this.Component = component;
this.Quantity = quantity;
this.Position = 0;
}

View File

@ -1,9 +1,12 @@
using System;
using System.Collections.Generic;
using mapper.attributes;
namespace sharpwawi.models
{
[MappingConstraint(FieldMappingConstraint = MappingConstraints.ANNOTATEDONLY,PropertyMappingConstraint = MappingConstraints.ALL)]
public class Entity
{
[PrimaryKey]
public String Key { get; set; }
public String Name { get; set; }

View File

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using mapper.attributes;
namespace sharpwawi.models
{
[MappingConstraint(FieldMappingConstraint = MappingConstraints.ANNOTATEDONLY,PropertyMappingConstraint = MappingConstraints.ANNOTATEDONLY)]
public class Part : Entity
{
public ISet<Assembly> Assemblies { get; private set; } = new HashSet<Assembly>();