public IEnumerable <T> GetAll() { var temp = new List <T>(); foreach (var t in context.Set <U>().Select(e => e)) { temp.Add(Mapper.ToDal(t) as T); } return(temp); }
public DalProfile GetProfileByLogin(string login) { var user = context.Set <User>().FirstOrDefault(u => u.Login == login); if (user == null) { return(null); } var profile = context.Set <Profile>().FirstOrDefault(p => p.Id == user.ProfileId); return(Mapper.ToDal(profile)); }