diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-16 13:33:30 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-16 13:33:30 +0200 |
| commit | aaa4c495f37d4613931c7561c8e012db1aad085a (patch) | |
| tree | e62685e3bfb6f0b9448945c80b060b5b30b3e8c3 /Software | |
| parent | 464a924f17cd91025be30c73c2c7b615a5333931 (diff) | |
| download | Tango-aaa4c495f37d4613931c7561c8e012db1aad085a.tar.gz Tango-aaa4c495f37d4613931c7561c8e012db1aad085a.zip | |
See previous commit...
Diffstat (limited to 'Software')
22 files changed, 76 insertions, 4667 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/DefaultGetwayService.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/DefaultGetwayService.cs deleted file mode 100644 index 47d50547e..000000000 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/DefaultGetwayService.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Configuration; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; -using Tango.MachineService.Gateway; -using Tango.Settings; -using Tango.Web; - -namespace Tango.MachineStudio.Common.Gateway -{ - public class DefaultGetwayService : ExtendedObject, IGatewayService - { - private ReadOnlyObservableCollection<EnvironmentConfiguration> _environments; - - public ReadOnlyObservableCollection<EnvironmentConfiguration> Environments - { - get { return _environments; } - private set { _environments = value; RaisePropertyChangedAuto(); } - } - - public List<EnvironmentConfiguration> GetEnvironments() - { - if (SettingsManager.Default.GetOrCreate<MachineStudioSettings>().GatewayMode == GatewayMode.Gateway) - { - using (HttpClient http = new HttpClient()) - { - GatewayClient client = new GatewayClient(ConfigurationManager.AppSettings.Get("GatewayUrl"), http); - var response = client.GetEnvironments(new EnvironmentsRequest()); - var list = response.Environments.ToList(); - Environments = new ReadOnlyObservableCollection<EnvironmentConfiguration>(new ObservableCollection<EnvironmentConfiguration>(list)); - return list; - } - } - else - { - List<EnvironmentConfiguration> environments = new List<EnvironmentConfiguration>(); - - foreach (var e in Enum.GetValues(typeof(DeploymentSlot))) - { - environments.Add(new EnvironmentConfiguration() - { - ID = ((int)e).ToString(), - Description = ((DeploymentSlot)e).ToDescription(), - Name = e.ToString(), - MachineServiceAddress = ((DeploymentSlot)e).ToAddress() - }); - } - - return environments; - } - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/GatewayClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/GatewayClient.cs deleted file mode 100644 index f63ab354b..000000000 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/GatewayClient.cs +++ /dev/null @@ -1,2693 +0,0 @@ -//---------------------- -// <auto-generated> -// Generated using the NSwag toolchain v13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// </auto-generated> -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." - -namespace Tango.MachineService.Gateway -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GatewayClient - { - private string _baseUrl = ""; - private System.Net.Http.HttpClient _httpClient; - private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings; - - public GatewayClient(string baseUrl, System.Net.Http.HttpClient httpClient) - { - BaseUrl = baseUrl; - _httpClient = httpClient; - _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// <exception cref="ApiException">A server side error occurred.</exception> - public System.Threading.Tasks.Task<EnvironmentsResponse> GetEnvironmentsAsync(EnvironmentsRequest request) - { - return GetEnvironmentsAsync(request, System.Threading.CancellationToken.None); - } - - /// <exception cref="ApiException">A server side error occurred.</exception> - public EnvironmentsResponse GetEnvironments(EnvironmentsRequest request) - { - return System.Threading.Tasks.Task.Run(async () => await GetEnvironmentsAsync(request, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); - } - - /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> - /// <exception cref="ApiException">A server side error occurred.</exception> - public async System.Threading.Tasks.Task<EnvironmentsResponse> GetEnvironmentsAsync(EnvironmentsRequest request, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Gateway/GetEnvironments"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync<EnvironmentsResponse>(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(EnvironmentsResponse); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// <exception cref="ApiException">A server side error occurred.</exception> - public System.Threading.Tasks.Task<FileResponse> ExecuteAsync(HttpControllerContext context) - { - return ExecuteAsync(context, System.Threading.CancellationToken.None); - } - - /// <exception cref="ApiException">A server side error occurred.</exception> - public FileResponse Execute(HttpControllerContext context) - { - return System.Threading.Tasks.Task.Run(async () => await ExecuteAsync(context, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); - } - - /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> - /// <exception cref="ApiException">A server side error occurred.</exception> - public async System.Threading.Tasks.Task<FileResponse> ExecuteAsync(HttpControllerContext context, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Gateway/Execute"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(context, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200" || status_ == "206") - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse((int)response_.StatusCode, headers_, responseStream_, null, response_); - client_ = null; response_ = null; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(FileResponse); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - protected struct ObjectResponseResult<T> - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult<T>(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(responseText, JsonSerializerSettings); - return new ObjectResponseResult<T>(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize<T>(jsonTextReader); - return new ObjectResponseResult<T>(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value is System.Enum) - { - string name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - } - } - else if (value is bool) { - return System.Convert.ToString(value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value != null && value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType<object>((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - return System.Convert.ToString(value, cultureInfo); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EnvironmentsResponse - { - [Newtonsoft.Json.JsonProperty("Environments", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<EnvironmentConfiguration> Environments { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EnvironmentConfiguration - { - [Newtonsoft.Json.JsonProperty("ID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ID { get; set; } - - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("Description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("MachineServiceAddress", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string MachineServiceAddress { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EnvironmentsRequest - { - [Newtonsoft.Json.JsonProperty("AppSecret", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string AppSecret { get; set; } - - - } - - /// <summary>Contains information for a single HTTP operation.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpControllerContext - { - /// <summary>Gets or sets the configuration.</summary> - [Newtonsoft.Json.JsonProperty("Configuration", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpConfiguration Configuration { get; set; } - - /// <summary>Gets or sets the controller descriptor.</summary> - [Newtonsoft.Json.JsonProperty("ControllerDescriptor", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpControllerDescriptor ControllerDescriptor { get; set; } - - /// <summary>Gets or sets the HTTP controller.</summary> - [Newtonsoft.Json.JsonProperty("Controller", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IHttpController Controller { get; set; } - - /// <summary>Gets or sets the request.</summary> - [Newtonsoft.Json.JsonProperty("Request", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpRequestMessage Request { get; set; } - - /// <summary>Gets or sets the request context.</summary> - [Newtonsoft.Json.JsonProperty("RequestContext", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpRequestContext RequestContext { get; set; } - - /// <summary>Gets or sets the route data.</summary> - [Newtonsoft.Json.JsonProperty("RouteData", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IHttpRouteData RouteData { get; set; } - - - } - - /// <summary>Represents a configuration of HttpServer instances. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpConfiguration - { - /// <summary>Gets or sets the action that will perform final initialization of the HttpConfiguration instance before it is used to process requests. </summary> - [Newtonsoft.Json.JsonProperty("Initializer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ActionOfHttpConfiguration Initializer { get; set; } - - /// <summary>Gets the list of filters that apply to all requests served using this HttpConfiguration instance.</summary> - [Newtonsoft.Json.JsonProperty("Filters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<FilterInfo> Filters { get; set; } - - /// <summary>Gets an ordered list of DelegatingHandler instances to be invoked as an HttpRequestMessage travels up the stack and an HttpResponseMessage travels down in stack in return. </summary> - [Newtonsoft.Json.JsonProperty("MessageHandlers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<DelegatingHandler> MessageHandlers { get; set; } - - /// <summary>Gets the HttpRouteCollection associated with this HttpConfiguration instance.</summary> - [Newtonsoft.Json.JsonProperty("Routes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<IHttpRoute> Routes { get; set; } - - /// <summary>Gets the properties associated with this instance.</summary> - [Newtonsoft.Json.JsonProperty("Properties", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary<string, object> Properties { get; set; } - - /// <summary>Gets the root virtual path.</summary> - [Newtonsoft.Json.JsonProperty("VirtualPathRoot", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string VirtualPathRoot { get; set; } - - /// <summary>Gets or sets the dependency resolver associated with thisinstance.</summary> - [Newtonsoft.Json.JsonProperty("DependencyResolver", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IDependencyResolver DependencyResolver { get; set; } - - /// <summary>Gets the container of default services associated with this instance.</summary> - [Newtonsoft.Json.JsonProperty("Services", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ServicesContainer Services { get; set; } - - /// <summary>Gets the collection of rules for how parameters should be bound.</summary> - [Newtonsoft.Json.JsonProperty("ParameterBindingRules", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ParameterBindingRulesCollection ParameterBindingRules { get; set; } - - /// <summary>Gets or sets a value indicating whether error details should be included in error messages.</summary> - [Newtonsoft.Json.JsonProperty("IncludeErrorDetailPolicy", Required = Newtonsoft.Json.Required.Always)] - public IncludeErrorDetailPolicy IncludeErrorDetailPolicy { get; set; } - - /// <summary>Gets the media-type formatters for this instance.</summary> - [Newtonsoft.Json.JsonProperty("Formatters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public MediaTypeFormatterCollection Formatters { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ActionOfHttpConfiguration : MulticastDelegate - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class MulticastDelegate : Delegate - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class Delegate - { - [Newtonsoft.Json.JsonProperty("_target", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object _target { get; set; } - - [Newtonsoft.Json.JsonProperty("_methodBase", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object _methodBase { get; set; } - - [Newtonsoft.Json.JsonProperty("_methodPtr", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public IntPtr _methodPtr { get; set; } = new IntPtr(); - - [Newtonsoft.Json.JsonProperty("_methodPtrAux", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public IntPtr _methodPtrAux { get; set; } = new IntPtr(); - - [Newtonsoft.Json.JsonProperty("Method", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public MethodInfo Method { get; set; } - - [Newtonsoft.Json.JsonProperty("Target", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object Target { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class IntPtr - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class MethodInfo : MethodBase - { - [Newtonsoft.Json.JsonProperty("MemberType", Required = Newtonsoft.Json.Required.Always)] - public MemberTypes MemberType { get; set; } - - [Newtonsoft.Json.JsonProperty("ReturnType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ReturnType { get; set; } - - [Newtonsoft.Json.JsonProperty("ReturnParameter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ParameterInfo ReturnParameter { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum MemberTypes - { - Constructor = 1, - - Event = 2, - - Field = 4, - - Method = 8, - - Property = 16, - - TypeInfo = 32, - - Custom = 64, - - NestedType = 128, - - All = 191, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ParameterInfo - { - [Newtonsoft.Json.JsonProperty("ParameterType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ParameterType { get; set; } - - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("HasDefaultValue", Required = Newtonsoft.Json.Required.Always)] - public bool HasDefaultValue { get; set; } - - [Newtonsoft.Json.JsonProperty("DefaultValue", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object DefaultValue { get; set; } - - [Newtonsoft.Json.JsonProperty("RawDefaultValue", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object RawDefaultValue { get; set; } - - [Newtonsoft.Json.JsonProperty("Position", Required = Newtonsoft.Json.Required.Always)] - public int Position { get; set; } - - [Newtonsoft.Json.JsonProperty("Attributes", Required = Newtonsoft.Json.Required.Always)] - public ParameterAttributes Attributes { get; set; } - - [Newtonsoft.Json.JsonProperty("Member", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public MemberInfo Member { get; set; } - - [Newtonsoft.Json.JsonProperty("IsIn", Required = Newtonsoft.Json.Required.Always)] - public bool IsIn { get; set; } - - [Newtonsoft.Json.JsonProperty("IsOut", Required = Newtonsoft.Json.Required.Always)] - public bool IsOut { get; set; } - - [Newtonsoft.Json.JsonProperty("IsLcid", Required = Newtonsoft.Json.Required.Always)] - public bool IsLcid { get; set; } - - [Newtonsoft.Json.JsonProperty("IsRetval", Required = Newtonsoft.Json.Required.Always)] - public bool IsRetval { get; set; } - - [Newtonsoft.Json.JsonProperty("IsOptional", Required = Newtonsoft.Json.Required.Always)] - public bool IsOptional { get; set; } - - [Newtonsoft.Json.JsonProperty("MetadataToken", Required = Newtonsoft.Json.Required.Always)] - public int MetadataToken { get; set; } - - [Newtonsoft.Json.JsonProperty("CustomAttributes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<CustomAttributeData> CustomAttributes { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum ParameterAttributes - { - None = 0, - - In = 1, - - Out = 2, - - Lcid = 4, - - Retval = 8, - - Optional = 16, - - HasDefault = 4096, - - HasFieldMarshal = 8192, - - Reserved3 = 16384, - - Reserved4 = 32768, - - ReservedMask = 61440, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class MemberInfo - { - [Newtonsoft.Json.JsonProperty("CustomAttributes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<CustomAttributeData> CustomAttributes { get; set; } - - [Newtonsoft.Json.JsonProperty("MetadataToken", Required = Newtonsoft.Json.Required.Always)] - public int MetadataToken { get; set; } - - [Newtonsoft.Json.JsonProperty("Module", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Module Module { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CustomAttributeData - { - [Newtonsoft.Json.JsonProperty("AttributeType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string AttributeType { get; set; } - - [Newtonsoft.Json.JsonProperty("Constructor", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ConstructorInfo Constructor { get; set; } - - [Newtonsoft.Json.JsonProperty("ConstructorArguments", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<CustomAttributeTypedArgument> ConstructorArguments { get; set; } - - [Newtonsoft.Json.JsonProperty("NamedArguments", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<CustomAttributeNamedArgument> NamedArguments { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class ConstructorInfo : MethodBase - { - [Newtonsoft.Json.JsonProperty("MemberType", Required = Newtonsoft.Json.Required.Always)] - public MemberTypes MemberType { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class MethodBase : MemberInfo - { - [Newtonsoft.Json.JsonProperty("MethodImplementationFlags", Required = Newtonsoft.Json.Required.Always)] - public MethodImplAttributes MethodImplementationFlags { get; set; } - - [Newtonsoft.Json.JsonProperty("CallingConvention", Required = Newtonsoft.Json.Required.Always)] - public CallingConventions CallingConvention { get; set; } - - [Newtonsoft.Json.JsonProperty("IsGenericMethodDefinition", Required = Newtonsoft.Json.Required.Always)] - public bool IsGenericMethodDefinition { get; set; } - - [Newtonsoft.Json.JsonProperty("ContainsGenericParameters", Required = Newtonsoft.Json.Required.Always)] - public bool ContainsGenericParameters { get; set; } - - [Newtonsoft.Json.JsonProperty("IsGenericMethod", Required = Newtonsoft.Json.Required.Always)] - public bool IsGenericMethod { get; set; } - - [Newtonsoft.Json.JsonProperty("IsSecurityCritical", Required = Newtonsoft.Json.Required.Always)] - public bool IsSecurityCritical { get; set; } - - [Newtonsoft.Json.JsonProperty("IsSecuritySafeCritical", Required = Newtonsoft.Json.Required.Always)] - public bool IsSecuritySafeCritical { get; set; } - - [Newtonsoft.Json.JsonProperty("IsSecurityTransparent", Required = Newtonsoft.Json.Required.Always)] - public bool IsSecurityTransparent { get; set; } - - [Newtonsoft.Json.JsonProperty("IsPublic", Required = Newtonsoft.Json.Required.Always)] - public bool IsPublic { get; set; } - - [Newtonsoft.Json.JsonProperty("IsPrivate", Required = Newtonsoft.Json.Required.Always)] - public bool IsPrivate { get; set; } - - [Newtonsoft.Json.JsonProperty("IsFamily", Required = Newtonsoft.Json.Required.Always)] - public bool IsFamily { get; set; } - - [Newtonsoft.Json.JsonProperty("IsAssembly", Required = Newtonsoft.Json.Required.Always)] - public bool IsAssembly { get; set; } - - [Newtonsoft.Json.JsonProperty("IsFamilyAndAssembly", Required = Newtonsoft.Json.Required.Always)] - public bool IsFamilyAndAssembly { get; set; } - - [Newtonsoft.Json.JsonProperty("IsFamilyOrAssembly", Required = Newtonsoft.Json.Required.Always)] - public bool IsFamilyOrAssembly { get; set; } - - [Newtonsoft.Json.JsonProperty("IsStatic", Required = Newtonsoft.Json.Required.Always)] - public bool IsStatic { get; set; } - - [Newtonsoft.Json.JsonProperty("IsFinal", Required = Newtonsoft.Json.Required.Always)] - public bool IsFinal { get; set; } - - [Newtonsoft.Json.JsonProperty("IsVirtual", Required = Newtonsoft.Json.Required.Always)] - public bool IsVirtual { get; set; } - - [Newtonsoft.Json.JsonProperty("IsHideBySig", Required = Newtonsoft.Json.Required.Always)] - public bool IsHideBySig { get; set; } - - [Newtonsoft.Json.JsonProperty("IsAbstract", Required = Newtonsoft.Json.Required.Always)] - public bool IsAbstract { get; set; } - - [Newtonsoft.Json.JsonProperty("IsSpecialName", Required = Newtonsoft.Json.Required.Always)] - public bool IsSpecialName { get; set; } - - [Newtonsoft.Json.JsonProperty("IsConstructor", Required = Newtonsoft.Json.Required.Always)] - public bool IsConstructor { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum MethodImplAttributes - { - IL = 0, - - Managed = 0, - - Native = 1, - - OPTIL = 2, - - Runtime = 3, - - CodeTypeMask = 3, - - Unmanaged = 4, - - ManagedMask = 4, - - NoInlining = 8, - - ForwardRef = 16, - - Synchronized = 32, - - NoOptimization = 64, - - PreserveSig = 128, - - AggressiveInlining = 256, - - SecurityMitigations = 1024, - - InternalCall = 4096, - - MaxMethodImplVal = 65535, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum CallingConventions - { - Standard = 1, - - VarArgs = 2, - - Any = 3, - - HasThis = 32, - - ExplicitThis = 64, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CustomAttributeTypedArgument - { - [Newtonsoft.Json.JsonProperty("ArgumentType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ArgumentType { get; set; } - - [Newtonsoft.Json.JsonProperty("Value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object Value { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CustomAttributeNamedArgument - { - [Newtonsoft.Json.JsonProperty("MemberInfo", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public MemberInfo MemberInfo { get; set; } - - [Newtonsoft.Json.JsonProperty("TypedValue", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public CustomAttributeTypedArgument TypedValue { get; set; } = new CustomAttributeTypedArgument(); - - [Newtonsoft.Json.JsonProperty("MemberName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string MemberName { get; set; } - - [Newtonsoft.Json.JsonProperty("IsField", Required = Newtonsoft.Json.Required.Always)] - public bool IsField { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class Module - { - [Newtonsoft.Json.JsonProperty("CustomAttributes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<CustomAttributeData> CustomAttributes { get; set; } - - [Newtonsoft.Json.JsonProperty("MDStreamVersion", Required = Newtonsoft.Json.Required.Always)] - public int MDStreamVersion { get; set; } - - [Newtonsoft.Json.JsonProperty("FullyQualifiedName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string FullyQualifiedName { get; set; } - - [Newtonsoft.Json.JsonProperty("ModuleVersionId", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.Guid ModuleVersionId { get; set; } - - [Newtonsoft.Json.JsonProperty("MetadataToken", Required = Newtonsoft.Json.Required.Always)] - public int MetadataToken { get; set; } - - [Newtonsoft.Json.JsonProperty("ScopeName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ScopeName { get; set; } - - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("Assembly", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Assembly Assembly { get; set; } - - [Newtonsoft.Json.JsonProperty("ModuleHandle", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public ModuleHandle ModuleHandle { get; set; } = new ModuleHandle(); - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class Assembly - { - [Newtonsoft.Json.JsonProperty("CodeBase", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string CodeBase { get; set; } - - [Newtonsoft.Json.JsonProperty("EscapedCodeBase", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string EscapedCodeBase { get; set; } - - [Newtonsoft.Json.JsonProperty("FullName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string FullName { get; set; } - - [Newtonsoft.Json.JsonProperty("EntryPoint", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public MethodInfo EntryPoint { get; set; } - - [Newtonsoft.Json.JsonProperty("ExportedTypes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> ExportedTypes { get; set; } - - [Newtonsoft.Json.JsonProperty("DefinedTypes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> DefinedTypes { get; set; } - - [Newtonsoft.Json.JsonProperty("Evidence", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<Evidence> Evidence { get; set; } - - [Newtonsoft.Json.JsonProperty("PermissionSet", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<PermissionSet> PermissionSet { get; set; } - - [Newtonsoft.Json.JsonProperty("IsFullyTrusted", Required = Newtonsoft.Json.Required.Always)] - public bool IsFullyTrusted { get; set; } - - [Newtonsoft.Json.JsonProperty("SecurityRuleSet", Required = Newtonsoft.Json.Required.Always)] - public SecurityRuleSet SecurityRuleSet { get; set; } - - [Newtonsoft.Json.JsonProperty("ManifestModule", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Module ManifestModule { get; set; } - - [Newtonsoft.Json.JsonProperty("CustomAttributes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<CustomAttributeData> CustomAttributes { get; set; } - - [Newtonsoft.Json.JsonProperty("ReflectionOnly", Required = Newtonsoft.Json.Required.Always)] - public bool ReflectionOnly { get; set; } - - [Newtonsoft.Json.JsonProperty("Modules", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<Module> Modules { get; set; } - - [Newtonsoft.Json.JsonProperty("Location", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Location { get; set; } - - [Newtonsoft.Json.JsonProperty("ImageRuntimeVersion", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ImageRuntimeVersion { get; set; } - - [Newtonsoft.Json.JsonProperty("GlobalAssemblyCache", Required = Newtonsoft.Json.Required.Always)] - public bool GlobalAssemblyCache { get; set; } - - [Newtonsoft.Json.JsonProperty("HostContext", Required = Newtonsoft.Json.Required.Always)] - public long HostContext { get; set; } - - [Newtonsoft.Json.JsonProperty("IsDynamic", Required = Newtonsoft.Json.Required.Always)] - public bool IsDynamic { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum SecurityRuleSet - { - None = 0, - - Level1 = 1, - - Level2 = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ModuleHandle - { - [Newtonsoft.Json.JsonProperty("MDStreamVersion", Required = Newtonsoft.Json.Required.Always)] - public int MDStreamVersion { get; set; } - - - } - - /// <summary>Provides information about the available action filters.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class FilterInfo - { - /// <summary>Gets or sets an instance of the FilterInfo.</summary> - [Newtonsoft.Json.JsonProperty("Instance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IFilter Instance { get; set; } - - /// <summary>Gets or sets the scope FilterInfo.</summary> - [Newtonsoft.Json.JsonProperty("Scope", Required = Newtonsoft.Json.Required.Always)] - public FilterScope Scope { get; set; } - - - } - - /// <summary>Defines the methods that are used in a filter.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IFilter - { - /// <summary>Gets or sets a value indicating whether more than one instance of the indicated attribute can be specified for a single program element.</summary> - [Newtonsoft.Json.JsonProperty("AllowMultiple", Required = Newtonsoft.Json.Required.Always)] - public bool AllowMultiple { get; set; } - - - } - - /// <summary>Defines values that specify the order in which filters run within the same filter type and filter order.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum FilterScope - { - Global = 0, - - Controller = 10, - - Action = 20, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class DelegatingHandler : HttpMessageHandler - { - [Newtonsoft.Json.JsonProperty("InnerHandler", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpMessageHandler InnerHandler { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class HttpMessageHandler - { - - } - - /// <summary>IHttpRoute defines the interface for a route expressing how to map an incoming HttpRequestMessage to a particular controller and action. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IHttpRoute - { - /// <summary>Gets the route template describing the URI pattern to match against. </summary> - [Newtonsoft.Json.JsonProperty("RouteTemplate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string RouteTemplate { get; set; } - - /// <summary>Gets the default values for route parameters if not provided by the incoming HttpRequestMessage. </summary> - [Newtonsoft.Json.JsonProperty("Defaults", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary<string, object> Defaults { get; set; } - - /// <summary>Gets the constraints for the route parameters. </summary> - [Newtonsoft.Json.JsonProperty("Constraints", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary<string, object> Constraints { get; set; } - - /// <summary>Gets any additional data tokens not used directly to determine whether a route matches an incoming HttpRequestMessage. </summary> - [Newtonsoft.Json.JsonProperty("DataTokens", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary<string, object> DataTokens { get; set; } - - /// <summary>Gets the message handler that will be the recipient of the request.</summary> - [Newtonsoft.Json.JsonProperty("Handler", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpMessageHandler Handler { get; set; } - - - } - - /// <summary>Represents a dependency injection container.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IDependencyResolver - { - - } - - /// <summary>An abstract class that provides a container for services used by ASP.NET Web API.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class ServicesContainer - { - - } - - /// <summary>Collection of functions that can produce a parameter binding for a given parameter. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ParameterBindingRulesCollection : System.Collections.ObjectModel.Collection<FuncOfHttpParameterDescriptorAndHttpParameterBinding> - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class FuncOfHttpParameterDescriptorAndHttpParameterBinding : MulticastDelegate - { - - } - - /// <summary>Specifies whether error details, such as exception messages and stack traces, should be included in error messages.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum IncludeErrorDetailPolicy - { - Default = 0, - - LocalOnly = 1, - - Always = 2, - - Never = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class MediaTypeFormatterCollection : Anonymous - { - - } - - /// <summary>MediaTypeFormatter class to handle Xml. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class XmlMediaTypeFormatter : MediaTypeFormatter - { - /// <summary>Gets or sets a value indicating whether the XML formatter uses the XmlSerializer as the default serializer, instead of using the DataContractSerializer.</summary> - [Newtonsoft.Json.JsonProperty("UseXmlSerializer", Required = Newtonsoft.Json.Required.Always)] - public bool UseXmlSerializer { get; set; } = false; - - /// <summary>Gets or sets a value indicating whether to indent elements when writing data.</summary> - [Newtonsoft.Json.JsonProperty("Indent", Required = Newtonsoft.Json.Required.Always)] - public bool Indent { get; set; } - - /// <summary>Gets the settings to be used while writing.</summary> - [Newtonsoft.Json.JsonProperty("WriterSettings", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public XmlWriterSettings WriterSettings { get; set; } - - /// <summary>Gets and sets the maximum nested node depth.</summary> - [Newtonsoft.Json.JsonProperty("MaxDepth", Required = Newtonsoft.Json.Required.Always)] - public int MaxDepth { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class XmlWriterSettings - { - [Newtonsoft.Json.JsonProperty("Async", Required = Newtonsoft.Json.Required.Always)] - public bool Async { get; set; } - - [Newtonsoft.Json.JsonProperty("Encoding", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Encoding Encoding { get; set; } - - [Newtonsoft.Json.JsonProperty("OmitXmlDeclaration", Required = Newtonsoft.Json.Required.Always)] - public bool OmitXmlDeclaration { get; set; } - - [Newtonsoft.Json.JsonProperty("NewLineHandling", Required = Newtonsoft.Json.Required.Always)] - public NewLineHandling NewLineHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("NewLineChars", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string NewLineChars { get; set; } - - [Newtonsoft.Json.JsonProperty("Indent", Required = Newtonsoft.Json.Required.Always)] - public bool Indent { get; set; } - - [Newtonsoft.Json.JsonProperty("IndentChars", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string IndentChars { get; set; } - - [Newtonsoft.Json.JsonProperty("NewLineOnAttributes", Required = Newtonsoft.Json.Required.Always)] - public bool NewLineOnAttributes { get; set; } - - [Newtonsoft.Json.JsonProperty("CloseOutput", Required = Newtonsoft.Json.Required.Always)] - public bool CloseOutput { get; set; } - - [Newtonsoft.Json.JsonProperty("ConformanceLevel", Required = Newtonsoft.Json.Required.Always)] - public ConformanceLevel ConformanceLevel { get; set; } - - [Newtonsoft.Json.JsonProperty("CheckCharacters", Required = Newtonsoft.Json.Required.Always)] - public bool CheckCharacters { get; set; } - - [Newtonsoft.Json.JsonProperty("NamespaceHandling", Required = Newtonsoft.Json.Required.Always)] - public NamespaceHandling NamespaceHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("WriteEndDocumentOnClose", Required = Newtonsoft.Json.Required.Always)] - public bool WriteEndDocumentOnClose { get; set; } - - [Newtonsoft.Json.JsonProperty("OutputMethod", Required = Newtonsoft.Json.Required.Always)] - public XmlOutputMethod OutputMethod { get; set; } - - [Newtonsoft.Json.JsonProperty("DoNotEscapeUriAttributes", Required = Newtonsoft.Json.Required.Always)] - public bool DoNotEscapeUriAttributes { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class Encoding - { - [Newtonsoft.Json.JsonProperty("BodyName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string BodyName { get; set; } - - [Newtonsoft.Json.JsonProperty("EncodingName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string EncodingName { get; set; } - - [Newtonsoft.Json.JsonProperty("HeaderName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string HeaderName { get; set; } - - [Newtonsoft.Json.JsonProperty("WebName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string WebName { get; set; } - - [Newtonsoft.Json.JsonProperty("WindowsCodePage", Required = Newtonsoft.Json.Required.Always)] - public int WindowsCodePage { get; set; } - - [Newtonsoft.Json.JsonProperty("IsBrowserDisplay", Required = Newtonsoft.Json.Required.Always)] - public bool IsBrowserDisplay { get; set; } - - [Newtonsoft.Json.JsonProperty("IsBrowserSave", Required = Newtonsoft.Json.Required.Always)] - public bool IsBrowserSave { get; set; } - - [Newtonsoft.Json.JsonProperty("IsMailNewsDisplay", Required = Newtonsoft.Json.Required.Always)] - public bool IsMailNewsDisplay { get; set; } - - [Newtonsoft.Json.JsonProperty("IsMailNewsSave", Required = Newtonsoft.Json.Required.Always)] - public bool IsMailNewsSave { get; set; } - - [Newtonsoft.Json.JsonProperty("IsSingleByte", Required = Newtonsoft.Json.Required.Always)] - public bool IsSingleByte { get; set; } - - [Newtonsoft.Json.JsonProperty("EncoderFallback", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public EncoderFallback EncoderFallback { get; set; } - - [Newtonsoft.Json.JsonProperty("DecoderFallback", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public DecoderFallback DecoderFallback { get; set; } - - [Newtonsoft.Json.JsonProperty("IsReadOnly", Required = Newtonsoft.Json.Required.Always)] - public bool IsReadOnly { get; set; } - - [Newtonsoft.Json.JsonProperty("CodePage", Required = Newtonsoft.Json.Required.Always)] - public int CodePage { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class EncoderFallback - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class DecoderFallback - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum NewLineHandling - { - Replace = 0, - - Entitize = 1, - - None = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum ConformanceLevel - { - Auto = 0, - - Fragment = 1, - - Document = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum NamespaceHandling - { - Default = 0, - - OmitDuplicates = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum XmlOutputMethod - { - Xml = 0, - - Html = 1, - - Text = 2, - - AutoDetect = 3, - - } - - /// <summary>Base class to handle serializing and deserializing strongly-typed objects using ObjectContent. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class MediaTypeFormatter - { - /// <summary>Gets the mutable collection of media types supported bythis MediaTypeFormatter.</summary> - [Newtonsoft.Json.JsonProperty("SupportedMediaTypes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<MediaTypeHeaderValue> SupportedMediaTypes { get; set; } - - /// <summary>Gets the mutable collection of character encodings supported bythis MediaTypeFormatter.</summary> - [Newtonsoft.Json.JsonProperty("SupportedEncodings", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<Encoding> SupportedEncodings { get; set; } - - /// <summary>Gets the mutable collection of MediaTypeMapping objects that match HTTP requests to media types.</summary> - [Newtonsoft.Json.JsonProperty("MediaTypeMappings", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<MediaTypeMapping> MediaTypeMappings { get; set; } - - /// <summary>Gets or sets the IRequiredMemberSelector instance used to determine required members.</summary> - [Newtonsoft.Json.JsonProperty("RequiredMemberSelector", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IRequiredMemberSelector RequiredMemberSelector { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class MediaTypeHeaderValue - { - [Newtonsoft.Json.JsonProperty("CharSet", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string CharSet { get; set; } - - [Newtonsoft.Json.JsonProperty("Parameters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<NameValueHeaderValue> Parameters { get; set; } - - [Newtonsoft.Json.JsonProperty("MediaType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string MediaType { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class NameValueHeaderValue - { - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("Value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Value { get; set; } - - - } - - /// <summary>An abstract base class used to create an association between HttpRequestMessage or HttpResponseMessage instances that have certain characteristics and a specific MediaTypeHeaderValue. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class MediaTypeMapping - { - /// <summary>Gets the MediaTypeHeaderValue that is associated with HttpRequestMessage or HttpResponseMessage instances that have the given characteristics of the MediaTypeMapping. </summary> - [Newtonsoft.Json.JsonProperty("MediaType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public MediaTypeHeaderValue MediaType { get; set; } - - - } - - /// <summary>Defines method that determines whether a given member is required on deserialization.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IRequiredMemberSelector - { - - } - - /// <summary>Represents the MediaTypeFormatter class to handle JSON. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class JsonMediaTypeFormatter : BaseJsonMediaTypeFormatter - { - /// <summary>Gets or sets a value indicating whether to use DataContractJsonSerializer by default. </summary> - [Newtonsoft.Json.JsonProperty("UseDataContractJsonSerializer", Required = Newtonsoft.Json.Required.Always)] - public bool UseDataContractJsonSerializer { get; set; } - - /// <summary>Gets or sets a value indicating whether to indent elements when writing data. </summary> - [Newtonsoft.Json.JsonProperty("Indent", Required = Newtonsoft.Json.Required.Always)] - public bool Indent { get; set; } - - /// <summary>Gets or sets the maximum depth allowed by this formatter.</summary> - [Newtonsoft.Json.JsonProperty("MaxDepth", Required = Newtonsoft.Json.Required.Always)] - public int MaxDepth { get; set; } - - - } - - /// <summary>Abstract media type formatter class to support Bson and Json.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class BaseJsonMediaTypeFormatter : MediaTypeFormatter - { - /// <summary>Gets or sets the JsonSerializerSettings used to configure the JsonSerializer.</summary> - [Newtonsoft.Json.JsonProperty("SerializerSettings", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public JsonSerializerSettings SerializerSettings { get; set; } - - /// <summary>Gets or sets the maximum depth allowed by this formatter.</summary> - [Newtonsoft.Json.JsonProperty("MaxDepth", Required = Newtonsoft.Json.Required.Always)] - public int MaxDepth { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class JsonSerializerSettings - { - [Newtonsoft.Json.JsonProperty("ReferenceLoopHandling", Required = Newtonsoft.Json.Required.Always)] - public ReferenceLoopHandling ReferenceLoopHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("MissingMemberHandling", Required = Newtonsoft.Json.Required.Always)] - public MissingMemberHandling MissingMemberHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("ObjectCreationHandling", Required = Newtonsoft.Json.Required.Always)] - public ObjectCreationHandling ObjectCreationHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("NullValueHandling", Required = Newtonsoft.Json.Required.Always)] - public NullValueHandling NullValueHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("DefaultValueHandling", Required = Newtonsoft.Json.Required.Always)] - public DefaultValueHandling DefaultValueHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("Converters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<JsonConverter> Converters { get; set; } - - [Newtonsoft.Json.JsonProperty("PreserveReferencesHandling", Required = Newtonsoft.Json.Required.Always)] - public PreserveReferencesHandling PreserveReferencesHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("TypeNameHandling", Required = Newtonsoft.Json.Required.Always)] - public TypeNameHandling TypeNameHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("MetadataPropertyHandling", Required = Newtonsoft.Json.Required.Always)] - public MetadataPropertyHandling MetadataPropertyHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("TypeNameAssemblyFormat", Required = Newtonsoft.Json.Required.Always)] - public FormatterAssemblyStyle TypeNameAssemblyFormat { get; set; } - - [Newtonsoft.Json.JsonProperty("TypeNameAssemblyFormatHandling", Required = Newtonsoft.Json.Required.Always)] - public TypeNameAssemblyFormatHandling TypeNameAssemblyFormatHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("ConstructorHandling", Required = Newtonsoft.Json.Required.Always)] - public ConstructorHandling ConstructorHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("ContractResolver", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IContractResolver ContractResolver { get; set; } - - [Newtonsoft.Json.JsonProperty("EqualityComparer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IEqualityComparer EqualityComparer { get; set; } - - [Newtonsoft.Json.JsonProperty("ReferenceResolver", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IReferenceResolver ReferenceResolver { get; set; } - - [Newtonsoft.Json.JsonProperty("ReferenceResolverProvider", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public FuncOfIReferenceResolver ReferenceResolverProvider { get; set; } - - [Newtonsoft.Json.JsonProperty("TraceWriter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ITraceWriter TraceWriter { get; set; } - - [Newtonsoft.Json.JsonProperty("Binder", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public SerializationBinder Binder { get; set; } - - [Newtonsoft.Json.JsonProperty("SerializationBinder", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ISerializationBinder SerializationBinder { get; set; } - - [Newtonsoft.Json.JsonProperty("Error", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public EventHandlerOfErrorEventArgs Error { get; set; } - - [Newtonsoft.Json.JsonProperty("Context", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public StreamingContext Context { get; set; } = new StreamingContext(); - - [Newtonsoft.Json.JsonProperty("DateFormatString", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string DateFormatString { get; set; } - - [Newtonsoft.Json.JsonProperty("MaxDepth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? MaxDepth { get; set; } - - [Newtonsoft.Json.JsonProperty("Formatting", Required = Newtonsoft.Json.Required.Always)] - public Formatting Formatting { get; set; } - - [Newtonsoft.Json.JsonProperty("DateFormatHandling", Required = Newtonsoft.Json.Required.Always)] - public DateFormatHandling DateFormatHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("DateTimeZoneHandling", Required = Newtonsoft.Json.Required.Always)] - public DateTimeZoneHandling DateTimeZoneHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("DateParseHandling", Required = Newtonsoft.Json.Required.Always)] - public DateParseHandling DateParseHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("FloatFormatHandling", Required = Newtonsoft.Json.Required.Always)] - public FloatFormatHandling FloatFormatHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("FloatParseHandling", Required = Newtonsoft.Json.Required.Always)] - public FloatParseHandling FloatParseHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("StringEscapeHandling", Required = Newtonsoft.Json.Required.Always)] - public StringEscapeHandling StringEscapeHandling { get; set; } - - [Newtonsoft.Json.JsonProperty("Culture", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Culture { get; set; } - - [Newtonsoft.Json.JsonProperty("CheckAdditionalContent", Required = Newtonsoft.Json.Required.Always)] - public bool CheckAdditionalContent { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum ReferenceLoopHandling - { - Error = 0, - - Ignore = 1, - - Serialize = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum MissingMemberHandling - { - Ignore = 0, - - Error = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum ObjectCreationHandling - { - Auto = 0, - - Reuse = 1, - - Replace = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum NullValueHandling - { - Include = 0, - - Ignore = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum DefaultValueHandling - { - Include = 0, - - Ignore = 1, - - Populate = 2, - - IgnoreAndPopulate = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class JsonConverter - { - [Newtonsoft.Json.JsonProperty("CanRead", Required = Newtonsoft.Json.Required.Always)] - public bool CanRead { get; set; } - - [Newtonsoft.Json.JsonProperty("CanWrite", Required = Newtonsoft.Json.Required.Always)] - public bool CanWrite { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum PreserveReferencesHandling - { - None = 0, - - Objects = 1, - - Arrays = 2, - - All = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum TypeNameHandling - { - None = 0, - - Objects = 1, - - Arrays = 2, - - All = 3, - - Auto = 4, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum MetadataPropertyHandling - { - Default = 0, - - ReadAhead = 1, - - Ignore = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum FormatterAssemblyStyle - { - Simple = 0, - - Full = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum TypeNameAssemblyFormatHandling - { - Simple = 0, - - Full = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum ConstructorHandling - { - Default = 0, - - AllowNonPublicDefaultConstructor = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IContractResolver - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IEqualityComparer - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IReferenceResolver - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class FuncOfIReferenceResolver : MulticastDelegate - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class ITraceWriter - { - [Newtonsoft.Json.JsonProperty("LevelFilter", Required = Newtonsoft.Json.Required.Always)] - public TraceLevel LevelFilter { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum TraceLevel - { - Off = 0, - - Error = 1, - - Warning = 2, - - Info = 3, - - Verbose = 4, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class SerializationBinder - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class ISerializationBinder - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EventHandlerOfErrorEventArgs : MulticastDelegate - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class StreamingContext - { - [Newtonsoft.Json.JsonProperty("Context", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public object Context { get; set; } - - [Newtonsoft.Json.JsonProperty("State", Required = Newtonsoft.Json.Required.Always)] - public StreamingContextStates State { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - [System.Flags] - public enum StreamingContextStates - { - CrossProcess = 1, - - CrossMachine = 2, - - File = 4, - - Persistence = 8, - - Remoting = 16, - - Other = 32, - - Clone = 64, - - CrossAppDomain = 128, - - All = 255, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum Formatting - { - None = 0, - - Indented = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum DateFormatHandling - { - IsoDateFormat = 0, - - MicrosoftDateFormat = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum DateTimeZoneHandling - { - Local = 0, - - Utc = 1, - - Unspecified = 2, - - RoundtripKind = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum DateParseHandling - { - None = 0, - - DateTime = 1, - - DateTimeOffset = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum FloatFormatHandling - { - String = 0, - - Symbol = 1, - - DefaultValue = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum FloatParseHandling - { - Double = 0, - - Decimal = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public enum StringEscapeHandling - { - Default = 0, - - EscapeNonAscii = 1, - - EscapeHtml = 2, - - } - - /// <summary>MediaTypeFormatter class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class FormUrlEncodedMediaTypeFormatter : MediaTypeFormatter - { - /// <summary>Gets or sets the maximum depth allowed by this formatter.</summary> - [Newtonsoft.Json.JsonProperty("MaxDepth", Required = Newtonsoft.Json.Required.Always)] - public int MaxDepth { get; set; } - - /// <summary>Gets or sets the size of the buffer when reading the incoming stream.</summary> - [Newtonsoft.Json.JsonProperty("ReadBufferSize", Required = Newtonsoft.Json.Required.Always)] - public int ReadBufferSize { get; set; } - - - } - - /// <summary>Represents information that describes the HTTP controller.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpControllerDescriptor - { - /// <summary>Gets the properties associated with this instance.</summary> - [Newtonsoft.Json.JsonProperty("Properties", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary<string, object> Properties { get; set; } - - /// <summary>Gets or sets the configurations associated with the controller.</summary> - [Newtonsoft.Json.JsonProperty("Configuration", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpConfiguration Configuration { get; set; } - - /// <summary>Gets or sets the name of the controller.</summary> - [Newtonsoft.Json.JsonProperty("ControllerName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ControllerName { get; set; } - - /// <summary>Gets or sets the type of the controller.</summary> - [Newtonsoft.Json.JsonProperty("ControllerType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ControllerType { get; set; } - - - } - - /// <summary>Represents an HTTP controller.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IHttpController - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpRequestMessage - { - [Newtonsoft.Json.JsonProperty("Version", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Version Version { get; set; } - - [Newtonsoft.Json.JsonProperty("Content", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpContent Content { get; set; } - - [Newtonsoft.Json.JsonProperty("Method", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpMethod Method { get; set; } - - [Newtonsoft.Json.JsonProperty("RequestUri", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Uri RequestUri { get; set; } - - [Newtonsoft.Json.JsonProperty("Headers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpRequestHeaders Headers { get; set; } - - [Newtonsoft.Json.JsonProperty("Properties", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary<string, object> Properties { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Version - { - [Newtonsoft.Json.JsonProperty("Major", Required = Newtonsoft.Json.Required.Always)] - public int Major { get; set; } - - [Newtonsoft.Json.JsonProperty("Minor", Required = Newtonsoft.Json.Required.Always)] - public int Minor { get; set; } - - [Newtonsoft.Json.JsonProperty("Build", Required = Newtonsoft.Json.Required.Always)] - public int Build { get; set; } - - [Newtonsoft.Json.JsonProperty("Revision", Required = Newtonsoft.Json.Required.Always)] - public int Revision { get; set; } - - [Newtonsoft.Json.JsonProperty("MajorRevision", Required = Newtonsoft.Json.Required.Always)] - public int MajorRevision { get; set; } - - [Newtonsoft.Json.JsonProperty("MinorRevision", Required = Newtonsoft.Json.Required.Always)] - public int MinorRevision { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class HttpContent - { - [Newtonsoft.Json.JsonProperty("Headers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpContentHeaders Headers { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpContentHeaders : Anonymous2 - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ContentDispositionHeaderValue - { - [Newtonsoft.Json.JsonProperty("DispositionType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string DispositionType { get; set; } - - [Newtonsoft.Json.JsonProperty("Parameters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<NameValueHeaderValue> Parameters { get; set; } - - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("FileName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string FileName { get; set; } - - [Newtonsoft.Json.JsonProperty("FileNameStar", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string FileNameStar { get; set; } - - [Newtonsoft.Json.JsonProperty("CreationDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? CreationDate { get; set; } - - [Newtonsoft.Json.JsonProperty("ModificationDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ModificationDate { get; set; } - - [Newtonsoft.Json.JsonProperty("ReadDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? ReadDate { get; set; } - - [Newtonsoft.Json.JsonProperty("Size", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? Size { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ContentRangeHeaderValue - { - [Newtonsoft.Json.JsonProperty("Unit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Unit { get; set; } - - [Newtonsoft.Json.JsonProperty("From", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? From { get; set; } - - [Newtonsoft.Json.JsonProperty("To", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? To { get; set; } - - [Newtonsoft.Json.JsonProperty("Length", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? Length { get; set; } - - [Newtonsoft.Json.JsonProperty("HasLength", Required = Newtonsoft.Json.Required.Always)] - public bool HasLength { get; set; } - - [Newtonsoft.Json.JsonProperty("HasRange", Required = Newtonsoft.Json.Required.Always)] - public bool HasRange { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class KeyValuePairOfStringAndIEnumerableOfString - { - [Newtonsoft.Json.JsonProperty("Key", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Key { get; set; } - - [Newtonsoft.Json.JsonProperty("Value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> Value { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpMethod - { - [Newtonsoft.Json.JsonProperty("Method", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Method { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpRequestHeaders : Anonymous3 - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class MediaTypeWithQualityHeaderValue : MediaTypeHeaderValue - { - [Newtonsoft.Json.JsonProperty("Quality", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double? Quality { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class StringWithQualityHeaderValue - { - [Newtonsoft.Json.JsonProperty("Value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Value { get; set; } - - [Newtonsoft.Json.JsonProperty("Quality", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double? Quality { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class AuthenticationHeaderValue - { - [Newtonsoft.Json.JsonProperty("Scheme", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Scheme { get; set; } - - [Newtonsoft.Json.JsonProperty("Parameter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Parameter { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class NameValueWithParametersHeaderValue : NameValueHeaderValue - { - [Newtonsoft.Json.JsonProperty("Parameters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<NameValueHeaderValue> Parameters { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EntityTagHeaderValue - { - [Newtonsoft.Json.JsonProperty("Tag", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Tag { get; set; } - - [Newtonsoft.Json.JsonProperty("IsWeak", Required = Newtonsoft.Json.Required.Always)] - public bool IsWeak { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class RangeConditionHeaderValue - { - [Newtonsoft.Json.JsonProperty("Date", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Date { get; set; } - - [Newtonsoft.Json.JsonProperty("EntityTag", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public EntityTagHeaderValue EntityTag { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class RangeHeaderValue - { - [Newtonsoft.Json.JsonProperty("Unit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Unit { get; set; } - - [Newtonsoft.Json.JsonProperty("Ranges", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<RangeItemHeaderValue> Ranges { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class RangeItemHeaderValue - { - [Newtonsoft.Json.JsonProperty("From", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? From { get; set; } - - [Newtonsoft.Json.JsonProperty("To", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? To { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class TransferCodingWithQualityHeaderValue : TransferCodingHeaderValue - { - [Newtonsoft.Json.JsonProperty("Quality", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double? Quality { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class TransferCodingHeaderValue - { - [Newtonsoft.Json.JsonProperty("Value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Value { get; set; } - - [Newtonsoft.Json.JsonProperty("Parameters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<NameValueHeaderValue> Parameters { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ProductInfoHeaderValue - { - [Newtonsoft.Json.JsonProperty("Product", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ProductHeaderValue Product { get; set; } - - [Newtonsoft.Json.JsonProperty("Comment", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Comment { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ProductHeaderValue - { - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("Version", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Version { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CacheControlHeaderValue - { - [Newtonsoft.Json.JsonProperty("NoCache", Required = Newtonsoft.Json.Required.Always)] - public bool NoCache { get; set; } - - [Newtonsoft.Json.JsonProperty("NoCacheHeaders", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> NoCacheHeaders { get; set; } - - [Newtonsoft.Json.JsonProperty("NoStore", Required = Newtonsoft.Json.Required.Always)] - public bool NoStore { get; set; } - - [Newtonsoft.Json.JsonProperty("MaxAge", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.TimeSpan? MaxAge { get; set; } - - [Newtonsoft.Json.JsonProperty("SharedMaxAge", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.TimeSpan? SharedMaxAge { get; set; } - - [Newtonsoft.Json.JsonProperty("MaxStale", Required = Newtonsoft.Json.Required.Always)] - public bool MaxStale { get; set; } - - [Newtonsoft.Json.JsonProperty("MaxStaleLimit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.TimeSpan? MaxStaleLimit { get; set; } - - [Newtonsoft.Json.JsonProperty("MinFresh", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.TimeSpan? MinFresh { get; set; } - - [Newtonsoft.Json.JsonProperty("NoTransform", Required = Newtonsoft.Json.Required.Always)] - public bool NoTransform { get; set; } - - [Newtonsoft.Json.JsonProperty("OnlyIfCached", Required = Newtonsoft.Json.Required.Always)] - public bool OnlyIfCached { get; set; } - - [Newtonsoft.Json.JsonProperty("Public", Required = Newtonsoft.Json.Required.Always)] - public bool Public { get; set; } - - [Newtonsoft.Json.JsonProperty("Private", Required = Newtonsoft.Json.Required.Always)] - public bool Private { get; set; } - - [Newtonsoft.Json.JsonProperty("PrivateHeaders", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> PrivateHeaders { get; set; } - - [Newtonsoft.Json.JsonProperty("MustRevalidate", Required = Newtonsoft.Json.Required.Always)] - public bool MustRevalidate { get; set; } - - [Newtonsoft.Json.JsonProperty("ProxyRevalidate", Required = Newtonsoft.Json.Required.Always)] - public bool ProxyRevalidate { get; set; } - - [Newtonsoft.Json.JsonProperty("Extensions", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<NameValueHeaderValue> Extensions { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ViaHeaderValue - { - [Newtonsoft.Json.JsonProperty("ProtocolName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ProtocolName { get; set; } - - [Newtonsoft.Json.JsonProperty("ProtocolVersion", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ProtocolVersion { get; set; } - - [Newtonsoft.Json.JsonProperty("ReceivedBy", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ReceivedBy { get; set; } - - [Newtonsoft.Json.JsonProperty("Comment", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Comment { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class WarningHeaderValue - { - [Newtonsoft.Json.JsonProperty("Code", Required = Newtonsoft.Json.Required.Always)] - public int Code { get; set; } - - [Newtonsoft.Json.JsonProperty("Agent", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Agent { get; set; } - - [Newtonsoft.Json.JsonProperty("Text", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Text { get; set; } - - [Newtonsoft.Json.JsonProperty("Date", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Date { get; set; } - - - } - - /// <summary>Represents the context associated with a request.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class HttpRequestContext - { - /// <summary>Gets or sets the client certificate.</summary> - [Newtonsoft.Json.JsonProperty("ClientCertificate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public X509Certificate2 ClientCertificate { get; set; } - - /// <summary>Gets or sets the configuration.</summary> - [Newtonsoft.Json.JsonProperty("Configuration", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpConfiguration Configuration { get; set; } - - /// <summary>Gets or sets a value indicating whether error details, such as exception messages and stack traces, should be included in the response for this request.</summary> - [Newtonsoft.Json.JsonProperty("IncludeErrorDetail", Required = Newtonsoft.Json.Required.Always)] - public bool IncludeErrorDetail { get; set; } - - /// <summary>Gets or sets a value indicating whether the request originates from a local address.</summary> - [Newtonsoft.Json.JsonProperty("IsLocal", Required = Newtonsoft.Json.Required.Always)] - public bool IsLocal { get; set; } - - /// <summary>.Gets or sets the principal</summary> - [Newtonsoft.Json.JsonProperty("Principal", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IPrincipal Principal { get; set; } - - /// <summary>Gets or sets the route data.</summary> - [Newtonsoft.Json.JsonProperty("RouteData", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IHttpRouteData RouteData { get; set; } - - /// <summary>Gets or sets the factory used to generate URLs to other APIs.</summary> - [Newtonsoft.Json.JsonProperty("Url", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public UrlHelper Url { get; set; } - - /// <summary>Gets or sets the virtual path root.</summary> - [Newtonsoft.Json.JsonProperty("VirtualPathRoot", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string VirtualPathRoot { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class X509Certificate2 : X509Certificate - { - [Newtonsoft.Json.JsonProperty("Archived", Required = Newtonsoft.Json.Required.Always)] - public bool Archived { get; set; } - - [Newtonsoft.Json.JsonProperty("Extensions", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<Extensions> Extensions { get; set; } - - [Newtonsoft.Json.JsonProperty("FriendlyName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string FriendlyName { get; set; } - - [Newtonsoft.Json.JsonProperty("IssuerName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public X500DistinguishedName IssuerName { get; set; } - - [Newtonsoft.Json.JsonProperty("NotAfter", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.DateTimeOffset NotAfter { get; set; } - - [Newtonsoft.Json.JsonProperty("NotBefore", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.DateTimeOffset NotBefore { get; set; } - - [Newtonsoft.Json.JsonProperty("HasPrivateKey", Required = Newtonsoft.Json.Required.Always)] - public bool HasPrivateKey { get; set; } - - [Newtonsoft.Json.JsonProperty("PrivateKey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AsymmetricAlgorithm PrivateKey { get; set; } - - [Newtonsoft.Json.JsonProperty("PublicKey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PublicKey PublicKey { get; set; } - - [Newtonsoft.Json.JsonProperty("RawData", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public byte[] RawData { get; set; } - - [Newtonsoft.Json.JsonProperty("SerialNumber", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string SerialNumber { get; set; } - - [Newtonsoft.Json.JsonProperty("SubjectName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public X500DistinguishedName SubjectName { get; set; } - - [Newtonsoft.Json.JsonProperty("SignatureAlgorithm", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Oid SignatureAlgorithm { get; set; } - - [Newtonsoft.Json.JsonProperty("Thumbprint", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Thumbprint { get; set; } - - [Newtonsoft.Json.JsonProperty("Version", Required = Newtonsoft.Json.Required.Always)] - public int Version { get; set; } - - [Newtonsoft.Json.JsonProperty("CertContext", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public SafeCertContextHandle CertContext { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class X500DistinguishedName : AsnEncodedData - { - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class AsnEncodedData - { - [Newtonsoft.Json.JsonProperty("Oid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Oid Oid { get; set; } - - [Newtonsoft.Json.JsonProperty("RawData", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public byte[] RawData { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Oid - { - [Newtonsoft.Json.JsonProperty("Value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Value { get; set; } - - [Newtonsoft.Json.JsonProperty("FriendlyName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string FriendlyName { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class AsymmetricAlgorithm - { - [Newtonsoft.Json.JsonProperty("KeySize", Required = Newtonsoft.Json.Required.Always)] - public int KeySize { get; set; } - - [Newtonsoft.Json.JsonProperty("LegalKeySizes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<KeySizes> LegalKeySizes { get; set; } - - [Newtonsoft.Json.JsonProperty("SignatureAlgorithm", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string SignatureAlgorithm { get; set; } - - [Newtonsoft.Json.JsonProperty("KeyExchangeAlgorithm", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string KeyExchangeAlgorithm { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class KeySizes - { - [Newtonsoft.Json.JsonProperty("MinSize", Required = Newtonsoft.Json.Required.Always)] - public int MinSize { get; set; } - - [Newtonsoft.Json.JsonProperty("MaxSize", Required = Newtonsoft.Json.Required.Always)] - public int MaxSize { get; set; } - - [Newtonsoft.Json.JsonProperty("SkipSize", Required = Newtonsoft.Json.Required.Always)] - public int SkipSize { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class PublicKey - { - [Newtonsoft.Json.JsonProperty("Key", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AsymmetricAlgorithm Key { get; set; } - - [Newtonsoft.Json.JsonProperty("Oid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Oid Oid { get; set; } - - [Newtonsoft.Json.JsonProperty("EncodedKeyValue", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AsnEncodedData EncodedKeyValue { get; set; } - - [Newtonsoft.Json.JsonProperty("EncodedParameters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AsnEncodedData EncodedParameters { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class SafeCertContextHandle : SafeHandleZeroOrMinusOneIsInvalid - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle - { - [Newtonsoft.Json.JsonProperty("IsInvalid", Required = Newtonsoft.Json.Required.Always)] - public bool IsInvalid { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class SafeHandle : CriticalFinalizerObject - { - [Newtonsoft.Json.JsonProperty("IsClosed", Required = Newtonsoft.Json.Required.Always)] - public bool IsClosed { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class CriticalFinalizerObject - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class X509Certificate - { - [Newtonsoft.Json.JsonProperty("Handle", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public IntPtr Handle { get; set; } = new IntPtr(); - - [Newtonsoft.Json.JsonProperty("Issuer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Issuer { get; set; } - - [Newtonsoft.Json.JsonProperty("Subject", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Subject { get; set; } - - [Newtonsoft.Json.JsonProperty("CertContext", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public SafeCertContextHandle2 CertContext { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class SafeCertContextHandle2 : SafeHandleZeroOrMinusOneIsInvalid - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IPrincipal - { - [Newtonsoft.Json.JsonProperty("Identity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IIdentity Identity { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IIdentity - { - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("AuthenticationType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string AuthenticationType { get; set; } - - [Newtonsoft.Json.JsonProperty("IsAuthenticated", Required = Newtonsoft.Json.Required.Always)] - public bool IsAuthenticated { get; set; } - - - } - - /// <summary>Provides information about a route.</summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public abstract partial class IHttpRouteData - { - /// <summary>Gets the object that represents the route.</summary> - [Newtonsoft.Json.JsonProperty("Route", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public IHttpRoute Route { get; set; } - - /// <summary>Gets a collection of URL parameter values and default values for the route.</summary> - [Newtonsoft.Json.JsonProperty("Values", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.IDictionary<string, object> Values { get; set; } - - - } - - /// <summary>Represents a factory for creating URLs. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class UrlHelper - { - /// <summary>Gets or sets the HttpRequestMessage of the current UrlHelper instance.</summary> - [Newtonsoft.Json.JsonProperty("Request", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public HttpRequestMessage Request { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Evidence - { - private System.Collections.Generic.IDictionary<string, object> _additionalProperties = new System.Collections.Generic.Dictionary<string, object>(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary<string, object> AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class PermissionSet - { - private System.Collections.Generic.IDictionary<string, object> _additionalProperties = new System.Collections.Generic.Dictionary<string, object>(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary<string, object> AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// <summary>Collection class that contains MediaTypeFormatter instances. </summary> - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Anonymous - { - /// <summary>Gets the MediaTypeFormatter to use for XML.</summary> - [Newtonsoft.Json.JsonProperty("XmlFormatter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public XmlMediaTypeFormatter XmlFormatter { get; set; } - - /// <summary>Gets the MediaTypeFormatter to use for JSON.</summary> - [Newtonsoft.Json.JsonProperty("JsonFormatter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public JsonMediaTypeFormatter JsonFormatter { get; set; } - - /// <summary>Gets the MediaTypeFormatter to use for application/x-www-form-urlencoded data.</summary> - [Newtonsoft.Json.JsonProperty("FormUrlEncodedFormatter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public FormUrlEncodedMediaTypeFormatter FormUrlEncodedFormatter { get; set; } - - [Newtonsoft.Json.JsonProperty("WritingFormatters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<MediaTypeFormatter> WritingFormatters { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Anonymous2 - { - [Newtonsoft.Json.JsonProperty("Allow", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> Allow { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentDisposition", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ContentDispositionHeaderValue ContentDisposition { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentEncoding", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> ContentEncoding { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentLanguage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> ContentLanguage { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentLength", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? ContentLength { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentLocation", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Uri ContentLocation { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentMD5", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public byte[] ContentMD5 { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentRange", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ContentRangeHeaderValue ContentRange { get; set; } - - [Newtonsoft.Json.JsonProperty("ContentType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public MediaTypeHeaderValue ContentType { get; set; } - - [Newtonsoft.Json.JsonProperty("Expires", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Expires { get; set; } - - [Newtonsoft.Json.JsonProperty("LastModified", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? LastModified { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Anonymous3 - { - [Newtonsoft.Json.JsonProperty("Accept", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<MediaTypeWithQualityHeaderValue> Accept { get; set; } - - [Newtonsoft.Json.JsonProperty("AcceptCharset", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<StringWithQualityHeaderValue> AcceptCharset { get; set; } - - [Newtonsoft.Json.JsonProperty("AcceptEncoding", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<StringWithQualityHeaderValue> AcceptEncoding { get; set; } - - [Newtonsoft.Json.JsonProperty("AcceptLanguage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<StringWithQualityHeaderValue> AcceptLanguage { get; set; } - - [Newtonsoft.Json.JsonProperty("Authorization", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AuthenticationHeaderValue Authorization { get; set; } - - [Newtonsoft.Json.JsonProperty("Expect", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<NameValueWithParametersHeaderValue> Expect { get; set; } - - [Newtonsoft.Json.JsonProperty("ExpectContinue", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool? ExpectContinue { get; set; } - - [Newtonsoft.Json.JsonProperty("From", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string From { get; set; } - - [Newtonsoft.Json.JsonProperty("Host", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Host { get; set; } - - [Newtonsoft.Json.JsonProperty("IfMatch", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<EntityTagHeaderValue> IfMatch { get; set; } - - [Newtonsoft.Json.JsonProperty("IfModifiedSince", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? IfModifiedSince { get; set; } - - [Newtonsoft.Json.JsonProperty("IfNoneMatch", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<EntityTagHeaderValue> IfNoneMatch { get; set; } - - [Newtonsoft.Json.JsonProperty("IfRange", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public RangeConditionHeaderValue IfRange { get; set; } - - [Newtonsoft.Json.JsonProperty("IfUnmodifiedSince", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? IfUnmodifiedSince { get; set; } - - [Newtonsoft.Json.JsonProperty("MaxForwards", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? MaxForwards { get; set; } - - [Newtonsoft.Json.JsonProperty("ProxyAuthorization", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AuthenticationHeaderValue ProxyAuthorization { get; set; } - - [Newtonsoft.Json.JsonProperty("Range", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public RangeHeaderValue Range { get; set; } - - [Newtonsoft.Json.JsonProperty("Referrer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Uri Referrer { get; set; } - - [Newtonsoft.Json.JsonProperty("TE", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<TransferCodingWithQualityHeaderValue> TE { get; set; } - - [Newtonsoft.Json.JsonProperty("UserAgent", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<ProductInfoHeaderValue> UserAgent { get; set; } - - [Newtonsoft.Json.JsonProperty("CacheControl", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public CacheControlHeaderValue CacheControl { get; set; } - - [Newtonsoft.Json.JsonProperty("Connection", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> Connection { get; set; } - - [Newtonsoft.Json.JsonProperty("ConnectionClose", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool? ConnectionClose { get; set; } - - [Newtonsoft.Json.JsonProperty("Date", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTimeOffset? Date { get; set; } - - [Newtonsoft.Json.JsonProperty("Pragma", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<NameValueHeaderValue> Pragma { get; set; } - - [Newtonsoft.Json.JsonProperty("Trailer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<string> Trailer { get; set; } - - [Newtonsoft.Json.JsonProperty("TransferEncoding", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<TransferCodingHeaderValue> TransferEncoding { get; set; } - - [Newtonsoft.Json.JsonProperty("TransferEncodingChunked", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool? TransferEncodingChunked { get; set; } - - [Newtonsoft.Json.JsonProperty("Upgrade", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<ProductHeaderValue> Upgrade { get; set; } - - [Newtonsoft.Json.JsonProperty("Via", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<ViaHeaderValue> Via { get; set; } - - [Newtonsoft.Json.JsonProperty("Warning", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<WarningHeaderValue> Warning { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Extensions - { - private System.Collections.Generic.IDictionary<string, object> _additionalProperties = new System.Collections.Generic.Dictionary<string, object>(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary<string, object> AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileResponse : System.IDisposable - { - private System.IDisposable _client; - private System.IDisposable _response; - - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; } - - public System.IO.Stream Stream { get; private set; } - - public bool IsPartial - { - get { return StatusCode == 206; } - } - - public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) - { - StatusCode = statusCode; - Headers = headers; - Stream = stream; - _client = client; - _response = response; - } - - public void Dispose() - { - if (Stream != null) - Stream.Dispose(); - if (_response != null) - _response.Dispose(); - if (_client != null) - _client.Dispose(); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + response.Substring(0, response.Length >= 512 ? 512 : response.Length), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiException<TResult> : ApiException - { - public TResult Result { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/GatewayMode.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/GatewayMode.cs deleted file mode 100644 index 2a7a5ae1f..000000000 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/GatewayMode.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.MachineStudio.Common.Gateway -{ - public enum GatewayMode - { - Default, - Gateway - } -} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/IGatewayService.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/IGatewayService.cs deleted file mode 100644 index 66e18912e..000000000 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Gateway/IGatewayService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.MachineService.Gateway; - -namespace Tango.MachineStudio.Common.Gateway -{ - public interface IGatewayService - { - ReadOnlyObservableCollection<EnvironmentConfiguration> Environments { get; } - - List<EnvironmentConfiguration> GetEnvironments(); - } -} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/GatewayClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/GatewayClient.cs deleted file mode 100644 index efe560e4e..000000000 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/GatewayClient.cs +++ /dev/null @@ -1,295 +0,0 @@ -//---------------------- -// <auto-generated> -// Generated using the NSwag toolchain v13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// </auto-generated> -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." - -namespace Tango.MachineService.Gateway -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GatewayClient - { - private string _baseUrl = ""; - private System.Net.Http.HttpClient _httpClient; - private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings; - - public GatewayClient(string baseUrl, System.Net.Http.HttpClient httpClient) - { - BaseUrl = baseUrl; - _httpClient = httpClient; - _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// <exception cref="ApiException">A server side error occurred.</exception> - public System.Threading.Tasks.Task<EnvironmentsResponse> GetEnvironmentsAsync(EnvironmentsRequest request) - { - return GetEnvironmentsAsync(request, System.Threading.CancellationToken.None); - } - - /// <exception cref="ApiException">A server side error occurred.</exception> - public EnvironmentsResponse GetEnvironments(EnvironmentsRequest request) - { - return System.Threading.Tasks.Task.Run(async () => await GetEnvironmentsAsync(request, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); - } - - /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> - /// <exception cref="ApiException">A server side error occurred.</exception> - public async System.Threading.Tasks.Task<EnvironmentsResponse> GetEnvironmentsAsync(EnvironmentsRequest request, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Gateway/GetEnvironments"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync<EnvironmentsResponse>(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(EnvironmentsResponse); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - protected struct ObjectResponseResult<T> - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult<T>(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(responseText, JsonSerializerSettings); - return new ObjectResponseResult<T>(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize<T>(jsonTextReader); - return new ObjectResponseResult<T>(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value is System.Enum) - { - string name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - } - } - else if (value is bool) { - return System.Convert.ToString(value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value != null && value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType<object>((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - return System.Convert.ToString(value, cultureInfo); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EnvironmentsResponse - { - [Newtonsoft.Json.JsonProperty("Environments", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection<EnvironmentConfiguration> Environments { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EnvironmentConfiguration - { - [Newtonsoft.Json.JsonProperty("ID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string ID { get; set; } - - [Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("Description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description { get; set; } - - [Newtonsoft.Json.JsonProperty("MachineServiceAddress", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string MachineServiceAddress { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.5.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class EnvironmentsRequest - { - [Newtonsoft.Json.JsonProperty("AppSecret", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string AppSecret { get; set; } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + response.Substring(0, response.Length >= 512 ? 512 : response.Length), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.2.3.0 (NJsonSchema v10.1.5.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiException<TResult> : ApiException - { - public TResult Result { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 09060b820..d07f75dbd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -99,7 +99,6 @@ <Compile Include="Controls\WpfGraphControl.cs" /> <Compile Include="Converters\UserRoleToBooleanConverter.cs" /> <Compile Include="Converters\UserRoleToVisibilityConverter.cs" /> - <Compile Include="GatewayClient.cs" /> <Compile Include="MachineStudioTheme.cs" /> <Compile Include="Resources\SharedResourceDictionary.cs" /> <Compile Include="Tup\TupFileBuilder.cs" /> @@ -428,10 +427,11 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> <PropertyGroup> - <PreBuildEvent>nswag run "$(SolutionDir)Web\Tango.MachineService.Gateway\Nswag\GatewayClient.nswag" /variables:assembly="$(SolutionDir)Web\Tango.MachineService.Gateway\bin\Tango.MachineService.Gateway.dll",output="$(ProjectDir)GatewayClient.cs"</PreBuildEvent> + <PreBuildEvent> + </PreBuildEvent> </PropertyGroup> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Nswag/Pre-Build Example.txt b/Software/Visual_Studio/Notes/Tango.Notes/Nswag/Pre-Build Example.txt new file mode 100644 index 000000000..eb9849fba --- /dev/null +++ b/Software/Visual_Studio/Notes/Tango.Notes/Nswag/Pre-Build Example.txt @@ -0,0 +1 @@ +nswag run "$(SolutionDir)Web\Tango.MachineService.Gateway\Nswag\GatewayClient.nswag" /variables:assembly="$(SolutionDir)Web\Tango.MachineService.Gateway\bin\Tango.MachineService.Gateway.dll",output="$(ProjectDir)Gateway\GatewayClient.cs"
\ No newline at end of file diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj index e95fe1069..023a4bc69 100644 --- a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj +++ b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj @@ -49,6 +49,7 @@ <Content Include="Azure\SQL Database.txt" /> <Content Include="DB\DB Schema Change Log.txt" /> <Content Include="DB\SQL Dependency.txt" /> + <Content Include="Nswag\Pre-Build Example.txt" /> <Content Include="PPC\Remote Debugging.txt" /> <Content Include="PPC\Virtual Flash Drive.txt" /> <Content Include="PPC\Windows 10 LTSB.txt" /> @@ -60,7 +61,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs index 75e953abe..e3391cd5d 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs @@ -7,10 +7,11 @@ using System.Web.Http; using Tango.MachineService.Gateway.DB; using Tango.MachineService.Gateway.DTO; using Tango.MachineService.Gateway.Messages; +using Tango.Web.Controllers; namespace Tango.MachineService.Gateway.Controllers { - public class GatewayController : ApiController + public class GatewayController : TangoController { [HttpPost] public EnvironmentsResponse GetEnvironments(EnvironmentsRequest request) @@ -19,16 +20,16 @@ namespace Tango.MachineService.Gateway.Controllers using (GatewayDbContext db = GatewayDbContext.CreateDefault()) { - var envs = db.ENVIRONMENTS.ToList(); + var envs = db.Environments.ToList(); foreach (var env in envs) { response.Environments.Add(new EnvironmentConfiguration() { ID = env.ID.ToString(), - Name = env.NAME, - Description = env.DESCRIPTION, - MachineServiceAddress = env.MACHINE_SERVICE_ADDRESS + Name = env.Name, + Description = env.Description, + MachineServiceAddress = env.MachineServiceAddress }); } } diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs index f70851d07..66cd2ff0c 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/ENVIRONMENT.cs @@ -1,22 +1,24 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; namespace Tango.MachineService.Gateway.DB { - using System; - using System.Collections.Generic; - - public partial class ENVIRONMENT + [Table("ENVIRONMENTS")] + public class Environment { + [Column("ID")] public int ID { get; set; } - public string NAME { get; set; } - public string DESCRIPTION { get; set; } - public string MACHINE_SERVICE_ADDRESS { get; set; } + + [Column("NAME")] + public String Name { get; set; } + + [Column("DESCRIPTION")] + public String Description { get; set; } + + [Column("MACHINE_SERVICE_ADDRESS")] + public String MachineServiceAddress { get; set; } } -} +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Context.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Context.cs deleted file mode 100644 index 3de28709f..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Context.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace Tango.MachineService.Gateway.DB -{ - using System; - using System.Data.Entity; - using System.Data.Entity.Infrastructure; - - public partial class GatewayDbContext : DbContext - { - public GatewayDbContext() - : base("name=GatewayDbContext") - { - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - - public virtual DbSet<ENVIRONMENT> ENVIRONMENTS { get; set; } - } -} diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Context.tt b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Context.tt deleted file mode 100644 index a994c4b1a..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Context.tt +++ /dev/null @@ -1,636 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF6.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -const string inputFile = @"GatewayDatabaseModel.edmx"; -var textTransform = DynamicTextTransformation.Create(this); -var code = new CodeGenerationTools(this); -var ef = new MetadataTools(this); -var typeMapper = new TypeMapper(code, ef, textTransform.Errors); -var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors); -var itemCollection = loader.CreateEdmItemCollection(inputFile); -var modelNamespace = loader.GetModelNamespace(inputFile); -var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); - -var container = itemCollection.OfType<EntityContainer>().FirstOrDefault(); -if (container == null) -{ - return string.Empty; -} -#> -//------------------------------------------------------------------------------ -// <auto-generated> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> -// </auto-generated> -//------------------------------------------------------------------------------ - -<# - -var codeNamespace = code.VsNamespaceSuggestion(); -if (!String.IsNullOrEmpty(codeNamespace)) -{ -#> -namespace <#=code.EscapeNamespace(codeNamespace)#> -{ -<# - PushIndent(" "); -} - -#> -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -<# -if (container.FunctionImports.Any()) -{ -#> -using System.Data.Entity.Core.Objects; -using System.Linq; -<# -} -#> - -<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext -{ - public <#=code.Escape(container)#>() - : base("name=<#=container.Name#>") - { -<# -if (!loader.IsLazyLoadingEnabled(container)) -{ -#> - this.Configuration.LazyLoadingEnabled = false; -<# -} - -foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>()) -{ - // Note: the DbSet members are defined below such that the getter and - // setter always have the same accessibility as the DbSet definition - if (Accessibility.ForReadOnlyProperty(entitySet) != "public") - { -#> - <#=codeStringGenerator.DbSetInitializer(entitySet)#> -<# - } -} -#> - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - -<# - foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>()) - { -#> - <#=codeStringGenerator.DbSet(entitySet)#> -<# - } - - foreach (var edmFunction in container.FunctionImports) - { - WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false); - } -#> -} -<# - -if (!String.IsNullOrEmpty(codeNamespace)) -{ - PopIndent(); -#> -} -<# -} -#> -<#+ - -private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) -{ - if (typeMapper.IsComposable(edmFunction)) - { -#> - - [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] - <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#> - { -<#+ - codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); -#> - <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#> - } -<#+ - } - else - { -#> - - <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#> - { -<#+ - codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); -#> - <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#> - } -<#+ - if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption)) - { - WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true); - } - } -} - -public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit) -{ -#> - var <#=name#> = <#=isNotNull#> ? - <#=notNullInit#> : - <#=nullInit#>; - -<#+ -} - -public const string TemplateId = "CSharp_DbContext_Context_EF6"; - -public class CodeStringGenerator -{ - private readonly CodeGenerationTools _code; - private readonly TypeMapper _typeMapper; - private readonly MetadataTools _ef; - - public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(typeMapper, "typeMapper"); - ArgumentNotNull(ef, "ef"); - - _code = code; - _typeMapper = typeMapper; - _ef = ef; - } - - public string Property(EdmProperty edmProperty) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - Accessibility.ForProperty(edmProperty), - _typeMapper.GetTypeName(edmProperty.TypeUsage), - _code.Escape(edmProperty), - _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); - } - - public string NavigationProperty(NavigationProperty navProp) - { - var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), - navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - _code.Escape(navProp), - _code.SpaceAfter(Accessibility.ForGetter(navProp)), - _code.SpaceAfter(Accessibility.ForSetter(navProp))); - } - - public string AccessibilityAndVirtual(string accessibility) - { - return accessibility + (accessibility != "private" ? " virtual" : ""); - } - - public string EntityClassOpening(EntityType entity) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1}partial class {2}{3}", - Accessibility.ForType(entity), - _code.SpaceAfter(_code.AbstractOption(entity)), - _code.Escape(entity), - _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); - } - - public string EnumOpening(SimpleType enumType) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} enum {1} : {2}", - Accessibility.ForType(enumType), - _code.Escape(enumType), - _code.Escape(_typeMapper.UnderlyingClrType(enumType))); - } - - public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter) - { - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; - writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); - } - } - - public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "{0} IQueryable<{1}> {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - _code.Escape(edmFunction), - string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); - } - - public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - edmFunction.NamespaceName, - edmFunction.Name, - string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), - _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); - } - - public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); - if (includeMergeOption) - { - paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } - - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - _code.Escape(edmFunction), - paramList); - } - - public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", - returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - edmFunction.Name, - callParams); - } - - public string DbSet(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} virtual DbSet<{1}> {2} {{ get; set; }}", - Accessibility.ForReadOnlyProperty(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType), - _code.Escape(entitySet)); - } - - public string DbSetInitializer(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} = Set<{1}>();", - _code.Escape(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType)); - } - - public string UsingDirectives(bool inHeader, bool includeCollections = true) - { - return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) - ? string.Format( - CultureInfo.InvariantCulture, - "{0}using System;{1}" + - "{2}", - inHeader ? Environment.NewLine : "", - includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", - inHeader ? "" : Environment.NewLine) - : ""; - } -} - -public class TypeMapper -{ - private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; - - private readonly System.Collections.IList _errors; - private readonly CodeGenerationTools _code; - private readonly MetadataTools _ef; - - public static string FixNamespaces(string typeName) - { - return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); - } - - public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(ef, "ef"); - ArgumentNotNull(errors, "errors"); - - _code = code; - _ef = ef; - _errors = errors; - } - - public string GetTypeName(TypeUsage typeUsage) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); - } - - public string GetTypeName(EdmType edmType) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: null); - } - - public string GetTypeName(TypeUsage typeUsage, string modelNamespace) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); - } - - public string GetTypeName(EdmType edmType, string modelNamespace) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); - } - - public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) - { - if (edmType == null) - { - return null; - } - - var collectionType = edmType as CollectionType; - if (collectionType != null) - { - return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); - } - - var typeName = _code.Escape(edmType.MetadataProperties - .Where(p => p.Name == ExternalTypeNameAttributeName) - .Select(p => (string)p.Value) - .FirstOrDefault()) - ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? - _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : - _code.Escape(edmType)); - - if (edmType is StructuralType) - { - return typeName; - } - - if (edmType is SimpleType) - { - var clrType = UnderlyingClrType(edmType); - if (!IsEnumType(edmType)) - { - typeName = _code.Escape(clrType); - } - - typeName = FixNamespaces(typeName); - - return clrType.IsValueType && isNullable == true ? - String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : - typeName; - } - - throw new ArgumentException("edmType"); - } - - public Type UnderlyingClrType(EdmType edmType) - { - ArgumentNotNull(edmType, "edmType"); - - var primitiveType = edmType as PrimitiveType; - if (primitiveType != null) - { - return primitiveType.ClrEquivalentType; - } - - if (IsEnumType(edmType)) - { - return GetEnumUnderlyingType(edmType).ClrEquivalentType; - } - - return typeof(object); - } - - public object GetEnumMemberValue(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var valueProperty = enumMember.GetType().GetProperty("Value"); - return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); - } - - public string GetEnumMemberName(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var nameProperty = enumMember.GetType().GetProperty("Name"); - return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); - } - - public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var membersProperty = enumType.GetType().GetProperty("Members"); - return membersProperty != null - ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) - : Enumerable.Empty<MetadataItem>(); - } - - public bool EnumIsFlags(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); - return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); - } - - public bool IsEnumType(GlobalItem edmType) - { - ArgumentNotNull(edmType, "edmType"); - - return edmType.GetType().Name == "EnumType"; - } - - public PrimitiveType GetEnumUnderlyingType(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); - } - - public string CreateLiteral(object value) - { - if (value == null || value.GetType() != typeof(TimeSpan)) - { - return _code.CreateLiteral(value); - } - - return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); - } - - public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile) - { - ArgumentNotNull(types, "types"); - ArgumentNotNull(sourceFile, "sourceFile"); - - var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase); - if (types.Any(item => !hash.Add(item))) - { - _errors.Add( - new CompilerError(sourceFile, -1, -1, "6023", - String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); - return false; - } - return true; - } - - public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection) - { - return GetItemsToGenerate<SimpleType>(itemCollection) - .Where(e => IsEnumType(e)); - } - - public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType - { - return itemCollection - .OfType<T>() - .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) - .OrderBy(i => i.Name); - } - - public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection) - { - return itemCollection - .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) - .Select(g => GetGlobalItemName(g)); - } - - public string GetGlobalItemName(GlobalItem item) - { - if (item is EdmType) - { - return ((EdmType)item).Name; - } - else - { - return ((EntityContainer)item).Name; - } - } - - public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetComplexProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type); - } - - public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - } - - public FunctionParameter GetReturnParameter(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); - return returnParamsProperty == null - ? edmFunction.ReturnParameter - : ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); - } - - public bool IsComposable(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); - return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); - } - - public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction) - { - return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - } - - public TypeUsage GetReturnType(EdmFunction edmFunction) - { - var returnParam = GetReturnParameter(edmFunction); - return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); - } - - public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) - { - var returnType = GetReturnType(edmFunction); - return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; - } -} - -public static void ArgumentNotNull<T>(T arg, string name) where T : class -{ - if (arg == null) - { - throw new ArgumentNullException(name); - } -} -#>
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Designer.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Designer.cs deleted file mode 100644 index 1881fe812..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.Designer.cs +++ /dev/null @@ -1,10 +0,0 @@ -// T4 code generation is enabled for model 'C:\DATA\Development\Tango\Software\Visual_Studio\Web\Tango.MachineService.Gateway\DB\GatewayDatabaseModel.edmx'. -// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer -// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model -// is open in the designer. - -// If no context and entity classes have been generated, it may be because you created an empty model but -// have not yet chosen which version of Entity Framework to use. To generate a context class and entity -// classes for your model, open the model in the designer, right-click on the designer surface, and -// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation -// Item...'.
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.cs deleted file mode 100644 index 7cc066228..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.edmx b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.edmx deleted file mode 100644 index 8d01b99f2..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.edmx +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx"> - <!-- EF Runtime content --> - <edmx:Runtime> - <!-- SSDL content --> - <edmx:StorageModels> - <Schema Namespace="GatewayModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl"> - <EntityType Name="ENVIRONMENTS"> - <Key> - <PropertyRef Name="ID" /> - </Key> - <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" /> - <Property Name="NAME" Type="nvarchar" MaxLength="100" Nullable="false" /> - <Property Name="DESCRIPTION" Type="nvarchar" MaxLength="100" Nullable="false" /> - <Property Name="MACHINE_SERVICE_ADDRESS" Type="nvarchar" MaxLength="300" Nullable="false" /> - </EntityType> - <EntityContainer Name="GatewayModelStoreContainer"> - <EntitySet Name="ENVIRONMENTS" EntityType="Self.ENVIRONMENTS" Schema="dbo" store:Type="Tables" /> - </EntityContainer> - </Schema> - </edmx:StorageModels> - <!-- CSDL content --> - <edmx:ConceptualModels> - <Schema Namespace="GatewayModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm"> - <EntityType Name="ENVIRONMENT"> - <Key> - <PropertyRef Name="ID" /> - </Key> - <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" /> - <Property Name="NAME" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" /> - <Property Name="DESCRIPTION" Type="String" MaxLength="100" FixedLength="false" Unicode="true" Nullable="false" /> - <Property Name="MACHINE_SERVICE_ADDRESS" Type="String" MaxLength="300" FixedLength="false" Unicode="true" Nullable="false" /> - </EntityType> - <EntityContainer Name="GatewayDbContext" annotation:LazyLoadingEnabled="true"> - <EntitySet Name="ENVIRONMENTS" EntityType="Self.ENVIRONMENT" /> - </EntityContainer> - </Schema> - </edmx:ConceptualModels> - <!-- C-S mapping content --> - <edmx:Mappings> - <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs"> - <EntityContainerMapping StorageEntityContainer="GatewayModelStoreContainer" CdmEntityContainer="GatewayDbContext"> - <EntitySetMapping Name="ENVIRONMENTS"> - <EntityTypeMapping TypeName="GatewayModel.ENVIRONMENT"> - <MappingFragment StoreEntitySet="ENVIRONMENTS"> - <ScalarProperty Name="ID" ColumnName="ID" /> - <ScalarProperty Name="NAME" ColumnName="NAME" /> - <ScalarProperty Name="DESCRIPTION" ColumnName="DESCRIPTION" /> - <ScalarProperty Name="MACHINE_SERVICE_ADDRESS" ColumnName="MACHINE_SERVICE_ADDRESS" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> - </EntityContainerMapping> - </Mapping> - </edmx:Mappings> - </edmx:Runtime> - <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) --> - <Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx"> - <Connection> - <DesignerInfoPropertySet> - <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" /> - </DesignerInfoPropertySet> - </Connection> - <Options> - <DesignerInfoPropertySet> - <DesignerProperty Name="ValidateOnBuild" Value="true" /> - <DesignerProperty Name="EnablePluralization" Value="true" /> - <DesignerProperty Name="IncludeForeignKeysInModel" Value="true" /> - <DesignerProperty Name="UseLegacyProvider" Value="false" /> - <DesignerProperty Name="CodeGenerationStrategy" Value="None" /> - </DesignerInfoPropertySet> - </Options> - <!-- Diagram content (shape and connector positions) --> - <Diagrams></Diagrams> - </Designer> -</edmx:Edmx>
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.edmx.diagram b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.edmx.diagram deleted file mode 100644 index ccaadbd1d..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.edmx.diagram +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx"> - <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) --> - <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx"> - <!-- Diagram content (shape and connector positions) --> - <edmx:Diagrams> - <Diagram DiagramId="a0f4c52cfde34333ad8acbff4d7567d6" Name="Diagram1"> - <EntityTypeShape EntityType="GatewayModel.ENVIRONMENT" Width="1.5" PointX="0.75" PointY="0.75" IsExpanded="true" /> - </Diagram> - </edmx:Diagrams> - </edmx:Designer> -</edmx:Edmx>
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.tt b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.tt deleted file mode 100644 index d49de7826..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDatabaseModel.tt +++ /dev/null @@ -1,733 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF6.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -const string inputFile = @"GatewayDatabaseModel.edmx"; -var textTransform = DynamicTextTransformation.Create(this); -var code = new CodeGenerationTools(this); -var ef = new MetadataTools(this); -var typeMapper = new TypeMapper(code, ef, textTransform.Errors); -var fileManager = EntityFrameworkTemplateFileManager.Create(this); -var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); -var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); - -if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile)) -{ - return string.Empty; -} - -WriteHeader(codeStringGenerator, fileManager); - -foreach (var entity in typeMapper.GetItemsToGenerate<EntityType>(itemCollection)) -{ - fileManager.StartNewFile(entity.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false)#> -<#=codeStringGenerator.EntityClassOpening(entity)#> -{ -<# - var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity); - var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity); - var complexProperties = typeMapper.GetComplexProperties(entity); - - if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) - { -#> - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] - public <#=code.Escape(entity)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var navigationProperty in collectionNavigationProperties) - { -#> - this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>(); -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var simpleProperties = typeMapper.GetSimpleProperties(entity); - if (simpleProperties.Any()) - { - foreach (var edmProperty in simpleProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var complexProperty in complexProperties) - { -#> - <#=codeStringGenerator.Property(complexProperty)#> -<# - } - } - - var navigationProperties = typeMapper.GetNavigationProperties(entity); - if (navigationProperties.Any()) - { -#> - -<# - foreach (var navigationProperty in navigationProperties) - { - if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) - { -#> - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] -<# - } -#> - <#=codeStringGenerator.NavigationProperty(navigationProperty)#> -<# - } - } -#> -} -<# - EndNamespace(code); -} - -foreach (var complex in typeMapper.GetItemsToGenerate<ComplexType>(itemCollection)) -{ - fileManager.StartNewFile(complex.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> -<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> -{ -<# - var complexProperties = typeMapper.GetComplexProperties(complex); - var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex); - - if (propertiesWithDefaultValues.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(complex)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var simpleProperties = typeMapper.GetSimpleProperties(complex); - if (simpleProperties.Any()) - { - foreach(var edmProperty in simpleProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var edmProperty in complexProperties) - { -#> - <#=codeStringGenerator.Property(edmProperty)#> -<# - } - } -#> -} -<# - EndNamespace(code); -} - -foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection)) -{ - fileManager.StartNewFile(enumType.Name + ".cs"); - BeginNamespace(code); -#> -<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> -<# - if (typeMapper.EnumIsFlags(enumType)) - { -#> -[Flags] -<# - } -#> -<#=codeStringGenerator.EnumOpening(enumType)#> -{ -<# - var foundOne = false; - - foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType)) - { - foundOne = true; -#> - <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>, -<# - } - - if (foundOne) - { - this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1); - } -#> -} -<# - EndNamespace(code); -} - -fileManager.Process(); - -#> -<#+ - -public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager) -{ - fileManager.StartHeader(); -#> -//------------------------------------------------------------------------------ -// <auto-generated> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> -// </auto-generated> -//------------------------------------------------------------------------------ -<#=codeStringGenerator.UsingDirectives(inHeader: true)#> -<#+ - fileManager.EndBlock(); -} - -public void BeginNamespace(CodeGenerationTools code) -{ - var codeNamespace = code.VsNamespaceSuggestion(); - if (!String.IsNullOrEmpty(codeNamespace)) - { -#> -namespace <#=code.EscapeNamespace(codeNamespace)#> -{ -<#+ - PushIndent(" "); - } -} - -public void EndNamespace(CodeGenerationTools code) -{ - if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion())) - { - PopIndent(); -#> -} -<#+ - } -} - -public const string TemplateId = "CSharp_DbContext_Types_EF6"; - -public class CodeStringGenerator -{ - private readonly CodeGenerationTools _code; - private readonly TypeMapper _typeMapper; - private readonly MetadataTools _ef; - - public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(typeMapper, "typeMapper"); - ArgumentNotNull(ef, "ef"); - - _code = code; - _typeMapper = typeMapper; - _ef = ef; - } - - public string Property(EdmProperty edmProperty) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - Accessibility.ForProperty(edmProperty), - _typeMapper.GetTypeName(edmProperty.TypeUsage), - _code.Escape(edmProperty), - _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); - } - - public string NavigationProperty(NavigationProperty navProp) - { - var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2} {{ {3}get; {4}set; }}", - AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), - navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - _code.Escape(navProp), - _code.SpaceAfter(Accessibility.ForGetter(navProp)), - _code.SpaceAfter(Accessibility.ForSetter(navProp))); - } - - public string AccessibilityAndVirtual(string accessibility) - { - return accessibility + (accessibility != "private" ? " virtual" : ""); - } - - public string EntityClassOpening(EntityType entity) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1}partial class {2}{3}", - Accessibility.ForType(entity), - _code.SpaceAfter(_code.AbstractOption(entity)), - _code.Escape(entity), - _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); - } - - public string EnumOpening(SimpleType enumType) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} enum {1} : {2}", - Accessibility.ForType(enumType), - _code.Escape(enumType), - _code.Escape(_typeMapper.UnderlyingClrType(enumType))); - } - - public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter) - { - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; - writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); - } - } - - public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "{0} IQueryable<{1}> {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - _code.Escape(edmFunction), - string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); - } - - public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) - { - var parameters = _typeMapper.GetParameters(edmFunction); - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", - _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), - edmFunction.NamespaceName, - edmFunction.Name, - string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), - _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); - } - - public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); - if (includeMergeOption) - { - paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } - - return string.Format( - CultureInfo.InvariantCulture, - "{0} {1} {2}({3})", - AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), - returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - _code.Escape(edmFunction), - paramList); - } - - public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) - { - var parameters = _typeMapper.GetParameters(edmFunction); - var returnType = _typeMapper.GetReturnType(edmFunction); - - var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } - - return string.Format( - CultureInfo.InvariantCulture, - "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", - returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", - edmFunction.Name, - callParams); - } - - public string DbSet(EntitySet entitySet) - { - return string.Format( - CultureInfo.InvariantCulture, - "{0} virtual DbSet<{1}> {2} {{ get; set; }}", - Accessibility.ForReadOnlyProperty(entitySet), - _typeMapper.GetTypeName(entitySet.ElementType), - _code.Escape(entitySet)); - } - - public string UsingDirectives(bool inHeader, bool includeCollections = true) - { - return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) - ? string.Format( - CultureInfo.InvariantCulture, - "{0}using System;{1}" + - "{2}", - inHeader ? Environment.NewLine : "", - includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", - inHeader ? "" : Environment.NewLine) - : ""; - } -} - -public class TypeMapper -{ - private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; - - private readonly System.Collections.IList _errors; - private readonly CodeGenerationTools _code; - private readonly MetadataTools _ef; - - public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) - { - ArgumentNotNull(code, "code"); - ArgumentNotNull(ef, "ef"); - ArgumentNotNull(errors, "errors"); - - _code = code; - _ef = ef; - _errors = errors; - } - - public static string FixNamespaces(string typeName) - { - return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); - } - - public string GetTypeName(TypeUsage typeUsage) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); - } - - public string GetTypeName(EdmType edmType) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: null); - } - - public string GetTypeName(TypeUsage typeUsage, string modelNamespace) - { - return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); - } - - public string GetTypeName(EdmType edmType, string modelNamespace) - { - return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); - } - - public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) - { - if (edmType == null) - { - return null; - } - - var collectionType = edmType as CollectionType; - if (collectionType != null) - { - return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); - } - - var typeName = _code.Escape(edmType.MetadataProperties - .Where(p => p.Name == ExternalTypeNameAttributeName) - .Select(p => (string)p.Value) - .FirstOrDefault()) - ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? - _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : - _code.Escape(edmType)); - - if (edmType is StructuralType) - { - return typeName; - } - - if (edmType is SimpleType) - { - var clrType = UnderlyingClrType(edmType); - if (!IsEnumType(edmType)) - { - typeName = _code.Escape(clrType); - } - - typeName = FixNamespaces(typeName); - - return clrType.IsValueType && isNullable == true ? - String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : - typeName; - } - - throw new ArgumentException("edmType"); - } - - public Type UnderlyingClrType(EdmType edmType) - { - ArgumentNotNull(edmType, "edmType"); - - var primitiveType = edmType as PrimitiveType; - if (primitiveType != null) - { - return primitiveType.ClrEquivalentType; - } - - if (IsEnumType(edmType)) - { - return GetEnumUnderlyingType(edmType).ClrEquivalentType; - } - - return typeof(object); - } - - public object GetEnumMemberValue(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var valueProperty = enumMember.GetType().GetProperty("Value"); - return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); - } - - public string GetEnumMemberName(MetadataItem enumMember) - { - ArgumentNotNull(enumMember, "enumMember"); - - var nameProperty = enumMember.GetType().GetProperty("Name"); - return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); - } - - public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var membersProperty = enumType.GetType().GetProperty("Members"); - return membersProperty != null - ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) - : Enumerable.Empty<MetadataItem>(); - } - - public bool EnumIsFlags(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); - return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); - } - - public bool IsEnumType(GlobalItem edmType) - { - ArgumentNotNull(edmType, "edmType"); - - return edmType.GetType().Name == "EnumType"; - } - - public PrimitiveType GetEnumUnderlyingType(EdmType enumType) - { - ArgumentNotNull(enumType, "enumType"); - - return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); - } - - public string CreateLiteral(object value) - { - if (value == null || value.GetType() != typeof(TimeSpan)) - { - return _code.CreateLiteral(value); - } - - return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); - } - - public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile) - { - ArgumentNotNull(types, "types"); - ArgumentNotNull(sourceFile, "sourceFile"); - - var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase); - if (types.Any(item => !hash.Add(item))) - { - _errors.Add( - new CompilerError(sourceFile, -1, -1, "6023", - String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); - return false; - } - return true; - } - - public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection) - { - return GetItemsToGenerate<SimpleType>(itemCollection) - .Where(e => IsEnumType(e)); - } - - public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType - { - return itemCollection - .OfType<T>() - .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) - .OrderBy(i => i.Name); - } - - public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection) - { - return itemCollection - .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) - .Select(g => GetGlobalItemName(g)); - } - - public string GetGlobalItemName(GlobalItem item) - { - if (item is EdmType) - { - return ((EdmType)item).Name; - } - else - { - return ((EntityContainer)item).Name; - } - } - - public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetComplexProperties(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); - } - - public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type) - { - return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); - } - - public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type); - } - - public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type) - { - return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - } - - public FunctionParameter GetReturnParameter(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); - return returnParamsProperty == null - ? edmFunction.ReturnParameter - : ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); - } - - public bool IsComposable(EdmFunction edmFunction) - { - ArgumentNotNull(edmFunction, "edmFunction"); - - var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); - return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); - } - - public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction) - { - return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); - } - - public TypeUsage GetReturnType(EdmFunction edmFunction) - { - var returnParam = GetReturnParameter(edmFunction); - return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); - } - - public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) - { - var returnType = GetReturnType(edmFunction); - return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; - } -} - -public static void ArgumentNotNull<T>(T arg, string name) where T : class -{ - if (arg == null) - { - throw new ArgumentNullException(name); - } -} -#>
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDbContext.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDbContext.cs new file mode 100644 index 000000000..9f4a9f0f9 --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDbContext.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Web; +using Tango.Core; + +namespace Tango.MachineService.Gateway.DB +{ + public class GatewayDbContext : DbContext + { + public GatewayDbContext(DataSource dataSource) : base(dataSource.ToConnection(), true) + { + + } + + public static GatewayDbContext CreateDefault() + { + return new GatewayDbContext(new DataSource() + { + Address = GatewayConfig.DB_ADDRESS, + IntegratedSecurity = false, + Catalog = GatewayConfig.DB_CATALOG, + Type = DataSourceType.SQLServer, + UserName = GatewayConfig.DB_USER_NAME, + Password = GatewayConfig.DB_PASSWORD + }); + } + + /// <summary> + /// Gets or sets the environments. + /// </summary> + public DbSet<Environment> Environments + { + get; set; + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDbContextExtension.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDbContextExtension.cs deleted file mode 100644 index 78478b903..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/DB/GatewayDbContextExtension.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Linq; -using System.Web; -using Tango.Core; - -namespace Tango.MachineService.Gateway.DB -{ - public partial class GatewayDbContext : DbContext - { - public GatewayDbContext(DataSource dataSource) : base(dataSource.ToConnection(), false) - { - - } - - public static GatewayDbContext CreateDefault() - { - return new GatewayDbContext(null); - } - } -}
\ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/GatewayConfig.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/GatewayConfig.cs index e7ad241ed..dbbb10709 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/GatewayConfig.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/GatewayConfig.cs @@ -9,6 +9,11 @@ namespace Tango.MachineService.Gateway { public class GatewayConfig { + public static String DB_ADDRESS => ConfigurationManager.AppSettings[nameof(DB_ADDRESS)].ToString(); + public static String DB_USER_NAME => ConfigurationManager.AppSettings[nameof(DB_USER_NAME)].ToString(); + public static String DB_PASSWORD => ConfigurationManager.AppSettings[nameof(DB_PASSWORD)].ToString(); + public static String DB_CATALOG => ConfigurationManager.AppSettings[nameof(DB_CATALOG)].ToString(); + public static String JWT_TOKEN_SECRET => ConfigurationManager.AppSettings[nameof(JWT_TOKEN_SECRET)].ToString(); public static String AZURE_UTILS_GROUP => ConfigurationManager.AppSettings[nameof(AZURE_UTILS_GROUP)].ToString(); public static String TENANT_ID => ConfigurationManager.AppSettings[nameof(TENANT_ID)].ToString(); diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Tango.MachineService.Gateway.csproj b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Tango.MachineService.Gateway.csproj index d0f1463f6..f749f7f57 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Tango.MachineService.Gateway.csproj +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Tango.MachineService.Gateway.csproj @@ -251,25 +251,8 @@ <Compile Include="Controllers\GatewayController.cs" /> <Compile Include="Controllers\HomeController.cs" /> <Compile Include="Controllers\ValuesController.cs" /> - <Compile Include="DB\ENVIRONMENT.cs"> - <DependentUpon>GatewayDatabaseModel.tt</DependentUpon> - </Compile> - <Compile Include="DB\GatewayDatabaseModel.Context.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>GatewayDatabaseModel.Context.tt</DependentUpon> - </Compile> - <Compile Include="DB\GatewayDatabaseModel.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>GatewayDatabaseModel.tt</DependentUpon> - </Compile> - <Compile Include="DB\GatewayDatabaseModel.Designer.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>GatewayDatabaseModel.edmx</DependentUpon> - </Compile> - <Compile Include="DB\GatewayDbContextExtension.cs" /> + <Compile Include="DB\Environment.cs" /> + <Compile Include="DB\GatewayDbContext.cs" /> <Compile Include="DTO\EnvironmentConfiguration.cs" /> <Compile Include="Filters\JwtTokenFilter.cs" /> <Compile Include="Global.asax.cs"> @@ -283,16 +266,6 @@ <Compile Include="WebToken.cs" /> </ItemGroup> <ItemGroup> - <Content Include="DB\GatewayDatabaseModel.Context.tt"> - <Generator>TextTemplatingFileGenerator</Generator> - <DependentUpon>GatewayDatabaseModel.edmx</DependentUpon> - <LastGenOutput>GatewayDatabaseModel.Context.cs</LastGenOutput> - </Content> - <Content Include="DB\GatewayDatabaseModel.tt"> - <Generator>TextTemplatingFileGenerator</Generator> - <DependentUpon>GatewayDatabaseModel.edmx</DependentUpon> - <LastGenOutput>GatewayDatabaseModel.cs</LastGenOutput> - </Content> <Content Include="Global.asax" /> <Content Include="Web.config"> <SubType>Designer</SubType> @@ -311,13 +284,6 @@ <Folder Include="Models\" /> </ItemGroup> <ItemGroup> - <EntityDeploy Include="DB\GatewayDatabaseModel.edmx"> - <Generator>EntityModelCodeGenerator</Generator> - <LastGenOutput>GatewayDatabaseModel.Designer.cs</LastGenOutput> - </EntityDeploy> - <Content Include="DB\GatewayDatabaseModel.edmx.diagram"> - <DependentUpon>GatewayDatabaseModel.edmx</DependentUpon> - </Content> <Content Include="Nswag\GatewayClient.nswag" /> <None Include="packages.config"> <SubType>Designer</SubType> diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Web.config b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Web.config index f88daea88..6dd29d57d 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Web.config +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Web.config @@ -16,7 +16,7 @@ <add key="DB_ADDRESS" value="twine.database.windows.net" /> <add key="DB_USER_NAME" value="Roy" /> <add key="DB_PASSWORD" value="Aa123456" /> - <add key="DB_CATALOG" value="Tango_Gateway" /> + <add key="DB_CATALOG" value="Gateway" /> <add key="TENANT_ID" value="2ebd63a5-bc2f-41dc-9066-4409ed5e5dd4" /> <add key="CLIENT_ID" value="be33437c-5052-449f-ab9d-a88d008eae24" /> <add key="CLIENT_SECRET" value="bf67fb6f-4d06-4893-988c-6b347aff23d6" /> |
