Skip to content

TortugaResearch/Tortuga.Anchor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tortuga Anchor

Data Modeling Library for .NET

Documentation

What does your entity base class really give you?

Some entity base classes are literally just this.

public class BaseEntity : IEntity
{
    public int Id { get; set; }
}

Besides locking down the name of your primary key (which you probably don't want anyways), that's not very helpful. So what should a base class do for you? Well, here's a short list.

Tortuga Anchor does all of this, and at a very low cost.

Normal DTO

public class Person
{
    public string FirstName { get; set; }
}

Tortuga.Anchor Model

public class Person : ModelBase
{
    public string FirstName
    {
        get { return Get<string>(); }
        set { Set(value); }
    }
}

Just the slight change in how you write your properties is all you need to enable validation and property change notification. To add change tracking, change the base class to ChangeTrackingModelBase. If you want a second level of undo, then use EditableObjectModelBase.

And since all of the functionality is exposed through standard .NET interfaces, your existing frameworks and libraries will just work, including serializers and ORMs.