Questions tagged as 'c#'

2
answers

Entity Framework is saving duplicate values when saving entities with relationship N to N

I have an entity called Book that has among other attributes a list of categories. In my model a book can have multiple categories and vice versa, so we have a N relationship for N. The EF therefore creates the books table, the category table an...
asked by 12.02.2014 / 22:21
1
answer

What tools are available for creating C # project installers?

I'm having trouble finding a satisfactory installer solution for my Windows forms and WPF applications. What does Microsoft have to offer or do I have flexibility? What do you use? What do you recommend?     
asked by 13.05.2016 / 13:07
4
answers

Within a decision structure, does the order of the terms change the result?

Is there any difference between: if (variavelA == variavelB) and if (variavelB == variavelA) In Java and C #, is there any difference between the examples? I emphasize that the question is not limited only to the == operator, bu...
asked by 25.05.2014 / 18:30
1
answer

Does a property take up space on the object?

I was reading a query about properties and saw that it is one or two methods at one time. Is there any additional cost in memory and processing in using it? If you do not use the code can you get more optimized?     
asked by 11.05.2017 / 16:11
4
answers

Converting HttpPostedFileBase to byte []: Exception_WasThrown

Follow the code below: Controller (with post action): var file = Request.Files[0]; var bytes = ConvertTo.Bytes(file); ConvertTo Class: public static byte[] Bytes(HttpPostedFileBase result) { var length = result.InputStream.Leng...
asked by 12.10.2017 / 17:50
1
answer

How could I improve the code for this paging control?

I mounted a paging control for a blog that I'm putting together, but I'm not sure if I did it the best way, I tried to copy the paging control of Stack Exchange sites. Could you guys take a look and tell me what you think? A screenshot of h...
asked by 23.11.2015 / 02:10
3
answers

How to make a POST that passes beyond the form, a file?

My question is this: I can move to the controller OR the file OR the form. I was wondering if there is any type (same FormCollection, however this apparently only gets the form itself, the files posted together does not) that it receives both th...
asked by 24.07.2014 / 18:53
1
answer

What is the difference between event and delegate?

I have already understood how delegate and event works, but I have not seen event utility. For example: public delegate void ChangedEventHandler(object sender, BaseEventArgs e); public ChangedEventHandler Changed; The c...
asked by 04.04.2015 / 17:37
3
answers

How to divide integers and get value with decimal part?

I'm trying to divide the following values into C #: Double media = 0.0; int soma = 7; int cont = 2; media = soma / cont; You are returning 3 .     
asked by 10.07.2017 / 15:51
4
answers

Reports with Asp.Net MVC

Hello, I would like to know some reporting options with Asp.Net MVC. I tried to use the ReportViewer but it is typed with the database and not used for objects. Would anyone have any suggestions? Thank you.     
asked by 26.10.2015 / 19:36