Questions tagged as 'c#'

1
answer

Why are relations in the Entity Framework code first pointed to with ICollectionT?

Why relationships in the Entity Framework code first are pointed to with ICollection? What is the best instantiation (?) For the property in common cases? List Is the use of the virtual keyword only to enable lazy loading on the property?     
asked by 06.01.2015 / 21:51
2
answers

How does the Tracking / Chache of EntityFramework objects work?

Whenever I used EntityFramework in a project, to add a record in the database through it, of a class that contains class type memberships (usually on behalf of ForeignKeys ), I did the following: After the entity instance, it filled in t...
asked by 09.05.2015 / 04:05
2
answers

How to count how many uppercase characters exist in a string?

How to count how many uppercase characters exist in a string?     
asked by 08.04.2015 / 23:32
1
answer

Replace words dynamically

For example, I have the file addresses:    C: /windows/x.exe       C: /windwos/system32/example.exe I would like to replace the filename and extension with "", thus:    C: / Windows /       C: / windows / system32 /     
asked by 10.04.2015 / 13:34
1
answer

How to do a complex query in SQL in .NET MVC

I would like to know how to make a query, using multiple fields, multiple tables with inner joins in ASP.NET MVC without having to put the SQL string in the code, using the Entity Framework. Currently, without using the string in the code, I...
asked by 19.06.2014 / 19:47
2
answers

How to make a user helper logged in Asp.NET MVC 4?

I need to implement a Helper for logged in user, ie a static class that returns information about the logged in user of context . The idea is to use information in both Controllers and Views .     
asked by 22.05.2014 / 00:38
2
answers

Inserting special character in view

I have an HTML table where one of your td needs to enter the following information: <td>@item.OrderSend º</td> I wanted to insert this way: <td>@item.OrderSendº</td> But when you join the º character with...
asked by 11.05.2017 / 14:26
2
answers

Keyword for C # equivalent to "synchronized" Java

Problem I'm implementing a connection manager that implements the standard Singleton , managing a pool of single-key connections for each new connection. So I'm trying to get problems with the parallelism of my manager, because it can be c...
asked by 17.08.2016 / 13:53
1
answer

Check if entered value is numeric and if it has 9 characters

How can I check if a value is numeric, and only numeric (no occurrence of periods, dashes, etc.), regardless of how many characters the number contains, in addition to having exactly 9 characters, neither more nor less?    Examples accepte...
asked by 20.03.2014 / 16:55
3
answers

Format a string with time

I'm trying to format a string that already has date and time, but this string just has to get the time I'm trying in this way more does not work: > Recovering from the database. string dtSolicitacao = String.IsNullOrEmpty(Convert.ToStri...
asked by 27.08.2015 / 14:01