Questions tagged as '.net'

1
answer

AspNet.Identity Creating user with Role

It's the first time I'm working with Entity and Identity and I'm confused about how my user persists. Basically I have a User table, with several relationships with the database and the Id int) I have the Identity AspNetUsers table and AspNetRol...
asked by 20.11.2017 / 17:52
1
answer

How to get value from a field in SQL using C #?

The idea is that I insert data about the same person within SQL, but in different Entities, contextualizing: I have the table Pessoa : create table Pessoa( ID_Pessoa int primary key identity (1,1), Nome_Pessoa varchar(50), CPF_Pessoa...
asked by 29.11.2017 / 18:52
1
answer

Usage Text User Interfaces in C #?

I would like to give a basic interface to an application developed in Console Application. I want to make use of features like TUI (Text-Based User Interfaces), common in other platforms like NodeJS. Is it possible to do this in a C # applicatio...
asked by 28.11.2017 / 18:59
1
answer

Execute method of one nested class as property in another in C #

I have the following class: public class Feliz : IFeliz { //public algumas propeiedades e tals... { get; set; } public bool EstaFeliz() { //Faz alguma coisa... } } And it's a property in another class: public Exemplo {...
asked by 07.11.2017 / 17:32
1
answer

Check if there is a value in the enumeration by the attribute and return its value

Is it possible to produce simpler code for this function without changing enum ? /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute()] public enum Velocidade { //...
asked by 02.10.2017 / 20:44
1
answer

Standardize error messages in DataAnnotations in ViewModels classes

It is possible to standardize the error messages used in DataAnnotations, so that you do not have to pass a string like: [Required(ErrorMessage = "Este campo é obrigatório.")] But you can use more or less like this: string mensagem = "Est...
asked by 18.09.2017 / 13:44
1
answer

How to call a "Stored Procedure" oracle c #

I have the following procedure in my bank: I'mtryingtocallmystoreprocedurein.netlikethis:publicintCountEvent(intresourceId,inteventCounterDefinitionId,DateTimestartDate,DateTimestopDate){intret=0;using(OracleConnectionconn=newOracleConnect...
asked by 05.10.2017 / 22:59
1
answer

Catch all the images in a sub-directory, except for one folder

I'm getting all the photos from a directory and its subsequent ones, but I do not like the "Backup" folder, how could I do that? string[] Arquivos = Directory.GetFiles(PathEx, "*.*", SearchOption.AllDirectories); I was thinking of using...
asked by 03.12.2017 / 15:44
2
answers

String handling in VB.Net

Hello, in the code I'm developing I need to get a file name. I used an OpenFileDialog for the user to select a file, and after selecting, the system returns the directory of this file within a string. Example: "C: \ Users \ Lucas \ Documents \ I...
asked by 03.09.2017 / 20:50
1
answer

How to handle a render exception in Windows Presentation Framework (WPF)

Randomly, my system causes this exception (which I only see because of the logs left in Windows events). It is an application that runs 24 hours a day every day. When the error occurs, the screen freezes and if I click anything, the program clos...
asked by 16.08.2017 / 13:41