/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='body'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Author> AddAuthorAsync(this IAuthors operations, Author body = default(Author), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddAuthorWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Author> GetAsync(this IAuthors operations, int id, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public async Task <IAuthors> Edit(IAuthors author) { author.ID = Guid.NewGuid(); AuthorsEntity authorE = _mapper.Map <AuthorsEntity>(author); dbSet.Add(authorE); await _context.SaveChangesAsync(); return(_mapper.Map <IAuthors>(author)); }
public async Task <IAuthors> Edit(IAuthors author) { //var authors = _context.Authors.Where(v => v.Name.Contains(book.AutorId.ToString())).FirstOrDefault(); author.ID = Guid.NewGuid(); AuthorsEntity authorE = _mapper.Map <AuthorsEntity>(author); dbSet.Add(authorE); await _context.SaveChangesAsync(); return(_mapper.Map <IAuthors>(author)); }
public async Task <bool> Update(IAuthors author) { Guid ID = author.ID; var authorE = await dbSet.SingleOrDefaultAsync(item => item.ID == ID); if (authorE != null) { authorE.Name = author.Name; _context.SaveChanges(); return(true); } else { return(false); } }
private void AddBookButtonClick(object sender, RoutedEventArgs e) { string title = titleTextBox.Text; IAuthors author = (IAuthors)authorComboBox.SelectedItem; int numOfPages = Convert.ToInt32(numOfPagesTextBox.Text); if (bookRadioButton.IsChecked ?? false) { Library.Books.Add(new Book(title, author, numOfPages)); } else if (coursebookRadioButton.IsChecked ?? false) { Library.Books.Add(new Coursebook(title, author, numOfPages, subjectTextBox.Text)); } else if (novelRadioButton.IsChecked ?? false) { Library.Books.Add(new Novel(title, author, numOfPages, typeTextBox.Text)); } Parent.SetValue(ContentProperty, new PrintBooksPage()); }
public AuthoresPresenter(IAuthors view) { this.iAuthors = view; }
public override bool AddOrModifyAuthor(IAuthors authors) { return(true); }
public Novel(string title, IAuthors author, int numOfPages, string type) : base(title, author, numOfPages) { Type = type; }
public Book(string title, IAuthors author, int numOfPages) { Title = title; Author = author; NumOfPages = numOfPages; }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> public static Author Get(this IAuthors operations, int id) { return(operations.GetAsync(id).GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='body'> /// </param> public static Author AddAuthor(this IAuthors operations, Author body = default(Author)) { return(operations.AddAuthorAsync(body).GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> public static IList <Author> GetAll(this IAuthors operations) { return(operations.GetAllAsync().GetAwaiter().GetResult()); }
public Coursebook(string title, IAuthors author, int numOfPages, string subject) : base(title, author, numOfPages) { Subject = subject; }
public AuthorController(AuthorsRepository AuthorRepository) { _Authors = AuthorRepository; }
public abstract bool AddOrModifyAuthor(IAuthors authors);