For example I have the following class:
public class PublishFacebookOpenGraphActionRequest
{
public FacebookOpenGraphActions Action { get; private set; }
public FacebookOpenGraphObjects ObjectType { get; private set; }
public Uri Url { get; private set; }
public Uri Image { get; private set; }
}
And I would like to be able to generate something like this from the current set of properties:
public class PublishFacebookOpenGraphAction
{
public FacebookOpenGraphActions Action { get; private set; }
public FacebookOpenGraphObjects ObjectType { get; private set; }
public Uri Url { get; private set; }
public Uri Image { get; private set; }
public PublishFacebookOpenGraphAction WithAction(FacebookOpenGraphActions action)
{
this.Action = action;
return this;
}
public PublishFacebookOpenGraphAction WithObjectType(FacebookOpenGraphObjects objectType)
{
this.ObjectType = objectType;
return this;
}
public PublishFacebookOpenGraphAction WithUrl(Uri url)
{
this.Url = url;
return this;
}
public PublishFacebookOpenGraphAction WithImage(Uri image)
{
this.Image = image;
return this;
}
}