EntityTranslationService<TBaseEntity, TTranslation> Class
Assembly: PTS.Modules.EntityTranslationComponent.dll
Syntax
public abstract class EntityTranslationService<TBaseEntity, TTranslation> : SingleRepositoryService<TTranslation>, IServiceProviderAccessor, IEntityTranslationService<TBaseEntity, TTranslation> where TBaseEntity : class, IIdRecord where TTranslation : class, IEntityPropertyTranslation<TBaseEntity>, new()
Type Parameters
Name |
Description |
TBaseEntity
|
|
TTranslation
|
|
Inheritance
System.Object
EntityTranslationService<TBaseEntity, TTranslation>
Constructors
EntityTranslationService(IUnitOfWork)
Declaration
public EntityTranslationService(IUnitOfWork unitOfWork)
Parameters
Methods
Entity<TEntity>(LanguageCode, TEntity)
Declaration
public virtual EntityTranslation<TEntity> Entity<TEntity>(LanguageCode language, TEntity entity)
where TEntity : class, TBaseEntity
Parameters
Returns
Type Parameters
EntityAsync<TEntity>(LanguageCode, TEntity)
Declaration
public virtual Task<EntityTranslation<TEntity>> EntityAsync<TEntity>(LanguageCode language, TEntity entity)
where TEntity : class, TBaseEntity
Parameters
Returns
Type Parameters
GetTranslation<TEntity>(LanguageCode, TEntity, Expression<Func<TEntity, String>>)
Declaration
public virtual TTranslation GetTranslation<TEntity>(LanguageCode language, TEntity entity, Expression<Func<TEntity, string>> property)
where TEntity : class, TBaseEntity
Parameters
Type |
Name |
Description |
LanguageCode |
language |
|
TEntity |
entity |
|
System.Linq.Expressions.Expression<System.Func<TEntity, System.String>> |
property |
|
Returns
Type |
Description |
TTranslation |
|
Type Parameters
GetTranslationAsync<TEntity>(LanguageCode, TEntity, Expression<Func<TEntity, String>>)
Declaration
public virtual Task<TTranslation> GetTranslationAsync<TEntity>(LanguageCode language, TEntity entity, Expression<Func<TEntity, string>> property)
where TEntity : class, TBaseEntity
Parameters
Type |
Name |
Description |
LanguageCode |
language |
|
TEntity |
entity |
|
System.Linq.Expressions.Expression<System.Func<TEntity, System.String>> |
property |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TTranslation> |
|
Type Parameters
Property<TEntity>(LanguageCode, TEntity, Expression<Func<TEntity, String>>)
Declaration
public virtual string Property<TEntity>(LanguageCode language, TEntity entity, Expression<Func<TEntity, string>> property)
where TEntity : TBaseEntity
Parameters
Type |
Name |
Description |
LanguageCode |
language |
|
TEntity |
entity |
|
System.Linq.Expressions.Expression<System.Func<TEntity, System.String>> |
property |
|
Returns
Type |
Description |
System.String |
|
Type Parameters
PropertyAsync<TEntity>(LanguageCode, TEntity, Expression<Func<TEntity, String>>)
Declaration
public virtual Task<string> PropertyAsync<TEntity>(LanguageCode language, TEntity entity, Expression<Func<TEntity, string>> property)
where TEntity : TBaseEntity
Parameters
Type |
Name |
Description |
LanguageCode |
language |
|
TEntity |
entity |
|
System.Linq.Expressions.Expression<System.Func<TEntity, System.String>> |
property |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.String> |
|
Type Parameters
SetEntity<TEntity>(TEntity, EntityTranslation<TEntity>)
Declaration
public virtual void SetEntity<TEntity>(TEntity entity, EntityTranslation<TEntity> translated)
where TEntity : class, TBaseEntity
Parameters
Type Parameters
SetEntityAsync<TEntity>(TEntity, EntityTranslation<TEntity>)
Declaration
public virtual Task SetEntityAsync<TEntity>(TEntity entity, EntityTranslation<TEntity> translated)
where TEntity : class, TBaseEntity
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Type Parameters
SetProperty<TEntity>(LanguageCode, TEntity, Expression<Func<TEntity, String>>, String)
Declaration
public virtual IEntityPropertyTranslation<TBaseEntity> SetProperty<TEntity>(LanguageCode language, TEntity entity, Expression<Func<TEntity, string>> property, string value)
where TEntity : class, TBaseEntity
Parameters
Type |
Name |
Description |
LanguageCode |
language |
|
TEntity |
entity |
|
System.Linq.Expressions.Expression<System.Func<TEntity, System.String>> |
property |
|
System.String |
value |
|
Returns
Type Parameters
SetPropertyAsync<TEntity>(LanguageCode, TEntity, Expression<Func<TEntity, String>>, String)
Declaration
public virtual Task<TTranslation> SetPropertyAsync<TEntity>(LanguageCode language, TEntity entity, Expression<Func<TEntity, string>> property, string value)
where TEntity : class, TBaseEntity
Parameters
Type |
Name |
Description |
LanguageCode |
language |
|
TEntity |
entity |
|
System.Linq.Expressions.Expression<System.Func<TEntity, System.String>> |
property |
|
System.String |
value |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TTranslation> |
|
Type Parameters
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Extension Methods