Skip to content
/ AT Public

C# library methods aimed at reducing common and redundant code.

Notifications You must be signed in to change notification settings

lehn0058/AT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compact parameter validation

Validate your parameters with minimal code using AT.Core.Argument

// Instead of writing this:
if (arg1 == null)
{
     throw new ArgumentNullException("arg1", "argument can not be null");
}

if (arg2 == null)
{
     throw new ArgumentNullException("arg2", "argument can not be null");
}

if (arg3 == null)
{
     throw new ArgumentNullException("arg3", "argument can not be null");
}

// Use this simplification instead:
Argument.NotNull(() => arg1, () => arg2, () => arg3);

EF Multiple Result Sets

Execute SQL queries with multiple result sets using AT.Data.DbContextExtensions

Tuple<IEnumerable<Person>, IEnumerable<Car>> results = context.MultipleResultSet(peopleQuery, carQuery);

MultipleResultQuery<Person> peopleQuery = (from p in context.People
                                           where p.Age > age
                                           select p).AsMultipleResultQuery();

MultipleResultQuery<Car> carQuery = (from c in context.Cars
                                     where c.HorsePower > horsePower
                                     select c).AsMultipleResultQuery();

// Single database round trip
context.MultipleResultSet(peopleQuery, carQuery);

IEnumerable<Person> peopleResults = peopleQuery.Results;
IEnumerable<Car> carResults = carQuery.Results;

About

C# library methods aimed at reducing common and redundant code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages