Posts by Thiago Lunardi • 6,968 points
255 posts
-
1
votes1
answer837
viewsA: Starting a windows service
I need to make two considerations: Trying to connect to the bank to test whether or not it is working is not the best approach. There are many factors that can cause a crash in this your test and…
-
1
votes2
answers303
viewsA: query and change procedures for DAO C#layer
That kind of Architecture BOLOVO separating the application by "levels" as view/business/date is very bad and outdated. It has been used a lot, but professionals have seen that it is an approach…
c#answered Thiago Lunardi 6,968 -
2
votes1
answer125
viewsA: Coordinate in MVC map
Any map component does what you want. Choose one, try applying it, and if you can’t, send a question, showing what you’ve already done. So we can really help. Bing Maps Dev Center Here Maps for…
-
3
votes2
answers390
viewsA: Why use Docker in Azure?
I will try to answer all the questions. If something was not clear, just comment that I will complement the answer, combined? Azure is a cloud mobile. In it we find two types of services that we can…
-
1
votes2
answers501
viewsA: Text alignment problem within select and input
Increases the weight and also the line-weight. The font must be too big for the line size, and ends up cutting the text like this.
-
0
votes1
answer620
viewsA: Mysql Unique record insertion problem
Try running Mysql table repairer. If it is a table using the engine InnoDb, just do this ALTER TABLEthat it will suffer a rebuild: mysql> ALTER TABLE t1 ENGINE = InnoDB; If it is a MyISAM, just…
-
0
votes2
answers75
viewsA: How to obtain a cookie in the Web API in a Forms Authentication scenario in Cross Application?
This is only possible if both applications are on the same server and sharing the same virtual directory. Any scenario other than that will not be possible. So, if you are hosting in the cloud, you…
-
0
votes3
answers3400
viewsA: Field value related to another field of another table?
You shouldn’t do that. If it was a Nosql base, it would make sense, but in a relational bank, you’re certainly doing something wrong. If you want the list of people and what courses you are…
-
1
votes1
answer79
viewsA: Scroll does not work after append with jquery
Your div.overview is not changing size, so the scroll does not "work". Imagine that your div.overview is 400px high, and you do the .append() of an object which, rendered, will be 600px high. It…
-
2
votes2
answers185
viewsA: Problems with positioning with columns in Bootstrap 3
All indicates that the problem is in the column sizes of your grid. Width without should total 12, if you pass there will be line break. <div class="container"> <div class="row"> <div…
-
1
votes2
answers352
viewsA: How to receive the view model in a GET request Webapi?
If you are using API 2+, Voce should use annotations in your actions. It is more elegant and simpler to configure. [RoutePrefix("/api/product")] public class ProductApiController : ApiController {…
-
3
votes1
answer117
viewsA: Facebook authentication in an app using Azure
The documentation of Facebook for Developers is quite complete to do what you need. See here all about Login to Facebook, provided to log in iOS and Android apps, as Websites and others. It is…
-
3
votes4
answers23311
viewsA: Force Javascript File Update Without Disabling Cache
As you are using ASP.NET, just use the resources of Bundling. It will manage this for you by creating a different URL only when there is a new version of Javascript, otherwise it will guide the…
-
2
votes1
answer187
viewsA: Configurationmanager.Appsettings returning different values in different environments
Inside your Webapp, in the "Appsettings" option, you will find not only settings pertaining to the hosting, but version of . NET Framework, as well as some transformations that your web.config…
-
0
votes1
answer401
viewsA: MVC error 404 POST method
Your second form is with different Ids than expected by Controller. @using (Html.BeginForm("TestePost", "Home", FormMethod.Post)) { <fieldset> <legend>Form tipo POST</legend>…
-
0
votes1
answer98
viewsA: Error generating Email Confirmation Token in Asp.MVC
The problem is this: Vc is now developing for cloud, so you cannot create a data provider at each request, but keep only one per application. See here this answer in English. To get around this, you…
-
0
votes2
answers1574
viewsA: How to get date and time in different columns through a select Sql server?
I recommend creating a third Date column, where the default value is a CAST(Data +' '+ Hora). So you’ll have a column with the right type to make your filters. But using what we have today, I would…
-
4
votes3
answers414
viewsA: How to change the structure of a LINQ query at runtime?
For situations like this, I like to extend the LINQ class and use the WhereIf. The cool thing about this method is whether or not you have control of what the ORM will or will not solve - and if it…
-
1
votes1
answer783
viewsA: Display dialog box when right-clicking
I made minor modifications to Jsfiddle of the commented response. Test here HTML: <div class="content"> <input type="text" placeholder="Clique aqui com o botão direito para comentar" />…
-
2
votes2
answers6785
viewsA: Image upload with Jquery
I recommend using the Plupload. Very popular, with good documentation. Source code: <div id="uploader"> <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>…
-
0
votes1
answer177
viewsA: Search box ASP . NET
There are two items to be implemented to achieve this kind of search-rich experience. Typeahead.js With this component you will be able to create this autocomplete or sugestions while searching in…
-
0
votes2
answers3709
viewsA: How do I update multiple rows of a table after it undergoes a certain change?
Well, it’s clear that there’s a infinite loop, look at you. There is a Trigger that, in the UPDATE country BLOQUEIO for S, he does UPDATE in the field BLOQUEIO also to S. I don’t like TRIGGER. It’s…
-
-1
votes3
answers2266
viewsA: Entity Framework [Foreignkey]
It’s very simple. Entity Framework will anyway create this Standardid in the database. What happens is, whether or not you have control of creating this column? Another, you can perform queries in…
-
2
votes4
answers325
viewsA: Loop 20 to 20 lines
Simple as that: for (var i = 0; i < 100; i+=10) { // ... } The incrementer ++ can be parameterized. ++ increment of 1; +=n increment of n, where n must >= 1; It can also be a decreasing: --…
-
4
votes2
answers423
viewsA: how to align center with css
I would solve so: <div class="linha"> <div class="botoes"> <button /> <button /> </div> </div> CSS: .linha { width:100%; } .botoes { margin: 0 auto 0 auto;…
-
3
votes1
answer493
viewsA: What is the best way to generate pdf files via webservice?
I’m on a job of it right now. And, the simplest, to generate PDF from an HTML and worked very well with me, is the Nreco.Pdfgenerator. Free, fast, and too easy to use. var htmlContent =…
-
1
votes1
answer101
viewsA: How to Batch Generate Excel Files in MVC?
Look, every requisition/request can return only one response/respose. So, the only way to return this you need, would be to create all Excel files in memory, with a MemoryStream, and then compress…
-
2
votes3
answers410
viewsA: Call a method automatically via a partial class on . NET
You must be explicit to fire that handler. Now, the location where he’s being shot is that it should be centered. Otherwise you will have to make a call like this each time you change the properties…
-
4
votes3
answers113
viewsA: How to implement custom features in a model on . NET?
One of the principles of object-oriented programming, SOLID, is that an object should be closed for maintenance, but open for extension. To add functionality to a closed object for maintenance,…
-
4
votes3
answers2971
viewsA: Generate an xml in c#
What you want is a database environment, in loco, to work with your app in mode offline and, when you have a connection, sync this data. Right? Well, as it was not said whether it is a desktop or…
c#answered Thiago Lunardi 6,968 -
0
votes2
answers529
viewsA: How can I automatically send my input information via javascript?
The size of the value of the input through the event onchange of it. See: <input type="text" id="campo1" onkeypress="campo1_change(this);" /> <script> function campo1_change(obj) {…
-
0
votes1
answer117
viewsA: How to organize viewmodels and mappings in the project?
Whereas Viewmodels serve only to serve the modeling/typing of Views, it should stay in the presentation project - if it is MVC, in the Web project, if it is Webapi, in the API project. They should…
-
1
votes3
answers1767
viewsA: Attribute in Dataannotations for Currency
According to the image, who is validating the input is the browser, and not your app. See and it did not create a <input type="number" />. Because if it is, it is out of your control to…
-
2
votes2
answers700
viewsA: C# - I/O on the network
Come on, your program about running under a user authentication, always. With this in mind it is easy to understand that this user should yes have access to the file you want to open via app.…
-
0
votes1
answer53
viewsA: Saving information in the same database attribute using two textbox
Yes, you can do this with simple techniques. See this example using only a Viewmodel class: public class CadastroViewModel { // outras propriedades public string CPF { get; set; } public string CNPJ…
c#answered Thiago Lunardi 6,968 -
0
votes1
answer81
viewsA: Is there a generic Css code to turn my website into "mobile friendly"?
Nothing magical, you can import the libs from Boostrap, and apply size and proportions according to device size. Just follow the guidelines of Grid System and create their adaptive layout.…
-
1
votes1
answer65
viewsA: How to change the PHP version in Azure
In the last release of Azure’s App Service, PHP was published in version 7.0. See if this solves your problem.
-
2
votes2
answers94
viewsA: Azure Shared App Service
In Azure, a shared-type billing plan, you can’t guarantee a minimum of resources (processing and memory) dedicated to your application. This is why it is not recommended to use this plan as the…
-
4
votes2
answers653
viewsA: Name collision between class and namespace
None of the options. The namespace serves to give context to the components you are using. It is only useful to the developer. Name a class with the same name as namespace will generate some…
-
0
votes1
answer29
viewsA: Wordpress - Share the social network pulls wrong photo
Install a plugin from Wordpress SEO. It will help you solve this problem. Just set up the Set Featured Image in each post.…
-
0
votes3
answers1650
viewsA: Send All Checkbox via Post
Without a workaround, is not possible. This is characteristic of <input type="checkbox" />. However, I believe that changing the way you’re treating request in his action, should improve. See,…
-
2
votes1
answer307
viewsA: Problem with WHERE and BETWEEN two Mysql tables
With subquery that is easily solved: SELECT T.* FROM ( SELECT user.*, (SELECT count(*) FROM user_aula WHERE user_aula_prof = user.user_id AND user_aula_status IN (1, 2, 3)) as aulas_dadas, (SELECT…
mysqlanswered Thiago Lunardi 6,968 -
0
votes1
answer165
viewsA: Webapi problem when trying to Deserialize object with property of the same type (circular reference)
In a Webapi, you don’t need to receive data like object and then deserialize. The namespace System.Web.WebAPI already owns the Newtonsoft.Json how dependency that solves this for you. Try it like…
-
2
votes3
answers1037
viewsA: Where dynamic Linq to SQL
You can also extend the System.Linq adding a WhereIf. I used it once, and it works fine. First add extension to your project: public static class LinqExtensions { public static…
-
2
votes2
answers1229
viewsA: Improve code performance in C#
There are many things that can be done to make your code performance much better. However, there are two things you really should do and refactoring in order to get the performance up quickly:…
-
0
votes1
answer84
viewsA: Generate Property Internal set
It depends on where you want to create this property, and also on the nomenclature format. public class Teste { public Teste() { minhaProriedade = 1; // private readonly OutraPropriedade = true; //…
-
2
votes3
answers1837
viewsA: Get back deleted files in Git
Just reverse the commit you used to delete the files. git revert <commit> Where <commit> is the number of the commit you want to undo. Documentation of Git Revert.…
-
7
votes3
answers671
viewsA: How to make SELECT in more than one bank table?
That would be the basics: SELECT * FROM USUARIOS JOIN CEP ON CEP.IDCEP = USUARIOS.IDCEP If you want to limit the columns: SELECT USUARIOS.*, CEP.cep, CEP.uf, CEP.cidade, CEP.bairro, CEP.logradouro…
-
4
votes3
answers538
viewsA: Average only in typed fields
Follow a POC with jQuery, I believe should help: HTML: Nota 1: <input class="nota" /><br/> Nota 2: <input class="nota" /><br/> Nota 3: <input class="nota"…
-
-3
votes2
answers292
viewsA: How does the flow of a Web Service work?
What you are looking for is how to create a REST Service, i.e., an API. If you want to use C# to create your API, then follow these steps: Download the Visual Studio Community: The best IDE on the…