Link Search Menu Expand Document

Charset


This attribute sets the FbParameter.Charset property value via a class property.

Attribute

Example usage:

public class Person
{
    public int Id { get; set; }

    [Charset(FbCharset.Utf8)]
    public string Name { get; set; }
}

Fluent Mapping

To configure via FluentMapper:

FluentMapper
    .Entity<Person>()
    .PropertyValueAttributes(e => e.Name, new CharsetAttribute(FbCharset.Utf8));

Retrieval

Retrieve the attribute via PropertyValueAttributeCache:

var attribute = PropertyValueAttributeCache
    .Get<Person>(e => e.Name)?
    .FirstOrDefault(e => e.GetType() == typeof(CharsetAttribute));

We strongly recommend using PropertyValueAttributeCache for maximum performance.