Questions tagged as 'c#'

1
answer

Unable to read property when merging two entities into one

I am placing two models in one through a class that unites them, with the objective of assigning them value that I get from the DB but it generates an exception in the first line that reads the read() -> Test.Models.Modelo.Pagos.get re...
asked by 21.07.2018 / 00:37
3
answers

What are the struct classes for in c #?

What are the struct classes in c # for, since I have seen the following: A class inPFile public class inPFile { public int P_Id { get; set; } public string P_Name { get; set; } public string P_Nick { get; set; } }...
asked by 08.06.2018 / 05:44
1
answer

How do lists work in c #?

I was wondering if someone could guide me or tell me what the concept is called in order to learn it and / or apply it on my own. Sometimes, using Api's I have found that some method returns a list, for example in this case. var ListaDevue...
asked by 12.10.2018 / 15:51
2
answers

IF Alternative C #

I would like to know an alternative to avoid the excessive use of IF within this code if (paq.Lunes) this.lu.Attributes.Add("class", "select"); if (paq.Martes) this.ma.Attributes.Add("class", "select"); if (paq.Miercoles) this.mi.A...
asked by 08.10.2018 / 02:57
2
answers

Deactivate asp.net mvc controls on the server side

Good morning, I present a small concern, recently I am working on a sales module for the company I work for. What I need is to deactivate two controls when identifying what is a cash sale: Controls: <input type="button" class="btn btn-pr...
asked by 11.09.2018 / 17:21
2
answers

Center controls within a maximized form

I would like to put cinco controles picturebo x aligned just in the top middle of the screen. (The length of the screen is different for each user). To begin with, my idea is that the window is maximizada , to obtain the total si...
asked by 15.08.2018 / 00:01
1
answer

Report Viewer (Sign Interrogation in page)

Good morning, I have a problem with my report viewer, the part of the page (Number of pages that the report has) That question mark appears, how could I remove it? I have the following code on my aspx page <rsweb:ReportViewe...
asked by 17.11.2017 / 14:16
2
answers

foreach with classes that do not 'implement' IEnumerable / IEnumerator

I saw the comment of Equidad in one of my answers with an interesting detail and is that implemented an interface (or part of it) without using the operator : to the right of the name of the object. Provided the following code: p...
asked by 20.07.2016 / 16:28
2
answers

C # - Threads, Timers and something else

I was trying to practice doing a game on the console before going to unity, or rather to boot with unity. Particularly I had problems making the enemies, I came to the conclusion that what controls the enemies is the time and the conditions they...
asked by 31.07.2017 / 05:11
3
answers

Assign object of a class and object of a class x

Someone knows how I can do the following: I have a class X and another class Y, both have the same attributes in the same order and others, they are practically identical only with a different name, so I want to do something like: X objX = new...
asked by 15.06.2016 / 17:37