Questions tagged as 'c#'

1
answer

In an MVC 4 C # Web Application model, on what layer can the ADO.NET Entity Data Model file be?

On what layer do I put it? Model control or view? ADO.NET Entity Data Model which connects to the database.     
asked by 16.11.2017 / 15:41
1
answer

Group items in table application asp.net web MVC

How can I group items in a table? I am bringing these items from the database, I would like to group by the code of the same, for example, if there is repeated code 1 would like to group it into a single item. This is the controller class. This...
asked by 03.12.2017 / 15:27
1
answer

How to Include and Refer. .JS in my project?

Well it's the following, I have a .JS file in my project. I'm calling it in HEAD SO: <script type ="text/javascript" src="~/JS/validacao.js"></script> within this validation. JS has a masquerade function. and put the f...
asked by 08.12.2017 / 13:04
2
answers

What is the purpose of a static constructor?

I've always used constructors as follows: public MinhaClasse() { //Algo ... } However, I discovered that in C # it is possible to create a static constructor as follows: public class MinhaClasse { public string Propriedade { get;...
asked by 03.07.2016 / 23:39
1
answer

Add photos and gallery to an ASP MVC product

I'm starting in ASP.NET using mvc 5, I've done some basics courses, and now I want to make a simple little complex virtual store. but I am in a crucial doubt in the product table, it will have a miniature photo and more others in its description...
asked by 13.12.2017 / 18:58
1
answer

Encrypt in UWP and Decrypt in Web API

I'm trying to encrypt a string in a Universal Windows Platform (UWP) application and decrypt the string in a Web application API. The problem is that I can not find / modify an algorithm common to both platforms. I currently use the code b...
asked by 27.12.2017 / 14:04
0
answers

How to read an excel and insert data into a table?

I wanted to send data from a file Excel to a table in Sql . I've tried using bulkcopy.ColumnMappings.Add but you're giving me an error.    System.InvalidOperationException The given ColumnName does not match   up with a...
asked by 17.10.2017 / 13:37
1
answer

When registering my class, stick with the OnAppearing method

I'm trying to make notifications with xamarin and the Xam.Plugin.PushNotification plugin. The problem is when I register the plugin. It does not work, by the time the UpdateData () method is called. Actually what I want is this: Whenever a f...
asked by 24.09.2017 / 15:40
1
answer

Why does the compiler require local variables to be initialized and fields not?

The question Why do you usually declare a variable with default value? addresses the issue of whether to initialize or not a variable before using it. However this option becomes mandatory when it comes to a local variable. A field is autom...
asked by 04.07.2017 / 16:29
2
answers

Return data from a query with Linq in an EF Core repository

I have the Person class that relates to the PersonPhysical and PersonJuridica tables in a one-to-one relationship. In my Person table I have the Field PersonNature where 0 = Individual and 1 = Legal Entity. A person can be physical or legal a...
asked by 15.02.2018 / 21:05