Exemplo n.º 1
0
        public async Task Add(DtoAuthor dto)
        {
            var author = new Author
            {
                FirstName = dto.FirstName,
                LastName  = dto.LastName
            };

            pc.Author.Add(author);
            await pc.SaveChangesAsync();
        }
Exemplo n.º 2
0
        public async Task Add(DtoPayroll dto)
        {
            var payroll = new Payroll
            {
                AuthorId = dto.AuthorId,
                Salary   = dto.Salary
            };

            pc.Payroll.Add(payroll);
            await pc.SaveChangesAsync();
        }
Exemplo n.º 3
0
        public async Task Add(DtoArticle dto)
        {
            var article = new Models.Article
            {
                AuthorId = dto.AuthorId,
                Title    = dto.Title,
                Body     = dto.Body
            };

            pc.Article.Add(article);
            await pc.SaveChangesAsync();
        }