Exemplo n.º 1
0
        public SongsController(IFreeSql fsql,
                               GuidRepository <Song> repos1,
                               GuidRepository <xxxx> repos2,

                               DefaultRepository <Song, int> repos11,
                               DefaultRepository <xxxx, int> repos21,

                               BaseRepository <Song> repos3, BaseRepository <Song, int> repos4,
                               IBasicRepository <Song> repos31, IBasicRepository <Song, int> repos41,
                               IReadOnlyRepository <Song> repos311, IReadOnlyRepository <Song, int> repos411,

                               SongRepository reposSong
                               )
        {
            _songRepository = repos4;

            //test code
            var curd1 = fsql.GetRepository <Song, int>();
            var curd2 = fsql.GetRepository <Song, string>();
            var curd3 = fsql.GetRepository <Song, Guid>();
            var curd4 = fsql.GetGuidRepository <Song>();

            Console.WriteLine(repos1.Select.ToSql());
            Console.WriteLine(reposSong.Select.ToSql());

            Console.WriteLine(repos2.Select.ToSql());
            Console.WriteLine(repos21.Select.ToSql());

            using (reposSong.DataFilter.DisableAll()) {
                Console.WriteLine(reposSong.Select.ToSql());
            }
        }
Exemplo n.º 2
0
        public SongsController(IFreeSql fsql)
        {
            _songRepository = new SongRepository(fsql);

            //test code
            var curd1 = fsql.GetRepository <Song, int>();
            var curd2 = fsql.GetRepository <Song, string>();
            var curd3 = fsql.GetRepository <Song, Guid>();
            var curd4 = fsql.GetGuidRepository <Song>();
        }
Exemplo n.º 3
0
        public SongsController(IFreeSql fsql,
                               BaseRepository <Song> repos3, BaseRepository <Song, int> repos4,
                               IBaseRepository <Song> repos31, IBaseRepository <Song, int> repos41,

                               SongRepository reposSong,
                               IBaseRepository <TestSoftDelete> reposTest
                               )
        {
            Console.Write(reposTest.Select.ToSql());

            _songRepository = repos4;
            //test code
            var curd1 = fsql.GetRepository <Song, int>();
            var curd2 = fsql.GetRepository <Song, string>();
            var curd3 = fsql.GetRepository <Song, Guid>();
            var curd4 = fsql.GetGuidRepository <Song>();

            Console.WriteLine(reposSong.Select.ToSql());

            using (reposSong.DataFilter.DisableAll())
            {
                Console.WriteLine(reposSong.Select.ToSql());
            }
        }
Exemplo n.º 4
0
 public SongsController(IFreeSql fsql)
 {
     _songRepository = new SongRepository(fsql);
 }