Example #1
0
        public UiAuthor GetAuthorByEmail(Author authors)
        {
            Author author = _authorDal.Get(a => a.email == authors.email);

            UiAuthor uiAuthor = new UiAuthor
            {
                name     = author.name,
                lastname = author.lastname,
                email    = author.email,
                tel      = author.tel
            };

            return(uiAuthor);
        }
Example #2
0
        public List <UiAuthor> GetAll()
        {
            List <Author>   authors   = _authorDal.GetList();
            List <UiAuthor> uiAuthors = new List <UiAuthor>();

            foreach (var item in authors)
            {
                UiAuthor uiAuthor = new UiAuthor
                {
                    name     = item.name,
                    lastname = item.lastname,
                    email    = item.email,
                    tel      = item.tel
                };

                uiAuthors.Add(uiAuthor);
            }

            return(uiAuthors);
        }