Skip to content

Instantly share code, notes, and snippets.

@jjeffers
Created August 27, 2015 18:36
Show Gist options
  • Save jjeffers/c6c7c3e39fc661ec0eca to your computer and use it in GitHub Desktop.
Save jjeffers/c6c7c3e39fc661ec0eca to your computer and use it in GitHub Desktop.
public static Company CreateCompany(string name)
{
if (name == null) throw new ArgumentNullException("name");
var company = new Company {Name = name, Address = "100 My Address, SomeWhere NC"};
using (var pe = DBContextFactory.Instance.Create())
{
pe.Company.Add(company);
pe.SaveChanges();
return company;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment