Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The public MapReduceResult<T> class isn't flexible enough to handle all MapReduce operations #50

Open
IanMercer opened this issue Nov 14, 2010 · 0 comments

Comments

@IanMercer
Copy link

Currently the class reads thus:-

/// <summary>
/// The map reduce result.
/// </summary>
/// <typeparam retval="T">Type to map and reduce</typeparam>
public class MapReduceResult<T>
{
    /// <summary>
    /// Gets or sets Id.
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// Gets or sets Value.
    /// </summary>
    public T Value { get; set; }
}

If instead it was like this it could handle all MapReduce results:

/// <summary>
/// This is a useful type for dealing with MapReduce results.  
/// It takes two type parameters, one for the key and one for the value.
/// The simplest possible result would use type parameters ObjectId and int
/// </summary>
public class MapReduceResult2<Tid, Tvalue>
{
    public Tid _id { get; set; }
    public Tvalue value { get; set; }

    public override string ToString()
    {
        return string.Format("{0} {1}", _id, value);
    }
}

Suggest either replacing it with the more flexible version or making it internal so it's not exposing a class that has no use outside NORM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant