Table of Contents

Class KeyOnlyAttribute

Namespace
DynaSharp.Mapping
Assembly
DynaSharp.dll

Stores a property only inside a key and restores it by parsing that key, which saves the bytes of a separate attribute. No attribute holds it, so it has no handle in Attrs: a condition, a filter, an update and Select cannot name it.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class KeyOnlyAttribute : Attribute
Inheritance
KeyOnlyAttribute
Inherited Members

Remarks

At least one key template must hold the property without loss. Text and numbers do, and a timestamp needs the format ticks, which a placeholder without a format has: every other format truncates. No format keeps the offset of a DateTimeOffset, which an attribute does not store either. Generated projections include every key a property is restored from. A property without this attribute is stored, so an input of a template such as appointment#{Key:raw} adds an attribute Key to every item a Put writes. This attribute is for items that do not hold it: on a table whose items hold it, a Put drops it. A read restores such a property the same way only if its attribute is missing, which is what an item created by an update looks like; a key that does not parse then restores nothing.

Constructors

KeyOnlyAttribute()

public KeyOnlyAttribute()