Questions tagged as 'c#'

1
answer

Creation of Cortana app in Portuguese is not working

First I created the following xml: <?xml version="1.0" encoding="utf-8" ?> <VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> <CommandSet xml:lang="pt-BR" Name="CommandSet_pt-BR"> <AppName> Ap...
asked by 04.09.2016 / 06:24
1
answer

Error formatting string with number

I want to format a string so that it has six digits filled with leading zeros. I'm using the following code: string.Format("{0:000000}", linha.Quant.ToString()); It is returning the following: 67 = 00067 19 = 00019 5 = 0005 9 = 0009...
asked by 14.02.2017 / 01:07
1
answer

Path access error was denied

I am using a program created in Visual Studio / Windows Forms. In it, access the following file to get some information: 1st Code (works normal) StreamReader file = new StreamReader(@ "E:\OneDrive\VisualStudio\codigosAIH\codigosAIH\bin\Debu...
asked by 19.01.2017 / 17:23
2
answers

How to use Chart.Js with ASP.NET MVC

Well, I am returning a list of and sending to View . You need to implement this using a graph with Chart.js . I have the Country class: [Table("Pais")] public class Pais { [Key] public Guid PaisId { get; set; } [R...
asked by 19.01.2017 / 14:32
2
answers

Many to Many with Fluent API

I'm doing a mapping with Fluent API and a you doubt how I should do the mapping very much. For example, I have the classes below. public partial class Territories { public Territories() { this.Employees = new HashSet<Em...
asked by 15.08.2017 / 15:47
1
answer

How to organize namespaces?

I have heard that namespaces should be organized by layer, in this case, using some design pattern to make it possible, such as Projeto.Controller , Projeto.UI , Projeto.Model , however, if we look at the namespaces of own .N...
asked by 16.08.2017 / 22:26
3
answers

Logout with Identity

I am trying to use the logoff function offered by default in Identity: // POST: /Account/LogOff [HttpPost] [ValidateAntiForgeryToken] public ActionResult LogOff() { AuthenticationManager.SignOut(DefaultAuthenticatio...
asked by 04.10.2017 / 19:58
1
answer

Passing Parameters to Store Procedure

Follow the Search Function Code public List<Pessoa> Buscar(string Nome) { using(var db = new MyContext()) { var Result = db.Database.SqlQuery<Pessoa>("EXEC SP_Busca_Cliente @Nome", Nome).ToList(); return Re...
asked by 02.10.2017 / 15:17
1
answer

How to project an image on the big screen?

I've searched the internet and I do not think so. How do I project an image on the big screen? Example: On the main screen (notebook) show executable (windows forms), and on the second screen show an image (do not show windows form). It's...
asked by 12.10.2017 / 01:25
1
answer

How to read a struct inside another with Json.Net?

I need the program to read this information:    {"kiseryota": {"id": 15031780, "name": "Kise Ryota", "profileIconId": 1374, "summonerLevel": 30, "revisionDate": 1475089675000}} I'm doing this: Structure: public struct SummonerInfo0 {...
asked by 29.09.2016 / 02:13