public TProjection GetOwnedProperty <TProjection>(Guid propertyId, Guid userId, bool full = false) where TProjection : class, new() { var propertyDao = _propertiesRepository .FindBy(p => p.Id == propertyId && p.UserId == userId, new[] { "Location" }) .FirstOrDefault(); TProjection result = default(TProjection); propertyDao .Match <PropertyDao, PropertyException>( _ => _.IsNull(), string.Format("There is no property {0} owned by user {1}", propertyId, userId), _ => { result = Mapper.Map <TProjection>(_); }); return(result); }