How to join two table with repository and service pattern

156 Views Asked by At

Greatings,

My project designed base on N-Tier Architecture. There are Core, Repository and Service layers.I have to many tables to join each other.And I would like to use Linq to support multiple sql database.

Here is my IRepository interface;

public interface INodeRepository :IGenericRepository<Node>
{

    Task<IEnumerable<Node>> GetAllAsync();


}

I am not sure that " Task<IEnumerable> GetAllAsync(); " this method is right.

Here is the Repository

public class NodeRepository : GenericRepository<Node>, INodeRepository
{
    public NodeRepository(AppDbContext context) : base(context)
    {
    }

    public async Task<IEnumerable<Node>> GetAll()
    {
        return await _context.Nodes.Join()
    }

}

I actually dont even know how to fill it.I will also make a implementation to my Iservice.

Any help ?

0

There are 0 best solutions below