Siaqodb storable objects may have a special unique public integer property named OID. Additional members can be any of the following types:

  1. Basic Types: int, uint, short, string, ushort, byte, sbyte, long, ulong, float, double, decimal, char, bool, TimeSpan, DateTime, DateTimeOffset, Guid, enum.

  2. Complex Types: IList derived types, List[T], Arrays, jagged Arrays, Dictionary [T,V].

  3. Nested Objects: object members can include other objects with basic or complex members.

  4. Nested Lists: object members can include lists of lists or lists of objects.

Example:

public enum TestEnum { One,Two }
public class MyFullType
{
    public int i;
    public uint iu;
    public short s;
    public string str;
    public ushort us;
    public byte b;
    public sbyte sb;
    public long l;
    public ulong ul;
    public float f;
    public double d;
    public decimal de;
    public char c;
    public bool bo;
    public TimeSpan ts;
    public DateTime dt;
    public DateTime dtOffset;
    public Guid g;
    public TestEnum enn = TestEnum.Two;
    public List<int> listInt;
    public List<Employee> listEmployees;
    public int[] arrayInt;
    public int[][][] matrix;
    public List<List<int>> NestedList;
    public int OID { get; set; }
    public int MyProperty { get; set; }
    private int _privateProperty;
    public int PropertyAccessor 
    {
        get
        {
            return _privateProperty;
        }
        set
        {
            _privateProperty = value;
            if(_privateProperty == 0)
            {
                _privateProperty = 1;
            }
        }
    }
}

Strings

Siaqodb stores strings either as fixed character type or a variable length text block. Fixed character fields are stored sequentially along with other basic Field types. Variable length text blocks are stored as a pointer to a block stored elsewhere in the database.

The default length for fixed character Fields is 100 characters. You can change the fixed character length for a given Field by decorating the Field with the MaxLength(…) attribute:

public class MyClass
{
.......
    [MaxLength(300)] 
    private string myString;
}

When a Field contains strings that vary greatly in length it is recommended to store the Field as a variable length text block. To do this use the Text attribute as shown below:

public class MyClass
{
.......
    [Text] 
    private string myString;
}

Note that Lists that contain strings do not have character length limitations on them because they are not members that can be searched or indexed in the database.

public class MyClass
{
.......
    public List<string> myListOfStrings;  // allowed to have variable length strings
}

Nested Objects

Nested Objects are automatically saved in the database under their own storage structure and are also assigned an OID. If you need to overwrite a child object during an update, please keep in mind that the original child object will persist in the database and if not handled properly, you could end up with more data stored than needed. For example:


var testToBeUpdated = myObjects.Where(c => c.Id == id).FirstOrDefault(); // Retrieves an object from SiaqoDB if it exists.
if(testToBeUpdated != null)
{
    testToBeUpdated.NestedObject = newNestedObject; // if NestedObject currently exists in the database, this line will keep it in the database and add a new nested object
    await db.StoreObjectAsync(testToBeUpdated, transaction);
}

                        
Instead, you may consider copying properties of the child object into your currently stored child. As long as the OID is preserved, then you will not create another record.