Click or drag to resize

DataContext Class

Defines a data context for Razor views.
Inheritance Hierarchy
SystemObject
  GSF.Web.ModelDataContext

Namespace: GSF.Web.Model
Assembly: GSF.Web (in GSF.Web.dll) Version: 2.4.207-beta
Syntax
public class DataContext : IDisposable
View Source

The DataContext type exposes the following members.

Constructors
 NameDescription
Public methodDataContext(String, IRazorEngine, ActionException) Creates a new DataContext using the specified settingsCategory.
Public methodDataContext(AdoDataConnection, Boolean, IRazorEngine, ActionException) Creates a new DataContext.
Top
Properties
 NameDescription
Public propertyAddCheckBoxFieldTemplate Gets or sets the check box field razor template file name.
Public propertyAddDateFieldTemplate Gets or sets the date field razor template file name.
Public propertyAddInputFieldTemplate Gets or sets the input field razor template file name.
Public propertyAddSelectFieldTemplate Gets or sets the select field razor template file name.
Public propertyAddTextAreaFieldTemplate Gets or sets the text area field razor template file name.
Public propertyConnection Gets the AdoDataConnection for this DataContext, creating a new one if needed.
Public propertyCustomTableOperationTokens Gets dictionary of per-model custom tokens to use with AmendExpressionAttribute values for TableOperationsT in this DataContext .
Public propertyDefinedDateFields Gets defined date fields, if any.
Public propertyFieldValidationParameters Gets validation pattern and error message for rendered fields, if any.
Public propertyFieldValueInitializers Gets field value initializers, if any.
Public propertyInitialFocusField Gets field name designated for initial focus.
Public propertyRazorEngine Gets reference to IRazorEngine used by this DataContext.
Public propertyReadonlyHotLinkFields Gets any text input fields that should render clickable URLs and e-mail addresses when in view mode.
Top
Methods
 NameDescription
