Add XBaseResourceProvider Class and Interfaces for Handle String Resource Based Services Implementation ...
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using xCommons.Configurations;
|
||||
using xModels.Dtos;
|
||||
using xStringService.Models.Dtos;
|
||||
|
||||
namespace xStringService.Interfaces
|
||||
{
|
||||
public interface IXBaseStringResourceProvider
|
||||
{
|
||||
//
|
||||
#region Props ...
|
||||
string Prefix { get; }
|
||||
IXStringProvider Provider { get; }
|
||||
XAppConfiguration AppConfiguration { get; }
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Actions ...
|
||||
/// <summary>
|
||||
/// Prepare Resource Title by Given Data ...
|
||||
/// </summary>
|
||||
/// <param name="suffix"></param>
|
||||
/// <returns></returns>
|
||||
string GetResourceTitle(string suffix);
|
||||
|
||||
/// <summary>
|
||||
/// Add Specified Locales ...
|
||||
/// </summary>
|
||||
/// <param name="suffix"></param>
|
||||
/// <param name="locales"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XStringDto>> Add(
|
||||
string suffix,
|
||||
IEnumerable<XLocaleResourceDto> locales
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Add Or Update Specified Locals ...
|
||||
/// </summary>
|
||||
/// <param name="resource"></param>
|
||||
/// <param name="locales"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XStringDto>> AddOrUpdate(
|
||||
string resource,
|
||||
IEnumerable<XLocaleResourceDto> locales
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get Specified Locale ...
|
||||
/// </summary>
|
||||
/// <param name="suffix"></param>
|
||||
/// <param name="language"></param>
|
||||
/// <returns></returns>
|
||||
Task<XLocaleResourceDto> GetLocale(
|
||||
string suffix,
|
||||
string language = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Add Specified Resource ...
|
||||
/// </summary>
|
||||
/// <param name="suffix"></param>
|
||||
/// <param name="item"></param>
|
||||
/// <returns></returns>
|
||||
Task<XResourceDto> AddResource(
|
||||
string suffix,
|
||||
XResourceDto item
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get Resources of Specified Resource ...
|
||||
/// </summary>
|
||||
/// <param name="suffix"></param>
|
||||
/// <returns></returns>
|
||||
Task<XResourceDto> GetResource(string suffix);
|
||||
|
||||
/// <summary>
|
||||
/// Remove Specified Suffix Resources ...
|
||||
/// </summary>
|
||||
/// <param name="suffix"></param>
|
||||
/// <returns></returns>
|
||||
Task Remove(string suffix);
|
||||
|
||||
/// <summary>
|
||||
/// Remove Specified Resource ...
|
||||
/// </summary>
|
||||
/// <param name="resource"></param>
|
||||
/// <param name="language"></param>
|
||||
/// <returns></returns>
|
||||
Task Remove(
|
||||
string resource,
|
||||
string language
|
||||
);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,17 @@ namespace xStringService.Interfaces
|
||||
string resource,
|
||||
string language = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Specified Resource ...
|
||||
/// </summary>
|
||||
/// <param name="resource"></param>
|
||||
/// <param name="language"></param>
|
||||
/// <returns></returns>
|
||||
Task<XStringDto> Get(
|
||||
string resource,
|
||||
string language = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Specified Translation of Specified Resource ...
|
||||
|
||||
Reference in New Issue
Block a user