static void Main(string[] args) { DeveloperRepository developerR = new DeveloperRepository(); GameRepository gameR = new GameRepository(); GenreRepository genreR = new GenreRepository(); OrderRepository orderR = new OrderRepository(); PublisherRepository publisherR = new PublisherRepository(); Genre genre1 = new Genre() { Title = "genre1" }; Genre genre2 = new Genre() { Title = "genre2" }; Genre genre3 = new Genre() { Title = "genre3" }; Publisher publisher1 = new Publisher() { Title = "publisher" }; Developer developer1 = new Developer() { Title = "developer" }; genreR.Create(genre1); genreR.Create(genre2); genreR.Create(genre3); publisherR.Create(publisher1); developerR.Create(developer1); genre1 = genreR.GetById(1); genre2 = genreR.GetById(2); genre3 = genreR.GetById(3); publisher1 = publisherR.GetById(1); developer1 = developerR.GetById(1); Game game1 = new Game() { Title = "game1", Developer = developer1, Publisher = publisher1, Genres = new List <Genre> { genre1, genre2, genre3 }, Discription = "AAA", ReleaseDate = DateTime.Now, Discount = 10, Price = 15 }; gameR.Create(game1); game1 = gameR.GetById(1); }
static void Main(string[] args) { PublisherId id = new PublisherId(Guid.Parse("6679C0E9-1C2C-4F99-9EB1-ED892225176B")); // John PublisherRepository repository = new PublisherRepository(); var publisher = repository.GetById(id); var account = publisher.AssignedSocialAccounts.FirstOrDefault(asa => asa.Email == "*****@*****.**"); publisher.ChangePublisherName("Derick"); publisher.ChangeAccountEmail(account, "*****@*****.**"); repository.Update(publisher); Console.ReadKey(); }
public PublisherQuery(PublisherRepository repository) { FieldAsync <ListGraphType <PublisherType> >( name: "publishers", resolve: async context => await repository.GetAll() ); FieldAsync <PublisherType>( name: "publisher", arguments: new QueryArguments(new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "Id", Description = "The id of the publisher you want to return" }), resolve: async context => { var id = context.GetArgument <string>("Id"); return(await repository.GetById(Guid.Parse((ReadOnlySpan <char>)id))); } ); }
public Publisher GetById(int id) { return(_repository.GetById(id)); }
private void booksDataGridView_CurrentCellDirtyStateChanged(object sender, EventArgs e) { if (booksDataGridView.CurrentCell.OwningColumn.Name == "publisherDropdownColumn") { booksDataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit); (booksDataGridView.CurrentCell.OwningRow.DataBoundItem as Books).PublishingHouses = publisherRepository.GetById((booksDataGridView.CurrentCell.OwningRow.DataBoundItem as Books).PublisherId); } }
public Publisher Get(int id) { PublisherRepository r = new PublisherRepository(); return(r.GetById(id)); }
public ActionResult PublisherEdit(int id) { return(View(_ObjPublisherRepository.GetById(id))); }
public IActionResult GetPublisher(int Id) { return(Ok(_publisherRepository.GetById(Id))); }
public async Task <IActionResult> GetPublisher(int id) { return(Ok(await _publisherRepository.GetById(id))); }