public LojaDiscoController(IAlbumService albumService, IPrecoService precoService, IVendaService vendaService) { _albumService = albumService; _precoService = precoService; _vendaService = vendaService; var precos = _precoService.ListaPrecos(); if (precos.Count() == 0) { _precoService.GravarPrecoAlbum(); } }
public PrecoMutation(IPrecoService service) { Name = "Mutation"; Field <PrecoType>( "createPreco", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <PrecoInputType> > { Name = "preco" } ), resolve: context => { var item = context.GetArgument <Preco>("preco"); return(service.Save(item)); }); }
public PrecoQuery(IPrecoService service) { Field <ListGraphType <PrecoType> >( "precos", resolve: context => { return(service.GetAll()); }); Field <PrecoType>( "preco", arguments: new QueryArguments(new QueryArgument <IntGraphType> { Name = "codigoProduto" }), resolve: context => { var preco = service.GetId(context.GetArgument <int>("codigoProduto")); return(preco); }); }
public PriceController(IPrecoService precoService, ICoberturaRepository coberturaRepository) { _precoService = precoService; _coberturaRepository = coberturaRepository; }