I'm new this site, I have a repository pattern, if you check below code, here the return type & parameter T is defined which will implemented by calling methods so at run time it will be replaced by `SomeClass` and the parameter will be changed like it will be string, int or bool, however below will not compile however I need to make it work please help and alternative will work too.

```
public interface IBaseRepository
{
    Task<T> Add<T>(T value,string typeName);
}

public class Test: IBaseRepository
{
    public Task<SomeClass> Add<SomeClass>(string value, string typeName)
    {
        throw new NotImplementedException();
    }

    public Task<SomeClass> Add<SomeClass>(int value, string typeName)
    {
        throw new NotImplementedException();
    }

    public Task<SomeClass> Add<SomeClass>(bool value, string typeName)
    {
        throw new NotImplementedException();
    }
}

```

---

Redundant Approach:

```
public interface IBaseRepository
{
    Task<T> AddData<T>(string namespaceName,string typeName);

    Task<T> AddData<T>(int namespaceName, string typeName);
}

public abstract class BaseRepo : IBaseRepository
{
    public async Task<T> AddData<T>(string namespaceName, string typeName)
    {
        return JsonConvert.DeserializeObject<T>(namespaceName.ToString());
    }

    public async Task<T> AddData<T>(int namespaceName, string typeName)
    {
        return JsonConvert.DeserializeObject<T>(namespaceName.ToString());
    }
}

public class Testing : BaseRepo
{
    public async Task<Testing> Add(string namespaceName, string typeName)
    {            
        return await AddData<Testing>(namespaceName,"");
    }

    public async Task<Testing> Add1(int namespaceName, string typeName)
    {
        return await AddData<Testing>(namespaceName, "");
    }
}

```