public void Add(Book book) { if (_bookDal.Get(b => b.Name == book.Name) == null) { _bookDal.Add(book); } }
public IResult Delete(int id) { var value = _bookDal.Get(x => x.Id == id); _bookDal.Delete(value); return(new SuccessResult()); }
public void Add(Book book) { if (_bookDal.Get(b => b.Name == book.Name && b.AuthorId == book.AuthorId) == null) { _bookDal.Add(book); return; } throw new Exception("Bu kitap zaten ekli"); }
public void Add(Book book) { if (_bookDal.Get(b => b.Name == book.Name && b.Authorid == book.Authorid) == null) { _bookDal.Add(book); } else { throw new Exception("Bu kitap adı zaten mevcut"); } }
public void Add(Book book) { if (_bookDal.Get(filter: b => b.Name == book.Name && b.AuthorId == book.AuthorId) == null) { _bookDal.Add(book); } else { throw new Exception(message: "Bu Kitap adı zaten mevcut"); } }
public void Add(Book book) { // İş Kodları if (_bookDal.Get(filter: b => b.Name == book.Name && b.AuthorId == book.AuthorId) == null) { _bookDal.Add(book); } else { throw new Exception(message: "Girmek istediğiniz kitap adı zaten var!"); } }
public void Add(Book book) { // Bu kontrol update içinde gerekeceğinden burayı farklı şekilde yönetmek gerek if (_bookDal.Get(filter: b => b.Name == book.Name) == null) { _bookDal.Add(book); } else { throw new Exception(message: "Bu kitap adı zaten mevcut"); } }
public void Add(Book entity) { //iş kodu //Örnegin bu iş kuralını biz birden fazla yerde kullanabiliriz bu yüzden bu kod kötü bunu ayrı bir yerde ele almamız lazım. if (_bookDal.Get(b => b.Name == entity.Name && b.AuthorId == entity.AuthorId) == null) { _bookDal.Add(entity); } else { throw new Exception("Bu kitap daha önce eklenmiş"); } }
public void Add(Book book) { // kitap eklerken kurallar varsa buraya yazılır. // İş kodu if (_bookDal.Get(b => b.Name == book.Name && book.AuthorId == book.AuthorId) == null) { _bookDal.Add(book); } else { throw new Exception("Bu kitap adı zaten mevcut..."); } }
public Book Get(Expression <Func <Book, bool> > filter) { try { return(_iBookDal.Get(filter)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void Add(Book book) { //throw new NotImplementedException(); //EfBookDal efBookDal = new EfBookDal(); _bookDal.Add(book); if (_bookDal.Get(b=>b.Name == book.Name && b.AuthorId==book.AuthorId ) == null) { _bookDal.Add(book); } throw new Exception("Bu kitap adı zaten var"); }
public Book GetById(int id) { return(_bookDal.Get(x => x.Id == id)); }
public Book Get(Func <Book, bool> condition = null) { return(_bookdal.Get(condition)); }
public Book Get(Expression <Func <Book, bool> > filter) { return(_bookDal.Get(filter)); }
public IDataResult <Book> GetById(int bookId) { return(new SuccessDataResult <Book>(_bookDal.Get(b => b.BookId == bookId), Messages.BooksIdListed)); }
public Book GetById(int bookId) { return(_bookDal.Get(p => p.BookId == bookId)); }
public IDataResult <Book> GetByBookId(int bookid) { return(new SuccessDataResult <Book>(_bookDal.Get(book => book.BookId == bookid))); }
public IDataResult <Book> GetById(int bookId) { return(new SuccessDataResult <Book>(_bookDal.Get(p => p.BookId == bookId))); }
public Book GetById(int bookId) { return(_bookDal.Get(b => b.Id == bookId)); }
public IDataResult <Book> CheckStock(string isbn) { return(new SuccessDataResult <Book>(_bookDal.Get(b => b.ISBN == isbn))); }