Questions tagged as 'c#'

2
answers

Entity Framework Entity Framework update and delete

I have a student table that has many-to-many relationship with the course table. This results in the CursoAluno table. I would like to know the correct way for update and delete of the CursoAluno table. For exam...
asked by 06.05.2014 / 13:37
3
answers

Change TimeZone from DateTime.now

I am hosting my system on a server that is in the US Then using DateTime.Now returns the US date and time. I would like to return the date and time of Brazil. Is it possible?     
asked by 11.01.2015 / 14:07
2
answers

Path of the previous folder

How can I get the path of the previous folder? For example I have this path: C:/Pasta1/Pasta2 And I wanted to get the folder path 1 C:/Pasta1 How can I do this?     
asked by 06.10.2017 / 15:14
1
answer

IIS mount server on PC at home

Hello, I need to know if I have IIS configuration on a notebook, so that when this notebook is connected in the company, it works as my server, so I can access my ASP.NET MVC application through other devices ... I want to access the site as...
asked by 23.11.2016 / 20:29
4
answers

Error message in datetime field

I have a field in my application in mvc asp.net c # to put start date and end date. [Required(ErrorMessage = "A data de início é obrigatória")] [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)] publ...
asked by 02.07.2014 / 18:19
3
answers

What's the difference between System.Web.Http and System.Web.Mvc?

I have a MVC project and I will have regular controls and controls providing services via webservices ( Controller and ApiController ). And I do not know which one to use because I do not know which one is best.     
asked by 25.06.2016 / 15:48
5
answers

Check if day exists in the month

I need to check / validate if a (numeric) day exists in a given month. For example: I have day 31 , and since it does not exist in the month of February the condition will fail. I think a simple if will solve the problem, wher...
asked by 07.02.2014 / 16:47
3
answers

When to use asynchronous or synchronous methods?

When should I use asynchronous or synchronous methods in controllers (Index, search, delete, create) ASP.NET MVC applications? Can I lose performance? In which situations should I use one or the other, could you give examples? If I have...
asked by 03.05.2017 / 03:33
3
answers

What is the difference between using single quotes and double quotation marks in C #?

In PHP, when we use single quotes or double quotation marks, both forms have the function of declaring a string . There is only one small difference. I'm now starting a C # study. When I tried to declare a string with single quotation mark...
asked by 28.05.2016 / 21:33
3
answers

What is Difference Between HTML.ActionLink vs. Url.Action?

Reading some tutorials from ASP.NET MVC I found these two helpers being used to do basically the same thing, which was to direct the user to a new view . Then I would like to know if there is any more noticeable difference...
asked by 28.03.2017 / 17:24