ModelFactory Class

Generate new instances of business objects.

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+ce90b2cf6b782b8d7b7fd47b3c546987c652c00f
public static class ModelFactory
Inheritance
Object    ModelFactory

Remarks

To ensure all business objects are in a valid state once created, we use this model factory rather than constructors; the constructors are only accessible for the ModelFactory and JSON Serializer MtJsonHandler. This is to ensure that all required properties are set properly.

Methods

GenerateAccountFromData Generates a new AccountDto from data.
GenerateActionFlowAssignment Creates a new ActionFlowAssignmentDto based on the given parameters.
GenerateActionFlowDefinition Generates a new ActionFlowDefinitionDto based on the given parameters.
GenerateActionFlowNode Generates a new NodeDto for an action flow based on information received from Blazor.Diagrams.
GenerateAlertRuleProcessResult Generates a AlertRuleProcessResultDto to be logged to the database after an alert rule was processed.
GenerateBlobData(String, BlobDownloadResult) Factory method for generating a BlobDto based on an Azure Storage Blob.
GenerateBlobData(String, Byte, BlobItem) Factory method for generating a BlobDto based on an Azure Storage Blob.
GenerateBlobData(String, Byte, BlobContentInfo, FileResourceTypeMap) Factory method for generating a BlobDto based on an Azure Storage Blob.
GenerateBlobFolder(BlobHierarchyItem, Guid) Generates a folder BlobDto based on a BlobHierarchyItem.
GenerateBlobFolder(String, Guid) Generates a folder BlobDto based on a BlobHierarchyItem.
GenerateCompanyFromData Generates a new CompanyDto from data
GenerateCompanySettings Generates default settings for a CompanyDto. These are normally created when the first user of said company signs in for the first time.
GenerateConfirmationNotificationFromFourEyesRequest Generates a new NotificationDto for a four eyes request that was accepted, letting the requester know it was accepted.
GenerateCustomContent Generates a new CustomPageDto based on the given parameters.
GenerateCustomPage Generates a new CustomPageDto based on the given parameters.
GenerateDashboard Generates a new DashboardDto based on the given parameters.
GenerateDeletedItem Generates a deleted item instance (based on a soft-deleted CompanyDto)
GeneratedEncryptedPassword Generates an encrypted password for a recipient.
GenerateDeviceMessage Generates a new DeviceMessageDto for a device, usually created when the device receiver receives a message.
GenerateEmptyAlertRule Generates an empty AlertRuleDto, with the intent that the user fills in the blanks before saving.
GenerateEmptyAlertType Generates an empty AlertTypeDto, with the intent that the user fills in the blanks before saving.
GenerateEmptyAlertTypeConfiguration Generates an AlertTypeConfiguration.
GenerateEmptyNotification Generates an empty messages to showcase there are no new notifications for the user.
GenerateEmptyPhoneNumber Generates a new PhoneNumber; we need currentCompany to determine the country code.
GenerateEmptyRoleAssignment Generates an empty RoleAssignmentDto, with the intent that the user fills in the blanks before saving.
GenerateGeofence Generates a new GeofenceDto based on the given parameters.
GenerateGlobalDashboard Generates a new DashboardDto for use by all users.
GenerateHtmlSection Generates a new HtmlSectionDto for a custom page.
GenerateHtmlSegment Generates a new HtmlSegmentDto for a custom page.
GenerateImageReference Generates an image reference, usually because of an image derived from the Azure Blob Storage or because the user uploaded an image.
GenerateLogForBackgroundProcess(Guid, EventId, CompanyDto, NullableGeoLocation, IIdLabel) Generates a log for an event inside background processes, e.g. the Event Handler or Device Receiver. (not the portal or API!).
GenerateLogForBackgroundProcessT(Guid, EventId, T, NullableGeoLocation, IIdLabel) Generates a log for events inside background processes, e.g. the Event Handler or Device Receiver. (not the portal or API!).
GenerateLogForException Generates a log for an exception.
GenerateLogForUserAction Generates a log generated because a user performed an action.
GenerateNewAccount Generates a new AccountDto
GenerateNewCompany Generates a new company with a main environment.
GenerateNewDevice Generates a new DeviceDto
GenerateNewEnvironment Generates a new EnvironmentDto
GenerateNewMapMarker Generates a new MapMarkerDto
GenerateNewMfaConnection Generates a new MfaConnectionDto
GenerateNewNotificationFromDeviceMessage Generates a new NotificationDto
GenerateNewNotificationFromFourEyesRequestT Generates a new NotificationDto for a four eyes request
GenerateNewRequest Generates a new RequestDto
GenerateNewRole Generates a new custom RoleDto, for use by a single company
GenerateNewRoleAssignment Generates a new role assignment for user recipient
GenerateOnAccountCreatedInputByOtherUser Generates the input model for OnAccountCreated action
GenerateOnAccountDeletedInputByOtherUser Generates the input model for OnAccountDeleted action
GenerateOnAccountUpdatedInputByOtherUser Generates the input model for OnAccountCreated action
GenerateOnDeviceCommandModel(DeviceDto, DeviceCommandType, DictionaryString, Object) Generates the input model for action
GenerateOnDeviceCommandModel(DeviceDto, DeviceCommandType, Object) Generates the input model for OnDeviceCommand action
GenerateOnDeviceConnectedModel Generates the input model for OnDeviceConnected action
GenerateOnDeviceCreatedInputByOtherUser Generates the input model for OnDeviceCreated action
GenerateOnDeviceDeletedInputByOtherUser Generates the input model for OnDeviceDeleted action
GenerateOnDeviceRebuildInputByOtherUser Generates the input model for OnDeviceRebuild action
GenerateOnDeviceRequestModel Generates the input model for OnDeviceMessageReceived action
GenerateOnDeviceUpdatedInputByOtherUser Generates the input model for OnDeviceUpdated action
GenerateOnEnvironmentCreatedInputByOtherUser Generates the input model for OnEnvironmentCreated action
GenerateOnEnvironmentDeletedInputByOtherUser Generates the input model for OnEnvironmentDeleted action
GenerateOnEnvironmentUpdatedInputByOtherUser Generates the input model for OnEnvironmentUpdated action
GenerateProgressBarItem Generates a new NodeProgressDto for a process bar.
GenerateRandomPassword Generates a new password of length len.
GenerateRootBlobFolder Generates the root folder (in the Azure Container) that the company owns.
GenerateSpoofEnvironment Generates a fake environment, only for use in testing/benchmarks!
GenerateTemplate Generates a new TemplateDto for a company.
GenerateTemplateLocalization Generates a new TemplateLocalizationDto for a template.
GenerateTemplateParameter Generates a new parameter for a TemplateDto
GenerateUserSettings Generates default settings for a AccountDto. These are normally created when the user signs in for the first time.
HashPassword Hashes a password (for validation)

See Also