public LojaDiscoController(IAlbumService albumService, IPrecoService precoService, IVendaService vendaService)
        {
            _albumService = albumService;
            _precoService = precoService;
            _vendaService = vendaService;

            var precos = _precoService.ListaPrecos();

            if (precos.Count() == 0)
            {
                _precoService.GravarPrecoAlbum();
            }
        }
Пример #2
0
 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));
     });
 }
Пример #3
0
        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);
            });
        }
Пример #4
0
 public PriceController(IPrecoService precoService, ICoberturaRepository coberturaRepository)
 {
     _precoService        = precoService;
     _coberturaRepository = coberturaRepository;
 }