Questions tagged as '.net'

2
answers

What is the correct way to send a form to a controller via AJAX?

I have a simple form, which is basically my ViewModel. I'm doing a post via AJAX passing this form, but on the server side, everything is always null. My AJAX is as follows: var formData = $('form').serialize(); $.ajax({ url: '/configuraca...
asked by 03.10.2017 / 18:14
1
answer

On how many threads should I split a task? [closed]

I'm developing an application in C #, one of my functions can be run with multiple threads. But how many should I use? If the processor has 4 cores, is there an advantage in using more than 4 threads?     
asked by 09.12.2017 / 15:06
1
answer

MSIL can be converted to native code?

Can I convert a .NET Framework CIL generated from an executable in C # to a native code? If yes, from this native code , can I transcode to other languages like C ++? If not, is there a lower level of CIL so that you can compile the same...
asked by 19.01.2018 / 13:44
2
answers

TaskCompletionSourceTResult without a type parameter

The TaskCompletionSource<TResult> class needs a TResult type. That way, when I need to use this class without having a return type ( void ), I have to do something like: var tcs = new TaskCompletionSource<object>(); /...
asked by 08.11.2017 / 03:20
1
answer

Is there an equivalent to VB.Net Call in C #?

The question is simple. Is there a keyword equivalent to Call of Visual Basic .NET in C #? In Visual Basic, I called a method of a class without explicitly declaring a member for it: Call New Form() With {.Text = "Olá, mundo!"}.ShowD...
asked by 01.08.2017 / 05:25
1
answer

How to get value from TempData with Listobject?

Follow the code below: List<object> list = new List<object> { "abc", // string 1, // int true // bool }; TempData["ID"] = list; The following code can not fetch value: var data = TempData["ID"...
asked by 21.05.2017 / 05:21
1
answer

What is the best way to read an IPTC header from an image? W#

What is the best way to read the IPTC header of an image? I have the following image and I had to read the description of it (for a bank of images), but I already researched many forms that were confusing for me. Has anyone done this and can you...
asked by 25.05.2017 / 17:30
1
answer

Doubt with @ Style.Render

If I put in my view Layout this line: @Styles.Render("~/Content/css") I'm stating that all .css files in Content folder will be rendered? That is, I do not need to explicitly put .css in my view , is that it? If ther...
asked by 21.05.2017 / 15:21
1
answer

Entity Framework Connection String

I'm creating a project using Entity Framework. My question, would be, how can I create a connectionString (for SQL Server for example) and set in my DBContext where it will get from the Web.config file? DBContext namespace Data { pub...
asked by 29.04.2017 / 16:25
1
answer

Returning difference between dates with days and months

I'm developing a C # function that calculates the interest applied to a particular account. for this it is necessary to know the correct difference between days and months. How can you perform a function in C # that returns the number of days...
asked by 19.07.2017 / 00:46