Exemplo n.º 1
0
        public IEnumerable <Artist> List(Artist model)
        {
            using (var session = Session)
            {
                var artists = session.CreateCriteria <Artist>()
                              .Add(NExpression.Like("Name", $"%{model.Name}%"))
                              .List <Artist>();

                return(artists);
            }
        }
Exemplo n.º 2
0
        public IEnumerable <Album> List(Album model)
        {
            using (var session = Session)
            {
                var albums = session.CreateCriteria <Album>()
                             .SetFetchMode("Artist", FetchMode.Join) // force to load
                             .Add(NExpression.Like("Title", $"%{model.Title}%"))
                             .List <Album>();

                return(albums);
            }
        }