﻿# CAPI.Custom.Entities

This namespace contains classes that map to database tables.

## Interfaces 
```c#
public interface IEntity
{
    int recId { get; set; }
}
public interface ISurfaceItem : IEntity
{
    int itemID { get; set; }
}

public interface IQueryEntity : ISurfaceItem { }

public interface IPublishedEntity : ISurfaceItem { }

public interface IView { }
```

- All classes mapped from a table should implement `IEntity`.
- All classes representing a *SurfaceItem* should implement `ISurfaceItem`.
- `IQueryEntity` and `IPublishedEnitty` server to differentiate between query and published surfaces (`qt_` and `publ_` tables).
- Classes representing Views should implement `IView`.

### ISurfaceItem

Using the `ISurfaceItem` interface on *SurfaceItems* will enable the data access classes to create and update the underlying SurfaceItem