Created
March 20, 2012 05:16
-
-
Save derans/2131603 to your computer and use it in GitHub Desktop.
L2S Repository Sample Usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleClass | |
{ | |
public SampleObject GetById(int id) | |
{ | |
using(var repository = new LinqToSqlRepository<SampleDataContext>()) | |
{ | |
var result = repository.Load<SampleDataModel>(id); | |
return Mapper.Map<SampleObject>(result); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment