public MeGrabUserDataObject GetRegisteredUserById(int id) { MeGrabUser registeredUser = userRepository.FindByKey(id); if (registeredUser == null) { return(null); } MeGrabUserDataObject registeredUserDataObject = new MeGrabUserDataObject(); registeredUserDataObject.MapFrom(registeredUser); return(registeredUserDataObject); }
public MeGrabUserDataObject GetRegisteredUserByName(string name) { ISpecification <MeGrabUser> spec = new ExpressionSpecification <MeGrabUser>(u => u.Name == name); MeGrabUser registeredUser = userRepository.Find(spec); if (registeredUser == null) { return(null); } MeGrabUserDataObject registeredUserDataObject = new MeGrabUserDataObject(); registeredUserDataObject.MapFrom(registeredUser); return(registeredUserDataObject); }