Class ContextManager
Contains the main api functions
Inheritance
Inherited Members
Namespace: Simplic.Framework.Extension.UI
Assembly: Simplic.Framework.Extension.dll
Syntax
public class ContextManager
Methods
| Improve this Doc View SourceDeleteAttribute(Attribute)
Delete an attribute from the database
Declaration
public void DeleteAttribute(Attribute attribute)
Parameters
Type | Name | Description |
---|---|---|
Attribute | attribute |
DeleteAttributeValues(IList<AttributeValue>)
Removes a list of values from the database
Declaration
public void DeleteAttributeValues(IList<AttributeValue> values)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<AttributeValue> | values | List of values |
DeleteColumnConfiguration(IList<ContextColumn>)
Delete all configurations from the database
Declaration
public void DeleteColumnConfiguration(IList<ContextColumn> columns)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<ContextColumn> | columns | List of columns |
DeleteContext(Guid)
Sets IsDeleted true
Declaration
public void DeleteContext(Guid guid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | guid |
DeletePropertyAssignment(PropertyAssignment)
Remove property assignment from database
Declaration
public void DeletePropertyAssignment(PropertyAssignment assignment)
Parameters
Type | Name | Description |
---|---|---|
PropertyAssignment | assignment | Assignment instance |
GetAllAttributes()
Load all attributes from the database
Declaration
public IEnumerable<Attribute> GetAllAttributes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Attribute> | Enumerable of attributes |
GetAllContexts()
Load a list of all available contexts
Declaration
public IEnumerable<Context> GetAllContexts()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Context> |
GetAllPropertyAssignment()
Get all available property assignments
Declaration
public IEnumerable<PropertyAssignment> GetAllPropertyAssignment()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyAssignment> | Enumerable of assignments |
GetAllPropertyDefinitions(Guid)
Gets all property definitions as enumerable
Declaration
public IEnumerable<PropertyDefinition> GetAllPropertyDefinitions(Guid contextId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | contextId |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyDefinition> | Proeprty definitions |
GetAttribute(Guid)
Load an attribute from the database
Declaration
public Attribute GetAttribute(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique attribute id |
Returns
Type | Description |
---|---|
Attribute | Attribute instance if found |
GetColumnConfiguration(Nullable<Guid>, Guid)
Get a list of configurations from the database
Declaration
public IEnumerable<ContextColumn> GetColumnConfiguration(Guid? groupId, Guid contextId)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Guid> | groupId | group id |
System.Guid | contextId | Unique stack id |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ContextColumn> | List of columns |
GetComposedColumnConfiguration(Guid)
Get a composed list of configurations
Declaration
public IEnumerable<ContextColumn> GetComposedColumnConfiguration(Guid contractGroupId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | contractGroupId | Article group id |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ContextColumn> | List of composed configurations |
GetContext(Guid)
Load an context from the database
Declaration
public Context GetContext(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique context id |
Returns
Type | Description |
---|---|
Context |
GetContractTableProperties(String)
Gets all article property types
Declaration
public IDictionary<string, Type> GetContractTableProperties(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.Type> |
GetPropertyAssignmentsByContractGroup(Guid)
Get all assignments that belongs to an article group
Declaration
public IEnumerable<PropertyAssignment> GetPropertyAssignmentsByContractGroup(Guid contractGroupId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | contractGroupId | Unique article group id |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyAssignment> | Enumerable of assignments |
GetPropertyDefinition(Guid)
Gets a property definition by its id
Declaration
public PropertyDefinition GetPropertyDefinition(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique property definition |
Returns
Type | Description |
---|---|
PropertyDefinition | Propertydefinition or null |
LoadAttributeValues(Guid)
Load all attribute values by an attribute id
Declaration
public IEnumerable<AttributeValue> LoadAttributeValues(Guid attributeId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | attributeId | Unique attribute id |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<AttributeValue> | Enumerable of attribute values |
SaveAttribute(Attribute)
Save an attribute in the database
Declaration
public void SaveAttribute(Attribute attribute)
Parameters
Type | Name | Description |
---|---|---|
Attribute | attribute | Attribute instance |
SaveAttributeValues(IList<AttributeValue>)
Save a list of attribute values to the database
Declaration
public void SaveAttributeValues(IList<AttributeValue> values)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<AttributeValue> | values | List of values |
SaveColumnConfiguration(IList<ContextColumn>)
Save a list of column configurations
Declaration
public void SaveColumnConfiguration(IList<ContextColumn> columns)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<ContextColumn> | columns | Columns to save |
SaveContext(Context)
writes a context to the database
Declaration
public void SaveContext(Context context)
Parameters
Type | Name | Description |
---|---|---|
Context | context |
SavePropertyAssignment(PropertyAssignment)
Insert or update a property assignment in the database
Declaration
public void SavePropertyAssignment(PropertyAssignment assignment)
Parameters
Type | Name | Description |
---|---|---|
PropertyAssignment | assignment | Assignment instance |
SavePropertyDefinition(PropertyDefinition, Guid)
Save a db property in the database
Declaration
public void SavePropertyDefinition(PropertyDefinition propertyDefinition, Guid contextId)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinition | propertyDefinition | Db-Property definition |
System.Guid | contextId |