Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Interfaces for Simple.Data + Impromptu
public interface IDatabase
{
ICustomers Customers { get; }
IEmployees Employees { get; }
}
public interface ICustomers
{
ICustomer Get(int id);
[UseNamedArgument]
ICustomer Insert(string name = null, string location = null);
}
public interface IEmployees
{
[UseNamedArgument]
IEmployee Insert(string name = null, int employerId = 0);
}
public interface ICustomer
{
int Id { get; set; }
string Name { get; set; }
string Location { get; set; }
IList<IEmployee> Employees { get; }
}
public interface IEmployee
{
int Id { get; set; }
int EmployerId { get; set; }
ICustomer Employer { get; }
string Name { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.