Posts by LeandroLuk • 4,989 points
276 posts
-
1
votes1
answer161
viewsQ: How to access custom attributes of a property using VB.NET
I have a solution in VB.NET where I am implementing some custom Attributes. One of them is for properties, example: Namespace Attributes <AttributeUsage(AttributeTargets.Property)> Public…
-
1
votes1
answer99
viewsQ: How to create an extension method for the type of a class in VB.NET
I’m creating a MVC structure that will work similar to the Entity Framework within a VB.NET project where I created an attribute called TableAttribute which will define the table and the schemas to…
-
3
votes0
answers113
viewsQ: How to use interfaces like Dbset’s in the C#Entity Framework
Hello, I’m making a solution where my entire business layer is in a separate project and in this project I created the layer relational structure from interfaces as shown in the example below: //…
-
1
votes3
answers73
viewsQ: How to create a class with type inference that can have a default type in C#
I’m creating a class where I make type inference, as in the example below: public class Foo<T> { public T Bar { get; set; } } Is there any way I can set T to a default type like string? My…
-
-2
votes3
answers92
viewsA: As I do in python for at the end of the code, it go to the start again
Another option (not only in python would turn this into a recursive function, which calls itself at the end of the run...
-
2
votes0
answers566
viewsQ: How to disable the back button on certain React Navigation routes with React Native
Hi, I’m working with React Navigation and I’m having problems regarding the "back" button on certain screens. My Navigator is as follows: import React from 'react' import { FluidNavigator } from…
-
0
votes1
answer462
viewsQ: How to disable React Navigation Drawer on specific routes
Hello, I’m creating an application that should not display Drawer on specific routes like login, registration, etc. Currently my file is like this: import React from 'react' import { FluidNavigator…
-
0
votes1
answer279
viewsQ: How to create a TRIGGER for an INSERT event without causing a lock in the Sqlserver table
Hello, I am doing the integration between 2 solutions, where I need to detect the change of a table, and, based on the information that is sent I must manipulate another table. I don’t have access…
-
-2
votes1
answer602
viewsQ: How to format a label using Stringformat in Xamarin Forms
I am creating a solution where I must display a whole in one <Label />. To do this I’m using the code below: public partial class Home : ContentPage { public Home() { InitializeComponent();…
-
0
votes0
answers27
viewsQ: How to separate style sheets using Xamarin Forms
Hello, I am coming from WPF where it is possible to create my style files in separate files and from the same use in my UserControl's the same style settings. I did some (many) searches and found…
-
0
votes1
answer1420
viewsA: How to inhibit the "back" button in an React Native application using React-navigation-Fluid-Transitions
After 4 hours of searching and then posting this question, I found this video that solves my problem: React-Native tutorial # 36 disable back button in navigation The solution is inside my screens…
-
0
votes1
answer1420
viewsQ: How to inhibit the "back" button in an React Native application using React-navigation-Fluid-Transitions
I’m creating a mobile application that uses as a basis react-native. To make the transition between the screens and to have a better user experience, I am using the libraries react-navigation and…
-
1
votes1
answer58
viewsQ: How to fire multiple errors in a single data check using C#
I am creating a solution where I would like to keep all business rules within my models including the answer to errors. The problem is that I would also like to be able to capture multiple errors at…
-
1
votes3
answers277
viewsQ: How to concatenate sublists from a list and add values to them using Linq with C#
Hello, I have the following 2 classes: public class EstoqueItem { [Key] public int Id { get; set; } public decimal Qtd { get; set; } public Estoque Estoque { get; set;} } public class Estoque {…
-
2
votes1
answer1350
viewsA: Error when trying to update a Wordpress post using the WP REST API plugin
I found the problem. When I read the documentation again the first time I was not paying attention to the details and it says that to be able to do all the processes the WP REST API plugin API…
-
1
votes1
answer1350
viewsQ: Error when trying to update a Wordpress post using the WP REST API plugin
Hello, I’m new with Wordpress and need (for yesterday) solve this problem. Help! I’m creating a simple Angular 2 (V6+) integration that accesses the plugin-generated api WP REST API and the json I…
-
1
votes0
answers21
viewsQ: How to integrate a Class Library to a Database Project in Visual Studio
Hello, I am creating a solution in Visual Studio in which I would like to separate all layers of the application in projects to have a better defined structuring. My solution until then is like…
-
0
votes1
answer233
viewsA: How to use the reference of a Barrel file in the same folder with Typescript
The solution was the way I was declaring the import because I should use the same logic for browsing between folders where . represents that I am looking for something in the same directory and ..…
-
2
votes1
answer43
viewsQ: How to use a literal tuple as property of a class in C#
Hello, I’m working with C# and I read about literal tuples. With that, I’m creating the class below: public class Foo { public (int bar, string bin)? barBin { get; set; } } In theory, in order for…
c#asked LeandroLuk 4,989 -
6
votes2
answers782
viewsQ: How to create a Restful API with asynchronous processing and response using C# + Angular(v5+)
Hello, I am working with C# and I have the following problem: Imagine I have a route to my API api/estoque/inventario where this route should make the calculation of the inventory of the entire…
-
0
votes1
answer226
viewsQ: How to access the Styles.scss file from within an Angular component
I am working with Angular (project generated by @angular/cli), and the structure of my project is below: src | - app | - foo | - foo.component.js | - foo.component.scss | - foo.component.html | -…
-
4
votes1
answer150
viewsQ: How to implement an abstract method with a generic class in C#
I am creating a functional Factory where I define what is its output type and what are the required implementation methods. With this implementation, when I try to use the object obj within the…
-
0
votes2
answers184
viewsQ: How to automatically name a manually created CONSTRAINT in Sqlserver 2016
Hello, I am creating a database and need to create some compound Index to optimize the bank processing. The problem is that I don’t want to have to name these Indexes one-on-one. Normally, I create…
-
4
votes1
answer385
viewsQ: How to PIVOT a column by concatenating strings into Sqlserver
Hello, I’m making a query in a database to identify all the columns that are primary key's of the tables of a database and also identify whether or not they are identity. For this I use the query…
-
0
votes0
answers171
viewsQ: How to define the order of a list dynamically using Linq and C#
Hello, I am creating a method so that I can return a list of people where, I pass the column that should be ordered and whether this is increasing or decreasing. Thus: public async…
-
1
votes1
answer102
viewsQ: How to create a unique index in a table so that it only has a record with a specific value in Sqlserver
Hello, I am creating a data structure in Sqlserver and I have the following situation: I have a list of contact types (person, public, commercial, etc...) This list can be changed by the user but,…
-
0
votes1
answer25
viewsA: How to change the view of toggle buttons based on a Binding in WPF Datagrid
I solved my problem by fixing my converter... the problem was that in the validation of the object type I did not compare the same correctly. I also added an "inverter" to the result, in case I want…
-
2
votes1
answer25
viewsQ: How to change the view of toggle buttons based on a Binding in WPF Datagrid
Hello, I am new with XAML/WPF and I have the following problem. I have a DataGrid which receives as Itemssource a ObservableCollection<DataEstoque>() thus public class DataEstoque { public…
-
1
votes1
answer152
viewsQ: How to directly compare strings treated with Regex in C# directly
Hello, I come from the web (javascript) and I have the habit of working with OO mixing a little functional paradigm. Imagine the following situation. I have a CC I have to check if it exists in the…
c#asked LeandroLuk 4,989 -
0
votes1
answer47
viewsQ: How to merge sublists from a class and return the result using Linq and C#
Hello, I am working with c# and I have the following situation: I have 2 classes in the system, Order and ProductSold; Order contains as property a List<ProductSold>; In certain Viewmodel, I…
-
1
votes2
answers184
viewsQ: How to call a parent window method when another daughter window is closed with WPF
Hello, I’m starting to work with WPF and my situation is as follows: I have a Mainwindow screen, which persists the application. The Mainwindow calls a new screen Regradetailsdialog in a certain…
-
3
votes1
answer296
viewsQ: How to create an index for two tables at once in SQL Server?
I’m pretty sure there’s no way but, come on... I have the following scenario: (I included only the fundamental fields for brevity) - Tabela Venda: - id: int; - cliente_id: int; - cliente_tipo:…
-
-1
votes1
answer248
viewsQ: How to get a page from another site using PHP
Hello, I’m trying to get the prices of a page on the iFood site using PHP so that if my client changes the prices he put on their page, the site will already make the automatic correction. The…
phpasked LeandroLuk 4,989 -
1
votes2
answers103
viewsA: How to make an implicit conversion (inheritance) without losing information
Based on @dherik falo, my solution was a mix of the 2 models, thus: 1º I added a type field to the AssinanteFree and a constructor to each class defining this type, thus: public class AssinanteFree…
javaanswered LeandroLuk 4,989 -
5
votes2
answers103
viewsQ: How to make an implicit conversion (inheritance) without losing information
Hello, I am doing a project for college where I have to implement 3 classes. These classes inherit from each other as in the model below: public class AssinanteFree { protected int id; public int…
javaasked LeandroLuk 4,989 -
1
votes1
answer199
viewsQ: How to read a json using Gson when the class contains Arraylist’s in JAVA
Hi, I’m doing some college work and I’m having trouble faking a persistence. The idea is this, I have an Observable/Singleton class that does both the control of updating data from some lists and…
javaasked LeandroLuk 4,989 -
1
votes1
answer52
viewsQ: How to copy the summary of a method with Overload in C#
I’m creating an application where in the classes I have a series of Overload's to optimise its performance and flexibility. Ex: public class Calc { // método original com sumário /// <summary>…
-
3
votes2
answers141
viewsA: How to create a class and pass an attribute value in the class constructor in C#
I was able to solve my problem based on what @Tony said in the comment and also in that fiddle I found. The answer was to generate a DefaultContractResolver customized with this specific treatment…
-
2
votes2
answers141
viewsQ: How to create a class and pass an attribute value in the class constructor in C#
Hello, I’m making an integration with the Tray Comerce API and thought to generate a generic class with the response of lists. In all listings, the API implements the following return class: public…
-
1
votes1
answer780
viewsQ: How to list files in a directory and use in an Angular2 + Webpack project
Hello, I am creating a project in Angular2 + Webpack and in this project I use as a design library @angular/material. So I can create my own icons using SVG, I’m extending the component MatIcon as…
-
0
votes1
answer116
viewsQ: How to navigate with React-router-dom when an action occurs
Hello, I’m starting to work with React and I’m doing an integration with Firebase. My problem is this, I can already fire all the actions I need, but when I fire my last action…
-
1
votes0
answers120
viewsQ: How to declare a ternary condition in XAML as a parameter for a Custommarkupextension
Hello I’m starting to work with WPF and created a Custom Markup Extension leaving of this tutorial. The intention of this Markup Extension is to simulate the declarative conditions that are found in…
-
1
votes1
answer55
viewsQ: How to take the Schema of a Model in a Dbcontext made in the Entity Framework Core
Hello, I’m starting to work with Efcore and I’m doing an Override on the method SaveChanges() so that whenever there is a manipulation of the bank I can log this manipulation. My problem is that I…
-
0
votes1
answer340
viewsQ: How to define multiple variables at once within a Trigger in Sqlserver
Hello, I am creating a TRIGGER where I must do a series of treatments after an UPDATE in a table in Sqlserver. In this TRIGGER, I need to define some variables so I can work with them in the rest of…
sql-serverasked LeandroLuk 4,989 -
1
votes1
answer142
viewsA: How to "bind" a Vue.js variable without using the keys
Oops, snooping on the net bumped right after inserting the question here. The solution is the directive v-text as shown in this link getting my html like this: <form id="foo"…
-
0
votes1
answer142
viewsQ: How to "bind" a Vue.js variable without using the keys
I’m starting to work now with Laravel 5 + Vue.js and I’m having problems with loading my page. My Vue variables are exposed at startup and are only rendered after javascript loads. My example is the…
-
1
votes2
answers65
viewsA: Excel, analyze condition in data table
Well theoretically, you would have a column with selective type values (single values within a list) and from these values you should do a treatment right? then I think you should have the following…
-
8
votes3
answers10018
viewsA: SASS and SCSS: Why use them instead of conventional CSS?
Well, we can say that SCSS and SASS do everything that CSS should and should not do. Here are some examples: Easy maintenance Imagine that I have a site with a certain color palette and need to…
-
0
votes2
answers374
viewsA: Change table color on Laravel Blade
First, what you should keep in mind is that it is not the Laravel that makes the change in specific, but rather a possible class that you define in the tr table as in the example below: .mytable tr…
-
1
votes2
answers313
viewsA: Cordova open app links within the app
I think the best solution in your case would be to work with a <iframe></iframe>. The Cordova is nothing more than a browser that runs a local "site" and gives access to a number of…