Click or drag to resize

Neon.ModelGen Namespace

This namespace includes the types used to generate data models from interface definitions. These models can be built to support round-tripping data without loss as well as optionally adding INotifyPropertyChanged related code for UX binding.
Classes
  ClassDescription
Public classCompilerErrorException
Thrown for a compiler error.
Public classControllerValidationAttribute

Used to have the Neon.Xunit.XunitExtensions.ValidateController<T>() method including the tagged method when validating the service controller against its definining interface. This is useful for rare situations where a service controller inherits from another class that implements some endpoints.

Note Note
By default, Neon.Xunit.XunitExtensions.ValidateController<T>() only considers service methods implemented directly in the service controller during validation.
Public classDataModelAttribute
Used to provide the model code generator additional information about a specific data type. Use of this optional because the code generator assumes that all types that are not specifically tagged by ServiceModelAttribute are data types.
Public classEnumMember
Describes an enum member.
Public classFromBodyAttribute
Used to indicate that a service endpoint parameter is to be obtained by parsing the request body as JSON.
Public classFromHeaderAttribute
Used to indicate that a service endpoint parameter is to be obtained by parsing a request header value.
Public classFromQueryAttribute
Used to indicate that a service endpoint parameter is to be obtained by parsing a request URI query parameter.
Public classFromRouteAttribute
Used to indicate that a service endpoint parameter is to be obtained by extracting it from the URI route template.
Public classGeneratedClientAttribute
Used to tag generated service client classes with additional metadata that will be used when validatating the a generated service client actually matches an ASP.NET service implementation.
Public classGeneratedMethodAttribute
Used to tag generated service client methods with additional metadata that will be used when validatating the a generated service client actually matches an ASP.NET service implementation.
Public classGeneratedParamAttribute
Used to tag generated service client method parameters with additional metadata that will be used when validatating the a generated service client actually matches an ASP.NET service implementation.
Public classHashSourceAttribute
Used to tag data model properties that should be included in the GetHashCode computation.
Public classHttpAttribute
Base class for the HTTP related attributes below.
Public classHttpDeleteAttribute
Used to identify a service endpoint that is triggered via the DELETE method.
Public classHttpGetAttribute
Used to identify a service endpoint that is triggered via the GET method.
Public classHttpHeadAttribute
Used to identify a service endpoint that is triggered via the HEAD method.
Public classHttpOptionsAttribute
Used to identify a service endpoint that is triggered via the OPTIONS method.
Public classHttpPatchAttribute
Used to identify a service endpoint that is triggered via the PATCH method.
Public classHttpPostAttribute
Used to identify a service endpoint that is triggered via the POST method.
Public classHttpPutAttribute
Used to identify a service endpoint that is triggered via the PUT method.
Public classMetadataReferences
Specifies the metadata references to be used when compiling C# code.
Public classModelGenerator
Handles data model and service client code generation.
Public classModelGeneratorOutput
Holds the output of a model code generation.
Public classModelGeneratorSettings
Specifies model code generator settings.
Public classNoCodeGenAttribute
Used to indicate that a class or interface should be ignored during code generation.
Public classNoControllerValidationAttribute
Used to prevent the Neon.Xunit.XunitExtensions.ValidateController<T>() method from including the tagged method when validating the service controller against its definining interface. This is useful for rare situations where a service controller implements some extra endpoints that are not covered by the generated client.
Public classPersistableAttribute

Used to customize the database related code generated for the tagged data model interface.

By default, a public static string GetKey(param object[] args) method is included in generated entity classes so that a database key for a specific entity can be easialy obtained. This method simply generates a string by calling ToString on all of arguments or using "NULL" for null values which each of these being separated by a single colon and then prepending the entire thing with the entity type. The generated code will look something like this:

C#
public class PersonEntity : Entity<Person>
{
    public static string GetKey(params object[] args)
    {
        if (args.Length == 0)
        {
            throw new ArgumentException("At least one argument is expected.");
        }

        var key = "entity-type::";

        for (int i=0; i $lt; args.Length; i++)
        {
            var arg = args[i];

            if (i > 0)
            {
                key += ":";
            }

            key += arg != null ? arg.ToString() : "NULL";
        }

        return key;
    }

    ...
}
Public classPersistableKeyAttribute
Used to tag the property acting as the database key for an IRoundtripData.
Public classRouteAttribute
Used to customize request routing at the service level.
Public classServiceModelAttribute
Used to indicate that an interface should be included when generating a service client class.
Public classTargetAttribute
Used to group data models and service definitions so that the class included in the generated code can filtered.
Interfaces
  InterfaceDescription
Public interfaceActionResultT
Used to indicate that a service method uses the IActionResult pattern to return a T.
Public interfaceIActionResult
Used to indicate that a service method uses the IActionResult pattern to return void.
Enumerations
  EnumerationDescription
Public enumerationPassAs
Identifies how a generated service client will pass a parameter to an ASP.NET service.
Public enumerationUxFrameworks
Enumerates the user interface frameworks that are supported with additional generated code.