Questions tagged as 'c#'

2
answers

Consuming C # Functions (dll) in a C / C ++ project

I need to call / reuse some functions I have in a DLL, developed in C #, within a project made in C. I've already looked for some things and what I managed to make legal work was this project: link This step-by-step article describes how...
asked by 30.04.2014 / 13:24
1
answer

sealed class, with private constructor, versus static class

By "studying" this class , I checked that it is sealed and has the private constructor: public sealed class Interaction { /// <remarks> /// CA1053: Static holder types should not have public constructors /// </rema...
asked by 11.01.2017 / 16:25
1
answer

Read file contacts agenda iPhone using Xamarin

How do I read the contact list in the iPhone phonebook using Xamarin? I need to read the contacts list from the iPhone calendar. I do not know how to do it and I did not find material in Portuguese about it. Can anyone help me with this?    ...
asked by 20.01.2014 / 00:39
1
answer

What is the best way to exit a C # application?

The most common way is to exit with return in Main() . But I saw that there are Environment.Exit() . and Application.Exit() . When should we use each?     
asked by 18.04.2017 / 14:26
2
answers

What is the purpose of the UseShellExecute property?

Developing an application in C # I came across the UseShellExecute property in the following code snippet: ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.CreateNoWindow = false; startInfo.UseShellExecute = false; startIn...
asked by 05.05.2017 / 15:45
2
answers

Control visibility of view components in ASP.NET MVC 5 controller

I am refactoring a project in ASP.NET MVC 5, implementing some good practices and researching, it was mentioned that the use of if in the view (razor) is not the best practice, but I use it to show or hide some components (fields) according to t...
asked by 21.09.2015 / 15:40
2
answers

Code First and Calculated Fields

I have a class Pedido , which has a calculated field, which is the value of the request, consisting of the sum of the items minus the discount. public class Pedido { public ICollection<PedidoItem> Itens { get; set; } publi...
asked by 25.11.2015 / 14:23
3
answers

LINQ with condition in where using variable

I have the following table: USUARIO Nome | Idade João | 21 Maria | 18 I want to make only one query that returns all users, or only returns users of a specific age based on a C # variable. Also by name. int idade = 18;...
asked by 26.08.2015 / 22:01
2
answers

How to implement a "thin"

I'm working on a prototype of an ASP.NET MVC application, where I want to leave my lean controller (with the least amount of code possible) for that, not doing business logic on it, but yes in the business layer. I have the business layer, wh...
asked by 24.11.2015 / 23:30
2
answers

Is it possible to join a C # form to a VB.NET project?

I have two distinct projects, one with just one form in C #, can I embed the form in my project in VB.NET?     
asked by 18.06.2015 / 06:13