You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.2 KiB
51 lines
1.2 KiB
// Author: Gockner, Simon
|
|
// Created: 2020-09-18
|
|
// Copyright(c) 2020 SimonG. All Rights Reserved.
|
|
|
|
using System.Collections.Generic;
|
|
using GBase;
|
|
using GBase.Attributes;
|
|
|
|
namespace Test.GBase.GBaseIntegrationTest
|
|
{
|
|
[GBaseTable("Items")]
|
|
public class Item : IItem
|
|
{
|
|
public Item()
|
|
{
|
|
|
|
}
|
|
|
|
public Item(string name, int number)
|
|
{
|
|
Name = name;
|
|
Number = number;
|
|
}
|
|
|
|
[GBaseColumn]
|
|
public string Name { get; private set; }
|
|
|
|
[GBaseColumn]
|
|
public int Number { get; private set; }
|
|
|
|
public GBaseKey Key { get; set; }
|
|
public string FileName => Name;
|
|
|
|
public override string ToString() => $"{Number}/{Name}";
|
|
|
|
public void InitializeFromString(string @string)
|
|
{
|
|
string[] properties = @string.Split('/');
|
|
|
|
Number = int.Parse(properties[0]);
|
|
Name = properties[1];
|
|
}
|
|
|
|
public void Initialize(GBaseKey key, List<object> parameters)
|
|
{
|
|
Key = key;
|
|
Name = (string) parameters[0];
|
|
Number = (int) parameters[1];
|
|
}
|
|
}
|
|
} |