Public methodAddCheckBoxField(String, String, String, String, String, String, String, String, Boolean) Generates template based check box field based on specified parameters.
Public methodAddCheckBoxFieldTModel(String, String, String, String, String, String, String, String, Boolean) Generates template based check box field based on reflected modeled table field attributes.
Public methodAddDateField(String, Boolean, Int32, String, String, String, String, String, String, String, String, String, Boolean) Generates template based input date field based on specified parameters.
Public methodAddDateFieldTModel(String, String, String, String, String, String, String, String, String, String, Boolean) Generates template based input date field based on reflected modeled table field attributes.
Public methodAddFieldValidation Adds a new pattern based validation and option error message to a field.
Public methodAddFieldValueInitializer(String, String) Adds a new field value initializer.
Public methodAddFieldValueInitializerTModel(String) Adds a new field value initializer based on modeled table field attributes.
Public methodAddInputField(String, Boolean, Int32, String, String, String, String, String, String, String, String, String, Boolean, Boolean) Generates template based input text field based on specified parameters.
Public methodAddInputFieldTModel(String, String, String, String, String, String, String, String, String, String, Boolean, Boolean) Generates template based input text field based on reflected modeled table field attributes.
Public methodAddPageDefinedFieldInitialization Adds field initialization, and optional validation, from a page-defined (e.g., loaded from database) parameter definition.
Public methodAddReadOnlyHotLinkField Renders a read-only field with enabled hot links for a given text input field when in view mode.
Public methodAddSelectFieldTModel(DictionaryString, String, String, Boolean, String, String, String, String, String, String, String, String, String, Boolean, Boolean, String, Boolean, String, Boolean, String, String) Generates template based select field based on a dictionary of field attributes.
Public methodAddSelectFieldTOption(String, Boolean, String, String, String, String, String, String, String, String, String, String, String, String, Boolean, RecordRestriction, Boolean, String, Boolean, String, Boolean, String, String) Generates template based select field based on specified parameters.
Public methodAddSelectFieldTModel, TOption(String, String, String, String, String, String, String, String, String, String, String, String, String, Boolean, RecordRestriction, Boolean, String, Boolean, String, Boolean, String, String) Generates template based select field based on reflected modeled table field attributes.
Public methodAddSelectFieldFromEnumTOption(String, Boolean, String, String, String, String, String, String, String, String, String, Boolean, Boolean, String, Boolean, String, Boolean, String, String) Generates template based select field based on specified parameters.
Public methodAddSelectFieldFromEnumTModel, TOption(String, String, String, String, String, String, String, String, String, String, Boolean, Boolean, String, Boolean, String, Boolean, String, String) Generates template based select field based on reflected modeled enum field attributes.
Public methodAddTextAreaField(String, Boolean, Int32, Int32, String, String, String, String, String, String, String, String, Boolean, Boolean) Generates template based text area field based on specified parameters.
Public methodAddTextAreaFieldTModel(String, Int32, String, String, String, String, String, String, String, String, Boolean, Boolean) Generates template based text area field based on reflected modeled table field attributes.
Public methodConfigureView(HttpRequestMessage, Object) Configures a simple view with common view bag parameters.
Public methodConfigureView(RequestContext, Object) Configures a simple view with common view bag parameters.
Public methodConfigureView(String, Object) Configures a simple view with common view bag parameters.
Public methodConfigureView(Type, Type, HttpRequestMessage, Object) Configures a view establishing user roles based on modeled table model and SignalR hub.
Public methodConfigureView(Type, Type, String, Object) Configures a view establishing user roles based on modeled table model and SignalR hub.
Public methodConfigureView(Type, Type, RequestContext, Object) Configures a view establishing user roles based on modeled table model and SignalR hub.
Public methodConfigureViewTModel, THub(HttpRequestMessage, Object) Configures a view establishing user roles based on modeled table TModel and SignalR THub.
Public methodConfigureViewTModel, THub(RequestContext, Object) Configures a view establishing user roles based on modeled table TModel and SignalR THub.
Public methodConfigureViewTModel, THub(String, Object) Configures a view establishing user roles based on modeled table TModel and SignalR THub.
Public methodDispose Releases all the resources used by the DataContext object.
Protected methodDispose(Boolean) Releases the unmanaged resources used by the DataContext object and optionally releases the managed resources.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodEstablishUserRolesForPage(Type, RecordOperationsCache, Object) Looks up proper user roles for paged based on modeled security in RecordOperationsCache.
Public methodEstablishUserRolesForPage(Type, Type, Object) Looks up proper user roles for paged based on modeled security in RecordOperationsCache.
Public methodEstablishUserRolesForPageTModel(RecordOperationsCache, Object) Looks up proper user roles for paged based on modeled security in RecordOperationsCache.
Public methodEstablishUserRolesForPageTModel, THub(Object) Looks up proper user roles for paged based on modeled security in RecordOperationsCache.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetIsDeletedFlag(Type) Gets the field name targeted to mark a record as deleted.
Public methodGetIsDeletedFlagTModel Gets the field name targeted to mark a record as deleted.
Public methodGetPrimaryLabelField(Type) Gets the field name targeted as the primary label for the modeled table.
Public methodGetPrimaryLabelFieldTModel Gets the field name targeted as the primary label for the modeled table.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodRenderLookupFunctionTModel Renders client-side Javascript function for looking up single values from a table.
Public methodRenderViewModelConfigurationTModel(RecordOperationsCache, Object, String, String, String, Object) Renders client-side configuration script for paged view model.
Public methodRenderViewModelConfigurationTModel, THub(Object, String, String, Object) Renders client-side configuration script for paged view model.
Public methodTable(Type) Gets the table operations for the specified modeled table type model.
Public methodTableTModel Gets the table operations for the specified modeled table TModel.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodUserIsInGroup(SecurityPrincipal, String) Determines if user is in a specific group or list of groups (comma separated).
Public methodUserIsInGroup(SecurityPrincipal, String) Determines if user is in one of the provided of groups.
Public methodUserIsInRole(SecurityPrincipal, String) Determines if user is in a specific role or list of roles (comma separated).
Public methodUserIsInRole(SecurityPrincipal, String) Determines if user is in one of the provided of roles.
Top
Fields
 NameDescription
Public fieldStatic memberUrlValidation Defines the regular expression used to validate URLs.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
This class is used by views to render HTML form input templates, paged view model configurations, provide access to modeled table operations and general database access.
See Also