Skip to content

Instantly share code, notes, and snippets.

@markrendle
Created October 12, 2012 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markrendle/3879479 to your computer and use it in GitHub Desktop.
Save markrendle/3879479 to your computer and use it in GitHub Desktop.
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