I am trying to create a class library that can consume a DbContext that will be able to query entities that have a common schema. (this is a DB first project)
I have the following in my class library project:
public interface ITranslate
{
public long Id
public long ParentId
public long LangId
}
In a seperate project, I would have the following:
public partial class SectionTranslation : ITranslate
{
public string SectionName { get; set; }
{
And in another project I might have the following
public partial class TemplateTranslation : ITranslate
{
public string TemplateName { get; set; }
{
What I would like to do is make the following contract a reality, however, I am not sure how to approach this one. I would want to be able to return a record that would match a common query in the GetBestTranslation method, I would want to return a SectionTranslation or TemplateTranslation Entity depending on which project is consuming the library and in the SaveTranslation method, save a translation record.
public interface ITranslateManager
{
Task<T> GetBestTranslationAsync(long langId);
Task CreateTranslationAsync<T>(long langId)
}
Thank you all in advance for your help