Questions tagged as 'c#'

1
answer

How to create verification that will validate if the ReportViewer is installed?

I need to create a check that will validate the Report Viewer installation on the user machine. If it is not installed, I need to receive this information to make a treatment present a message to the user and facilitate future maintenance. I'...
asked by 17.04.2017 / 18:00
2
answers

Can I have more than one Views directory in MVC?

I'm transferring my project to MVC, and would like to know if you can have more than one Views folder in the project, or if you have a CSS load outside of BundleConfig , have a static page somewhere bugar all my pages.     
asked by 06.05.2017 / 20:36
2
answers

How can I create events in a safer way?

I'm creating events according to the code below, however it seems to be a slightly dangerous way, since if there is no event cancellation it will accumulate with every "trigger" of the event, ie if it occurs three times on the fourth time it wil...
asked by 29.09.2015 / 16:41
1
answer

C # converter for JavaScript: ((object) sender). attribute

I'm developing a C # to JavaScript converter and I'm in a bind when the code has a line of code like this: ((CONTROLE)sender).Atributo Exemplo:((ImageButton)sender).ImageUrl What is the corresponding JavaScript code?     
asked by 25.05.2015 / 14:41
1
answer

Problem with Decimal (4,2)

I have an MVC project, I am using Entity Framkework and in my database there is a table with a column of type decimal (4,2) . The problem is: I try to insert any value, for example: 5.00 // 5,00 // 14.21 // 14,21 and it always re...
asked by 19.05.2015 / 15:29
4
answers

Extract decimal part of a Decimal

I'm having trouble formulating a good way to extract the decimal part of a decimal variable, so far the existing implementation on the system is this: public static bool getCasasDecimais(decimal val, out int result) { string[] split...
asked by 14.05.2015 / 14:08
1
answer

Why use IEnumerable?

I have the following code in a Controller: var carro = new List<SelectListItem> { new SelectListItem {Text = "Pegeout", Value = "Pegeout"}, new SelectListItem {Text = "Chevrolet", Value = "Chevrolet...
asked by 15.05.2015 / 03:34
2
answers

Persistence using Fluent API

How do I persist an address without having to pass all client information? Below is my address client mapping: HasMany(f => f.EnderecoList) .WithMany(e => e.ClienteList) .Map(me => {...
asked by 28.09.2015 / 18:13
1
answer

How to get timezone?

I have the following code: var minhaData = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, meuTimeZone); If meuTimeZone = "E. South America Standard Time"; then the value returned to minhaData is timezone -03:00...
asked by 22.09.2015 / 21:32
1
answer

REST Fundamental Principles

In this Infoq article , the author highlights the five fundamental tenets of REST: Give all things an Identifier Link things (resources / identifier) Use standardized methods Features with multiple representations Communicate wit...
asked by 23.09.2015 / 03:17