예제 #1
0
 public static GenrDto FroGenr(this GenrDto dto, Genr a)
 {
     dto.Id    = a.Id;
     dto.Title = a.Title;
     dto.Info  = a.Info;
     //foreach (var p in a.GenrBooks)
     //{
     //    dto.GenrBooks.Add(p.ToGenrBookDto());
     //}
     return(dto);
 }
예제 #2
0
        public static GenrDto ToGenrDto(this Genr a)
        {
            var b = new GenrDto
            {
                Id    = a.Id,
                Title = a.Title,
                Info  = a.Info
            };

            //ICollection<GenrBook> genre = a.GenrBooks;
            //b.GenrBooks = new List<GenrBookDto>();
            //foreach (var p in genre)
            //{
            //    b.GenrBooks.Add(p.ToGenrBookDto());
            //}
            return(b);
        }
예제 #3
0
        public static Genr ToGenr(this GenrDto dto)
        {
            var b = new Genr()
            {
                Id    = dto.Id,
                Title = dto.Title,
                Info  = dto.Info,
            };

            //ICollection<GenrBookDto> genre = dto.GenrBooks;
            //b.GenrBooks = new List<GenrBook>();
            //foreach (var p in genre)
            //{
            //    b.GenrBooks.Add(p.ToGenrBook());
            //}
            return(b);
        }