Class BaseModel
Abstract base model.
public abstract class BaseModel : IModel, IDisposable
- Inheritance
-
BaseModel
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
BaseModel()
Default ctor.
protected BaseModel()
BaseModel(string, string?, IReadOnlyDictionary<string, object?>?)
Ctor from base properties.
protected BaseModel(string name, string? description, IReadOnlyDictionary<string, object?>? properties)
Parameters
name
stringdescription
stringproperties
IReadOnlyDictionary<string, object>
Properties
Description
Model description.
public string Description { get; }
Property Value
Name
Model name.
public string Name { get; }
Property Value
Properties
Model properties.
public IReadOnlyDictionary<string, object?> Properties { get; }
Property Value
Methods
Dispose()
Dispose
public void Dispose()
Dispose(bool)
dispose when == true.
protected abstract void Dispose(bool disposing)
Parameters
disposing
bool
InitBase(string, string?, IReadOnlyDictionary<string, object?>?)
Base init.
protected void InitBase(string name, string? description, IReadOnlyDictionary<string, object?>? properties)
Parameters
name
stringdescription
stringproperties
IReadOnlyDictionary<string, object>
Remarks
Used to support implementing Job.Initialize()...
PropertyBool(string, bool)
Return a property's boolean value or defaultVal
if not existing or not convertible to bool.
public bool PropertyBool(string propKey, bool defaultVal)
Parameters
Returns
PropertyEnum(string, Enum)
Return an enumeration member named by the property's string value or defaultEnum
if not existing.
public object PropertyEnum(string propKey, Enum defaultEnum)
Parameters
Returns
Exceptions
- ArgumentException
if property's string value is not a named constant of the enumeration
PropertyInt(string, int)
Return a property's integer value or defaultVal
if not existing or not convertible to int.
public int PropertyInt(string propKey, int defaultVal)
Parameters
Returns
PropertyString(string)
Return a property's string value or null if not existing or not a string.
public string? PropertyString(string propKey)
Parameters
propKey
string
Returns
PropertyString(string, string)
Return a property's string value or defaultVal
if not existing or not a string.
public string PropertyString(string propKey, string defaultVal)