Posts by Thiago Lunardi • 6,968 points
255 posts
-
0
votes1
answer31
viewsA: How to Insert Message from visual studio C# to Queue in Azure?
To insert a message in an existing queue, first create a new Cloudqueuemessage. Then call the Addmessage method. A Cloudqueuemessage can be created using a string (in UTF-8 format) or a byte array.…
-
3
votes1
answer353
viewsA: Save JSON file information to database
This is not complicated, especially being Web system. All means of environment client have an area of Storage - even browsers. Usually these areas of Storage work simply, with key and value - key…
-
0
votes1
answer67
viewsA: Client Identity x Azure AD x ADFS integration
Identityserver will be your best way out. It will provide you with all possible and necessary means of accreditation. It supports multiple ways of authentication: Windows Integrated Authentication:…
-
3
votes2
answers262
viewsA: How to use Simpleinjector in a multi-layer project?
Yes, you should create your Ioc as a Crosscutting. That is, a project, DLL, that has cache of records, and that sees all projects. You can see an example here:…
-
1
votes1
answer27
viewsA: Windows Powershell Azure Login Error
Failed to install the Azure module in your Powershell - run with Administrator privileges. PS> Get-Module PowerShellGet -list | Select-Object Name,Version,Path PS> Install-Module Azure See the…
-
2
votes5
answers212
viewsA: Get array object by description in index
It is possible to use the property of an object as the index of an array, as described in the example below? YES I like working with Collection List better. I find it more elegant, and do not need…
-
2
votes3
answers707
viewsA: Foreach wait for the select result to proceed
Work with Promises: function consulta(lista) { var defer = $q.defer(); var pesquisas = []; var queue = 0; // tamanho da fila a processar lista.forEach(function (row) { queue++; // adiciona uma…
-
0
votes1
answer544
viewsA: Basic Authentication in Webservice Rest C#
It lacked to decorate its method with the created attribute. [BasicAuthentication] public ConsultaPessoa GetPessoa(string cpfcnpj) { ... }
-
1
votes1
answer23
viewsA: Set Spending Limit by Resource Group
NAO, It is not possible to limit the spending of a resource group. At least not via RG configuration, either portal or PS. There is the way to create a prepaid subscription, in this you will have…
windows-azureanswered Thiago Lunardi 6,968 -
0
votes1
answer3475
viewsA: C# - How to make a simple Web Scraping
Expressoes Regulares This is still the best way to handle string like you’re looking for. With Regex - Regular Expressions - vc create a Pattern and conflicts this against a text. And all pouch that…
-
0
votes1
answer325
viewsA: Sort a list of objects by a string list
First, let’s review your code, because it may be creating problems outside the scope of the question. // Linha é irrelevante. A variavel `posts` será sobrescrita na proxima linha // Ela deve ser…
-
2
votes1
answer497
viewsA: Communication between MVC Controllers
Although it is possible to make one controller consume another controller, this is a very bad approach. The responsibility of controllers is of control the data flow in the pipeline request. That…
-
1
votes1
answer1122
viewsA: Browse Arraylist of object objects and compare c#
Simple answer Make your list a generic type. ListaFormas = new List<object>(); Full answer Square, rectangle or circle, all derive from the same type, all are Trigonometric Format, so the…
-
2
votes2
answers95
viewsA: Mysql parameter automation does not work
If the intention is to prevent SQL Injection, you’re on the wrong track. Mysql Driver for . NET already has all the resources necessary for this, just use correctly. Mysql driver has Mysqlparameter…
-
0
votes1
answer41
viewsA: Read Access for Users
Take a look at the documentation on Azure SQL Database - Access Control - Authorization. It explains possible permissioning types with Azure SQL Database. To see the SQL instructions for making…
-
1
votes1
answer114
viewsA: Error trying to change a user’s role
Your data entity has a property that is not correctly mapped by the Entity Framework. In case a EntityValidationErrors. I recommend to guide the RU to ignore this property - since it is a state of…
-
1
votes1
answer257
viewsA: Error trying asynchronous connection
You created an asynchronous method, but you’re not waiting for him to finish the execution. Exchange the code for the following: private void Conectar_Click(object sender, EventArgs e) {…
-
0
votes1
answer488
viewsA: Notification with C# Framework, is it okay?
See if this example is what you’re looking for: https://github.com/thiagolunardi/AzureNotificationHub To receive notifications, simply register the app like this: private async void…
-
0
votes1
answer29
viewsA: Scheduled Backup in Azure SQL Database
You CANNOT configure the frequency of backups in Azure SQL. I confess that I see no need for this, since it occurs back every 5-10 minutes. See excerpt from the documentation on how often backups…
-
0
votes2
answers268
viewsA: Azure phpMyAdmin error: Access denied!
Mysql in App already has a manager, you don’t need a third party to manage your Mysql database in the App. Comments from @Uilherme-nascimento make sense. Adding phpMyAdmin to the same hosting as…
-
0
votes1
answer52
viewsA: Configure Webjob Azure to run every 15 minutes
Today the recommendation is to use Azure Functions with Time Trigger. https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer…
-
1
votes1
answer341
viewsA: How to call a database Function from the code
The same way you do SELECT. var query = "SELECT functionName() as Result FROM Dual"; var result = con.ExecuteScalar(query);
-
1
votes4
answers1741
viewsA: How to identify and when to use Value Object?
Very briefly it is the following: Entities have Identification - Id. Ex: Client. Values do not have Identification. Ex: Customer’s Website. See the following: cliente: { id: 1, nome: "Thiago…
-
1
votes1
answer358
viewsA: How to log a post into a web api
I recommend using Fluent HTTP for this. In addition to being more elegant to perform HTTP requests, comes several other features like the one you need: FlurlHttp.Configure(c => {…
-
4
votes1
answer1398
viewsQ: When to use String and Stringbuilder
There is another question about What is the most appropriate way to concatenate strings?. It explains the possible types of concatenations in C#. But when should we use System.String and when we…
-
7
votes1
answer1398
viewsA: When to use String and Stringbuilder
First let’s meet the two guys. System.String The guy string is a reference type within the . NET Framework. Therefore it "lives" only in memory heap, a simple and quick-access object storage memory.…
-
1
votes1
answer42
viewsA: Azure Web Roles and Worker Roles
The main difference between the two is that Web Role runs with IIS support, while a Worker Role does not. For example, a Webrole is a web application that will perform an operation that has no…
windows-azureanswered Thiago Lunardi 6,968 -
75
votes3
answers154272
viewsA: What is REST and Restful?
REST According to Wikipedia: Is thought of as a design image of the application will behave. That is, it would be something like, depending on how you consume the same resource - a feature that can…
-
3
votes1
answer83
viewsA: Modeling - Model
If you had given a more concrete example, you could help better. It seems to me that you are working with structures. I will make a very superficial example. Using the model below, we will assemble…
-
0
votes3
answers261
viewsA: How to send selected data to an ftp server
This example shows how to load a file to an FTP server. Example C# using System; using System.IO; using System.Net; using System.Text; namespace Examples.System.Net { public class…
-
2
votes2
answers1582
viewsA: Variable of the foreach loop
Depends on what kind the list is. If it’s a complex kind of list - class - shall be by reference. If it’s a primitive type list - string, int, bool, decimals, etc - will be by value. However, you…
-
5
votes4
answers1643
viewsA: Variable in message box c#
The code below is also self-explanatory. :) public partial class Form1 : Form { private int _c; public Form1() { InitializeComponent(); _c = 23; } private void button1_Click(object sender, EventArgs…
-
3
votes3
answers187
viewsA: How to understand and deal with the cost of Azure?
What I want to know is: it really comes easily at such high costs in Azure? Yes, very easily, as it is very easy to scale any service on it - there is Azure SQL instance that cost USD 22K/month. It…
-
2
votes2
answers117
viewsA: How to connect an Azure Storage Account to an ASP.NET Core project?
Azure Storage Emulator First you should configure the Azure Storage emulator locally, so you can develop without the need to go remote. The storage emulator is available as part of Microsoft Azure…
-
0
votes3
answers335
viewsA: Add data from a sql column c#
I refactored some of your code, but with commentary to improve your writing. // PontoEntites é um Contexto de repositório ou banco de dados // Então, quando instancia um PontoEntities ele retorna um…
-
2
votes2
answers593
viewsA: How to model the products table for an e-commerce?
Your problem isn’t modeling tables, but you don’t know the business you’re creating. Talk more to your P.O. or customer about all processes. Just to clarify a little bit: Product, also known as…
-
0
votes3
answers68
viewsA: Error in if ultimalization
Only to demonstrate the same code, but refactored. var atividade = new [] {1,2,3,4,5,6}; var totalImpar = 0; for (var i = 0; i < atividade.Length; i++) { totalImpar += atividade[i] % 2 == 0 ? 0 :…
c#answered Thiago Lunardi 6,968 -
1
votes1
answer228
viewsA: Signal the receipt of messages
You can use Azure Notification Hub to do so. So you can generate the notification for any platform. In my github you can see a example of sending notifications. In your app, you sign in to receive…
-
1
votes1
answer549
viewsA: Ajax Request Does Not Work - Success Does Not Work
Your API must return a JSON, not a C object#. public JsonResult GetSubCategory(int id) { var subCategories = new List<ProjectSubCategory>(); using (var context = new ApplicationDbContext()) {…
-
1
votes1
answer87
viewsA: Stop all services in Azure
No, it does not have this functionality the way you look for it. This pq is not every service that has the "Stop" option. The only thing you can do in batches is to delete an entire Resouce Group -…
windows-azureanswered Thiago Lunardi 6,968 -
1
votes1
answer14
viewsA: Scalar Collection at Cosmosdb
In fact, this is exactly how you scale in Cosmosdb, you only scale a collection, not a whole database. See: Here I am selecting to climb just the Collection workspace of database eventstore.…
-
1
votes3
answers136
viewsA: Problems with result accuracy
Surely your problem lies in mixing the types (double, int, etc) in the calculation of the media. You can read here about what is the correct way to use float, double and decimal. I was in a good…
c#answered Thiago Lunardi 6,968 -
1
votes3
answers4984
viewsA: Get the highest value from a list?
Using only C#: // criar a lista var lista = new long[100]; for(var i = 0; i < 100; i++) // Cada segundo possui 10 milhoes de Ticks, // isso ira gerar valores aleatorios para a lista lista[i] =…
c#answered Thiago Lunardi 6,968 -
0
votes1
answer46
viewsA: Switch Connectionstring to Appdata/Roaming
Change relative path (recommended): ConnectionString = "Data Source=|DataDirectory|\Database.sdf"; Change at runtime according to executable: var executavelAtual =…
c#answered Thiago Lunardi 6,968 -
1
votes2
answers95
viewsA: Recovers data with Request.Querystring
In his BeginForm you say you must submit the data to CadastroEvento. But in your controller, you expect the data in PesquisarEventoPorLocal. suggested improvement [HttpGet] public ActionResult…
-
2
votes3
answers388
viewsA: Is it possible to offer return options in a method?
In the post were asked two questions. I can create a return Overload? Not, this really cannot. The identity of a method is done by method name x parameters. Even if you duplicate the method by…
-
2
votes2
answers128
viewsA: Visual Studio Installer Projects with Postgresql
Using Powershell from VSI, it is possible yes: Simple installation: Import-Module Install-Postgres Install-Postgres -User "postgres" -Password "ChangeMe!" With more parameterizations:…
-
2
votes2
answers135
viewsA: Why only an Encoding works in the algorithm?
Being very superficial: ASCII does not support accentuation. If you expect to receive accentuation - or binary text - use Encoding.UTF8. See how they behave in simple conversions. var original =…
-
3
votes1
answer102
viewsA: Autocomplete locking the database
Postgresql Fulltext Search If you don’t want to make significant changes to the software or infrastructure, see Postgresql Fulltext Search. It is a function/resource of Postgresql to perform…
-
2
votes2
answers1655
viewsA: Create spreadsheet by C# without having excel installed
Use Spreadsheet Light SLDocument sl = new SLDocument(); sl.SetCellValue("A1", "Hello World"); sl.SaveAs("HelloWorld.xlsx");…