From b69830fb41cd0d0fa5579c5118a3c6cc706a78a1 Mon Sep 17 00:00:00 2001 From: Simon G Date: Fri, 18 Sep 2020 15:08:28 +0200 Subject: [PATCH] - first try add base GBaseObject implementation --- GBase/GBaseObject.cs | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 GBase/GBaseObject.cs diff --git a/GBase/GBaseObject.cs b/GBase/GBaseObject.cs new file mode 100644 index 0000000..5ff272e --- /dev/null +++ b/GBase/GBaseObject.cs @@ -0,0 +1,44 @@ +// Author: Gockner, Simon +// Created: 2020-09-18 +// Copyright(c) 2020 SimonG. All Rights Reserved. + +using System; +using System.Linq; +using GBase.Api; +using GBase.Exceptions; +using GBase.Interfaces; + +namespace GBase +{ + /// + /// GBase object that supplies inheriting classes with methods to get data from a + /// + public abstract class GBaseObject : IGBaseObject where T : INotifyGBaseEntryChanged + { + private readonly IGBaseTable _gBaseTable; + + /// + /// GBase object that allows conversion from + /// + /// No table for is existing + protected GBaseObject(IGBase gBase) + { + _gBaseTable = gBase.GetTable(); + if (_gBaseTable == null) + throw new MissingTableException(typeof(T)); + } + + + protected TProperty Get() + { + throw new NotImplementedException(); + //_gBaseTable.GetEntry() + } + + /// + /// Initialize this from a given + /// + /// The given + public abstract void InitializeFromString(string @string); + } +} \ No newline at end of file