# Name Alias Provider

`IAliasProvider` in assembly SanteDB.Core.Api version 3.0.1980.0

## Summary

Provider for name and place aliasing

### Description

Some implementations of the SanteDB engine allow for searching of data based on aliases. This aliasing allows SanteDB to map an inbound query parameter like 'Bob' to 'Robert' or 'Will' to 'Bill' and 'William'. The service is responsible for providing the known aliases for each name into the SanteDB infrastructure, and these can be accessed using the HDSI extended query filter:

```
name.component.value=:(alias|Bob)&gt;=1.0
```

```
        which indicates that the aliases of the stored name should match Bob.
```

## Operations

| Operation     | Response/Return                                   | Input/Parameter                                                                                                                                                                               | Description                                        |
| ------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| GetAlias      | IEnumerable\<ComponentAlias>                      | *String* **name**                                                                                                                                                                             | Gets the known alias names and score for the alias |
| AddAlias      | void                                              | <p><em>String</em> <strong>name</strong><br><em>String</em> <strong>alias</strong><br><em>Double</em> <strong>weight</strong></p>                                                             | Add an alias to the alias provider                 |
| RemoveAlias   | void                                              | <p><em>String</em> <strong>name</strong><br><em>String</em> <strong>alias</strong></p>                                                                                                        | Remove the specified alias                         |
| GetAllAliases | IDictionary\<String,IEnumerable\<ComponentAlias>> | <p><em>String</em> <strong>filter</strong><br><em>Int32</em> <strong>offset</strong><br><em>Nullable\<Int32></em> <strong>count</strong><br><em>Int32&</em> <strong>totalResults</strong></p> | Get all aliases                                    |

## Implementations

None

## Example Implementation

```csharp
/// Example Implementation
using SanteDB.Core.Services;
/// Other usings here
public class MyAliasProvider : SanteDB.Core.Services.IAliasProvider { 
	public String ServiceName => "My own IAliasProvider service";
	/// <summary>
	/// Gets the known alias names and score for the alias
	/// </summary>
	public IEnumerable<ComponentAlias> GetAlias(String name){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Add an alias to the alias provider
	/// </summary>
	public void AddAlias(String name,String alias,Double weight){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Remove the specified alias
	/// </summary>
	public void RemoveAlias(String name,String alias){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Get all aliases
	/// </summary>
	public IDictionary<String,IEnumerable<ComponentAlias>> GetAllAliases(String filter,Int32 offset,Nullable<Int32> count,Int32& totalResults){
		throw new System.NotImplementedException();
	}
}
```

## References

* [IAliasProvider C# Documentation](http://santesuite.org/assets/doc/net/html/T_SanteDB_Core_Services_IAliasProvider.htm)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.santesuite.org/developers/server-plugins/implementing-.net-features/service-definitions/name-alias-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
