using CloudBuilder.Core.DatabaseAccessor.Entity;
using CloudBuilder.Security.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudBuilder.Security.Service
{
    public class SysTableSchemaViewService : ISysTableSchemaViewService
    {
        private readonly IApplicationService service;
        private readonly IRepository<SysTableSchemaViewEntity> repository;
        public SysTableSchemaViewService(IApplicationService service)
        {
            repository = service.GetRepository<IRepository<SysTableSchemaViewEntity>>();
            this.service = service;
        }


        public List<SysTableSchemaViewEntity> FindByTableName(string tableName)
        {
            List<SysTableSchemaViewEntity> list =  repository.DetachedEntities.Where(x => x.TableName == tableName).ToList();
            return list;
        }
    }
}
