SampleGenerator Class

Namespace:
Weavy.Web.Areas.Docs.Samples
Assembly:
Weavy.Web.dll

This class will generate the samples for the API documentation.

public class SampleGenerator
Inheritance:
System.Object → SampleGenerator

Constructors

SampleGenerator() Initializes a new instance of the SampleGenerator class.

Properties

SampleObjects Gets the pre-configured samples objects.

Methods

GetSampleObject(ApiDescription, SampleDirection) Gets sample object for the specified System.Web.Http.Description.ApiDescription.
GetSampleObject(Type) Gets the sample object that will be serialized by the formatters. First, it will look at the SampleObjects. If no sample object is found, it will try to create one using ObjectGenerator.

Extension Methods

Serialize(object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(object, Formatting?, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.