Questions tagged as '.net'

3
answers

Write TimeSpan in full

I want to write a static class (can be Extension ) to represent the value of a structure TimeSpan " in full, in Portuguese. The idea is to always compare the current date ( Datetime.Now ) with the date that the event occurred....
asked by 24.08.2015 / 19:26
4
answers

Should I use GUID or int as a primary key?

I'm about to start a new project in MVC 4 with Entity Framework, searching I found several examples here in the SOpt of models that use GUID as ID and some doubts have arisen: What is the advantage of using GUID as a primary key? Is it feas...
asked by 19.06.2014 / 21:38
1
answer

Compiler Roslyn - What is it, and why was it created?

What is the Roslyn compiler? Is this the default Visual Studio compiler? Is it open source? Why did they do this? Only for C # or other languages as well?     
asked by 26.08.2015 / 22:08
2
answers

What is serialization? When to use? How to implement in C #?

[Serializable] public class Pessoa { public string Nome { get; set; } public string Cpf { get; set; } } Is there only one kind of serialization ? What are the alternatives for not needing serializing an object?
asked by 15.04.2014 / 22:59
4
answers

Why use C # extension methods?

What do I get with extension methods that I do not gain with inheritance? Simply using it as if it had the same name is tricky, since it causes more confusion than anything else.     
asked by 24.06.2016 / 13:43
3
answers

What is the System.Linq in C #?

I asked this question here in SOPT What is the equivalent of PHP's array_map in C #? And I was curious to know what this System.Linq is about. Because when I tried to use the above response code without using it, I got an error...
asked by 27.04.2016 / 17:48
4
answers

How does C # lock work?

I was checking out an MSDN article, but it was not clear why use this. class Account { decimal balance; private Object thisLock = new Object(); public void Withdraw(decimal amount) { lock (thisLock) {...
asked by 12.08.2014 / 17:41
2
answers

Best practice to log system log

What is the best practice for registering a log system? public void inserirLog(string Acao) { StringBuilder csql = new StringBuilder(); csql.Append("insert into Log (Acao,data) values("); csql.Append(@"""...
asked by 26.02.2015 / 19:26
3
answers

ASP.Net MVC or WebAPI?

What is the advantage of using MVC and WebAPI (using Visual Studio and C #)? I think developing in MVC is easier than putting together a form with validations, so just put special attributes for this purpose and use the Wizard that already as...
asked by 02.02.2015 / 14:54
3
answers

Difference between Any, Contains and Exists

What is the difference between Any , Contains and Exists ? What is the appropriate context for each of them? (Examples of use) What are the advantages and disadvantages?     
asked by 10.12.2015 / 13:29