I've hit on the idea of creating static methods on the partial Linq queries such as
public partial class User
{
public static User FindByGuid(string guid, ApplicationDataContext context)
{
return context.Users.Where(x => x.GUID == guid).Single();
}
}
So, for example, I can easily find a user by doing:
using (var context = new ApplicationDataContext())
{
var user = DataAccess.User.FindByGuid(UsersDropDown.SelectedValue, context);
}
Is this a recognised design pattern? What are the advantages/disadvantages of doing this vs the repository model?