Posts by Amadeu Antunes • 3,331 points
161 posts
-
-2
votes0
answers15
viewsQ: How to get sessionId from an http request?
"When a HTTP request is Received" I need to get the sessionId of this request. For this I used the following function @triggerBody()?['sessionId'] however this returns "" -Empty string. Is there any…
azure-logic-appsasked Amadeu Antunes 3,331 -
0
votes1
answer52
viewsQ: Why can’t I instantiate a class from Linq
I’m trying to instantiate the following class from the English library using System.Reflection; namespace System.Linq.Expressions { // // Summary: // Represents accessing a field or property. public…
-
1
votes0
answers95
viewsQ: How should I test an EF core repository with xunit
I’m currently testing a repository as follows: public class SomethingTest { [Fact] public async void GetKeyValuesAsync_NotNull() { // Arrange var categoryRepository = CreateRepository(); var fixture…
-
0
votes1
answer43
viewsQ: Is it possible to call members of a Dynamic class as a string?
using System; public class Program { public static void Main() { dynamic stud = new Student(); Console.WriteLine(stud.Name); } } public class Student { public string Name = "John"; } Output John Is…
-
1
votes1
answer34
viewsQ: How to get an instance in . net core without using constructor
Normally I use the constructor to get dependencies something like: public class Test { private IServiceDependency serviceDependency; Test(IServiceDependency serviceDependency) { _serviceDependency =…
-
3
votes1
answer128
viewsA: Even after adding the file to gitignore, it continues on github
Since the node_modules directory is already being tracked as part of the repository, the rule .gitignore will not apply to him. You need to clear the git directory using git rm -r --cached…
-
-3
votes1
answer151
viewsQ: How to pass a url variable in web api that contains / or a question mark?
I am developing an api in . net core and noticed that in the url if I want to pass for example https://localhost:44365/api/values/test=?/ or https://localhost:44365/api/values/test=// An error…
-
1
votes0
answers29
viewsQ: Is there any way to make @bind-... a property readonly in blazor?
Is there any way to make @bind-... a property readonly in blazor? <MyComponent @bind-Property="@ReadOnlyProperty" /> @code{ public readonly bool ReadOnlyProperty= true; } Severity Code…
blazorasked Amadeu Antunes 3,331 -
1
votes1
answer72
viewsQ: How to put 2 background-image being one of them semi-transparent
Summary: I need to put two background 1 on top of the other one and the top one should be semi-transferred so that the background appears below and without affecting the other elements of the page…
cssasked Amadeu Antunes 3,331 -
4
votes3
answers1081
viewsQ: How to put a <p> on the same line as <hr>
It is possible to place the element <hr> in front of an element <p>? hr{ border-top: 1px solid red; } <p>Colocar a tag <b>hr</b> em frente do <b>p</b>…
-
0
votes2
answers169
viewsQ: How to make a group by Select is done to more than one table
SELECT tblOrgao.eleicao_id as IdEleicao, tblCargo.orgao_id as IdOrgao, tblOrgao.orgao as Orgao, tblCargo.id as IdCargo, tblCargo.cargo as Cargo, tblLista.lista as NomeLista,…
sqlasked Amadeu Antunes 3,331 -
1
votes1
answer281
viewsA: How to use Bindproperty in variables where names are dynamic in . net-core Razor pages
[BindProperty] public List<string> NMembro { get; set; } Data is being generated using javasript thus, the data after generated are placed with jquery to manipulate and generate the html,…
-
1
votes1
answer281
viewsQ: How to use Bindproperty in variables where names are dynamic in . net-core Razor pages
In Asp.net core Razor pages to pass data from a form declared as follows: [BindProperty] public int NMembro1 { get; set; } Where on the form side the tag input is stated as follows: <input…
-
0
votes1
answer58
viewsA: Unexpected symbol, can’t I detect it?
Remove the vigula from this line new Action(exibirMeses), Place public static void Main(string[] args)
c#answered Amadeu Antunes 3,331 -
3
votes1
answer2537
viewsQ: What it means: ERROR Error: Expressionchangedafterithasbeencheckeoverthrow
Areareservadacomponentcomponent.html:2 ERROR Error: Expressionchangedafterithasbeencheckederror: Expression has changed after it was checked. Previous value: 'Hidden: Undefined'. Current value:…
angularasked Amadeu Antunes 3,331 -
5
votes1
answer122
viewsQ: How does Windows manage installation frameworks?
Today you were asking me how the management of frameworks on Windows. The new version is coming out .NET 5, that means I will have to install this version to install programs made with this version…
-
0
votes1
answer102
viewsA: Why does EF Core not load the information from the related Tables?
The answer is simple: I need to use Include to all other data tables. var anuncios = await _context.Anuncio.Include(x => x.Cor) .Include(x => x.Imagens) .Include(x => x.Localidade)…
-
2
votes1
answer186
viewsQ: Why is EF Core updating data from other tables?
Why EF Core is actuating data from other tables? I am updating a table with EF but however I notice that EF is updating that table and still other tables. public async Task<IActionResult>…
-
0
votes1
answer102
viewsQ: Why does EF Core not load the information from the related Tables?
I will start by posting my data templates public class Anuncio { public int Id { get; set; } [Required] public string Descricao { get; set; } [Required] public TipoAnuncio TipoAnuncio { get; set; }…
-
0
votes2
answers1155
viewsQ: How to convert dd/MM/yyyy HH:mm:ss to yyyy-MM-dd HH:mm:ss
If I try to convert the date this way in Visual Studio works, but when I deploy the API (this already published) responds error 500. string added = "10/09/2018 10:20:11"; added =…
-
1
votes0
answers37
viewsQ: How to put images in the select tag in Asp-net core?
<select> <option background="https://lipis.github.io/flag-icon-css/flags/4x3/gb.svg">gb</option> <option…
-
0
votes1
answer66
viewsQ: How to check if the item is in the knockout list, because the isthere function returns 'false'?
The duvia is as follows: When I click the button Add To List this executes the function addToList which in turn performs the function isThere who is returning false and this is exactly what I don’t…
-
1
votes1
answer500
viewsQ: How to pass a URL in the Parameter of an API
How to pass a URL to an API public class HTTPController : ControllerBase { [HttpGet("URL={URL}")] public JsonResult GETURL(string URL) { } } However when passing for example https://google.pt this…
-
6
votes2
answers163
viewsQ: What do these question marks mean?
What do the question marks on that get. What do they mean int? and ?? in this line of code, I have already found examples that used ? and ?? but never so many in a single line and this gets a little…
-
0
votes1
answer52
viewsA: How to translate a rdlc file using resx files?
This was my solution to translate the report public static Stream TranslateReport(Stream reportStream, string Code) { var reportXml = XElement.Load(reportStream); reportXml = Translate(reportXml,…
-
2
votes1
answer52
viewsQ: How to translate a rdlc file using resx files?
I am trying through a rdlc files to configure to fetch translations from a Resource . resx file public static Stream TranslateReport(Stream reportStream, string partyId) { var reportXml =…
-
1
votes1
answer478
viewsQ: How to place routes with optional parameters Asp.net-core
I wish my route was this way [HttpGet("APIPassword={APIPassword}/AvatarUUID={AvatarUUID}/Idioma?={Idioma}")] Where Language is Optional…
-
0
votes1
answer33
viewsA: Is it possible to put the translation files in folders to get more organized?
I found the solution so just follow the following pattern If my controller is in the Folder /Controllers/Novapasta/Exemplocontroller.Cs Then I can put the translation file as follows…
-
0
votes1
answer33
viewsQ: Is it possible to put the translation files in folders to get more organized?
I would like to put the translation files organized by folders in this way Everything in the root of the folder Resources works but moves into that other folder stops working as I can configure so…
-
0
votes3
answers98
viewsQ: How to check if the record exists in the database and update if it exists
How to check if the record exists in the database and update if it exists I tried this way Select if((SELECT COUNT(*) FROM Pessoas WHERE id = 0) > 0, ( UPDATE Pessoas SET Name ="João" where id =…
-
0
votes1
answer167
viewsQ: EF Core error when applying update-database
I’m creating the table AspNetUSers while applying update-database The following error occurs You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for…
-
3
votes2
answers1140
viewsA: How do you input one input into the other?
You can do it this way $("#a-1").bind('input',function(event) { var data=$(this).val(); $("#a").val(data); }); $("#a").bind('input',function(event) { var data=$(this).val(); $("#a-1").val(data); });…
-
2
votes3
answers470
viewsA: Left Join with LINQ
I would do it this way var result= from a in ListA join b in ListB on a.Codigo equals b.Codigo into tmpMapp from m in tmpMapp.DefaultIfEmpty() select new { X = a, Y = m } More information can be…
-
2
votes3
answers127
viewsA: How to clear a list without losing all positions?
Let’s imagine the following list List<float> lista = new List<float>(); To delete the entire list lista.Clear(); So to delete keep the last 2000 what I would do is create a list based on…
-
0
votes1
answer36
viewsA: Redirecting via htacess
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://seusitecomhttps.com.br/$1 [R,L]
htaccessanswered Amadeu Antunes 3,331 -
1
votes1
answer696
viewsA: How to set up languages in Asp.net Core
To configure the languages in Asp.net core I used the following configuration: In the Startup file public void ConfigureServices(IServiceCollection services) { services.AddLocalization(opts => {…
-
0
votes2
answers544
viewsA: ASP.NET Core Attribute routing
It has two methods with the same number of parameters and the same name so you have to change the name of a [Route("api/[controller]")] public class SalesController : Controller { // api/sales/1…
-
1
votes3
answers596
viewsA: Questions about the Count sql command
I’d do it this way select count(*) from nometabela where carga > 40; In this example it will count the records that have been selected The selected records would be all that the value of carga…
sqlanswered Amadeu Antunes 3,331 -
5
votes1
answer696
viewsQ: How to set up languages in Asp.net Core
I’m setting up the AddLocalization So the problem is that Resources are in a separate class library of the project and I don’t know how to set up. services.AddLocalization(options =>…
-
0
votes3
answers148
viewsA: How do I know if an Itemtapped has been clicked?
I don’t have much information about your project but this example can help shaman <ListView Grid.Row="1" ItemsSource="{Binding Orders}" VerticalOptions="Fill" x:Name="ListviewOrder">…
-
0
votes1
answer32
viewsA: It is possible to change the background color of an image where this image is all white in Xamarin.Ios
For the problem at issue as the image was just white what I did was take the image and assign a color: Cor ImagemFundobackground = CriarCor(RecursosCores.preto); ImagemFundo.Image = null;…
-
0
votes1
answer32
viewsQ: It is possible to change the background color of an image where this image is all white in Xamarin.Ios
I have an image that is white by default, it is possible to change this color via code? Cor ImagemFundobackground = CriarCor(RecursosCores.preto); ImagemFundo.BackgroundColor =…
-
0
votes1
answer138
viewsA: create android text file on internal memory Xamarin.android
The Sqlite.NET library that Xamarin recommends is a very basic ORM that allows you to easily store and retrieve objects in the local Sqlite database on an Android device. ORM stands for Object…
-
0
votes0
answers50
viewsQ: How to detect that the text has created new lines
Let’s imagine I have a lable and has a text with n characters. Whenever this text does not fit he will put the words in the bottom line. How do I detect that this happened? I tried so internal int…
-
0
votes1
answer74
viewsQ: How to force use the float method instead of the double method?
How to force use the float method instead of the double method? public static void Dividir(double dividendo, double divisor) {…
c#asked Amadeu Antunes 3,331 -
7
votes1
answer424
viewsQ: What is the difference between using normal methods and Action or Func?
public Action<string> Escrever = (texto) => { Console.WriteLine(texto); }; Might call it that Escrever.Invoke("Algum texto aqui dentro"); VS public string Escrever(string texto) {…
-
1
votes0
answers12
viewsQ: How to move a Uitextfield in Xamarin.Ios?
I wanted to move one UITextField up or down in order to solve the problem of 'Keyboard' tried this way TextChaveAcesso.Frame.Location = new CoreGraphics.CGPoint(TextChaveAcesso.Frame.Y,…
-
5
votes2
answers1223
viewsA: Why don’t you need the `&`in the `scanf();`?
The RAM (= Random access memory) of any computer is a sequence of bytes. The position (0, 1, 2, 3, etc.) that a byte occupies in the sequence is the address (= address) of the byte. (It’s like the…
-
1
votes3
answers144
viewsA: How to keep html data saved
Cookies Cookies are data, stored in small text files, on your computer. When a web server sends a web page to a browser, the connection is terminated and the server forgets all about the user.…
-
0
votes1
answer56
viewsA: How to change the text of the BACK button in Xamarin.Ios
The solution I found was the following: this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem("Novo Texto", UIBarButtonItemStyle.Plain, (sender, args) => {…
xamarin.iosanswered Amadeu Antunes 3,331