Questions tagged as 'c#'

1
answer

Doubt about Mapping an Interface with a Class - SimpleInjector

I'm having trouble mapping Interface IClienteRepository to class ClienteRepository . When compiling the application, this error appears:    "exception {" To be able to use the Lifestyle.Scoped property, please ensure that the con...
asked by 06.12.2017 / 10:02
1
answer

Rule Rewrite Changing scripts directories

I have the following problem, while using the rule below my default directory is changed and my js and css files stop working. <rule name="Produtos Detalhe"> <match url="^(produto)\/(.*)\/(.*)\/?$" /> <action type="Rew...
asked by 05.12.2017 / 18:44
1
answer

Problems with a Dependency Injection Container - Simple Injector

I am mounting my ID container using the Simple Injector, but it is giving a compilation error (Underline red) in the config. of the IReadOnlyRepository Interface with the ClientDapperRepository class. I think I'm doing something wrong but I do n...
asked by 06.12.2017 / 00:29
0
answers

Return a PartialView in ASP.NET MVC [duplicate]

When returning a PartialView my action can both have an ActionResult as a PartialViewResult / p> public PartialViewResult Franquias() { return PartialView("_Franquias"); } Or public ActionResult Franquias() { return Partia...
asked by 06.12.2017 / 16:55
2
answers

Api that receives an Array of items

I have the following situation, I need to create an API that will receive the content below: { "numeroCarrinho": 122865, "itens": { "PA00058": 1, "MA00068": 1, "PA00004": 1 }, "cep": "41706670", "retiraNoLocal": false }...
asked by 06.12.2017 / 20:01
0
answers

Visual Studio 2017 only recognizes new code if restarted

Well, I'm having a problem with VS 2017 when compiling or even pulling a code via Git ... VS 2017 only recognizes the new code if I do some of the following: close and reopen it, insert a file (it happens that when I pull a code via Git, the...
asked by 08.12.2017 / 00:39
3
answers

App.config to access a SQL Server database?

How can I set this app.config to access my SQL Server database? <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <startup> <supportedRuntime...
asked by 15.12.2017 / 16:55
1
answer

Return int on a select using Dapper.

I need to return the idCity. If it does not find in one table, it is mandatory in the other. Return is null. My Query public const string sql = @"DECLARE @retorno AS INT = 0; SELECT @retorno = id...
asked by 30.11.2017 / 13:56
1
answer

Import data from MS Access to Sql Server via code

I need to import data that is in an Access database via code to Sql Server. My software that is made in C # for many years has been integrated into an Access database. From now on we are migrating to Sql Server and the intention is that in the u...
asked by 30.11.2017 / 17:34
0
answers

Path access denied when doing "File.WriteAllText"

Follow the code below: public static string pathname = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory.ToString()) + @"\Arquivo_Principal"; if (!File.Exists($@"{pathname}\Musica\{nomemusica}.txt")) { File.WriteAllText($@"{path...
asked by 26.11.2017 / 15:56